mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
|
||||
*/
|
||||
|
||||
var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
|
||||
var currentApi = nativeApi;
|
||||
|
||||
module.exports = {
|
||||
get: function () { return currentApi; },
|
||||
setPreferPrompt: function (value) {
|
||||
currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
|
||||
},
|
||||
// Used only by tests.
|
||||
set: function (value) {
|
||||
currentApi = value;
|
||||
}
|
||||
};
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
|
||||
* This is used pre-JellyBean, where addJavascriptInterface() is disabled.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
exec: function (bridgeSecret, service, action, callbackId, argsJson) {
|
||||
return prompt(argsJson, 'gap:' + JSON.stringify([bridgeSecret, service, action, callbackId]));
|
||||
},
|
||||
setNativeToJsBridgeMode: function (bridgeSecret, value) {
|
||||
prompt(value, 'gap_bridge_mode:' + bridgeSecret);
|
||||
},
|
||||
retrieveJsMessages: function (bridgeSecret, fromOnlineEvent) {
|
||||
return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,287 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Execute a cordova command. It is up to the native side whether this action
|
||||
* is synchronous or asynchronous. The native side can return:
|
||||
* Synchronous: PluginResult object as a JSON string
|
||||
* Asynchronous: Empty string ""
|
||||
* If async, the native side will cordova.callbackSuccess or cordova.callbackError,
|
||||
* depending upon the result of the action.
|
||||
*
|
||||
* @param {Function} success The success callback
|
||||
* @param {Function} fail The fail callback
|
||||
* @param {String} service The name of the service to use
|
||||
* @param {String} action Action to be run in cordova
|
||||
* @param {String[]} [args] Zero or more arguments to pass to the method
|
||||
*/
|
||||
var cordova = require('cordova');
|
||||
var nativeApiProvider = require('cordova/android/nativeapiprovider');
|
||||
var utils = require('cordova/utils');
|
||||
var base64 = require('cordova/base64');
|
||||
var channel = require('cordova/channel');
|
||||
var jsToNativeModes = {
|
||||
PROMPT: 0,
|
||||
JS_OBJECT: 1
|
||||
};
|
||||
var nativeToJsModes = {
|
||||
// Polls for messages using the JS->Native bridge.
|
||||
POLLING: 0,
|
||||
// For LOAD_URL to be viable, it would need to have a work-around for
|
||||
// the bug where the soft-keyboard gets dismissed when a message is sent.
|
||||
LOAD_URL: 1,
|
||||
// For the ONLINE_EVENT to be viable, it would need to intercept all event
|
||||
// listeners (both through addEventListener and window.ononline) as well
|
||||
// as set the navigator property itself.
|
||||
ONLINE_EVENT: 2,
|
||||
EVAL_BRIDGE: 3
|
||||
};
|
||||
var jsToNativeBridgeMode; // Set lazily.
|
||||
var nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE;
|
||||
var pollEnabled = false;
|
||||
var bridgeSecret = -1;
|
||||
|
||||
var messagesFromNative = [];
|
||||
var isProcessing = false;
|
||||
var resolvedPromise = typeof Promise === 'undefined' ? null : Promise.resolve();
|
||||
var nextTick = resolvedPromise ? function (fn) { resolvedPromise.then(fn); } : function (fn) { setTimeout(fn); };
|
||||
|
||||
function androidExec (success, fail, service, action, args) {
|
||||
if (bridgeSecret < 0) {
|
||||
// If we ever catch this firing, we'll need to queue up exec()s
|
||||
// and fire them once we get a secret. For now, I don't think
|
||||
// it's possible for exec() to be called since plugins are parsed but
|
||||
// not run until until after onNativeReady.
|
||||
throw new Error('exec() called without bridgeSecret');
|
||||
}
|
||||
// Set default bridge modes if they have not already been set.
|
||||
// By default, we use the failsafe, since addJavascriptInterface breaks too often
|
||||
if (jsToNativeBridgeMode === undefined) {
|
||||
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
||||
}
|
||||
|
||||
// If args is not provided, default to an empty array
|
||||
args = args || [];
|
||||
|
||||
// Process any ArrayBuffers in the args into a string.
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
if (utils.typeName(args[i]) === 'ArrayBuffer') {
|
||||
args[i] = base64.fromArrayBuffer(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
var callbackId = service + cordova.callbackId++;
|
||||
var argsJson = JSON.stringify(args);
|
||||
if (success || fail) {
|
||||
cordova.callbacks[callbackId] = { success: success, fail: fail };
|
||||
}
|
||||
|
||||
var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
|
||||
// If argsJson was received by Java as null, try again with the PROMPT bridge mode.
|
||||
// This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
|
||||
if (jsToNativeBridgeMode === jsToNativeModes.JS_OBJECT && msgs === '@Null arguments.') {
|
||||
androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
|
||||
androidExec(success, fail, service, action, args);
|
||||
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
||||
} else if (msgs) {
|
||||
messagesFromNative.push(msgs);
|
||||
// Always process async to avoid exceptions messing up stack.
|
||||
nextTick(processMessages);
|
||||
}
|
||||
}
|
||||
|
||||
androidExec.init = function () {
|
||||
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
|
||||
channel.onNativeReady.fire();
|
||||
};
|
||||
|
||||
function pollOnceFromOnlineEvent () {
|
||||
pollOnce(true);
|
||||
}
|
||||
|
||||
function pollOnce (opt_fromOnlineEvent) {
|
||||
if (bridgeSecret < 0) {
|
||||
// This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
|
||||
// We know there's nothing to retrieve, so no need to poll.
|
||||
return;
|
||||
}
|
||||
var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
|
||||
if (msgs) {
|
||||
messagesFromNative.push(msgs);
|
||||
// Process sync since we know we're already top-of-stack.
|
||||
processMessages();
|
||||
}
|
||||
}
|
||||
|
||||
function pollingTimerFunc () {
|
||||
if (pollEnabled) {
|
||||
pollOnce();
|
||||
setTimeout(pollingTimerFunc, 50);
|
||||
}
|
||||
}
|
||||
|
||||
function hookOnlineApis () {
|
||||
function proxyEvent (e) {
|
||||
cordova.fireWindowEvent(e.type);
|
||||
}
|
||||
// The network module takes care of firing online and offline events.
|
||||
// It currently fires them only on document though, so we bridge them
|
||||
// to window here (while first listening for exec()-releated online/offline
|
||||
// events).
|
||||
window.addEventListener('online', pollOnceFromOnlineEvent, false);
|
||||
window.addEventListener('offline', pollOnceFromOnlineEvent, false);
|
||||
cordova.addWindowEventHandler('online');
|
||||
cordova.addWindowEventHandler('offline');
|
||||
document.addEventListener('online', proxyEvent, false);
|
||||
document.addEventListener('offline', proxyEvent, false);
|
||||
}
|
||||
|
||||
hookOnlineApis();
|
||||
|
||||
androidExec.jsToNativeModes = jsToNativeModes;
|
||||
androidExec.nativeToJsModes = nativeToJsModes;
|
||||
|
||||
androidExec.setJsToNativeBridgeMode = function (mode) {
|
||||
if (mode === jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
|
||||
mode = jsToNativeModes.PROMPT;
|
||||
}
|
||||
nativeApiProvider.setPreferPrompt(mode === jsToNativeModes.PROMPT);
|
||||
jsToNativeBridgeMode = mode;
|
||||
};
|
||||
|
||||
androidExec.setNativeToJsBridgeMode = function (mode) {
|
||||
if (mode === nativeToJsBridgeMode) {
|
||||
return;
|
||||
}
|
||||
if (nativeToJsBridgeMode === nativeToJsModes.POLLING) {
|
||||
pollEnabled = false;
|
||||
}
|
||||
|
||||
nativeToJsBridgeMode = mode;
|
||||
// Tell the native side to switch modes.
|
||||
// Otherwise, it will be set by androidExec.init()
|
||||
if (bridgeSecret >= 0) {
|
||||
nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
|
||||
}
|
||||
|
||||
if (mode === nativeToJsModes.POLLING) {
|
||||
pollEnabled = true;
|
||||
setTimeout(pollingTimerFunc, 1);
|
||||
}
|
||||
};
|
||||
|
||||
function buildPayload (payload, message) {
|
||||
var payloadKind = message.charAt(0);
|
||||
if (payloadKind === 's') {
|
||||
payload.push(message.slice(1));
|
||||
} else if (payloadKind === 't') {
|
||||
payload.push(true);
|
||||
} else if (payloadKind === 'f') {
|
||||
payload.push(false);
|
||||
} else if (payloadKind === 'N') {
|
||||
payload.push(null);
|
||||
} else if (payloadKind === 'n') {
|
||||
payload.push(+message.slice(1));
|
||||
} else if (payloadKind === 'A') {
|
||||
var data = message.slice(1);
|
||||
payload.push(base64.toArrayBuffer(data));
|
||||
} else if (payloadKind === 'S') {
|
||||
payload.push(window.atob(message.slice(1)));
|
||||
} else if (payloadKind === 'M') {
|
||||
var multipartMessages = message.slice(1);
|
||||
while (multipartMessages !== '') {
|
||||
var spaceIdx = multipartMessages.indexOf(' ');
|
||||
var msgLen = +multipartMessages.slice(0, spaceIdx);
|
||||
var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
|
||||
multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
|
||||
buildPayload(payload, multipartMessage);
|
||||
}
|
||||
} else {
|
||||
payload.push(JSON.parse(message));
|
||||
}
|
||||
}
|
||||
|
||||
// Processes a single message, as encoded by NativeToJsMessageQueue.java.
|
||||
function processMessage (message) {
|
||||
var firstChar = message.charAt(0);
|
||||
if (firstChar === 'J') {
|
||||
// This is deprecated on the .java side. It doesn't work with CSP enabled.
|
||||
// eslint-disable-next-line no-eval
|
||||
eval(message.slice(1));
|
||||
} else if (firstChar === 'S' || firstChar === 'F') {
|
||||
var success = firstChar === 'S';
|
||||
var keepCallback = message.charAt(1) === '1';
|
||||
var spaceIdx = message.indexOf(' ', 2);
|
||||
var status = +message.slice(2, spaceIdx);
|
||||
var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
|
||||
var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
|
||||
var payloadMessage = message.slice(nextSpaceIdx + 1);
|
||||
var payload = [];
|
||||
buildPayload(payload, payloadMessage);
|
||||
cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
|
||||
} else {
|
||||
console.log('processMessage failed: invalid message: ' + JSON.stringify(message));
|
||||
}
|
||||
}
|
||||
|
||||
function processMessages () {
|
||||
// Check for the reentrant case.
|
||||
if (isProcessing) {
|
||||
return;
|
||||
}
|
||||
if (messagesFromNative.length === 0) {
|
||||
return;
|
||||
}
|
||||
isProcessing = true;
|
||||
try {
|
||||
var msg = popMessageFromQueue();
|
||||
// The Java side can send a * message to indicate that it
|
||||
// still has messages waiting to be retrieved.
|
||||
if (msg === '*' && messagesFromNative.length === 0) {
|
||||
nextTick(pollOnce);
|
||||
return;
|
||||
}
|
||||
processMessage(msg);
|
||||
} finally {
|
||||
isProcessing = false;
|
||||
if (messagesFromNative.length > 0) {
|
||||
nextTick(processMessages);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function popMessageFromQueue () {
|
||||
var messageBatch = messagesFromNative.shift();
|
||||
if (messageBatch === '*') {
|
||||
return '*';
|
||||
}
|
||||
|
||||
var spaceIdx = messageBatch.indexOf(' ');
|
||||
var msgLen = +messageBatch.slice(0, spaceIdx);
|
||||
var message = messageBatch.substr(spaceIdx + 1, msgLen);
|
||||
messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
|
||||
if (messageBatch) {
|
||||
messagesFromNative.unshift(messageBatch);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
module.exports = androidExec;
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
var lastResumeEvent = null;
|
||||
|
||||
module.exports = {
|
||||
id: 'android',
|
||||
bootstrap: function () {
|
||||
var channel = require('cordova/channel');
|
||||
var cordova = require('cordova');
|
||||
var exec = require('cordova/exec');
|
||||
var modulemapper = require('cordova/modulemapper');
|
||||
|
||||
// Get the shared secret needed to use the bridge.
|
||||
exec.init();
|
||||
|
||||
// TODO: Extract this as a proper plugin.
|
||||
modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
|
||||
|
||||
var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
||||
|
||||
// Inject a listener for the backbutton on the document.
|
||||
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
|
||||
backButtonChannel.onHasSubscribersChange = function () {
|
||||
// If we just attached the first handler or detached the last handler,
|
||||
// let native know we need to override the back button.
|
||||
exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [this.numHandlers === 1]);
|
||||
};
|
||||
|
||||
// Add hardware MENU and SEARCH button handlers
|
||||
cordova.addDocumentEventHandler('menubutton');
|
||||
cordova.addDocumentEventHandler('searchbutton');
|
||||
|
||||
function bindButtonChannel (buttonName) {
|
||||
// generic button bind used for volumeup/volumedown buttons
|
||||
var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
|
||||
volumeButtonChannel.onHasSubscribersChange = function () {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [buttonName, this.numHandlers === 1]);
|
||||
};
|
||||
}
|
||||
// Inject a listener for the volume buttons on the document.
|
||||
bindButtonChannel('volumeup');
|
||||
bindButtonChannel('volumedown');
|
||||
|
||||
// The resume event is not "sticky", but it is possible that the event
|
||||
// will contain the result of a plugin call. We need to ensure that the
|
||||
// plugin result is delivered even after the event is fired (CB-10498)
|
||||
var cordovaAddEventListener = document.addEventListener;
|
||||
|
||||
document.addEventListener = function (evt, handler, capture) {
|
||||
cordovaAddEventListener(evt, handler, capture);
|
||||
|
||||
if (evt === 'resume' && lastResumeEvent) {
|
||||
handler(lastResumeEvent);
|
||||
}
|
||||
};
|
||||
|
||||
// Let native code know we are all done on the JS side.
|
||||
// Native code will then un-hide the WebView.
|
||||
channel.onCordovaReady.subscribe(function () {
|
||||
exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
|
||||
exec(null, null, APP_PLUGIN_NAME, 'show', []);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function onMessageFromNative (msg) {
|
||||
var cordova = require('cordova');
|
||||
var action = msg.action;
|
||||
|
||||
switch (action) {
|
||||
// pause and resume are Android app life cycle events
|
||||
case 'backbutton':
|
||||
case 'menubutton':
|
||||
case 'searchbutton':
|
||||
case 'pause':
|
||||
case 'volumedownbutton':
|
||||
case 'volumeupbutton':
|
||||
cordova.fireDocumentEvent(action);
|
||||
break;
|
||||
case 'resume':
|
||||
if (arguments.length > 1 && msg.pendingResult) {
|
||||
if (arguments.length === 2) {
|
||||
msg.pendingResult.result = arguments[1];
|
||||
} else {
|
||||
// The plugin returned a multipart message
|
||||
var res = [];
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
res.push(arguments[i]);
|
||||
}
|
||||
msg.pendingResult.result = res;
|
||||
}
|
||||
|
||||
// Save the plugin result so that it can be delivered to the js
|
||||
// even if they miss the initial firing of the event
|
||||
lastResumeEvent = msg;
|
||||
}
|
||||
cordova.fireDocumentEvent(action, msg);
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unknown event action ' + action);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Clear the resource cache.
|
||||
*/
|
||||
clearCache: function () {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'clearCache', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Load the url into the webview or into new browser instance.
|
||||
*
|
||||
* @param url The URL to load
|
||||
* @param props Properties that can be passed in to the activity:
|
||||
* wait: int => wait msec before loading URL
|
||||
* loadingDialog: "Title,Message" => display a native loading dialog
|
||||
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
|
||||
* clearHistory: boolean => clear webview history (default=false)
|
||||
* openExternal: boolean => open in a new browser (default=false)
|
||||
*
|
||||
* Example:
|
||||
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
|
||||
*/
|
||||
loadUrl: function (url, props) {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'loadUrl', [url, props]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Cancel loadUrl that is waiting to be loaded.
|
||||
*/
|
||||
cancelLoadUrl: function () {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'cancelLoadUrl', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear web history in this web view.
|
||||
* Instead of BACK button loading the previous web page, it will exit the app.
|
||||
*/
|
||||
clearHistory: function () {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'clearHistory', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to previous page displayed.
|
||||
* This is the same as pressing the backbutton on Android device.
|
||||
*/
|
||||
backHistory: function () {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'backHistory', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Override the default behavior of the Android back button.
|
||||
* If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
|
||||
*
|
||||
* Note: The user should not have to call this method. Instead, when the user
|
||||
* registers for the "backbutton" event, this is automatically done.
|
||||
*
|
||||
* @param override T=override, F=cancel override
|
||||
*/
|
||||
overrideBackbutton: function (override) {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'overrideBackbutton', [override]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Override the default behavior of the Android volume button.
|
||||
* If overridden, when the volume button is pressed, the "volume[up|down]button"
|
||||
* JavaScript event will be fired.
|
||||
*
|
||||
* Note: The user should not have to call this method. Instead, when the user
|
||||
* registers for the "volume[up|down]button" event, this is automatically done.
|
||||
*
|
||||
* @param button volumeup, volumedown
|
||||
* @param override T=override, F=cancel override
|
||||
*/
|
||||
overrideButton: function (button, override) {
|
||||
exec(null, null, APP_PLUGIN_NAME, 'overrideButton', [button, override]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Exit and terminate the application.
|
||||
*/
|
||||
exitApp: function () {
|
||||
return exec(null, null, APP_PLUGIN_NAME, 'exitApp', []);
|
||||
}
|
||||
};
|
||||
+1904
File diff suppressed because it is too large
Load Diff
+360
@@ -0,0 +1,360 @@
|
||||
cordova.define('cordova/plugin_list', function(require, exports, module) {
|
||||
module.exports = [
|
||||
{
|
||||
"id": "cordova-plugin-camera.Camera",
|
||||
"file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
|
||||
"pluginId": "cordova-plugin-camera",
|
||||
"clobbers": [
|
||||
"Camera"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-camera.CameraPopoverOptions",
|
||||
"file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
|
||||
"pluginId": "cordova-plugin-camera",
|
||||
"clobbers": [
|
||||
"CameraPopoverOptions"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-camera.camera",
|
||||
"file": "plugins/cordova-plugin-camera/www/Camera.js",
|
||||
"pluginId": "cordova-plugin-camera",
|
||||
"clobbers": [
|
||||
"navigator.camera"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-camera.CameraPopoverHandle",
|
||||
"file": "plugins/cordova-plugin-camera/www/CameraPopoverHandle.js",
|
||||
"pluginId": "cordova-plugin-camera",
|
||||
"clobbers": [
|
||||
"CameraPopoverHandle"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-device.device",
|
||||
"file": "plugins/cordova-plugin-device/www/device.js",
|
||||
"pluginId": "cordova-plugin-device",
|
||||
"clobbers": [
|
||||
"device"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-dialogs.notification",
|
||||
"file": "plugins/cordova-plugin-dialogs/www/notification.js",
|
||||
"pluginId": "cordova-plugin-dialogs",
|
||||
"merges": [
|
||||
"navigator.notification"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-dialogs.notification_android",
|
||||
"file": "plugins/cordova-plugin-dialogs/www/android/notification.js",
|
||||
"pluginId": "cordova-plugin-dialogs",
|
||||
"merges": [
|
||||
"navigator.notification"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.DirectoryEntry",
|
||||
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.DirectoryEntry"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.DirectoryReader",
|
||||
"file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.DirectoryReader"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.Entry",
|
||||
"file": "plugins/cordova-plugin-file/www/Entry.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.Entry"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.File",
|
||||
"file": "plugins/cordova-plugin-file/www/File.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.File"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileEntry",
|
||||
"file": "plugins/cordova-plugin-file/www/FileEntry.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileEntry"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileError",
|
||||
"file": "plugins/cordova-plugin-file/www/FileError.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileError"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileReader",
|
||||
"file": "plugins/cordova-plugin-file/www/FileReader.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileReader"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileSystem",
|
||||
"file": "plugins/cordova-plugin-file/www/FileSystem.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileSystem"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileUploadOptions",
|
||||
"file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileUploadOptions"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileUploadResult",
|
||||
"file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileUploadResult"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.FileWriter",
|
||||
"file": "plugins/cordova-plugin-file/www/FileWriter.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.FileWriter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.Flags",
|
||||
"file": "plugins/cordova-plugin-file/www/Flags.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.Flags"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.LocalFileSystem",
|
||||
"file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.LocalFileSystem"
|
||||
],
|
||||
"merges": [
|
||||
"window"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.Metadata",
|
||||
"file": "plugins/cordova-plugin-file/www/Metadata.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.Metadata"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.ProgressEvent",
|
||||
"file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.ProgressEvent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.fileSystems",
|
||||
"file": "plugins/cordova-plugin-file/www/fileSystems.js",
|
||||
"pluginId": "cordova-plugin-file"
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.requestFileSystem",
|
||||
"file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"clobbers": [
|
||||
"window.requestFileSystem"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.resolveLocalFileSystemURI",
|
||||
"file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"merges": [
|
||||
"window"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.isChrome",
|
||||
"file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.androidFileSystem",
|
||||
"file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"merges": [
|
||||
"FileSystem"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.fileSystems-roots",
|
||||
"file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-file.fileSystemPaths",
|
||||
"file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
|
||||
"pluginId": "cordova-plugin-file",
|
||||
"merges": [
|
||||
"cordova"
|
||||
],
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-fingerprint-aio.Fingerprint",
|
||||
"file": "plugins/cordova-plugin-fingerprint-aio/www/Fingerprint.js",
|
||||
"pluginId": "cordova-plugin-fingerprint-aio",
|
||||
"clobbers": [
|
||||
"Fingerprint"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-globalization.GlobalizationError",
|
||||
"file": "plugins/cordova-plugin-globalization/www/GlobalizationError.js",
|
||||
"pluginId": "cordova-plugin-globalization",
|
||||
"clobbers": [
|
||||
"window.GlobalizationError"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-globalization.globalization",
|
||||
"file": "plugins/cordova-plugin-globalization/www/globalization.js",
|
||||
"pluginId": "cordova-plugin-globalization",
|
||||
"clobbers": [
|
||||
"navigator.globalization"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-inappbrowser.inappbrowser",
|
||||
"file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
|
||||
"pluginId": "cordova-plugin-inappbrowser",
|
||||
"clobbers": [
|
||||
"cordova.InAppBrowser.open"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-ionic-keyboard.keyboard",
|
||||
"file": "plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js",
|
||||
"pluginId": "cordova-plugin-ionic-keyboard",
|
||||
"clobbers": [
|
||||
"window.Keyboard"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-ionic-webview.IonicWebView",
|
||||
"file": "plugins/cordova-plugin-ionic-webview/src/www/util.js",
|
||||
"pluginId": "cordova-plugin-ionic-webview",
|
||||
"clobbers": [
|
||||
"Ionic.WebView"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-mfp.mfp",
|
||||
"file": "plugins/cordova-plugin-mfp/bootstrap.js",
|
||||
"pluginId": "cordova-plugin-mfp",
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-mfp-push.MFPPush",
|
||||
"file": "plugins/cordova-plugin-mfp-push/www/MFPPush.js",
|
||||
"pluginId": "cordova-plugin-mfp-push",
|
||||
"clobbers": [
|
||||
"MFPPush"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-splashscreen.SplashScreen",
|
||||
"file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js",
|
||||
"pluginId": "cordova-plugin-splashscreen",
|
||||
"clobbers": [
|
||||
"navigator.splashscreen"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-statusbar.statusbar",
|
||||
"file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
|
||||
"pluginId": "cordova-plugin-statusbar",
|
||||
"clobbers": [
|
||||
"window.StatusBar"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-sqlite-storage.SQLitePlugin",
|
||||
"file": "plugins/cordova-sqlite-storage/www/SQLitePlugin.js",
|
||||
"pluginId": "cordova-sqlite-storage",
|
||||
"clobbers": [
|
||||
"SQLitePlugin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-mfp-jsonstore.jsonstore",
|
||||
"file": "plugins/cordova-plugin-mfp-jsonstore/bootstrap.js",
|
||||
"pluginId": "cordova-plugin-mfp-jsonstore",
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "es6-promise-plugin.Promise",
|
||||
"file": "plugins/es6-promise-plugin/www/promise.js",
|
||||
"pluginId": "es6-promise-plugin",
|
||||
"runs": true
|
||||
},
|
||||
{
|
||||
"id": "cordova-plugin-screen-orientation.screenorientation",
|
||||
"file": "plugins/cordova-plugin-screen-orientation/www/screenorientation.js",
|
||||
"pluginId": "cordova-plugin-screen-orientation",
|
||||
"clobbers": [
|
||||
"cordova.plugins.screenorientation"
|
||||
]
|
||||
}
|
||||
];
|
||||
module.exports.metadata = {
|
||||
"cordova-plugin-androidx-adapter": "1.1.3",
|
||||
"cordova-plugin-camera": "5.0.1",
|
||||
"cordova-plugin-device": "2.0.3",
|
||||
"cordova-plugin-dialogs": "2.0.2",
|
||||
"cordova-plugin-file": "6.0.2",
|
||||
"cordova-plugin-fingerprint-aio": "4.0.2",
|
||||
"cordova-plugin-globalization": "1.11.0",
|
||||
"cordova-plugin-inappbrowser": "4.1.0",
|
||||
"cordova-plugin-ionic-keyboard": "2.2.0",
|
||||
"cordova-plugin-ionic-webview": "4.2.1",
|
||||
"cordova-plugin-okhttp": "2.0.0",
|
||||
"cordova-plugin-mfp": "8.0.2021031007",
|
||||
"cordova-plugin-mfp-push": "8.0.2021062405",
|
||||
"cordova-plugin-splashscreen": "5.0.4",
|
||||
"cordova-plugin-statusbar": "2.4.3",
|
||||
"cordova-sqlite-storage": "5.1.0",
|
||||
"cordova-plugin-mfp-jsonstore": "8.0.2021062408",
|
||||
"es6-promise-plugin": "4.2.2",
|
||||
"cordova-plugin-screen-orientation": "3.0.2"
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,188 @@
|
||||
cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var exec = require('cordova/exec');
|
||||
var Camera = require('./Camera');
|
||||
// XXX: commented out
|
||||
// CameraPopoverHandle = require('./CameraPopoverHandle');
|
||||
|
||||
/**
|
||||
* @namespace navigator
|
||||
*/
|
||||
|
||||
/**
|
||||
* @exports camera
|
||||
*/
|
||||
var cameraExport = {};
|
||||
|
||||
// Tack on the Camera Constants to the base camera plugin.
|
||||
for (var key in Camera) {
|
||||
cameraExport[key] = Camera[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function that provides an error message.
|
||||
* @callback module:camera.onError
|
||||
* @param {string} message - The message is provided by the device's native code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Callback function that provides the image data.
|
||||
* @callback module:camera.onSuccess
|
||||
* @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
|
||||
* @example
|
||||
* // Show image
|
||||
* //
|
||||
* function cameraCallback(imageData) {
|
||||
* var image = document.getElementById('myImage');
|
||||
* image.src = "data:image/jpeg;base64," + imageData;
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Optional parameters to customize the camera settings.
|
||||
* * [Quirks](#CameraOptions-quirks)
|
||||
* @typedef module:camera.CameraOptions
|
||||
* @type {Object}
|
||||
* @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
|
||||
* @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
|
||||
* @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
|
||||
* @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
|
||||
* @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
|
||||
* @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
|
||||
* @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
|
||||
* @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
|
||||
* @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
|
||||
* @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
|
||||
* @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
|
||||
* @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description Takes a photo using the camera, or retrieves a photo from the device's
|
||||
* image gallery. The image is passed to the success callback as a
|
||||
* Base64-encoded `String`, or as the URI for the image file.
|
||||
*
|
||||
* The `camera.getPicture` function opens the device's default camera
|
||||
* application that allows users to snap pictures by default - this behavior occurs,
|
||||
* when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
|
||||
* Once the user snaps the photo, the camera application closes and the application is restored.
|
||||
*
|
||||
* If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
|
||||
* `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
|
||||
* that allows users to select an existing image.
|
||||
*
|
||||
* The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
|
||||
* one of the following formats, depending on the specified
|
||||
* `cameraOptions`:
|
||||
*
|
||||
* - A `String` containing the Base64-encoded photo image.
|
||||
* - A `String` representing the image file location on local storage (default).
|
||||
*
|
||||
* You can do whatever you want with the encoded image or URI, for
|
||||
* example:
|
||||
*
|
||||
* - Render the image in an `<img>` tag, as in the example below
|
||||
* - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
|
||||
* - Post the data to a remote server
|
||||
*
|
||||
* __NOTE__: Photo resolution on newer devices is quite good. Photos
|
||||
* selected from the device's gallery are not downscaled to a lower
|
||||
* quality, even if a `quality` parameter is specified. To avoid common
|
||||
* memory problems, set `Camera.destinationType` to `FILE_URI` rather
|
||||
* than `DATA_URL`.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* - Android
|
||||
* - BlackBerry
|
||||
* - Browser
|
||||
* - Firefox
|
||||
* - FireOS
|
||||
* - iOS
|
||||
* - Windows
|
||||
* - WP8
|
||||
* - Ubuntu
|
||||
*
|
||||
* More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
|
||||
*
|
||||
* @example
|
||||
* navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
|
||||
* @param {module:camera.onSuccess} successCallback
|
||||
* @param {module:camera.onError} errorCallback
|
||||
* @param {module:camera.CameraOptions} options CameraOptions
|
||||
*/
|
||||
cameraExport.getPicture = function (successCallback, errorCallback, options) {
|
||||
argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
|
||||
options = options || {};
|
||||
var getValue = argscheck.getValue;
|
||||
|
||||
var quality = getValue(options.quality, 50);
|
||||
var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
|
||||
var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
|
||||
var targetWidth = getValue(options.targetWidth, -1);
|
||||
var targetHeight = getValue(options.targetHeight, -1);
|
||||
var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
|
||||
var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
|
||||
var allowEdit = !!options.allowEdit;
|
||||
var correctOrientation = !!options.correctOrientation;
|
||||
var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
|
||||
var popoverOptions = getValue(options.popoverOptions, null);
|
||||
var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
|
||||
|
||||
var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
|
||||
mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
|
||||
|
||||
exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
|
||||
// XXX: commented out
|
||||
// return new CameraPopoverHandle();
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes intermediate image files that are kept in temporary storage
|
||||
* after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
|
||||
* `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
|
||||
* `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
|
||||
*
|
||||
* __Supported Platforms__
|
||||
*
|
||||
* - iOS
|
||||
*
|
||||
* @example
|
||||
* navigator.camera.cleanup(onSuccess, onFail);
|
||||
*
|
||||
* function onSuccess() {
|
||||
* console.log("Camera cleanup success.")
|
||||
* }
|
||||
*
|
||||
* function onFail(message) {
|
||||
* alert('Failed because: ' + message);
|
||||
* }
|
||||
*/
|
||||
cameraExport.cleanup = function (successCallback, errorCallback) {
|
||||
exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
|
||||
};
|
||||
|
||||
module.exports = cameraExport;
|
||||
|
||||
});
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module Camera
|
||||
*/
|
||||
module.exports = {
|
||||
/**
|
||||
* @description
|
||||
* Defines the output format of `Camera.getPicture` call.
|
||||
*
|
||||
* @enum {number}
|
||||
*/
|
||||
DestinationType: {
|
||||
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI if possible */
|
||||
DATA_URL: 0,
|
||||
/** Return file uri (content://media/external/images/media/2 for Android) */
|
||||
FILE_URI: 1
|
||||
},
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
EncodingType: {
|
||||
/** Return JPEG encoded image */
|
||||
JPEG: 0,
|
||||
/** Return PNG encoded image */
|
||||
PNG: 1
|
||||
},
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
MediaType: {
|
||||
/** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
|
||||
PICTURE: 0,
|
||||
/** Allow selection of video only, ONLY RETURNS URL */
|
||||
VIDEO: 1,
|
||||
/** Allow selection from all media types */
|
||||
ALLMEDIA: 2
|
||||
},
|
||||
/**
|
||||
* @description
|
||||
* Defines the output format of `Camera.getPicture` call.
|
||||
*
|
||||
* @enum {number}
|
||||
*/
|
||||
PictureSourceType: {
|
||||
/** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
|
||||
PHOTOLIBRARY: 0,
|
||||
/** Take picture from camera */
|
||||
CAMERA: 1,
|
||||
/** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
|
||||
SAVEDPHOTOALBUM: 2
|
||||
},
|
||||
/**
|
||||
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
|
||||
* @enum {number}
|
||||
*/
|
||||
PopoverArrowDirection: {
|
||||
ARROW_UP: 1,
|
||||
ARROW_DOWN: 2,
|
||||
ARROW_LEFT: 4,
|
||||
ARROW_RIGHT: 8,
|
||||
ARROW_ANY: 15
|
||||
},
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
Direction: {
|
||||
/** Use the back-facing camera */
|
||||
BACK: 0,
|
||||
/** Use the front-facing camera */
|
||||
FRONT: 1
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore in favour of iOS' one
|
||||
* A handle to an image picker popover.
|
||||
*/
|
||||
var CameraPopoverHandle = function () {
|
||||
this.setPosition = function (popoverOptions) {
|
||||
console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = CameraPopoverHandle;
|
||||
|
||||
});
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var Camera = require('./Camera');
|
||||
|
||||
/**
|
||||
* @namespace navigator
|
||||
*/
|
||||
|
||||
/**
|
||||
* iOS-only parameters that specify the anchor element location and arrow
|
||||
* direction of the popover when selecting images from an iPad's library
|
||||
* or album.
|
||||
* Note that the size of the popover may change to adjust to the
|
||||
* direction of the arrow and orientation of the screen. Make sure to
|
||||
* account for orientation changes when specifying the anchor element
|
||||
* location.
|
||||
* @module CameraPopoverOptions
|
||||
* @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
|
||||
* @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
|
||||
* @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
|
||||
* @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
|
||||
* @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
|
||||
* @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
|
||||
* @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
|
||||
*/
|
||||
var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
|
||||
// information of rectangle that popover should be anchored to
|
||||
this.x = x || 0;
|
||||
this.y = y || 32;
|
||||
this.width = width || 320;
|
||||
this.height = height || 480;
|
||||
this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
|
||||
this.popoverWidth = popoverWidth || 0;
|
||||
this.popoverHeight = popoverHeight || 0;
|
||||
};
|
||||
|
||||
module.exports = CameraPopoverOptions;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,86 @@
|
||||
cordova.define("cordova-plugin-device.device", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var channel = require('cordova/channel');
|
||||
var utils = require('cordova/utils');
|
||||
var exec = require('cordova/exec');
|
||||
var cordova = require('cordova');
|
||||
|
||||
channel.createSticky('onCordovaInfoReady');
|
||||
// Tell cordova channel to wait on the CordovaInfoReady event
|
||||
channel.waitForInitialization('onCordovaInfoReady');
|
||||
|
||||
/**
|
||||
* This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
|
||||
* phone, etc.
|
||||
* @constructor
|
||||
*/
|
||||
function Device () {
|
||||
this.available = false;
|
||||
this.platform = null;
|
||||
this.version = null;
|
||||
this.uuid = null;
|
||||
this.cordova = null;
|
||||
this.model = null;
|
||||
this.manufacturer = null;
|
||||
this.isVirtual = null;
|
||||
this.serial = null;
|
||||
|
||||
var me = this;
|
||||
|
||||
channel.onCordovaReady.subscribe(function () {
|
||||
me.getInfo(function (info) {
|
||||
// ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
|
||||
// TODO: CB-5105 native implementations should not return info.cordova
|
||||
var buildLabel = cordova.version;
|
||||
me.available = true;
|
||||
me.platform = info.platform;
|
||||
me.version = info.version;
|
||||
me.uuid = info.uuid;
|
||||
me.cordova = buildLabel;
|
||||
me.model = info.model;
|
||||
me.isVirtual = info.isVirtual;
|
||||
me.manufacturer = info.manufacturer || 'unknown';
|
||||
me.serial = info.serial || 'unknown';
|
||||
channel.onCordovaInfoReady.fire();
|
||||
}, function (e) {
|
||||
me.available = false;
|
||||
utils.alert('[ERROR] Error initializing Cordova: ' + e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get device info
|
||||
*
|
||||
* @param {Function} successCallback The function to call when the heading data is available
|
||||
* @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
|
||||
*/
|
||||
Device.prototype.getInfo = function (successCallback, errorCallback) {
|
||||
argscheck.checkArgs('fF', 'Device.getInfo', arguments);
|
||||
exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
|
||||
};
|
||||
|
||||
module.exports = new Device();
|
||||
|
||||
});
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
cordova.define("cordova-plugin-dialogs.notification_android", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
/**
|
||||
* Provides Android enhanced notification API.
|
||||
*/
|
||||
module.exports = {
|
||||
activityStart: function (title, message) {
|
||||
// If title and message not specified then mimic Android behavior of
|
||||
// using default strings.
|
||||
if (typeof title === 'undefined' && typeof message === 'undefined') {
|
||||
title = 'Busy';
|
||||
message = 'Please wait...';
|
||||
}
|
||||
|
||||
exec(null, null, 'Notification', 'activityStart', [ title, message ]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Close an activity dialog
|
||||
*/
|
||||
activityStop: function () {
|
||||
exec(null, null, 'Notification', 'activityStop', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Display a progress dialog with progress bar that goes from 0 to 100.
|
||||
*
|
||||
* @param {String}
|
||||
* title Title of the progress dialog.
|
||||
* @param {String}
|
||||
* message Message to display in the dialog.
|
||||
*/
|
||||
progressStart: function (title, message) {
|
||||
exec(null, null, 'Notification', 'progressStart', [ title, message ]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the progress dialog.
|
||||
*/
|
||||
progressStop: function () {
|
||||
exec(null, null, 'Notification', 'progressStop', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the progress dialog value.
|
||||
*
|
||||
* @param {Number}
|
||||
* value 0-100
|
||||
*/
|
||||
progressValue: function (value) {
|
||||
exec(null, null, 'Notification', 'progressValue', [ value ]);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
cordova.define("cordova-plugin-dialogs.notification", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var platform = require('cordova/platform');
|
||||
|
||||
/**
|
||||
* Provides access to notifications on the device.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
|
||||
/**
|
||||
* Open a native alert dialog, with a customizable title and button text.
|
||||
*
|
||||
* @param {String} message Message to print in the body of the alert
|
||||
* @param {Function} completeCallback The callback that is called when user clicks on a button.
|
||||
* @param {String} title Title of the alert dialog (default: Alert)
|
||||
* @param {String} buttonLabel Label of the close button (default: OK)
|
||||
*/
|
||||
alert: function (message, completeCallback, title, buttonLabel) {
|
||||
var _message = (typeof message === 'string' ? message : JSON.stringify(message));
|
||||
var _title = (typeof title === 'string' ? title : 'Alert');
|
||||
var _buttonLabel = (buttonLabel && typeof buttonLabel === 'string' ? buttonLabel : 'OK');
|
||||
exec(completeCallback, null, 'Notification', 'alert', [_message, _title, _buttonLabel]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Open a native confirm dialog, with a customizable title and button text.
|
||||
* The result that the user selects is returned to the result callback.
|
||||
*
|
||||
* @param {String} message Message to print in the body of the alert
|
||||
* @param {Function} resultCallback The callback that is called when user clicks on a button.
|
||||
* @param {String} title Title of the alert dialog (default: Confirm)
|
||||
* @param {Array} buttonLabels Array of the labels of the buttons (default: ['OK', 'Cancel'])
|
||||
*/
|
||||
confirm: function (message, resultCallback, title, buttonLabels) {
|
||||
var _message = (typeof message === 'string' ? message : JSON.stringify(message));
|
||||
var _title = (typeof title === 'string' ? title : 'Confirm');
|
||||
var _buttonLabels = (buttonLabels || ['OK', 'Cancel']);
|
||||
|
||||
// Strings are deprecated!
|
||||
if (typeof _buttonLabels === 'string') {
|
||||
console.log('Notification.confirm(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array).');
|
||||
}
|
||||
|
||||
_buttonLabels = convertButtonLabels(_buttonLabels);
|
||||
|
||||
exec(resultCallback, null, 'Notification', 'confirm', [_message, _title, _buttonLabels]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Open a native prompt dialog, with a customizable title and button text.
|
||||
* The following results are returned to the result callback:
|
||||
* buttonIndex Index number of the button selected.
|
||||
* input1 The text entered in the prompt dialog box.
|
||||
*
|
||||
* @param {String} message Dialog message to display (default: "Prompt message")
|
||||
* @param {Function} resultCallback The callback that is called when user clicks on a button.
|
||||
* @param {String} title Title of the dialog (default: "Prompt")
|
||||
* @param {Array} buttonLabels Array of strings for the button labels (default: ["OK","Cancel"])
|
||||
* @param {String} defaultText Textbox input value (default: empty string)
|
||||
*/
|
||||
prompt: function (message, resultCallback, title, buttonLabels, defaultText) {
|
||||
var _message = (typeof message === 'string' ? message : JSON.stringify(message));
|
||||
var _title = (typeof title === 'string' ? title : 'Prompt');
|
||||
var _buttonLabels = (buttonLabels || ['OK', 'Cancel']);
|
||||
|
||||
// Strings are deprecated!
|
||||
if (typeof _buttonLabels === 'string') {
|
||||
console.log('Notification.prompt(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array).');
|
||||
}
|
||||
|
||||
_buttonLabels = convertButtonLabels(_buttonLabels);
|
||||
|
||||
var _defaultText = (defaultText || '');
|
||||
exec(resultCallback, null, 'Notification', 'prompt', [_message, _title, _buttonLabels, _defaultText]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Causes the device to beep.
|
||||
* On Android, the default notification ringtone is played "count" times.
|
||||
*
|
||||
* @param {Integer} count The number of beeps.
|
||||
*/
|
||||
beep: function (count) {
|
||||
var defaultedCount = count || 1;
|
||||
exec(null, null, 'Notification', 'beep', [ defaultedCount ]);
|
||||
}
|
||||
};
|
||||
|
||||
function convertButtonLabels (buttonLabels) {
|
||||
|
||||
// Some platforms take an array of button label names.
|
||||
// Other platforms take a comma separated list.
|
||||
// For compatibility, we convert to the desired type based on the platform.
|
||||
if (platform.id === 'amazon-fireos' || platform.id === 'android' || platform.id === 'ios' ||
|
||||
platform.id === 'windowsphone' || platform.id === 'firefoxos' || platform.id === 'ubuntu' ||
|
||||
platform.id === 'windows8' || platform.id === 'windows') {
|
||||
|
||||
if (typeof buttonLabels === 'string') {
|
||||
buttonLabels = buttonLabels.split(','); // not crazy about changing the var type here
|
||||
}
|
||||
} else {
|
||||
if (Array.isArray(buttonLabels)) {
|
||||
var buttonLabelArray = buttonLabels;
|
||||
buttonLabels = buttonLabelArray.toString();
|
||||
}
|
||||
}
|
||||
|
||||
return buttonLabels;
|
||||
}
|
||||
|
||||
});
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
cordova.define("cordova-plugin-file.DirectoryEntry", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var utils = require('cordova/utils');
|
||||
var exec = require('cordova/exec');
|
||||
var Entry = require('./Entry');
|
||||
var FileError = require('./FileError');
|
||||
var DirectoryReader = require('./DirectoryReader');
|
||||
|
||||
/**
|
||||
* An interface representing a directory on the file system.
|
||||
*
|
||||
* {boolean} isFile always false (readonly)
|
||||
* {boolean} isDirectory always true (readonly)
|
||||
* {DOMString} name of the directory, excluding the path leading to it (readonly)
|
||||
* {DOMString} fullPath the absolute full path to the directory (readonly)
|
||||
* {FileSystem} filesystem on which the directory resides (readonly)
|
||||
*/
|
||||
var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
|
||||
|
||||
// add trailing slash if it is missing
|
||||
if ((fullPath) && !/\/$/.test(fullPath)) {
|
||||
fullPath += '/';
|
||||
}
|
||||
// add trailing slash if it is missing
|
||||
if (nativeURL && !/\/$/.test(nativeURL)) {
|
||||
nativeURL += '/';
|
||||
}
|
||||
DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
|
||||
};
|
||||
|
||||
utils.extend(DirectoryEntry, Entry);
|
||||
|
||||
/**
|
||||
* Creates a new DirectoryReader to read entries from this directory
|
||||
*/
|
||||
DirectoryEntry.prototype.createReader = function () {
|
||||
return new DirectoryReader(this.toInternalURL());
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates or looks up a directory
|
||||
*
|
||||
* @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
|
||||
* @param {Flags} options to create or exclusively create the directory
|
||||
* @param {Function} successCallback is called with the new entry
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
|
||||
var fs = this.filesystem;
|
||||
var win = successCallback && function (result) {
|
||||
var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
|
||||
successCallback(entry);
|
||||
};
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Deletes a directory and all of it's contents
|
||||
*
|
||||
* @param {Function} successCallback is called with no parameters
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
|
||||
argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates or looks up a file
|
||||
*
|
||||
* @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
|
||||
* @param {Flags} options to create or exclusively create the file
|
||||
* @param {Function} successCallback is called with the new entry
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
|
||||
var fs = this.filesystem;
|
||||
var win = successCallback && function (result) {
|
||||
var FileEntry = require('./FileEntry');
|
||||
var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
|
||||
successCallback(entry);
|
||||
};
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
|
||||
};
|
||||
|
||||
module.exports = DirectoryEntry;
|
||||
|
||||
});
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
cordova.define("cordova-plugin-file.DirectoryReader", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var FileError = require('./FileError');
|
||||
|
||||
/**
|
||||
* An interface that lists the files and directories in a directory.
|
||||
*/
|
||||
function DirectoryReader (localURL) {
|
||||
this.localURL = localURL || null;
|
||||
this.hasReadEntries = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of entries from a directory.
|
||||
*
|
||||
* @param {Function} successCallback is called with a list of entries
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
|
||||
// If we've already read and passed on this directory's entries, return an empty list.
|
||||
if (this.hasReadEntries) {
|
||||
successCallback([]);
|
||||
return;
|
||||
}
|
||||
var reader = this;
|
||||
var win = typeof successCallback !== 'function' ? null : function (result) {
|
||||
var retVal = [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var entry = null;
|
||||
if (result[i].isDirectory) {
|
||||
entry = new (require('./DirectoryEntry'))();
|
||||
} else if (result[i].isFile) {
|
||||
entry = new (require('./FileEntry'))();
|
||||
}
|
||||
entry.isDirectory = result[i].isDirectory;
|
||||
entry.isFile = result[i].isFile;
|
||||
entry.name = result[i].name;
|
||||
entry.fullPath = result[i].fullPath;
|
||||
entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName);
|
||||
entry.nativeURL = result[i].nativeURL;
|
||||
retVal.push(entry);
|
||||
}
|
||||
reader.hasReadEntries = true;
|
||||
successCallback(retVal);
|
||||
};
|
||||
var fail = typeof errorCallback !== 'function' ? null : function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(win, fail, 'File', 'readEntries', [this.localURL]);
|
||||
};
|
||||
|
||||
module.exports = DirectoryReader;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,263 @@
|
||||
cordova.define("cordova-plugin-file.Entry", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var exec = require('cordova/exec');
|
||||
var FileError = require('./FileError');
|
||||
var Metadata = require('./Metadata');
|
||||
|
||||
/**
|
||||
* Represents a file or directory on the local file system.
|
||||
*
|
||||
* @param isFile
|
||||
* {boolean} true if Entry is a file (readonly)
|
||||
* @param isDirectory
|
||||
* {boolean} true if Entry is a directory (readonly)
|
||||
* @param name
|
||||
* {DOMString} name of the file or directory, excluding the path
|
||||
* leading to it (readonly)
|
||||
* @param fullPath
|
||||
* {DOMString} the absolute full path to the file or directory
|
||||
* (readonly)
|
||||
* @param fileSystem
|
||||
* {FileSystem} the filesystem on which this entry resides
|
||||
* (readonly)
|
||||
* @param nativeURL
|
||||
* {DOMString} an alternate URL which can be used by native
|
||||
* webview controls, for example media players.
|
||||
* (optional, readonly)
|
||||
*/
|
||||
function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
|
||||
this.isFile = !!isFile;
|
||||
this.isDirectory = !!isDirectory;
|
||||
this.name = name || '';
|
||||
this.fullPath = fullPath || '';
|
||||
this.filesystem = fileSystem || null;
|
||||
this.nativeURL = nativeURL || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up the metadata of the entry.
|
||||
*
|
||||
* @param successCallback
|
||||
* {Function} is called with a Metadata object
|
||||
* @param errorCallback
|
||||
* {Function} is called with a FileError
|
||||
*/
|
||||
Entry.prototype.getMetadata = function (successCallback, errorCallback) {
|
||||
argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
|
||||
var success = successCallback && function (entryMetadata) {
|
||||
var metadata = new Metadata({
|
||||
size: entryMetadata.size,
|
||||
modificationTime: entryMetadata.lastModifiedDate
|
||||
});
|
||||
successCallback(metadata);
|
||||
};
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the metadata of the entry.
|
||||
*
|
||||
* @param successCallback
|
||||
* {Function} is called with a Metadata object
|
||||
* @param errorCallback
|
||||
* {Function} is called with a FileError
|
||||
* @param metadataObject
|
||||
* {Object} keys and values to set
|
||||
*/
|
||||
Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
|
||||
argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
|
||||
exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Move a file or directory to a new location.
|
||||
*
|
||||
* @param parent
|
||||
* {DirectoryEntry} the directory to which to move this entry
|
||||
* @param newName
|
||||
* {DOMString} new name of the entry, defaults to the current name
|
||||
* @param successCallback
|
||||
* {Function} called with the new DirectoryEntry object
|
||||
* @param errorCallback
|
||||
* {Function} called with a FileError
|
||||
*/
|
||||
Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
var srcURL = this.toInternalURL();
|
||||
// entry name
|
||||
var name = newName || this.name;
|
||||
var success = function (entry) {
|
||||
if (entry) {
|
||||
if (successCallback) {
|
||||
// create appropriate Entry object
|
||||
var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
|
||||
var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
|
||||
var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
|
||||
successCallback(result);
|
||||
}
|
||||
} else {
|
||||
// no Entry object returned
|
||||
if (fail) {
|
||||
fail(FileError.NOT_FOUND_ERR);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// copy
|
||||
exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Copy a directory to a different location.
|
||||
*
|
||||
* @param parent
|
||||
* {DirectoryEntry} the directory to which to copy the entry
|
||||
* @param newName
|
||||
* {DOMString} new name of the entry, defaults to the current name
|
||||
* @param successCallback
|
||||
* {Function} called with the new Entry object
|
||||
* @param errorCallback
|
||||
* {Function} called with a FileError
|
||||
*/
|
||||
Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
var srcURL = this.toInternalURL();
|
||||
// entry name
|
||||
var name = newName || this.name;
|
||||
// success callback
|
||||
var success = function (entry) {
|
||||
if (entry) {
|
||||
if (successCallback) {
|
||||
// create appropriate Entry object
|
||||
var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
|
||||
var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
|
||||
var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
|
||||
successCallback(result);
|
||||
}
|
||||
} else {
|
||||
// no Entry object returned
|
||||
if (fail) {
|
||||
fail(FileError.NOT_FOUND_ERR);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// copy
|
||||
exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a URL that can be passed across the bridge to identify this entry.
|
||||
*/
|
||||
Entry.prototype.toInternalURL = function () {
|
||||
if (this.filesystem && this.filesystem.__format__) {
|
||||
return this.filesystem.__format__(this.fullPath, this.nativeURL);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a URL that can be used to identify this entry.
|
||||
* Use a URL that can be used to as the src attribute of a <video> or
|
||||
* <audio> tag. If that is not possible, construct a cdvfile:// URL.
|
||||
*/
|
||||
Entry.prototype.toURL = function () {
|
||||
if (this.nativeURL) {
|
||||
return this.nativeURL;
|
||||
}
|
||||
// fullPath attribute may contain the full URL in the case that
|
||||
// toInternalURL fails.
|
||||
return this.toInternalURL() || 'file://localhost' + this.fullPath;
|
||||
};
|
||||
|
||||
/**
|
||||
* Backwards-compatibility: In v1.0.0 - 1.0.2, .toURL would only return a
|
||||
* cdvfile:// URL, and this method was necessary to obtain URLs usable by the
|
||||
* webview.
|
||||
* See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
|
||||
* and CB-6300.
|
||||
*/
|
||||
Entry.prototype.toNativeURL = function () {
|
||||
console.log("DEPRECATED: Update your code to use 'toURL'");
|
||||
return this.toURL();
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a URI that can be used to identify this entry.
|
||||
*
|
||||
* @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
|
||||
* @return uri
|
||||
*/
|
||||
Entry.prototype.toURI = function (mimeType) {
|
||||
console.log("DEPRECATED: Update your code to use 'toURL'");
|
||||
return this.toURL();
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove a file or directory. It is an error to attempt to delete a
|
||||
* directory that is not empty. It is an error to attempt to delete a
|
||||
* root directory of a file system.
|
||||
*
|
||||
* @param successCallback {Function} called with no parameters
|
||||
* @param errorCallback {Function} called with a FileError
|
||||
*/
|
||||
Entry.prototype.remove = function (successCallback, errorCallback) {
|
||||
argscheck.checkArgs('FF', 'Entry.remove', arguments);
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Look up the parent DirectoryEntry of this entry.
|
||||
*
|
||||
* @param successCallback {Function} called with the parent DirectoryEntry object
|
||||
* @param errorCallback {Function} called with a FileError
|
||||
*/
|
||||
Entry.prototype.getParent = function (successCallback, errorCallback) {
|
||||
argscheck.checkArgs('FF', 'Entry.getParent', arguments);
|
||||
var fs = this.filesystem;
|
||||
var win = successCallback && function (result) {
|
||||
var DirectoryEntry = require('./DirectoryEntry');
|
||||
var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
|
||||
successCallback(entry);
|
||||
};
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
|
||||
};
|
||||
|
||||
module.exports = Entry;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,81 @@
|
||||
cordova.define("cordova-plugin-file.File", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* name {DOMString} name of the file, without path information
|
||||
* fullPath {DOMString} the full path of the file, including the name
|
||||
* type {DOMString} mime type
|
||||
* lastModifiedDate {Date} last modified date
|
||||
* size {Number} size of the file in bytes
|
||||
*/
|
||||
|
||||
var File = function (name, localURL, type, lastModifiedDate, size) {
|
||||
this.name = name || '';
|
||||
this.localURL = localURL || null;
|
||||
this.type = type || null;
|
||||
this.lastModified = lastModifiedDate || null;
|
||||
// For backwards compatibility, store the timestamp in lastModifiedDate as well
|
||||
this.lastModifiedDate = lastModifiedDate || null;
|
||||
this.size = size || 0;
|
||||
|
||||
// These store the absolute start and end for slicing the file.
|
||||
this.start = 0;
|
||||
this.end = this.size;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a "slice" of the file. Since Cordova Files don't contain the actual
|
||||
* content, this really returns a File with adjusted start and end.
|
||||
* Slices of slices are supported.
|
||||
* start {Number} The index at which to start the slice (inclusive).
|
||||
* end {Number} The index at which to end the slice (exclusive).
|
||||
*/
|
||||
File.prototype.slice = function (start, end) {
|
||||
var size = this.end - this.start;
|
||||
var newStart = 0;
|
||||
var newEnd = size;
|
||||
if (arguments.length) {
|
||||
if (start < 0) {
|
||||
newStart = Math.max(size + start, 0);
|
||||
} else {
|
||||
newStart = Math.min(size, start);
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.length >= 2) {
|
||||
if (end < 0) {
|
||||
newEnd = Math.max(size + end, 0);
|
||||
} else {
|
||||
newEnd = Math.min(end, size);
|
||||
}
|
||||
}
|
||||
|
||||
var newFile = new File(this.name, this.localURL, this.type, this.lastModified, this.size);
|
||||
newFile.start = this.start + newStart;
|
||||
newFile.end = this.start + newEnd;
|
||||
return newFile;
|
||||
};
|
||||
|
||||
module.exports = File;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
cordova.define("cordova-plugin-file.FileEntry", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var utils = require('cordova/utils');
|
||||
var exec = require('cordova/exec');
|
||||
var Entry = require('./Entry');
|
||||
var FileWriter = require('./FileWriter');
|
||||
var File = require('./File');
|
||||
var FileError = require('./FileError');
|
||||
|
||||
/**
|
||||
* An interface representing a file on the file system.
|
||||
*
|
||||
* {boolean} isFile always true (readonly)
|
||||
* {boolean} isDirectory always false (readonly)
|
||||
* {DOMString} name of the file, excluding the path leading to it (readonly)
|
||||
* {DOMString} fullPath the absolute full path to the file (readonly)
|
||||
* {FileSystem} filesystem on which the file resides (readonly)
|
||||
*/
|
||||
var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
|
||||
// remove trailing slash if it is present
|
||||
if (fullPath && /\/$/.test(fullPath)) {
|
||||
fullPath = fullPath.substring(0, fullPath.length - 1);
|
||||
}
|
||||
if (nativeURL && /\/$/.test(nativeURL)) {
|
||||
nativeURL = nativeURL.substring(0, nativeURL.length - 1);
|
||||
}
|
||||
|
||||
FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
|
||||
};
|
||||
|
||||
utils.extend(FileEntry, Entry);
|
||||
|
||||
/**
|
||||
* Creates a new FileWriter associated with the file that this FileEntry represents.
|
||||
*
|
||||
* @param {Function} successCallback is called with the new FileWriter
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
|
||||
this.file(function (filePointer) {
|
||||
var writer = new FileWriter(filePointer);
|
||||
|
||||
if (writer.localURL === null || writer.localURL === '') {
|
||||
if (errorCallback) {
|
||||
errorCallback(new FileError(FileError.INVALID_STATE_ERR));
|
||||
}
|
||||
} else {
|
||||
if (successCallback) {
|
||||
successCallback(writer);
|
||||
}
|
||||
}
|
||||
}, errorCallback);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a File that represents the current state of the file that this FileEntry represents.
|
||||
*
|
||||
* @param {Function} successCallback is called with the new File object
|
||||
* @param {Function} errorCallback is called with a FileError
|
||||
*/
|
||||
FileEntry.prototype.file = function (successCallback, errorCallback) {
|
||||
var localURL = this.toInternalURL();
|
||||
var win = successCallback && function (f) {
|
||||
var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
|
||||
successCallback(file);
|
||||
};
|
||||
var fail = errorCallback && function (code) {
|
||||
errorCallback(new FileError(code));
|
||||
};
|
||||
exec(win, fail, 'File', 'getFileMetadata', [localURL]);
|
||||
};
|
||||
|
||||
module.exports = FileEntry;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
cordova.define("cordova-plugin-file.FileError", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* FileError
|
||||
*/
|
||||
function FileError (error) {
|
||||
this.code = error || null;
|
||||
}
|
||||
|
||||
// File error codes
|
||||
// Found in DOMException
|
||||
FileError.NOT_FOUND_ERR = 1;
|
||||
FileError.SECURITY_ERR = 2;
|
||||
FileError.ABORT_ERR = 3;
|
||||
|
||||
// Added by File API specification
|
||||
FileError.NOT_READABLE_ERR = 4;
|
||||
FileError.ENCODING_ERR = 5;
|
||||
FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
|
||||
FileError.INVALID_STATE_ERR = 7;
|
||||
FileError.SYNTAX_ERR = 8;
|
||||
FileError.INVALID_MODIFICATION_ERR = 9;
|
||||
FileError.QUOTA_EXCEEDED_ERR = 10;
|
||||
FileError.TYPE_MISMATCH_ERR = 11;
|
||||
FileError.PATH_EXISTS_ERR = 12;
|
||||
|
||||
module.exports = FileError;
|
||||
|
||||
});
|
||||
+301
@@ -0,0 +1,301 @@
|
||||
cordova.define("cordova-plugin-file.FileReader", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var modulemapper = require('cordova/modulemapper');
|
||||
var utils = require('cordova/utils');
|
||||
var FileError = require('./FileError');
|
||||
var ProgressEvent = require('./ProgressEvent');
|
||||
var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
|
||||
|
||||
/**
|
||||
* This class reads the mobile device file system.
|
||||
*
|
||||
* For Android:
|
||||
* The root directory is the root of the file system.
|
||||
* To read from the SD card, the file name is "sdcard/my_file.txt"
|
||||
* @constructor
|
||||
*/
|
||||
var FileReader = function () {
|
||||
this._readyState = 0;
|
||||
this._error = null;
|
||||
this._result = null;
|
||||
this._progress = null;
|
||||
this._localURL = '';
|
||||
this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the maximum size to read at a time via the native API. The default value is a compromise between
|
||||
* minimizing the overhead of many exec() calls while still reporting progress frequently enough for large files.
|
||||
* (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
|
||||
* OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
|
||||
*/
|
||||
FileReader.READ_CHUNK_SIZE = 256 * 1024;
|
||||
|
||||
// States
|
||||
FileReader.EMPTY = 0;
|
||||
FileReader.LOADING = 1;
|
||||
FileReader.DONE = 2;
|
||||
|
||||
utils.defineGetter(FileReader.prototype, 'readyState', function () {
|
||||
return this._localURL ? this._readyState : this._realReader.readyState;
|
||||
});
|
||||
|
||||
utils.defineGetter(FileReader.prototype, 'error', function () {
|
||||
return this._localURL ? this._error : this._realReader.error;
|
||||
});
|
||||
|
||||
utils.defineGetter(FileReader.prototype, 'result', function () {
|
||||
return this._localURL ? this._result : this._realReader.result;
|
||||
});
|
||||
|
||||
function defineEvent (eventName) {
|
||||
utils.defineGetterSetter(FileReader.prototype, eventName, function () {
|
||||
return this._realReader[eventName] || null;
|
||||
}, function (value) {
|
||||
this._realReader[eventName] = value;
|
||||
});
|
||||
}
|
||||
defineEvent('onloadstart'); // When the read starts.
|
||||
defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
|
||||
defineEvent('onload'); // When the read has successfully completed.
|
||||
defineEvent('onerror'); // When the read has failed (see errors).
|
||||
defineEvent('onloadend'); // When the request has completed (either in success or failure).
|
||||
defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
|
||||
|
||||
function initRead (reader, file) {
|
||||
// Already loading something
|
||||
if (reader.readyState === FileReader.LOADING) {
|
||||
throw new FileError(FileError.INVALID_STATE_ERR);
|
||||
}
|
||||
|
||||
reader._result = null;
|
||||
reader._error = null;
|
||||
reader._progress = 0;
|
||||
reader._readyState = FileReader.LOADING;
|
||||
|
||||
if (typeof file.localURL === 'string') {
|
||||
reader._localURL = file.localURL;
|
||||
} else {
|
||||
reader._localURL = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
if (reader.onloadstart) {
|
||||
reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used by the following read* functions to handle incremental or final success.
|
||||
* Must be bound to the FileReader's this along with all but the last parameter,
|
||||
* e.g. readSuccessCallback.bind(this, "readAsText", "UTF-8", offset, totalSize, accumulate)
|
||||
* @param readType The name of the read function to call.
|
||||
* @param encoding Text encoding, or null if this is not a text type read.
|
||||
* @param offset Starting offset of the read.
|
||||
* @param totalSize Total number of bytes or chars to read.
|
||||
* @param accumulate A function that takes the callback result and accumulates it in this._result.
|
||||
* @param r Callback result returned by the last read exec() call, or null to begin reading.
|
||||
*/
|
||||
function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
|
||||
if (this._readyState === FileReader.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
var CHUNK_SIZE = FileReader.READ_CHUNK_SIZE;
|
||||
if (readType === 'readAsDataURL') {
|
||||
// Windows proxy does not support reading file slices as Data URLs
|
||||
// so read the whole file at once.
|
||||
CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
|
||||
// Calculate new chunk size for data URLs to be multiply of 3
|
||||
// Otherwise concatenated base64 chunks won't be valid base64 data
|
||||
FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
|
||||
}
|
||||
|
||||
if (typeof r !== 'undefined') {
|
||||
accumulate(r);
|
||||
this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
|
||||
|
||||
if (typeof this.onprogress === 'function') {
|
||||
this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof r === 'undefined' || this._progress < totalSize) {
|
||||
var execArgs = [
|
||||
this._localURL,
|
||||
offset + this._progress,
|
||||
offset + this._progress + Math.min(totalSize - this._progress, CHUNK_SIZE)];
|
||||
if (encoding) {
|
||||
execArgs.splice(1, 0, encoding);
|
||||
}
|
||||
exec(
|
||||
readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
|
||||
readFailureCallback.bind(this),
|
||||
'File', readType, execArgs);
|
||||
} else {
|
||||
this._readyState = FileReader.DONE;
|
||||
|
||||
if (typeof this.onload === 'function') {
|
||||
this.onload(new ProgressEvent('load', {target: this}));
|
||||
}
|
||||
|
||||
if (typeof this.onloadend === 'function') {
|
||||
this.onloadend(new ProgressEvent('loadend', {target: this}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used by the following read* functions to handle errors.
|
||||
* Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
|
||||
*/
|
||||
function readFailureCallback (e) {
|
||||
if (this._readyState === FileReader.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._readyState = FileReader.DONE;
|
||||
this._result = null;
|
||||
this._error = new FileError(e);
|
||||
|
||||
if (typeof this.onerror === 'function') {
|
||||
this.onerror(new ProgressEvent('error', {target: this}));
|
||||
}
|
||||
|
||||
if (typeof this.onloadend === 'function') {
|
||||
this.onloadend(new ProgressEvent('loadend', {target: this}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort reading file.
|
||||
*/
|
||||
FileReader.prototype.abort = function () {
|
||||
if (origFileReader && !this._localURL) {
|
||||
return this._realReader.abort();
|
||||
}
|
||||
this._result = null;
|
||||
|
||||
if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._readyState = FileReader.DONE;
|
||||
|
||||
// If abort callback
|
||||
if (typeof this.onabort === 'function') {
|
||||
this.onabort(new ProgressEvent('abort', {target: this}));
|
||||
}
|
||||
// If load end callback
|
||||
if (typeof this.onloadend === 'function') {
|
||||
this.onloadend(new ProgressEvent('loadend', {target: this}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Read text file.
|
||||
*
|
||||
* @param file {File} File object containing file properties
|
||||
* @param encoding [Optional] (see http://www.iana.org/assignments/character-sets)
|
||||
*/
|
||||
FileReader.prototype.readAsText = function (file, encoding) {
|
||||
if (initRead(this, file)) {
|
||||
return this._realReader.readAsText(file, encoding);
|
||||
}
|
||||
|
||||
// Default encoding is UTF-8
|
||||
var enc = encoding || 'UTF-8';
|
||||
|
||||
var totalSize = file.end - file.start;
|
||||
readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
|
||||
if (this._progress === 0) {
|
||||
this._result = '';
|
||||
}
|
||||
this._result += r;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Read file and return data as a base64 encoded data url.
|
||||
* A data url is of the form:
|
||||
* data:[<mediatype>][;base64],<data>
|
||||
*
|
||||
* @param file {File} File object containing file properties
|
||||
*/
|
||||
FileReader.prototype.readAsDataURL = function (file) {
|
||||
if (initRead(this, file)) {
|
||||
return this._realReader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
var totalSize = file.end - file.start;
|
||||
readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
|
||||
var commaIndex = r.indexOf(',');
|
||||
if (this._progress === 0) {
|
||||
this._result = r;
|
||||
} else {
|
||||
this._result += r.substring(commaIndex + 1);
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Read file and return data as a binary data.
|
||||
*
|
||||
* @param file {File} File object containing file properties
|
||||
*/
|
||||
FileReader.prototype.readAsBinaryString = function (file) {
|
||||
if (initRead(this, file)) {
|
||||
return this._realReader.readAsBinaryString(file);
|
||||
}
|
||||
|
||||
var totalSize = file.end - file.start;
|
||||
readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
|
||||
if (this._progress === 0) {
|
||||
this._result = '';
|
||||
}
|
||||
this._result += r;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Read file and return data as a binary data.
|
||||
*
|
||||
* @param file {File} File object containing file properties
|
||||
*/
|
||||
FileReader.prototype.readAsArrayBuffer = function (file) {
|
||||
if (initRead(this, file)) {
|
||||
return this._realReader.readAsArrayBuffer(file);
|
||||
}
|
||||
|
||||
var totalSize = file.end - file.start;
|
||||
readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
|
||||
var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
|
||||
resultArray.set(new Uint8Array(r), this._progress);
|
||||
this._result = resultArray.buffer;
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
module.exports = FileReader;
|
||||
|
||||
});
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
cordova.define("cordova-plugin-file.FileSystem", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var DirectoryEntry = require('./DirectoryEntry');
|
||||
|
||||
/**
|
||||
* An interface representing a file system
|
||||
*
|
||||
* @constructor
|
||||
* {DOMString} name the unique name of the file system (readonly)
|
||||
* {DirectoryEntry} root directory of the file system (readonly)
|
||||
*/
|
||||
var FileSystem = function (name, root) {
|
||||
this.name = name;
|
||||
if (root) {
|
||||
this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
|
||||
} else {
|
||||
this.root = new DirectoryEntry(this.name, '/', this);
|
||||
}
|
||||
};
|
||||
|
||||
FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
|
||||
return fullPath;
|
||||
};
|
||||
|
||||
FileSystem.prototype.toJSON = function () {
|
||||
return '<FileSystem: ' + this.name + '>';
|
||||
};
|
||||
|
||||
// Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
|
||||
FileSystem.encodeURIPath = function (path) {
|
||||
// Because # is a valid filename character, it must be encoded to prevent part of the
|
||||
// path from being parsed as a URI fragment.
|
||||
return encodeURI(path).replace(/#/g, '%23');
|
||||
};
|
||||
|
||||
module.exports = FileSystem;
|
||||
|
||||
});
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
cordova.define("cordova-plugin-file.FileUploadOptions", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options to customize the HTTP request used to upload files.
|
||||
* @constructor
|
||||
* @param fileKey {String} Name of file request parameter.
|
||||
* @param fileName {String} Filename to be used by the server. Defaults to image.jpg.
|
||||
* @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg.
|
||||
* @param params {Object} Object with key: value params to send to the server.
|
||||
* @param headers {Object} Keys are header names, values are header values. Multiple
|
||||
* headers of the same name are not supported.
|
||||
*/
|
||||
var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
|
||||
this.fileKey = fileKey || null;
|
||||
this.fileName = fileName || null;
|
||||
this.mimeType = mimeType || null;
|
||||
this.params = params || null;
|
||||
this.headers = headers || null;
|
||||
this.httpMethod = httpMethod || null;
|
||||
};
|
||||
|
||||
module.exports = FileUploadOptions;
|
||||
|
||||
});
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
cordova.define("cordova-plugin-file.FileUploadResult", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* FileUploadResult
|
||||
* @constructor
|
||||
*/
|
||||
module.exports = function FileUploadResult (size, code, content) {
|
||||
this.bytesSent = size;
|
||||
this.responseCode = code;
|
||||
this.response = content;
|
||||
};
|
||||
|
||||
});
|
||||
+328
@@ -0,0 +1,328 @@
|
||||
cordova.define("cordova-plugin-file.FileWriter", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var FileError = require('./FileError');
|
||||
var FileReader = require('./FileReader');
|
||||
var ProgressEvent = require('./ProgressEvent');
|
||||
|
||||
/**
|
||||
* This class writes to the mobile device file system.
|
||||
*
|
||||
* For Android:
|
||||
* The root directory is the root of the file system.
|
||||
* To write to the SD card, the file name is "sdcard/my_file.txt"
|
||||
*
|
||||
* @constructor
|
||||
* @param file {File} File object containing file properties
|
||||
* @param append if true write to the end of the file, otherwise overwrite the file
|
||||
*/
|
||||
var FileWriter = function (file) {
|
||||
this.fileName = '';
|
||||
this.length = 0;
|
||||
if (file) {
|
||||
this.localURL = file.localURL || file;
|
||||
this.length = file.size || 0;
|
||||
}
|
||||
// default is to write at the beginning of the file
|
||||
this.position = 0;
|
||||
|
||||
this.readyState = 0; // EMPTY
|
||||
|
||||
this.result = null;
|
||||
|
||||
// Error
|
||||
this.error = null;
|
||||
|
||||
// Event handlers
|
||||
this.onwritestart = null; // When writing starts
|
||||
this.onprogress = null; // While writing the file, and reporting partial file data
|
||||
this.onwrite = null; // When the write has successfully completed.
|
||||
this.onwriteend = null; // When the request has completed (either in success or failure).
|
||||
this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
|
||||
this.onerror = null; // When the write has failed (see errors).
|
||||
};
|
||||
|
||||
// States
|
||||
FileWriter.INIT = 0;
|
||||
FileWriter.WRITING = 1;
|
||||
FileWriter.DONE = 2;
|
||||
|
||||
/**
|
||||
* Abort writing file.
|
||||
*/
|
||||
FileWriter.prototype.abort = function () {
|
||||
// check for invalid state
|
||||
if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
|
||||
throw new FileError(FileError.INVALID_STATE_ERR);
|
||||
}
|
||||
|
||||
// set error
|
||||
this.error = new FileError(FileError.ABORT_ERR);
|
||||
|
||||
this.readyState = FileWriter.DONE;
|
||||
|
||||
// If abort callback
|
||||
if (typeof this.onabort === 'function') {
|
||||
this.onabort(new ProgressEvent('abort', {'target': this}));
|
||||
}
|
||||
|
||||
// If write end callback
|
||||
if (typeof this.onwriteend === 'function') {
|
||||
this.onwriteend(new ProgressEvent('writeend', {'target': this}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes data to the file
|
||||
*
|
||||
* @param data text or blob to be written
|
||||
* @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
|
||||
*/
|
||||
FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
|
||||
|
||||
var that = this;
|
||||
var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
|
||||
/* eslint-disable no-undef */
|
||||
var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
|
||||
var isBinary;
|
||||
|
||||
// Check to see if the incoming data is a blob
|
||||
if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
|
||||
var fileReader = new FileReader();
|
||||
/* eslint-enable no-undef */
|
||||
fileReader.onload = function () {
|
||||
// Call this method again, with the arraybuffer as argument
|
||||
FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
|
||||
};
|
||||
fileReader.onerror = function () {
|
||||
// DONE state
|
||||
that.readyState = FileWriter.DONE;
|
||||
|
||||
// Save error
|
||||
that.error = this.error;
|
||||
|
||||
// If onerror callback
|
||||
if (typeof that.onerror === 'function') {
|
||||
that.onerror(new ProgressEvent('error', {'target': that}));
|
||||
}
|
||||
|
||||
// If onwriteend callback
|
||||
if (typeof that.onwriteend === 'function') {
|
||||
that.onwriteend(new ProgressEvent('writeend', {'target': that}));
|
||||
}
|
||||
};
|
||||
|
||||
// WRITING state
|
||||
this.readyState = FileWriter.WRITING;
|
||||
|
||||
if (supportsBinary) {
|
||||
fileReader.readAsArrayBuffer(data);
|
||||
} else {
|
||||
fileReader.readAsText(data);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Mark data type for safer transport over the binary bridge
|
||||
isBinary = supportsBinary && (data instanceof ArrayBuffer);
|
||||
if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
|
||||
// create a plain array, using the keys from the Uint8Array view so that we can serialize it
|
||||
data = Array.apply(null, new Uint8Array(data));
|
||||
}
|
||||
|
||||
// Throw an exception if we are already writing a file
|
||||
if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
|
||||
throw new FileError(FileError.INVALID_STATE_ERR);
|
||||
}
|
||||
|
||||
// WRITING state
|
||||
this.readyState = FileWriter.WRITING;
|
||||
|
||||
var me = this;
|
||||
|
||||
// If onwritestart callback
|
||||
if (typeof me.onwritestart === 'function') {
|
||||
me.onwritestart(new ProgressEvent('writestart', {'target': me}));
|
||||
}
|
||||
|
||||
// Write file
|
||||
exec(
|
||||
// Success callback
|
||||
function (r) {
|
||||
// If DONE (cancelled), then don't do anything
|
||||
if (me.readyState === FileWriter.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// position always increases by bytes written because file would be extended
|
||||
me.position += r;
|
||||
// The length of the file is now where we are done writing.
|
||||
|
||||
me.length = me.position;
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileWriter.DONE;
|
||||
|
||||
// If onwrite callback
|
||||
if (typeof me.onwrite === 'function') {
|
||||
me.onwrite(new ProgressEvent('write', {'target': me}));
|
||||
}
|
||||
|
||||
// If onwriteend callback
|
||||
if (typeof me.onwriteend === 'function') {
|
||||
me.onwriteend(new ProgressEvent('writeend', {'target': me}));
|
||||
}
|
||||
},
|
||||
// Error callback
|
||||
function (e) {
|
||||
// If DONE (cancelled), then don't do anything
|
||||
if (me.readyState === FileWriter.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileWriter.DONE;
|
||||
|
||||
// Save error
|
||||
me.error = new FileError(e);
|
||||
|
||||
// If onerror callback
|
||||
if (typeof me.onerror === 'function') {
|
||||
me.onerror(new ProgressEvent('error', {'target': me}));
|
||||
}
|
||||
|
||||
// If onwriteend callback
|
||||
if (typeof me.onwriteend === 'function') {
|
||||
me.onwriteend(new ProgressEvent('writeend', {'target': me}));
|
||||
}
|
||||
}, 'File', 'write', [this.localURL, data, this.position, isBinary]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Moves the file pointer to the location specified.
|
||||
*
|
||||
* If the offset is a negative number the position of the file
|
||||
* pointer is rewound. If the offset is greater than the file
|
||||
* size the position is set to the end of the file.
|
||||
*
|
||||
* @param offset is the location to move the file pointer to.
|
||||
*/
|
||||
FileWriter.prototype.seek = function (offset) {
|
||||
// Throw an exception if we are already writing a file
|
||||
if (this.readyState === FileWriter.WRITING) {
|
||||
throw new FileError(FileError.INVALID_STATE_ERR);
|
||||
}
|
||||
|
||||
if (!offset && offset !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// See back from end of file.
|
||||
if (offset < 0) {
|
||||
this.position = Math.max(offset + this.length, 0);
|
||||
// Offset is bigger than file size so set position
|
||||
// to the end of the file.
|
||||
} else if (offset > this.length) {
|
||||
this.position = this.length;
|
||||
// Offset is between 0 and file size so set the position
|
||||
// to start writing.
|
||||
} else {
|
||||
this.position = offset;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Truncates the file to the size specified.
|
||||
*
|
||||
* @param size to chop the file at.
|
||||
*/
|
||||
FileWriter.prototype.truncate = function (size) {
|
||||
// Throw an exception if we are already writing a file
|
||||
if (this.readyState === FileWriter.WRITING) {
|
||||
throw new FileError(FileError.INVALID_STATE_ERR);
|
||||
}
|
||||
|
||||
// WRITING state
|
||||
this.readyState = FileWriter.WRITING;
|
||||
|
||||
var me = this;
|
||||
|
||||
// If onwritestart callback
|
||||
if (typeof me.onwritestart === 'function') {
|
||||
me.onwritestart(new ProgressEvent('writestart', {'target': this}));
|
||||
}
|
||||
|
||||
// Write file
|
||||
exec(
|
||||
// Success callback
|
||||
function (r) {
|
||||
// If DONE (cancelled), then don't do anything
|
||||
if (me.readyState === FileWriter.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileWriter.DONE;
|
||||
|
||||
// Update the length of the file
|
||||
me.length = r;
|
||||
me.position = Math.min(me.position, r);
|
||||
|
||||
// If onwrite callback
|
||||
if (typeof me.onwrite === 'function') {
|
||||
me.onwrite(new ProgressEvent('write', {'target': me}));
|
||||
}
|
||||
|
||||
// If onwriteend callback
|
||||
if (typeof me.onwriteend === 'function') {
|
||||
me.onwriteend(new ProgressEvent('writeend', {'target': me}));
|
||||
}
|
||||
},
|
||||
// Error callback
|
||||
function (e) {
|
||||
// If DONE (cancelled), then don't do anything
|
||||
if (me.readyState === FileWriter.DONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// DONE state
|
||||
me.readyState = FileWriter.DONE;
|
||||
|
||||
// Save error
|
||||
me.error = new FileError(e);
|
||||
|
||||
// If onerror callback
|
||||
if (typeof me.onerror === 'function') {
|
||||
me.onerror(new ProgressEvent('error', {'target': me}));
|
||||
}
|
||||
|
||||
// If onwriteend callback
|
||||
if (typeof me.onwriteend === 'function') {
|
||||
me.onwriteend(new ProgressEvent('writeend', {'target': me}));
|
||||
}
|
||||
}, 'File', 'truncate', [this.localURL, size]);
|
||||
};
|
||||
|
||||
module.exports = FileWriter;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
cordova.define("cordova-plugin-file.Flags", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Supplies arguments to methods that lookup or create files and directories.
|
||||
*
|
||||
* @param create
|
||||
* {boolean} file or directory if it doesn't exist
|
||||
* @param exclusive
|
||||
* {boolean} used with create; if true the command will fail if
|
||||
* target path exists
|
||||
*/
|
||||
function Flags (create, exclusive) {
|
||||
this.create = create || false;
|
||||
this.exclusive = exclusive || false;
|
||||
}
|
||||
|
||||
module.exports = Flags;
|
||||
|
||||
});
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
cordova.define("cordova-plugin-file.LocalFileSystem", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
exports.TEMPORARY = 0;
|
||||
exports.PERSISTENT = 1;
|
||||
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
cordova.define("cordova-plugin-file.Metadata", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Information about the state of the file or directory
|
||||
*
|
||||
* {Date} modificationTime (readonly)
|
||||
*/
|
||||
var Metadata = function (metadata) {
|
||||
if (typeof metadata === 'object') {
|
||||
this.modificationTime = new Date(metadata.modificationTime);
|
||||
this.size = metadata.size || 0;
|
||||
} else if (typeof metadata === 'undefined') {
|
||||
this.modificationTime = null;
|
||||
this.size = 0;
|
||||
} else {
|
||||
/* Backwards compatiblity with platforms that only return a timestamp */
|
||||
this.modificationTime = new Date(metadata);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Metadata;
|
||||
|
||||
});
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
cordova.define("cordova-plugin-file.ProgressEvent", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
|
||||
// Feature test: See if we can instantiate a native ProgressEvent;
|
||||
// if so, use that approach,
|
||||
// otherwise fill-in with our own implementation.
|
||||
//
|
||||
// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
|
||||
var ProgressEvent = (function () {
|
||||
/*
|
||||
var createEvent = function(data) {
|
||||
var event = document.createEvent('Events');
|
||||
event.initEvent('ProgressEvent', false, false);
|
||||
if (data) {
|
||||
for (var i in data) {
|
||||
if (data.hasOwnProperty(i)) {
|
||||
event[i] = data[i];
|
||||
}
|
||||
}
|
||||
if (data.target) {
|
||||
// TODO: cannot call <some_custom_object>.dispatchEvent
|
||||
// need to first figure out how to implement EventTarget
|
||||
}
|
||||
}
|
||||
return event;
|
||||
};
|
||||
try {
|
||||
var ev = createEvent({type:"abort",target:document});
|
||||
return function ProgressEvent(type, data) {
|
||||
data.type = type;
|
||||
return createEvent(data);
|
||||
};
|
||||
} catch(e){
|
||||
*/
|
||||
return function ProgressEvent (type, dict) {
|
||||
this.type = type;
|
||||
this.bubbles = false;
|
||||
this.cancelBubble = false;
|
||||
this.cancelable = false;
|
||||
this.lengthComputable = false;
|
||||
this.loaded = dict && dict.loaded ? dict.loaded : 0;
|
||||
this.total = dict && dict.total ? dict.total : 0;
|
||||
this.target = dict && dict.target ? dict.target : null;
|
||||
};
|
||||
// }
|
||||
})();
|
||||
|
||||
module.exports = ProgressEvent;
|
||||
|
||||
});
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
cordova.define("cordova-plugin-file.androidFileSystem", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
|
||||
|
||||
module.exports = {
|
||||
__format__: function (fullPath, nativeUrl) {
|
||||
var path;
|
||||
var contentUrlMatch = /^content:\/\//.exec(nativeUrl);
|
||||
if (contentUrlMatch) {
|
||||
// When available, use the path from a native content URL, which was already encoded by Android.
|
||||
// This is necessary because JavaScript's encodeURI() does not encode as many characters as
|
||||
// Android, which can result in permission exceptions when the encoding of a content URI
|
||||
// doesn't match the string for which permission was originally granted.
|
||||
path = nativeUrl.substring(contentUrlMatch[0].length - 1);
|
||||
} else {
|
||||
path = FileSystem.encodeURIPath(fullPath); // eslint-disable-line no-undef
|
||||
if (!/^\//.test(path)) {
|
||||
path = '/' + path;
|
||||
}
|
||||
|
||||
var m = /\?.*/.exec(nativeUrl);
|
||||
if (m) {
|
||||
path += m[0];
|
||||
}
|
||||
}
|
||||
|
||||
return FILESYSTEM_PROTOCOL + '://localhost/' + this.name + path; // eslint-disable-line no-undef
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
cordova.define("cordova-plugin-file.isChrome", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = function () {
|
||||
// window.webkitRequestFileSystem and window.webkitResolveLocalFileSystemURL are available only in Chrome and
|
||||
// possibly a good flag to indicate that we're running in Chrome
|
||||
return window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
|
||||
};
|
||||
|
||||
});
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
cordova.define("cordova-plugin-file.fileSystemPaths", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
var channel = require('cordova/channel');
|
||||
|
||||
exports.file = {
|
||||
// Read-only directory where the application is installed.
|
||||
applicationDirectory: null,
|
||||
// Root of app's private writable storage
|
||||
applicationStorageDirectory: null,
|
||||
// Where to put app-specific data files.
|
||||
dataDirectory: null,
|
||||
// Cached files that should survive app restarts.
|
||||
// Apps should not rely on the OS to delete files in here.
|
||||
cacheDirectory: null,
|
||||
// Android: the application space on external storage.
|
||||
externalApplicationStorageDirectory: null,
|
||||
// Android: Where to put app-specific data files on external storage.
|
||||
externalDataDirectory: null,
|
||||
// Android: the application cache on external storage.
|
||||
externalCacheDirectory: null,
|
||||
// Android: the external storage (SD card) root.
|
||||
externalRootDirectory: null,
|
||||
// iOS: Temp directory that the OS can clear at will.
|
||||
tempDirectory: null,
|
||||
// iOS: Holds app-specific files that should be synced (e.g. to iCloud).
|
||||
syncedDataDirectory: null,
|
||||
// iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
|
||||
documentsDirectory: null,
|
||||
// BlackBerry10: Files globally available to all apps
|
||||
sharedDirectory: null
|
||||
};
|
||||
|
||||
channel.waitForInitialization('onFileSystemPathsReady');
|
||||
channel.onCordovaReady.subscribe(function () {
|
||||
function after (paths) {
|
||||
for (var k in paths) {
|
||||
exports.file[k] = paths[k];
|
||||
}
|
||||
channel.initializationComplete('onFileSystemPathsReady');
|
||||
}
|
||||
exec(after, null, 'File', 'requestAllPaths', []);
|
||||
});
|
||||
|
||||
});
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
cordova.define("cordova-plugin-file.fileSystems-roots", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
// Map of fsName -> FileSystem.
|
||||
var fsMap = null;
|
||||
var FileSystem = require('./FileSystem');
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
|
||||
require('./fileSystems').getFs = function (name, callback) {
|
||||
function success (response) {
|
||||
fsMap = {};
|
||||
for (var i = 0; i < response.length; ++i) {
|
||||
var fsRoot = response[i];
|
||||
if (fsRoot) {
|
||||
var fs = new FileSystem(fsRoot.filesystemName, fsRoot);
|
||||
fsMap[fs.name] = fs;
|
||||
}
|
||||
}
|
||||
callback(fsMap[name]);
|
||||
}
|
||||
|
||||
if (fsMap) {
|
||||
callback(fsMap[name]);
|
||||
} else {
|
||||
exec(success, null, 'File', 'requestAllFileSystems', []);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
cordova.define("cordova-plugin-file.fileSystems", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
|
||||
module.exports.getFs = function (name, callback) {
|
||||
callback(null);
|
||||
};
|
||||
|
||||
});
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
cordova.define("cordova-plugin-file.requestFileSystem", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
// For browser platform: not all browsers use this file.
|
||||
function checkBrowser () {
|
||||
if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
|
||||
module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (checkBrowser()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var FileError = require('./FileError');
|
||||
var FileSystem = require('./FileSystem');
|
||||
var exec = require('cordova/exec');
|
||||
var fileSystems = require('./fileSystems');
|
||||
|
||||
/**
|
||||
* Request a file system in which to store application data.
|
||||
* @param type local file system type
|
||||
* @param size indicates how much storage space, in bytes, the application expects to need
|
||||
* @param successCallback invoked with a FileSystem object
|
||||
* @param errorCallback invoked if error occurs retrieving file system
|
||||
*/
|
||||
var requestFileSystem = function (type, size, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
|
||||
var fail = function (code) {
|
||||
if (errorCallback) {
|
||||
errorCallback(new FileError(code));
|
||||
}
|
||||
};
|
||||
|
||||
if (type < 0) {
|
||||
fail(FileError.SYNTAX_ERR);
|
||||
} else {
|
||||
// if successful, return a FileSystem object
|
||||
var success = function (file_system) {
|
||||
if (file_system) {
|
||||
if (successCallback) {
|
||||
fileSystems.getFs(file_system.name, function (fs) {
|
||||
// This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
|
||||
if (!fs) {
|
||||
fs = new FileSystem(file_system.name, file_system.root);
|
||||
}
|
||||
successCallback(fs);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// no FileSystem object returned
|
||||
fail(FileError.NOT_FOUND_ERR);
|
||||
}
|
||||
};
|
||||
exec(success, fail, 'File', 'requestFileSystem', [type, size]);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = requestFileSystem;
|
||||
})();
|
||||
|
||||
});
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
(function () {
|
||||
// For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
|
||||
function checkBrowser () {
|
||||
if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
|
||||
module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (checkBrowser()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var DirectoryEntry = require('./DirectoryEntry');
|
||||
var FileEntry = require('./FileEntry');
|
||||
var FileError = require('./FileError');
|
||||
var exec = require('cordova/exec');
|
||||
var fileSystems = require('./fileSystems');
|
||||
|
||||
/**
|
||||
* Look up file system Entry referred to by local URI.
|
||||
* @param {DOMString} uri URI referring to a local file or directory
|
||||
* @param successCallback invoked with Entry object corresponding to URI
|
||||
* @param errorCallback invoked if error occurs retrieving file system entry
|
||||
*/
|
||||
module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
|
||||
argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
|
||||
// error callback
|
||||
var fail = function (error) {
|
||||
if (errorCallback) {
|
||||
errorCallback(new FileError(error));
|
||||
}
|
||||
};
|
||||
// sanity check for 'not:valid:filename' or '/not:valid:filename'
|
||||
// file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
|
||||
if (!uri || uri.split(':').length > 2) {
|
||||
setTimeout(function () {
|
||||
fail(FileError.ENCODING_ERR);
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
// if successful, return either a file or directory entry
|
||||
var success = function (entry) {
|
||||
if (entry) {
|
||||
if (successCallback) {
|
||||
// create appropriate Entry object
|
||||
var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
|
||||
fileSystems.getFs(fsName, function (fs) {
|
||||
// This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
|
||||
if (!fs) {
|
||||
fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
|
||||
}
|
||||
var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
|
||||
successCallback(result);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// no Entry object returned
|
||||
fail(FileError.NOT_FOUND_ERR);
|
||||
}
|
||||
};
|
||||
|
||||
exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
|
||||
};
|
||||
|
||||
module.exports.resolveLocalFileSystemURI = function () {
|
||||
console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
|
||||
module.exports.resolveLocalFileSystemURL.apply(this, arguments);
|
||||
};
|
||||
})();
|
||||
|
||||
});
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
cordova.define("cordova-plugin-fingerprint-aio.Fingerprint", function(require, exports, module) {
|
||||
/*global cordova */
|
||||
|
||||
var Fingerprint = function() {
|
||||
};
|
||||
|
||||
// Plugin Errors
|
||||
Fingerprint.prototype.BIOMETRIC_UNKNOWN_ERROR = -100;
|
||||
Fingerprint.prototype.BIOMETRIC_UNAVAILABLE = -101;
|
||||
Fingerprint.prototype.BIOMETRIC_AUTHENTICATION_FAILED = -102;
|
||||
Fingerprint.prototype.BIOMETRIC_SDK_NOT_SUPPORTED = -103;
|
||||
Fingerprint.prototype.BIOMETRIC_HARDWARE_NOT_SUPPORTED = -104;
|
||||
Fingerprint.prototype.BIOMETRIC_PERMISSION_NOT_GRANTED = -105;
|
||||
Fingerprint.prototype.BIOMETRIC_NOT_ENROLLED = -106;
|
||||
Fingerprint.prototype.BIOMETRIC_INTERNAL_PLUGIN_ERROR = -107;
|
||||
Fingerprint.prototype.BIOMETRIC_DISMISSED = -108;
|
||||
Fingerprint.prototype.BIOMETRIC_PIN_OR_PATTERN_DISMISSED = -109;
|
||||
Fingerprint.prototype.BIOMETRIC_SCREEN_GUARD_UNSECURED = -110;
|
||||
Fingerprint.prototype.BIOMETRIC_LOCKED_OUT = -111;
|
||||
Fingerprint.prototype.BIOMETRIC_LOCKED_OUT_PERMANENT = -112;
|
||||
Fingerprint.prototype.BIOMETRIC_NO_SECRET_FOUND = -113;
|
||||
|
||||
// Biometric types
|
||||
Fingerprint.prototype.BIOMETRIC_TYPE_FINGERPRINT = "finger";
|
||||
Fingerprint.prototype.BIOMETRIC_TYPE_FACE = "face";
|
||||
Fingerprint.prototype.BIOMETRIC_TYPE_COMMON = "biometric";
|
||||
|
||||
Fingerprint.prototype.show = function (params, successCallback, errorCallback) {
|
||||
cordova.exec(
|
||||
successCallback,
|
||||
errorCallback,
|
||||
"Fingerprint",
|
||||
"authenticate",
|
||||
[params]
|
||||
);
|
||||
};
|
||||
|
||||
Fingerprint.prototype.isAvailable = function (successCallback, errorCallback, optionalParams) {
|
||||
cordova.exec(
|
||||
successCallback,
|
||||
errorCallback,
|
||||
"Fingerprint",
|
||||
"isAvailable",
|
||||
[optionalParams]
|
||||
);
|
||||
};
|
||||
|
||||
Fingerprint.prototype.registerBiometricSecret = function (params, successCallback, errorCallback) {
|
||||
cordova.exec(
|
||||
successCallback,
|
||||
errorCallback,
|
||||
"Fingerprint",
|
||||
"registerBiometricSecret",
|
||||
[params]
|
||||
);
|
||||
};
|
||||
|
||||
Fingerprint.prototype.loadBiometricSecret = function (params, successCallback, errorCallback) {
|
||||
cordova.exec(
|
||||
successCallback,
|
||||
errorCallback,
|
||||
"Fingerprint",
|
||||
"loadBiometricSecret",
|
||||
[params]
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = new Fingerprint();
|
||||
|
||||
});
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
cordova.define("cordova-plugin-globalization.GlobalizationError", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Globalization error object
|
||||
*
|
||||
* @constructor
|
||||
* @param code
|
||||
* @param message
|
||||
*/
|
||||
var GlobalizationError = function (code, message) {
|
||||
this.code = code || null;
|
||||
this.message = message || '';
|
||||
};
|
||||
|
||||
// Globalization error codes
|
||||
GlobalizationError.UNKNOWN_ERROR = 0;
|
||||
GlobalizationError.FORMATTING_ERROR = 1;
|
||||
GlobalizationError.PARSING_ERROR = 2;
|
||||
GlobalizationError.PATTERN_ERROR = 3;
|
||||
|
||||
module.exports = GlobalizationError;
|
||||
|
||||
});
|
||||
+388
@@ -0,0 +1,388 @@
|
||||
cordova.define("cordova-plugin-globalization.globalization", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var argscheck = require('cordova/argscheck');
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var globalization = {
|
||||
|
||||
/**
|
||||
* Returns the string identifier for the client's current language.
|
||||
* It returns the language identifier string to the successCB callback with a
|
||||
* properties object as a parameter. If there is an error getting the language,
|
||||
* then the errorCB callback is invoked.
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
*
|
||||
* @return Object.value {String}: The language identifier
|
||||
*
|
||||
* @error GlobalizationError.UNKNOWN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getPreferredLanguage(function (language) {alert('language:' + language.value + '\n');},
|
||||
* function () {});
|
||||
*/
|
||||
getPreferredLanguage: function (successCB, failureCB) {
|
||||
argscheck.checkArgs('fF', 'Globalization.getPreferredLanguage', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getPreferredLanguage', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the string identifier for the client's current locale setting.
|
||||
* It returns the locale identifier string to the successCB callback with a
|
||||
* properties object as a parameter. If there is an error getting the locale,
|
||||
* then the errorCB callback is invoked.
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
*
|
||||
* @return Object.value {String}: The locale identifier
|
||||
*
|
||||
* @error GlobalizationError.UNKNOWN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getLocaleName(function (locale) {alert('locale:' + locale.value + '\n');},
|
||||
* function () {});
|
||||
*/
|
||||
getLocaleName: function (successCB, failureCB) {
|
||||
argscheck.checkArgs('fF', 'Globalization.getLocaleName', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getLocaleName', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a date formatted as a string according to the client's user preferences and
|
||||
* calendar using the time zone of the client. It returns the formatted date string to the
|
||||
* successCB callback with a properties object as a parameter. If there is an error
|
||||
* formatting the date, then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: formatLenght="short" and selector="date and time"
|
||||
*
|
||||
* @param {Date} date
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* formatLength {String}: 'short', 'medium', 'long', or 'full'
|
||||
* selector {String}: 'date', 'time', or 'date and time'
|
||||
*
|
||||
* @return Object.value {String}: The localized date string
|
||||
*
|
||||
* @error GlobalizationError.FORMATTING_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.dateToString(new Date(),
|
||||
* function (date) {alert('date:' + date.value + '\n');},
|
||||
* function (errorCode) {alert(errorCode);},
|
||||
* {formatLength:'short'});
|
||||
*/
|
||||
dateToString: function (date, successCB, failureCB, options) {
|
||||
argscheck.checkArgs('dfFO', 'Globalization.dateToString', arguments);
|
||||
var dateValue = date.valueOf();
|
||||
exec(successCB, failureCB, 'Globalization', 'dateToString', [{'date': dateValue, 'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a date formatted as a string according to the client's user
|
||||
* preferences and calendar using the time zone of the client and returns
|
||||
* the corresponding date object. It returns the date to the successCB
|
||||
* callback with a properties object as a parameter. If there is an error
|
||||
* parsing the date string, then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: formatLength="short" and selector="date and time"
|
||||
*
|
||||
* @param {String} dateString
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* formatLength {String}: 'short', 'medium', 'long', or 'full'
|
||||
* selector {String}: 'date', 'time', or 'date and time'
|
||||
*
|
||||
* @return Object.year {Number}: The four digit year
|
||||
* Object.month {Number}: The month from (0 - 11)
|
||||
* Object.day {Number}: The day from (1 - 31)
|
||||
* Object.hour {Number}: The hour from (0 - 23)
|
||||
* Object.minute {Number}: The minute from (0 - 59)
|
||||
* Object.second {Number}: The second from (0 - 59)
|
||||
* Object.millisecond {Number}: The milliseconds (from 0 - 999),
|
||||
* not available on all platforms
|
||||
*
|
||||
* @error GlobalizationError.PARSING_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.stringToDate('4/11/2011',
|
||||
* function (date) { alert('Month:' + date.month + '\n' +
|
||||
* 'Day:' + date.day + '\n' +
|
||||
* 'Year:' + date.year + '\n');},
|
||||
* function (errorCode) {alert(errorCode);},
|
||||
* {selector:'date'});
|
||||
*/
|
||||
stringToDate: function (dateString, successCB, failureCB, options) {
|
||||
argscheck.checkArgs('sfFO', 'Globalization.stringToDate', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'stringToDate', [{'dateString': dateString, 'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a pattern string for formatting and parsing dates according to the client's
|
||||
* user preferences. It returns the pattern to the successCB callback with a
|
||||
* properties object as a parameter. If there is an error obtaining the pattern,
|
||||
* then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: formatLength="short" and selector="date and time"
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* formatLength {String}: 'short', 'medium', 'long', or 'full'
|
||||
* selector {String}: 'date', 'time', or 'date and time'
|
||||
*
|
||||
* @return Object.pattern {String}: The date and time pattern for formatting and parsing dates.
|
||||
* The patterns follow Unicode Technical Standard #35
|
||||
* http://unicode.org/reports/tr35/tr35-4.html
|
||||
* Object.timezone {String}: The abbreviated name of the time zone on the client
|
||||
* Object.utc_offset {Number}: The current difference in seconds between the client's
|
||||
* time zone and coordinated universal time.
|
||||
* Object.dst_offset {Number}: The current daylight saving time offset in seconds
|
||||
* between the client's non-daylight saving's time zone
|
||||
* and the client's daylight saving's time zone.
|
||||
*
|
||||
* @error GlobalizationError.PATTERN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getDatePattern(
|
||||
* function (date) {alert('pattern:' + date.pattern + '\n');},
|
||||
* function () {},
|
||||
* {formatLength:'short'});
|
||||
*/
|
||||
getDatePattern: function (successCB, failureCB, options) {
|
||||
argscheck.checkArgs('fFO', 'Globalization.getDatePattern', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getDatePattern', [{'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an array of either the names of the months or days of the week
|
||||
* according to the client's user preferences and calendar. It returns the array of names to the
|
||||
* successCB callback with a properties object as a parameter. If there is an error obtaining the
|
||||
* names, then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: type="wide" and item="months"
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* type {String}: 'narrow' or 'wide'
|
||||
* item {String}: 'months', or 'days'
|
||||
*
|
||||
* @return Object.value {Array{String}}: The array of names starting from either
|
||||
* the first month in the year or the
|
||||
* first day of the week.
|
||||
* @error GlobalizationError.UNKNOWN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getDateNames(function (names) {
|
||||
* for(var i = 0; i < names.value.length; i++) {
|
||||
* alert('Month:' + names.value[i] + '\n');}},
|
||||
* function () {});
|
||||
*/
|
||||
getDateNames: function (successCB, failureCB, options) {
|
||||
argscheck.checkArgs('fFO', 'Globalization.getDateNames', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getDateNames', [{'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns whether daylight savings time is in effect for a given date using the client's
|
||||
* time zone and calendar. It returns whether or not daylight savings time is in effect
|
||||
* to the successCB callback with a properties object as a parameter. If there is an error
|
||||
* reading the date, then the errorCB callback is invoked.
|
||||
*
|
||||
* @param {Date} date
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
*
|
||||
* @return Object.dst {Boolean}: The value "true" indicates that daylight savings time is
|
||||
* in effect for the given date and "false" indicate that it is not.
|
||||
*
|
||||
* @error GlobalizationError.UNKNOWN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.isDayLightSavingsTime(new Date(),
|
||||
* function (date) {alert('dst:' + date.dst + '\n');}
|
||||
* function () {});
|
||||
*/
|
||||
isDayLightSavingsTime: function (date, successCB, failureCB) {
|
||||
argscheck.checkArgs('dfF', 'Globalization.isDayLightSavingsTime', arguments);
|
||||
var dateValue = date.valueOf();
|
||||
exec(successCB, failureCB, 'Globalization', 'isDayLightSavingsTime', [{'date': dateValue}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the first day of the week according to the client's user preferences and calendar.
|
||||
* The days of the week are numbered starting from 1 where 1 is considered to be Sunday.
|
||||
* It returns the day to the successCB callback with a properties object as a parameter.
|
||||
* If there is an error obtaining the pattern, then the errorCB callback is invoked.
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
*
|
||||
* @return Object.value {Number}: The number of the first day of the week.
|
||||
*
|
||||
* @error GlobalizationError.UNKNOWN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getFirstDayOfWeek(function (day)
|
||||
* { alert('Day:' + day.value + '\n');},
|
||||
* function () {});
|
||||
*/
|
||||
getFirstDayOfWeek: function (successCB, failureCB) {
|
||||
argscheck.checkArgs('fF', 'Globalization.getFirstDayOfWeek', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getFirstDayOfWeek', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a number formatted as a string according to the client's user preferences.
|
||||
* It returns the formatted number string to the successCB callback with a properties object as a
|
||||
* parameter. If there is an error formatting the number, then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: type="decimal"
|
||||
*
|
||||
* @param {Number} number
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* type {String}: 'decimal', "percent", or 'currency'
|
||||
*
|
||||
* @return Object.value {String}: The formatted number string.
|
||||
*
|
||||
* @error GlobalizationError.FORMATTING_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.numberToString(3.25,
|
||||
* function (number) {alert('number:' + number.value + '\n');},
|
||||
* function () {},
|
||||
* {type:'decimal'});
|
||||
*/
|
||||
numberToString: function (number, successCB, failureCB, options) {
|
||||
argscheck.checkArgs('nfFO', 'Globalization.numberToString', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'numberToString', [{'number': number, 'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a number formatted as a string according to the client's user preferences and
|
||||
* returns the corresponding number. It returns the number to the successCB callback with a
|
||||
* properties object as a parameter. If there is an error parsing the number string, then
|
||||
* the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: type="decimal"
|
||||
*
|
||||
* @param {String} numberString
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* type {String}: 'decimal', "percent", or 'currency'
|
||||
*
|
||||
* @return Object.value {Number}: The parsed number.
|
||||
*
|
||||
* @error GlobalizationError.PARSING_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.stringToNumber('1234.56',
|
||||
* function (number) {alert('Number:' + number.value + '\n');},
|
||||
* function () { alert('Error parsing number');});
|
||||
*/
|
||||
stringToNumber: function (numberString, successCB, failureCB, options) {
|
||||
argscheck.checkArgs('sfFO', 'Globalization.stringToNumber', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'stringToNumber', [{'numberString': numberString, 'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a pattern string for formatting and parsing numbers according to the client's user
|
||||
* preferences. It returns the pattern to the successCB callback with a properties object as a
|
||||
* parameter. If there is an error obtaining the pattern, then the errorCB callback is invoked.
|
||||
*
|
||||
* The defaults are: type="decimal"
|
||||
*
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
* @param {Object} options {optional}
|
||||
* type {String}: 'decimal', "percent", or 'currency'
|
||||
*
|
||||
* @return Object.pattern {String}: The number pattern for formatting and parsing numbers.
|
||||
* The patterns follow Unicode Technical Standard #35.
|
||||
* http://unicode.org/reports/tr35/tr35-4.html
|
||||
* Object.symbol {String}: The symbol to be used when formatting and parsing
|
||||
* e.g., percent or currency symbol.
|
||||
* Object.fraction {Number}: The number of fractional digits to use when parsing and
|
||||
* formatting numbers.
|
||||
* Object.rounding {Number}: The rounding increment to use when parsing and formatting.
|
||||
* Object.positive {String}: The symbol to use for positive numbers when parsing and formatting.
|
||||
* Object.negative: {String}: The symbol to use for negative numbers when parsing and formatting.
|
||||
* Object.decimal: {String}: The decimal symbol to use for parsing and formatting.
|
||||
* Object.grouping: {String}: The grouping symbol to use for parsing and formatting.
|
||||
*
|
||||
* @error GlobalizationError.PATTERN_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getNumberPattern(
|
||||
* function (pattern) {alert('Pattern:' + pattern.pattern + '\n');},
|
||||
* function () {});
|
||||
*/
|
||||
getNumberPattern: function (successCB, failureCB, options) {
|
||||
argscheck.checkArgs('fFO', 'Globalization.getNumberPattern', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getNumberPattern', [{'options': options}]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a pattern string for formatting and parsing currency values according to the client's
|
||||
* user preferences and ISO 4217 currency code. It returns the pattern to the successCB callback with a
|
||||
* properties object as a parameter. If there is an error obtaining the pattern, then the errorCB
|
||||
* callback is invoked.
|
||||
*
|
||||
* @param {String} currencyCode
|
||||
* @param {Function} successCB
|
||||
* @param {Function} errorCB
|
||||
*
|
||||
* @return Object.pattern {String}: The currency pattern for formatting and parsing currency values.
|
||||
* The patterns follow Unicode Technical Standard #35
|
||||
* http://unicode.org/reports/tr35/tr35-4.html
|
||||
* Object.code {String}: The ISO 4217 currency code for the pattern.
|
||||
* Object.fraction {Number}: The number of fractional digits to use when parsing and
|
||||
* formatting currency.
|
||||
* Object.rounding {Number}: The rounding increment to use when parsing and formatting.
|
||||
* Object.decimal: {String}: The decimal symbol to use for parsing and formatting.
|
||||
* Object.grouping: {String}: The grouping symbol to use for parsing and formatting.
|
||||
*
|
||||
* @error GlobalizationError.FORMATTING_ERROR
|
||||
*
|
||||
* Example
|
||||
* globalization.getCurrencyPattern('EUR',
|
||||
* function (currency) {alert('Pattern:' + currency.pattern + '\n');}
|
||||
* function () {});
|
||||
*/
|
||||
getCurrencyPattern: function (currencyCode, successCB, failureCB) {
|
||||
argscheck.checkArgs('sfF', 'Globalization.getCurrencyPattern', arguments);
|
||||
exec(successCB, failureCB, 'Globalization', 'getCurrencyPattern', [{'currencyCode': currencyCode}]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = globalization;
|
||||
|
||||
});
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var exec = require('cordova/exec');
|
||||
var channel = require('cordova/channel');
|
||||
var modulemapper = require('cordova/modulemapper');
|
||||
var urlutil = require('cordova/urlutil');
|
||||
|
||||
function InAppBrowser () {
|
||||
this.channels = {
|
||||
beforeload: channel.create('beforeload'),
|
||||
loadstart: channel.create('loadstart'),
|
||||
loadstop: channel.create('loadstop'),
|
||||
loaderror: channel.create('loaderror'),
|
||||
exit: channel.create('exit'),
|
||||
customscheme: channel.create('customscheme'),
|
||||
message: channel.create('message')
|
||||
};
|
||||
}
|
||||
|
||||
InAppBrowser.prototype = {
|
||||
_eventHandler: function (event) {
|
||||
if (event && event.type in this.channels) {
|
||||
if (event.type === 'beforeload') {
|
||||
this.channels[event.type].fire(event, this._loadAfterBeforeload);
|
||||
} else {
|
||||
this.channels[event.type].fire(event);
|
||||
}
|
||||
}
|
||||
},
|
||||
_loadAfterBeforeload: function (strUrl) {
|
||||
strUrl = urlutil.makeAbsolute(strUrl);
|
||||
exec(null, null, 'InAppBrowser', 'loadAfterBeforeload', [strUrl]);
|
||||
},
|
||||
close: function (eventname) {
|
||||
exec(null, null, 'InAppBrowser', 'close', []);
|
||||
},
|
||||
show: function (eventname) {
|
||||
exec(null, null, 'InAppBrowser', 'show', []);
|
||||
},
|
||||
hide: function (eventname) {
|
||||
exec(null, null, 'InAppBrowser', 'hide', []);
|
||||
},
|
||||
addEventListener: function (eventname, f) {
|
||||
if (eventname in this.channels) {
|
||||
this.channels[eventname].subscribe(f);
|
||||
}
|
||||
},
|
||||
removeEventListener: function (eventname, f) {
|
||||
if (eventname in this.channels) {
|
||||
this.channels[eventname].unsubscribe(f);
|
||||
}
|
||||
},
|
||||
|
||||
executeScript: function (injectDetails, cb) {
|
||||
if (injectDetails.code) {
|
||||
exec(cb, null, 'InAppBrowser', 'injectScriptCode', [injectDetails.code, !!cb]);
|
||||
} else if (injectDetails.file) {
|
||||
exec(cb, null, 'InAppBrowser', 'injectScriptFile', [injectDetails.file, !!cb]);
|
||||
} else {
|
||||
throw new Error('executeScript requires exactly one of code or file to be specified');
|
||||
}
|
||||
},
|
||||
|
||||
insertCSS: function (injectDetails, cb) {
|
||||
if (injectDetails.code) {
|
||||
exec(cb, null, 'InAppBrowser', 'injectStyleCode', [injectDetails.code, !!cb]);
|
||||
} else if (injectDetails.file) {
|
||||
exec(cb, null, 'InAppBrowser', 'injectStyleFile', [injectDetails.file, !!cb]);
|
||||
} else {
|
||||
throw new Error('insertCSS requires exactly one of code or file to be specified');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function (strUrl, strWindowName, strWindowFeatures, callbacks) {
|
||||
// Don't catch calls that write to existing frames (e.g. named iframes).
|
||||
if (window.frames && window.frames[strWindowName]) {
|
||||
var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open');
|
||||
return origOpenFunc.apply(window, arguments);
|
||||
}
|
||||
|
||||
strUrl = urlutil.makeAbsolute(strUrl);
|
||||
var iab = new InAppBrowser();
|
||||
|
||||
callbacks = callbacks || {};
|
||||
for (var callbackName in callbacks) {
|
||||
iab.addEventListener(callbackName, callbacks[callbackName]);
|
||||
}
|
||||
|
||||
var cb = function (eventname) {
|
||||
iab._eventHandler(eventname);
|
||||
};
|
||||
|
||||
strWindowFeatures = strWindowFeatures || '';
|
||||
|
||||
exec(cb, cb, 'InAppBrowser', 'open', [strUrl, strWindowName, strWindowFeatures]);
|
||||
return iab;
|
||||
};
|
||||
})();
|
||||
|
||||
});
|
||||
Vendored
+87
@@ -0,0 +1,87 @@
|
||||
cordova.define("cordova-plugin-ionic-keyboard.keyboard", function(require, exports, module) {
|
||||
var argscheck = require('cordova/argscheck'),
|
||||
utils = require('cordova/utils'),
|
||||
exec = require('cordova/exec'),
|
||||
channel = require('cordova/channel');
|
||||
|
||||
var Keyboard = function () {};
|
||||
|
||||
Keyboard.fireOnShow = function (height) {
|
||||
Keyboard.isVisible = true;
|
||||
cordova.fireWindowEvent('keyboardDidShow', {
|
||||
'keyboardHeight': height
|
||||
});
|
||||
|
||||
// To support the keyboardAttach directive listening events
|
||||
// inside Ionic's main bundle
|
||||
cordova.fireWindowEvent('native.keyboardshow', {
|
||||
'keyboardHeight': height
|
||||
});
|
||||
};
|
||||
|
||||
Keyboard.fireOnHide = function () {
|
||||
Keyboard.isVisible = false;
|
||||
cordova.fireWindowEvent('keyboardDidHide');
|
||||
|
||||
// To support the keyboardAttach directive listening events
|
||||
// inside Ionic's main bundle
|
||||
cordova.fireWindowEvent('native.keyboardhide');
|
||||
};
|
||||
|
||||
Keyboard.fireOnHiding = function () {
|
||||
cordova.fireWindowEvent('keyboardWillHide');
|
||||
};
|
||||
|
||||
Keyboard.fireOnShowing = function (height) {
|
||||
cordova.fireWindowEvent('keyboardWillShow', {
|
||||
'keyboardHeight': height
|
||||
});
|
||||
};
|
||||
|
||||
Keyboard.hideFormAccessoryBar = Keyboard.hideKeyboardAccessoryBar = function (hide) {
|
||||
console.warn("Keyboard.hideKeyboardAccessoryBar() not supported in Android");
|
||||
};
|
||||
|
||||
Keyboard.hide = function () {
|
||||
exec(null, null, "CDVIonicKeyboard", "hide", []);
|
||||
};
|
||||
|
||||
Keyboard.show = function () {
|
||||
exec(null, null, "CDVIonicKeyboard", "show", []);
|
||||
};
|
||||
|
||||
Keyboard.disableScroll = function (disable) {
|
||||
console.warn("Keyboard.disableScroll() not supported in Android");
|
||||
};
|
||||
|
||||
Keyboard.setResizeMode = function (mode) {
|
||||
console.warn("Keyboard.setResizeMode() not supported in Android");
|
||||
}
|
||||
|
||||
Keyboard.setKeyboardStyle = function(style) {
|
||||
console.warn("Keyboard.setKeyboardStyle() not supported in Android");
|
||||
};
|
||||
|
||||
channel.onCordovaReady.subscribe(function () {
|
||||
exec(success, null, 'CDVIonicKeyboard', 'init', []);
|
||||
|
||||
function success(msg) {
|
||||
var action = msg.charAt(0);
|
||||
if (action === 'S') {
|
||||
var keyboardHeight = parseInt(msg.substr(1));
|
||||
Keyboard.fireOnShowing(keyboardHeight);
|
||||
Keyboard.fireOnShow(keyboardHeight);
|
||||
|
||||
} else if (action === 'H') {
|
||||
Keyboard.fireOnHiding();
|
||||
Keyboard.fireOnHide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Keyboard.isVisible = false;
|
||||
|
||||
module.exports = Keyboard;
|
||||
|
||||
});
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
cordova.define("cordova-plugin-ionic-webview.IonicWebView", function(require, exports, module) {
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var WebView = {
|
||||
convertFileSrc: function(url) {
|
||||
if (!url) {
|
||||
return url;
|
||||
}
|
||||
if (url.indexOf('/')===0) {
|
||||
return window.WEBVIEW_SERVER_URL + '/_app_file_' + url;
|
||||
}
|
||||
if (url.indexOf('file://')===0) {
|
||||
return window.WEBVIEW_SERVER_URL + url.replace('file://', '/_app_file_');
|
||||
}
|
||||
if (url.indexOf('content://')===0) {
|
||||
return window.WEBVIEW_SERVER_URL + url.replace('content:/', '/_app_content_');
|
||||
}
|
||||
return url;
|
||||
},
|
||||
setServerBasePath: function(path) {
|
||||
exec(null, null, 'IonicWebView', 'setServerBasePath', [path]);
|
||||
},
|
||||
getServerBasePath: function(callback) {
|
||||
exec(callback, null, 'IonicWebView', 'getServerBasePath', []);
|
||||
},
|
||||
persistServerBasePath: function() {
|
||||
exec(null, null, 'IonicWebView', 'persistServerBasePath', []);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WebView;
|
||||
|
||||
});
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
cordova.define("cordova-plugin-mfp-jsonstore.jsonstore", function(require, exports, module) {
|
||||
/*
|
||||
Licensed Materials - Property of IBM
|
||||
|
||||
(C) Copyright 2015, 2016 IBM Corp.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp-jsonstore/worklight
|
||||
var WORKLIGHT_DIR = 'plugins/cordova-plugin-mfp-jsonstore/worklight';
|
||||
|
||||
//{platform}/www/plugins/cordova-plugin-mfp-jsonstore/worklight/jsonstore.js
|
||||
var JSONSTORE_PATH = WORKLIGHT_DIR + '/jsonstore.js';
|
||||
|
||||
document.addEventListener('mfpjsloaded', loadJSONStore, false);
|
||||
function loadJSONStore(){
|
||||
|
||||
if(typeof WL !== 'undefined' && WL._JSONStoreImpl){
|
||||
//console.log('Developer is injecting scripts manually');
|
||||
/*
|
||||
<script src="worklight/static_app_props.js"></script>
|
||||
<script src="cordova.js"></script>
|
||||
<script src="worklight/wljq.js"></script>
|
||||
<script src="worklight/worklight.js"></script>
|
||||
<script src="worklight/checksum.js"></script>
|
||||
<script src="worklight/jsonstore.js"></script>
|
||||
*/
|
||||
mfpjsonstoreready();
|
||||
} else {
|
||||
//console.log('Inject MFP JSONStore Scripts dynamically');
|
||||
loadJSONStoreScript();
|
||||
}
|
||||
|
||||
function mfpjsonstoreready(){
|
||||
var wlevent;
|
||||
|
||||
//console.log("bootstrap.js dispatching mfpjsonjsloaded event");
|
||||
|
||||
try {
|
||||
wlevent = new Event('mfpjsonjsloaded');
|
||||
} catch (err) {
|
||||
if (err instanceof TypeError) {
|
||||
// Trying to use old events
|
||||
wlevent = document.createEvent('Event');
|
||||
wlevent.initEvent('mfpjsonjsloaded', true, true);
|
||||
} else
|
||||
console.error(err.message);
|
||||
}
|
||||
|
||||
// Dispatch the event.
|
||||
document.dispatchEvent(wlevent);
|
||||
}
|
||||
|
||||
function loadJSONStoreScript(){
|
||||
//console.log("injecting script jsonstore.js");
|
||||
injectScript(findCordovaPath() + JSONSTORE_PATH, mfpjsonstoreready,
|
||||
bootError);
|
||||
}
|
||||
|
||||
function injectScript(url, onload, onerror) {
|
||||
var script = document.createElement("script");
|
||||
// onload fires even when script fails loads with an error.
|
||||
script.onload = onload;
|
||||
// onerror fires for malformed URLs.
|
||||
script.onerror = onerror;
|
||||
script.src = url;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
function bootError(errMsg) {
|
||||
throw errMsg;
|
||||
}
|
||||
}
|
||||
|
||||
function findCordovaPath() {
|
||||
var path = null;
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
var startterm = '/cordova.';
|
||||
var term = '/cordova.js';
|
||||
for (var n = scripts.length-1; n>-1; n--) {
|
||||
var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
|
||||
// APAR 119091: findCordovaPath function to work with hashed builds.
|
||||
var idx = src.indexOf(startterm);
|
||||
if (idx >= 0 && src.substring(idx).replace(/cordova\.[^\.\/]*\.js/, "cordova.js") == term) {
|
||||
term = src.substring(idx);
|
||||
}
|
||||
if (src.indexOf(term) === (src.length - term.length)) {
|
||||
path = src.substring(0, src.length - term.length) + '/';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
});
|
||||
Vendored
+6084
File diff suppressed because it is too large
Load Diff
+209
@@ -0,0 +1,209 @@
|
||||
cordova.define("cordova-plugin-mfp-push.MFPPush", function(require, exports, module) {
|
||||
/*
|
||||
Licensed Materials - Property of IBM
|
||||
|
||||
(C) Copyright 2016 IBM Corp.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var failure = function(res) {
|
||||
alert(res);
|
||||
}
|
||||
|
||||
var MFPPush = {
|
||||
|
||||
/**
|
||||
* Initializes MFPPush instance. This is required for the client application to connect to MFPPush service with the right
|
||||
* application context. This API should be called first before using other MFPPush APIs.
|
||||
*
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
* @param timeout request timeout in seconds
|
||||
*/
|
||||
initialize: function(success, failure, options, timeout) {
|
||||
if (typeof timeout !== "undefined" && typeof timeout === "number" && timeout === parseInt(timeout, 10)) {
|
||||
if (typeof options !== "undefined" && options !== null ) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "initialize", [timeout,options]);
|
||||
} else {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "initialize", [timeout]);
|
||||
}
|
||||
} else if ( typeof options !== "undefined" && options !== null ) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "initialize", [-1,options]);
|
||||
}
|
||||
else {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "initialize", [-1]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether Push Notification is supported on the device
|
||||
*
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
isPushSupported: function(success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "isPushSupported", []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves all the subscriptions of the device
|
||||
*
|
||||
* @param success callback - recieves array of subscribed tags
|
||||
* @param failure callback
|
||||
*/
|
||||
getSubscriptions: function(success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "getSubscriptions", []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves all the available tags of the application
|
||||
*
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
getTags: function(success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "getTags", []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Subscribes the device to the given tags
|
||||
*
|
||||
* @param tags - The Tag array to subscribe to.
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
|
||||
subscribe: function(tags, success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "subscribe", [tags.toString()]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Unsubscribes the device from the given tags
|
||||
*
|
||||
* @param tags - The Tag name array to unsubscribe from.
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
|
||||
unsubscribe: function(tags, success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "unsubscribe", [tags.toString()]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Registers the device with the push service
|
||||
*
|
||||
* @param options:
|
||||
* ios: { alert: boolean, badge: boolean, sound: boolean, categories: object[] }
|
||||
* android: {}
|
||||
* phoneNumber: String
|
||||
*
|
||||
* where
|
||||
* phoneNumber - Phone number to receive the SMS based notifications
|
||||
* alert - To enable displaying alert messages
|
||||
* badge - To enable badge icons
|
||||
* sound - To enable playing sound
|
||||
* categories - iOS8 interactive notification categories
|
||||
* for example,
|
||||
* {
|
||||
* ios: {
|
||||
* alert: true,
|
||||
* badge: true,
|
||||
* sound: true,
|
||||
* categories: [{
|
||||
* //Category identifier, this is used while sending the notification.
|
||||
* id : "poll",
|
||||
* //Optional array of actions to show the action buttons along with the message.
|
||||
* actions: [
|
||||
* {
|
||||
* //Action identifier
|
||||
* id : "poll_ok",
|
||||
*
|
||||
* //Action title to be displayed as part of the notification button.
|
||||
* title : "OK",
|
||||
*
|
||||
* //Optional mode to run the action in foreground or background. 1-foreground. 0-background. Default is foreground.
|
||||
* mode: 1,
|
||||
*
|
||||
* //Optional property to mark the action button in red color. Default is false.
|
||||
* destructive: false,
|
||||
*
|
||||
* //Optional property to set if authentication is required or not before running the action.(Screen lock).
|
||||
* //For foreground, this property is always true.
|
||||
* authenticationRequired: true
|
||||
* },
|
||||
* {
|
||||
* id : "poll_nok",
|
||||
* title : "NOK",
|
||||
* mode: 1,
|
||||
* destructive: false,
|
||||
* authenticationRequired: true
|
||||
* }
|
||||
* ],
|
||||
* //Optional list of actions that is needed to show in the case alert.
|
||||
* //If it is not specified, then the first four actions will be shown.
|
||||
* defaultContextActions: ['poll_ok','poll_nok'],
|
||||
*
|
||||
* //Optional list of actions that is needed to show in the notification center, lock screen.
|
||||
* //If it is not specified, then the first two actions will be shown.
|
||||
* minimalContextActions: ['poll_ok','poll_nok']
|
||||
* }]
|
||||
* },
|
||||
* android: {
|
||||
* },
|
||||
* phoneNumber: "999999999"
|
||||
* }
|
||||
*
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
registerDevice: function(options,success, failure) {
|
||||
if (options === null || options === "undefined") {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "registerDevice", [{}]);
|
||||
} else {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "registerDevice", [options]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Unregisters the device from the push service
|
||||
*
|
||||
* @param success callback
|
||||
* @param failure callback
|
||||
*/
|
||||
unregisterDevice: function(success, failure) {
|
||||
cordova.exec(success, failure, "MFPPushPlugin", "unregisterDevice", []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Registers the callback method used for receiving the notifications
|
||||
*
|
||||
* @param callback The callback function that receives the notification
|
||||
*/
|
||||
registerNotificationsCallback: function(callback) {
|
||||
cordova.exec(callback, null, "MFPPushPlugin", "registerNotificationsCallback", []);
|
||||
},
|
||||
|
||||
/**
|
||||
* Completes the background job after receving the silent notification. This API is applicable for iOS environment.
|
||||
* When the silent notification arrives and the background job is completed, need to call this method to notify that
|
||||
* the background job is completed.
|
||||
*
|
||||
* @param id callback-id received as part of notification properties.
|
||||
* @param result of background activity
|
||||
*/
|
||||
backgroundJobDone: function(id, result) {
|
||||
if(result == "undefined" || isNaN(result)){
|
||||
result = 1;
|
||||
}
|
||||
cordova.exec(null,null,"MFPPushPlugin","backgroundJobDone", [id, result]);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = MFPPush;
|
||||
});
|
||||
@@ -0,0 +1,155 @@
|
||||
cordova.define("cordova-plugin-mfp.mfp", function(require, exports, module) {
|
||||
/*
|
||||
Licensed Materials - Property of IBM
|
||||
|
||||
(C) Copyright 2015 IBM Corp.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
var mfpreadyfired = false;
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp/worklight
|
||||
var WORKLIGHT_DIR = 'plugins/cordova-plugin-mfp/worklight';
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp/static_app_props.js
|
||||
var STATIC_APP_PROPS_PATH = WORKLIGHT_DIR + '/static_app_props.js';
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp/static_app_props.js
|
||||
var WLJQ_PATH = WORKLIGHT_DIR + '/wljq.js';
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp/static_app_props.js
|
||||
var WORKLIGHT_PATH = WORKLIGHT_DIR + '/worklight.js';
|
||||
|
||||
// {platform}/www/plugins/cordova-plugin-mfp/static_app_props.js
|
||||
var WORKLIGHT_CHECKSUM_PATH = WORKLIGHT_DIR + '/checksum.js';
|
||||
|
||||
document.addEventListener('deviceready', loadMFP, false);
|
||||
|
||||
function loadMFP(){
|
||||
if(typeof WL !== 'undefined' && WL.StaticAppProps){
|
||||
//console.log('Developer is injecting scripts manually');
|
||||
/*
|
||||
<script src="worklight/static_app_props.js"></script>
|
||||
<script src="cordova.js"></script>
|
||||
<script src="worklight/wljq.js"></script>
|
||||
<script src="worklight/worklight.js"></script>
|
||||
<script src="worklight/checksum.js"></script>
|
||||
*/
|
||||
mfpready();
|
||||
} else {
|
||||
//console.log('Inject MFP Scripts dynamically');
|
||||
loadStaticAppProps();
|
||||
}
|
||||
|
||||
function loadStaticAppProps(){
|
||||
//console.log("worklight/static_app_props.js");
|
||||
injectScript(findCordovaPath() + STATIC_APP_PROPS_PATH, loadJQ,bootError);
|
||||
}
|
||||
|
||||
function loadJQ(){
|
||||
//console.log("injecting script wljq.js");
|
||||
injectScript(findCordovaPath() + WLJQ_PATH, loadWorklight,bootError);
|
||||
}
|
||||
|
||||
function loadWorklight(){
|
||||
//console.log("injecting script worklight.js");
|
||||
injectScript(findCordovaPath() + WORKLIGHT_PATH, loadChecksum,bootError);
|
||||
}
|
||||
|
||||
function loadChecksum (){
|
||||
//console.log("injecting script checksum.js");
|
||||
injectScript(findCordovaPath() + WORKLIGHT_CHECKSUM_PATH, mfpready,bootError);
|
||||
}
|
||||
|
||||
function mfpready (){
|
||||
mfpFire();
|
||||
//call WL.Client.init unless user defined mfpClientCustomInit = true in config.xml, and propagated to static_app_props.js
|
||||
if(WL.StaticAppProps && !WL.StaticAppProps.mfpClientCustomInit){
|
||||
console.log('Calling WL.Client.init(wlInitOptions);')
|
||||
var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions : {};
|
||||
WL.Client.init(options);
|
||||
} else {
|
||||
console.log('Developer will call WL.Client.init manually');
|
||||
}
|
||||
//Inform developer they should load their own jquery and not use MFP internal version
|
||||
deprecateWLJQ();
|
||||
}
|
||||
|
||||
function mfpFire(){
|
||||
//console.log("bootstrap.js dispatching mfpjsloaded event");
|
||||
try {
|
||||
var wlevent = new Event('mfpjsloaded');
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof TypeError) {
|
||||
// Trying to use old events
|
||||
wlevent = document.createEvent('Event');
|
||||
wlevent.initEvent('mfpjsloaded', true, true);
|
||||
}
|
||||
else {
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
// Dispatch the event.
|
||||
document.dispatchEvent(wlevent);
|
||||
mfpreadyfired = true;
|
||||
}
|
||||
|
||||
function deprecateWLJQ(){
|
||||
setTimeout(function checkWLJQ(){
|
||||
if(window.$ === WLJQ){
|
||||
console.error('Using WLJQ as your window.$ is deprecated, if needed, please load your own JQuery instance');
|
||||
} else if(window.jQuery === WLJQ){
|
||||
console.error('Using WLJQ as your window.jQuery is deprecated, if needed, please load your own JQuery instance');
|
||||
}
|
||||
},10000);
|
||||
}
|
||||
|
||||
function injectScript(url, onload, onerror) {
|
||||
var script = document.createElement("script");
|
||||
// onload fires even when script fails loads with an error.
|
||||
script.onload = onload;
|
||||
// onerror fires for malformed URLs.
|
||||
script.onerror = onerror;
|
||||
script.src = url;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
function bootError(){
|
||||
console.error("mfp bootstrap failed to inject script");
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function mfpTimeOut(){
|
||||
if(!mfpreadyfired){
|
||||
loadMFP();
|
||||
}
|
||||
},6000);
|
||||
|
||||
|
||||
function findCordovaPath() {
|
||||
var path = null;
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
var startterm = '/cordova.';
|
||||
var term = '/cordova.js';
|
||||
for (var n = scripts.length-1; n>-1; n--) {
|
||||
var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
|
||||
// APAR 119091: findCordovaPath function to work with hashed builds.
|
||||
var idx = src.indexOf(startterm);
|
||||
if (idx >= 0 && src.substring(idx).replace(/cordova\.[^\.\/]*\.js/, "cordova.js") == term) {
|
||||
term = src.substring(idx);
|
||||
}
|
||||
if (src.indexOf(term) === (src.length - term.length)) {
|
||||
path = src.substring(0, src.length - term.length) + '/';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
});
|
||||
Vendored
+1696
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
var WL_CHECKSUM = {"checksum":3619450036,"date":1629201211702,"machine":"LAPTOP-57"}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "Zugriff verweigert",
|
||||
"authFailure" : "Beim Verarbeiten der Anforderung von der Anwendung wurde ein Fehler festgestellt.",
|
||||
"applicationDenied" : "Anwendung inaktiviert",
|
||||
"browserIsNotSupported" : "{0} wird momentan nicht unterstützt.",
|
||||
"cancel" : "Abbrechen",
|
||||
"close" : "Schließen",
|
||||
"cookiesAreDisabled" : "In Ihrem Browser sind Cookies inaktiviert. Aktivieren Sie Cookies, damit die Anwendung ordnungsgemäß funktioniert.",
|
||||
"copyToClipboard" : "Kopieren",
|
||||
"details" : "Details",
|
||||
"diagApp" : "App-Diagnose",
|
||||
"diagTime" : "Zeit",
|
||||
"diagApplicationName" : "Anwendungsname",
|
||||
"diagApplicationVersion" : "Anwendungsversion",
|
||||
"diagServiceURL" : "Service-URL",
|
||||
"diagDevicePlatform" : "Geräteplattform",
|
||||
"diagDeviceVersion" : "Geräteversion",
|
||||
"diagScreenResolution" : "Bildschirmauflösung",
|
||||
"diagAirplaneMode" : "Flugzeugmodus",
|
||||
"diagUsingNetwork" : "Verwendetes Netz",
|
||||
"diagWifiName" : "WiFi-Name",
|
||||
"diagMobileNetworkType" : "Typ des mobilen Netzes",
|
||||
"diagCarrierName" : "Name des Betreibers",
|
||||
"diagErrorCode" : "Fehlercode",
|
||||
"diagErrorMessage" : "Fehlernachricht",
|
||||
"diagHttpStatus" : "HTTP-Status",
|
||||
"diagIPAddress" : "IP-Adresse",
|
||||
"directUpdateNotificationTitle" : "Aktualisierung verfügbar",
|
||||
"directUpdateNotificationMessage" : "Es stehen neuere Webressourcen zur Verfügung. Für Aktualisierung bestätigen (Dateigröße: {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Es stehen neuere Webressourcen zur Verfügung. Für Aktualisierung bestätigen (Dateigröße: {0} KB).",
|
||||
"directUpdateErrorTitle" : "Aktualisierung fehlgeschlagen",
|
||||
"directUpdateErrorMessage" : "Die direkte Aktualisierung ist fehlgeschlagen.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "Für die Anwendung steht ein Update zur Verfügung, aber es ist nicht genügend Speicherplatz auf den Gerät vorhanden (erforderlicher Speicherplatz: {0} MB, verfügbarer Speicherplatz: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Die Datei mit der Anwendungsaktualisierung konnte nicht heruntergeladen werden.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Die Datei mit der Anwendungsaktualisierung konnte nicht verarbeitet werden.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Die App-Ressourcen können nicht heruntergeladen werden. Geben Sie in der Anzeige mit den Einstellungen die App-ID an.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "Die Anwendung '{0}' wurde nicht gefunden. Implementieren Sie sie zunächst im Server der Plattform IBM MobileFirst.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Die App-Ressourcen können nicht heruntergeladen werden. Geben Sie in der Anzeige mit den Einstellungen die App-Version an.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Die App-Ressourcen können nicht heruntergeladen werden. Die Oberfläche {0} ist nicht vorhanden. Stellen Sie sicher, dass getSkinName() eine gültige Oberfläche ergibt.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Anwendung '{0}' {1} für {2} nicht gefunden",
|
||||
"deviceAuthenticationFail" : "Konnektivitätsfehler",
|
||||
"saveCertificateFailure" : "Das Zertifikat kann nicht gespeichert werden.",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "Es ist keine Verbindung zum Server verfügbar. Die Anwendungsressourcen können nicht heruntergeladen werden.",
|
||||
"expandWindow" : "Anwendung zur Benutzung einblenden",
|
||||
"exit" : "Beenden",
|
||||
"exitApplication" : "Anwendung beenden",
|
||||
"error" : "Fehler",
|
||||
"gadgetUpdateAvailable" : "Anwendungsaktualisierung verfügbar",
|
||||
"getNewVersion" : "Neue Version abrufen",
|
||||
"handleTimeOut" : "Zeitlimitüberschreitung bei der Anforderung für {0}. Stellen Sie sicher, dass die Hostadresse für die Anwendung verfügbar ist (besonders für Android- und iPhone-Apps).",
|
||||
"invalidUsernamePassword" : "Ungültiger Benutzername oder ungültiges Kennwort",
|
||||
"keepAliveInBackgroundText" : "Anwendung wird im Hintergrund weiter ausgeführt",
|
||||
"loading" : "Ladevorgang",
|
||||
"login" : "Anmeldung",
|
||||
"minimize" : "Symbolgröße",
|
||||
"missingFeatureException" : "{1} konnte nicht aufgerufen werden, weil {0} in der Anwendung fehlt. Fügen Sie {0} zum Anwendungsdeskriptor hinzu. Erstellen und implementieren Sie dann die Anwendung neu.",
|
||||
"name" : "Name:",
|
||||
"noInternet" : "Keine Verbindung zum Service verfügbar",
|
||||
"notificationTitle" : "Servicebenachrichtigung",
|
||||
"notAvailable" : "Nicht verfügbar",
|
||||
"ok" : "OK",
|
||||
"password" : "Kennwort:",
|
||||
"reload" : "Erneut laden",
|
||||
"restore" : "Wiederherstellen",
|
||||
"requestTimeout" : "Die Anwendung konnte keine Verbindung zu dem Service herstellen.",
|
||||
"responseNotRecognized" : "Nicht erwartete Antwort",
|
||||
"settings" : "Einstellungen",
|
||||
"serverError" : "Fehler beim Prozeduraufruf",
|
||||
"tryAgain" : "Erneut versuchen",
|
||||
"userInstanceAccessViolationException" : "Sie versuchen, sich bei einer nicht für Sie registrierten Anwendung anzumelden.",
|
||||
"unexpectedError" : "Der Server konnte die Anfrage von der Anwendung nicht verarbeiten. Versuchen Sie es später erneut.",
|
||||
"unresponsiveHost" : "Der Service ist zurzeit nicht verfügbar.",
|
||||
"update" : "Aktualisieren",
|
||||
"upgrade" : "Upgrade",
|
||||
"upgradeGadget" : "Die Version Ihrer Anwendung ist {0}. Version {1} dieser Anwendung ist verfügbar. Klicken Sie zum Herunterladen und Installieren auf OK.",
|
||||
"wlclientInitFailure" : "Fehler",
|
||||
"wlSettings" : "Einstellungen der Plattform IBM MobileFirst",
|
||||
"userEnrollmentUnsupportedOS" : "Fehler bei der Authentifizierung des Benutzerzertifikats. Nicht unterstützte Clientplattform.",
|
||||
"failureCallingMethod" : "Fehler beim Aufrufen von {0}",
|
||||
"challengeHandlingCanceled" : "Die Abfrage-Handler-Operation wurde abgebrochen.",
|
||||
"unsupportedEnvironment" : "Nicht unterstützte Umgebung",
|
||||
"redirect" : "Umleiten"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "Para el usuario de PII" ,
|
||||
"accessDenied" : "Acceso denegado",
|
||||
"authFailure" : "Se ha producido un error al procesar la solicitud desde la aplicación.",
|
||||
"applicationDenied" : "Aplicación inhabilitada",
|
||||
"browserIsNotSupported" : "{0} no está actualmente soportado.",
|
||||
"cancel" : "Cancelar",
|
||||
"close" : "Cerrar",
|
||||
"cookiesAreDisabled" : "Las cookies están actualmente inhabilitadas en el navegador. Debe habilitarlas para que la aplicación funcione correctamente.",
|
||||
"copyToClipboard" : "Copiar",
|
||||
"details" : "Detalles",
|
||||
"diagApp" : "Diagnóstico de aplicación",
|
||||
"diagTime" : "Hora",
|
||||
"diagApplicationName" : "Nombre de aplicación",
|
||||
"diagApplicationVersion" : "Versión de aplicación",
|
||||
"diagServiceURL" : "URL de servicio",
|
||||
"diagDevicePlatform" : "Plataforma de dispositivo",
|
||||
"diagDeviceVersion" : "Versión de dispositivo",
|
||||
"diagScreenResolution" : "Resolución de pantalla",
|
||||
"diagAirplaneMode" : "Modo avión",
|
||||
"diagUsingNetwork" : "Uso de red",
|
||||
"diagWifiName" : "Nombre de WiFi",
|
||||
"diagMobileNetworkType" : "Tipo de red móvil",
|
||||
"diagCarrierName" : "Nombre de operadora",
|
||||
"diagErrorCode" : "Código de error",
|
||||
"diagErrorMessage" : "Mensaje de error",
|
||||
"diagHttpStatus" : "Estado HTTP",
|
||||
"diagIPAddress" : "Dirección IP",
|
||||
"directUpdateNotificationTitle" : "Actualización disponible",
|
||||
"directUpdateNotificationMessage" : "Hay disponibles nuevos recursos web. Confirme para actualizar. (tamaño archivos: {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Hay disponibles nuevos recursos web. Confirme para actualizar. (tamaño archivos: {0} KB).",
|
||||
"directUpdateErrorTitle" : "Actualización fallida",
|
||||
"directUpdateErrorMessage" : "Anomalía en Direct Update. ",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "Hay una actualización disponible para la aplicación, pero no hay suficiente espacio disponible en el dispositivo (espacio necesario: {0} MB, espacio disponible: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Ha fallado la descarga del archivo de actualización de aplicación.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Ha fallado el proceso del archivo de actualización de la aplicación.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "No se pueden descargar los recursos de la aplicación. Especifique la ID de la aplicación en la pantalla Configuración.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "La aplicación '{0}' no se puede encontrar. Despliéguela en primer lugar en IBM MobileFirst Platform Server.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "No se pueden descargar los recursos de la aplicación. Especifique la Versión de la aplicación en la pantalla Configuración.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "No se pueden descargar los recursos de la aplicación. El skin: {0} no existe. Asegúrese de que getSkinName() se resuelve en un skin válido.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "No se puede encontrar la aplicación '{0}' {1} para {2}",
|
||||
"deviceAuthenticationFail" : "Error de conectividad",
|
||||
"saveCertificateFailure" : "No se ha podido guardar el certificado",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "No está disponible una conexión al servidor. No se pueden descargar los recursos de la aplicación.",
|
||||
"expandWindow" : "Expanda la aplicación para utilizarla",
|
||||
"exit" : "Salir",
|
||||
"exitApplication" : "Salir de la aplicación",
|
||||
"error" : "Error",
|
||||
"gadgetUpdateAvailable" : "Actualización de la aplicación disponible",
|
||||
"getNewVersion" : "Obtener una versión nueva",
|
||||
"handleTimeOut" : "Se ha excedido el tiempo de espera de la solicitud de {0}. Asegúrese de que la dirección del host está disponible en la aplicación (especialmente relevante para aplicaciones Android e iPhone).",
|
||||
"invalidUsernamePassword" : "Nombre de usuario o contraseña no válido",
|
||||
"keepAliveInBackgroundText" : "La aplicación continúa en ejecución en segundo plano",
|
||||
"loading" : "Cargando",
|
||||
"login" : "Iniciar sesión",
|
||||
"minimize" : "Minimizar",
|
||||
"missingFeatureException" : "No se ha podido llamar a {1} porque falta {0} en la aplicación. Añada {0} al descriptor de la aplicación, vuelva a crearlo y despliéguelo.",
|
||||
"name" : "Nombre:",
|
||||
"noInternet" : "La conexión al servicio no está disponible.",
|
||||
"notificationTitle" : "Notificación de servicio",
|
||||
"notAvailable" : "No disponible",
|
||||
"ok" : "Aceptar",
|
||||
"password" : "Contraseña:",
|
||||
"reload" : "Volver a cargar",
|
||||
"restore" : "Restaurar",
|
||||
"requestTimeout" : "La aplicación no se ha podido conectar al servicio.",
|
||||
"responseNotRecognized" : "Respuesta inesperada.",
|
||||
"settings" : "Valores",
|
||||
"serverError" : "Error de invocación de procedimiento.",
|
||||
"tryAgain" : "Inténtelo de nuevo",
|
||||
"userInstanceAccessViolationException" : "Está intentando iniciar sesión en una aplicación que no está registrada para el usuario.",
|
||||
"unexpectedError" : "El servidor no ha podido procesar la solicitud desde la aplicación. Inténtelo de nuevo más tarde.",
|
||||
"unresponsiveHost" : "El servicio no está disponible en este momento.",
|
||||
"update" : "Actualizar",
|
||||
"upgrade" : "Actualizar",
|
||||
"upgradeGadget" : "La versión de la aplicación es {0}. La versión {1} de esta aplicación está disponible. Pulse Aceptar para descargarla e instalarla.",
|
||||
"wlclientInitFailure" : "Error",
|
||||
"wlSettings" : "Configuración de IBM MobileFirst Platform",
|
||||
"userEnrollmentUnsupportedOS" : "Error de autenticación de certificado de usuario: plataforma de cliente no soportada.",
|
||||
"failureCallingMethod" : "Error de llamada {0}",
|
||||
"challengeHandlingCanceled" : "Se ha cancelado la operación del manejador de desafíos.",
|
||||
"unsupportedEnvironment" : "Entorno no soportado",
|
||||
"redirect" : "Redireccionar"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "Accès refusé",
|
||||
"authFailure" : "Une erreur est survenue lors du traitement de la demande de l'application.",
|
||||
"applicationDenied" : "Application désactivée",
|
||||
"browserIsNotSupported" : "{0} n'est pas pris en charge actuellement.",
|
||||
"cancel" : "Annuler",
|
||||
"close" : "Fermer",
|
||||
"cookiesAreDisabled" : "Les cookies sont désactivés dans votre navigateur. Vous devez les activer pour que l'application fonctionne correctement.",
|
||||
"copyToClipboard" : "Copier",
|
||||
"details" : "Détails",
|
||||
"diagApp" : "Diagnostics d'application",
|
||||
"diagTime" : "Heure",
|
||||
"diagApplicationName" : "Nom de l'application",
|
||||
"diagApplicationVersion" : "Version de l'application",
|
||||
"diagServiceURL" : "Adresse URL du service",
|
||||
"diagDevicePlatform" : "Plateforme du terminal",
|
||||
"diagDeviceVersion" : "Version du terminal",
|
||||
"diagScreenResolution" : "Résolution d'écran",
|
||||
"diagAirplaneMode" : "Mode avion",
|
||||
"diagUsingNetwork" : "Utilisation du réseau",
|
||||
"diagWifiName" : "Nom du Wi-Fi",
|
||||
"diagMobileNetworkType" : "Type de réseau de mobile",
|
||||
"diagCarrierName" : "Nom de l'opérateur",
|
||||
"diagErrorCode" : "Code d'erreur",
|
||||
"diagErrorMessage" : "Message d'erreur",
|
||||
"diagHttpStatus" : "Statut HTTP",
|
||||
"diagIPAddress" : "Adresse IP",
|
||||
"directUpdateNotificationTitle" : "Mise à jour disponible",
|
||||
"directUpdateNotificationMessage" : "Des ressources Web plus récentes sont disponibles. Confirmez la mise à jour. (taille du fichier : {0} Mo).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Des ressources Web plus récentes sont disponibles. Confirmez la mise à jour. (taille du fichier : {0} Ko).",
|
||||
"directUpdateErrorTitle" : "Echec de la mise à jour",
|
||||
"directUpdateErrorMessage" : "Echec de la mise à jour directe.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "Une mise à jour de l'application est disponible mais l'espace disponible sur le terminal est insuffisant (taille requise : {0} Mo, espace disponible : {1} Mo).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Echec du téléchargement du fichier de mise à jour de l'application.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Echec du traitement du fichier de mise à jour de l'application.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Impossible de télécharger les ressources de l'application. Spécifiez l'ID de l'application dans l'écran Paramètres.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "L'application '{0}' est introuvable. Déployez-la d'abord sur le serveur IBM MobileFirst Platform.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Impossible de télécharger les ressources de l'application. Spécifiez la version de l'application dans l'écran Paramètres.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Impossible de télécharger les ressources de l'application. L'habillage {0} n'existe pas. Assurez-vous que getSkinName() génère un habillage valide.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Application '{0}' {1} introuvable pour {2}",
|
||||
"deviceAuthenticationFail" : "Erreur de connectivité",
|
||||
"saveCertificateFailure" : "Impossible de sauvegarder le certificat",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "La connexion au serveur n'est pas disponible. Impossible de télécharger les ressources d'application.",
|
||||
"expandWindow" : "Développez l'application pour l'utiliser",
|
||||
"exit" : "Quitter",
|
||||
"exitApplication" : "Quitter l'application",
|
||||
"error" : "Erreur",
|
||||
"gadgetUpdateAvailable" : "Mise à jour de l'application disponible",
|
||||
"getNewVersion" : "Obtenir la nouvelle version",
|
||||
"handleTimeOut" : "La demande a expiré pour {0}. Assurez-vous que l'adresse de l'hôte est disponible dans l'application (notamment pour les applications Android et iPhone).",
|
||||
"invalidUsernamePassword" : "Nom d'utilisateur ou mot de passe non valide",
|
||||
"keepAliveInBackgroundText" : "L'application continue de s'exécuter en arrière-plan",
|
||||
"loading" : "Chargement",
|
||||
"login" : "Connexion",
|
||||
"minimize" : "Réduire",
|
||||
"missingFeatureException" : "Echec de l'appel de {1} car {0} manque dans l'application. Ajoutez {0} au descripteur d'application, régénérez-le et déployez-le.",
|
||||
"name" : "Nom\u00A0:",
|
||||
"noInternet" : "La connexion au service n'est pas disponible.",
|
||||
"notificationTitle" : "Notification de service",
|
||||
"notAvailable" : "Non disponible",
|
||||
"ok" : "OK",
|
||||
"password" : "Mot de passe\u00A0:",
|
||||
"reload" : "Recharger",
|
||||
"restore" : "Restaurer",
|
||||
"requestTimeout" : "L'application n'est pas parvenue à se connecter au service.",
|
||||
"responseNotRecognized" : "Réponse inattendue.",
|
||||
"settings" : "Paramètres",
|
||||
"serverError" : "Erreur d'invocation de procédure.",
|
||||
"tryAgain" : "Réessayer",
|
||||
"userInstanceAccessViolationException" : "Vous essayez de vous connecter à une application qui n'est pas enregistrée pour vous.",
|
||||
"unexpectedError" : "Le serveur n'est pas parvenu à traiter la demande de l'application. Essayez à nouveau ultérieurement.",
|
||||
"unresponsiveHost" : "Le service n'est pas disponible actuellement.",
|
||||
"update" : "Mettre à jour",
|
||||
"upgrade" : "Mettre à niveau",
|
||||
"upgradeGadget" : "La version de votre application est {0}. La version {1} de cette application est disponible. Cliquez sur OK pour la télécharger et l'installer.",
|
||||
"wlclientInitFailure" : "Erreur",
|
||||
"wlSettings" : "Paramètres d'IBM MobileFirst Platform",
|
||||
"userEnrollmentUnsupportedOS" : "Echec de l'authentification du certificat utilisateur\u00A0: plateforme client non prise en charge.",
|
||||
"failureCallingMethod" : "Echec de l'appel de {0}",
|
||||
"challengeHandlingCanceled" : "L'opération du gestionnaire de demandes d'authentification a été annulée.",
|
||||
"unsupportedEnvironment" : "Environnement non pris en charge",
|
||||
"redirect" : "Redirection"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "הגישה חסומה",
|
||||
"authFailure" : "אירעה שגיאה בעיבוד הבקשה מהיישום.",
|
||||
"applicationDenied" : "היישום מושבת",
|
||||
"browserIsNotSupported" : "{0} אינו נתמך כרגע.",
|
||||
"cancel" : "ביטול",
|
||||
"close" : "סגירה",
|
||||
"cookiesAreDisabled" : "קובצי Cookie מושבתית כרגע בדפדפן שלכם. עליכם להפעיל אותם כדי שהיישום יפעל כהלכה.",
|
||||
"copyToClipboard" : "העתקה",
|
||||
"details" : "פרטים",
|
||||
"diagApp" : "אבחון יישום",
|
||||
"diagTime" : "שעה",
|
||||
"diagApplicationName" : "שם יישום",
|
||||
"diagApplicationVersion" : "גרסת יישום",
|
||||
"diagServiceURL" : "URL שירות",
|
||||
"diagDevicePlatform" : "פלטפורמת התקן",
|
||||
"diagDeviceVersion" : "גרסת התקן",
|
||||
"diagScreenResolution" : "רזולוציית מסך",
|
||||
"diagAirplaneMode" : "מצב מטוס",
|
||||
"diagUsingNetwork" : "שימוש ברשת",
|
||||
"diagWifiName" : "שם WiFi",
|
||||
"diagMobileNetworkType" : "סוג רשת ניידת",
|
||||
"diagCarrierName" : "שם ספק",
|
||||
"diagErrorCode" : "קוד שגיאה",
|
||||
"diagErrorMessage" : "הודעת שגיאה",
|
||||
"diagHttpStatus" : "מצב HTTP",
|
||||
"diagIPAddress" : "כתובת IP",
|
||||
"directUpdateNotificationTitle" : "יש עדכון זמין",
|
||||
"directUpdateNotificationMessage" : "זמינים משאבי רשת חדשים יותר. אשרו כדי לעדכן. (גודל הקובץ הוא {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "זמינים משאבי רשת חדשים יותר. אשרו כדי לעדכן. (גודל הקובץ הוא {0} KB).",
|
||||
"directUpdateErrorTitle" : "העדכון נכשל",
|
||||
"directUpdateErrorMessage" : "כשל בעדכון הישיר.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "זמין עדכון עבור היישום, אך אין מספיק מקום זמין בהתקן (גודל דרוש: {0} MB, שטח זמין: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "כשל בהורדת קובץ העדכון של היישום.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "כשל בעיבוד קובץ העדכון של היישום.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "לא ניתן להוריד את משאבי היישום. ציינו את זיהוי היישום במסך ההגדרות.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "היישום '{0}' לא נמצא . הציבו אותו תחילה בשרת IBM MobileFirst Platform.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "לא ניתן להוריד את משאבי היישום. ציינו את גרסת היישום במסך ההגדרות.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "לא ניתן להוריד את משאבי היישום. המעטפת: {0} אינה קיימת. ודאי כי הפונקציה getSkinName() מתפענחת למעטפת חוקית.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "היישום '{0}' {1} עבור {2} לא נמצא",
|
||||
"deviceAuthenticationFail" : "שגיאת קישוריות",
|
||||
"saveCertificateFailure" : "לא ניתן לשמור את האישור",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "חיבור לשרת אינו זמין. לא ניתן להוריד את משאבי היישום.",
|
||||
"expandWindow" : "הרחיבו את היישום כדי להשתמש בו",
|
||||
"exit" : "יציאה",
|
||||
"exitApplication" : "יציאה מהיישום",
|
||||
"error" : "שגיאה",
|
||||
"gadgetUpdateAvailable" : "זמין עדכון של היישום",
|
||||
"getNewVersion" : "קבלת גרסה חדשה",
|
||||
"handleTimeOut" : "הבקשה חרגה ממגבלת הזמן עבור {0}. ודאו שכתובת המארח זמינה ליישום (רלוונטי בעיקר עבור יישומי Android ו-iPhone).",
|
||||
"invalidUsernamePassword" : "שם משתמש או סיסמה לא חוקיים",
|
||||
"keepAliveInBackgroundText" : "היישום ממשיך לרוץ ברקע",
|
||||
"loading" : "טעינה",
|
||||
"login" : "התחברות",
|
||||
"minimize" : "מזעור",
|
||||
"missingFeatureException" : "Failed to call {1} because {0} is missing in the application. Add {0} to the application descriptor, rebuild and deploy it.",
|
||||
"name" : "שם:",
|
||||
"noInternet" : "אין חיבור זמין לשירות זה.",
|
||||
"notificationTitle" : "הודעת שירות",
|
||||
"notAvailable" : "לא זמין",
|
||||
"ok" : "אישור",
|
||||
"password" : "סיסמה:",
|
||||
"reload" : "טעינה מחדש",
|
||||
"restore" : "שחזור",
|
||||
"requestTimeout" : "היישום לא הצליח להתחבר לשירות.",
|
||||
"responseNotRecognized" : "תגובה לא צפויה.",
|
||||
"settings" : "הגדרות",
|
||||
"serverError" : "שגיאה בהפעלת פרוצדורה.",
|
||||
"tryAgain" : "נסיון חוזר",
|
||||
"userInstanceAccessViolationException" : "אתם מנסים להתחבר ליישום שאינו רשום עבורכם.",
|
||||
"unexpectedError" : "השרת לא הצליח לעבד את הבקשה מהיישום. נא לנסות שוב מאוחר יותר.",
|
||||
"unresponsiveHost" : "השירות אינו זמין כרגע.",
|
||||
"update" : "עדכון",
|
||||
"upgrade" : "שידרוג",
|
||||
"upgradeGadget" : "גרסת היישום שלכם היא {0}. גרסה {1} של יישום זה זמינה כעת. לחצו על 'אישור' כדי להוריד ולהתקין אותה.",
|
||||
"wlclientInitFailure" : "שגיאה",
|
||||
"wlSettings" : "הגדרות IBM MobileFirst Platform",
|
||||
"userEnrollmentUnsupportedOS" : "כשל באימות אישור משתמש: פלטפורמת לקוח לא נתמכת.",
|
||||
"failureCallingMethod" : "כשל בקריאה למתודה {0}",
|
||||
"challengeHandlingCanceled" : "Challenge handler operation was cancelled.",
|
||||
"unsupportedEnvironment" : "סביבה לא נתמכת",
|
||||
"redirect" : "ניתוב"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "Accesso negato",
|
||||
"authFailure" : "È stato rilevato un errore durante l'elaborazione della richiesta dall'applicazione",
|
||||
"applicationDenied" : "Applicazione disabilitata",
|
||||
"browserIsNotSupported" : "{0} non è attualmente supportato.",
|
||||
"cancel" : "Annulla",
|
||||
"close" : "Chiudi",
|
||||
"cookiesAreDisabled" : "Attualmente i cookie sono disabilitati nel browser in uso. È necessario abilitarli per un corretto funzionamento dell'applicazione.",
|
||||
"copyToClipboard" : "Copia",
|
||||
"details" : "Dettagli",
|
||||
"diagApp" : "Diagnostica app",
|
||||
"diagTime" : "Ora",
|
||||
"diagApplicationName" : "Nome applicazione",
|
||||
"diagApplicationVersion" : "Versione applicazione",
|
||||
"diagServiceURL" : "URL servizio",
|
||||
"diagDevicePlatform" : "Piattaforma dispositivo",
|
||||
"diagDeviceVersion" : "Versione dispositivo",
|
||||
"diagScreenResolution" : "Risoluzione schermo",
|
||||
"diagAirplaneMode" : "Modalità aereo",
|
||||
"diagUsingNetwork" : "Utilizzo della rete",
|
||||
"diagWifiName" : "Nome WiFi",
|
||||
"diagMobileNetworkType" : "Tipo di rete mobile",
|
||||
"diagCarrierName" : "Nome vettore",
|
||||
"diagErrorCode" : "Codice di errore",
|
||||
"diagErrorMessage" : "Messaggio di errore",
|
||||
"diagHttpStatus" : "Stato HTTP",
|
||||
"diagIPAddress" : "Indirizzo IP",
|
||||
"directUpdateNotificationTitle" : "Aggiornamento disponibile",
|
||||
"directUpdateNotificationMessage" : "Sono disponibili nuove risorse web. Confermare l'aggiornamento (la dimensione file è {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Sono disponibili nuove risorse web. Confermare l'aggiornamento (la dimensione file è {0} KB).",
|
||||
"directUpdateErrorTitle" : "Aggiornamento non riuscito",
|
||||
"directUpdateErrorMessage" : "Errore dell'aggiornamento diretto.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "È disponibile un aggiornamento per l'applicazione, ma lo spazio disponibile sul dispositivo non è sufficiente (dimensione richiesta: {0} MB, spazio disponibile: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Download del file di aggiornamento dell'applicazione non riuscito.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Elaborazione del file di aggiornamento dell'applicazione non riuscita.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Impossibile scaricare le risorse app. Specificare l'ID app nella schermata Impostazioni.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "Impossibile trovare l'applicazione '{0}'. Eseguire prima la distribuzione su IBM MobileFirst Platform Server.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Impossibile scaricare le risorse app. Specificare la versione app nella schermata Impostazioni.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Impossibile scaricare le risorse app. skin: {0} non esistente. Assicurarsi che getSkinName() sia risolto in uno skin valido.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Impossibile trovare l'applicazione '{0}' {1} per {2}",
|
||||
"deviceAuthenticationFail" : "Errore di connettività",
|
||||
"saveCertificateFailure" : "Impossibile salvare il certificato",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "Una connessione al server non è disponibile. Impossibile scaricare le risorse dell'applicazione.",
|
||||
"expandWindow" : "Espandere l'applicazione per utilizzarla",
|
||||
"exit" : "Esci",
|
||||
"exitApplication" : "Esci dall'applicazione",
|
||||
"error" : "Errore",
|
||||
"gadgetUpdateAvailable" : "Aggiornamento dell'applicazione disponibile",
|
||||
"getNewVersion" : "Ottieni nuova versione",
|
||||
"handleTimeOut" : "Richiesta scaduta per {0}. Assicurarsi che l'indirizzo host sia disponibile per l'applicazione (particolarmente importante per le app di Android e iPhone).",
|
||||
"invalidUsernamePassword" : "Nome utente o password non validi",
|
||||
"keepAliveInBackgroundText" : "L'esecuzione dell'applicazione prosegue in background",
|
||||
"loading" : "Caricamento",
|
||||
"login" : "Accesso",
|
||||
"minimize" : "Riduci al minimo",
|
||||
"missingFeatureException" : "Chiamata a {1} non riuscita perché {0} non è presente nell'applicazione. Aggiungere {0} al descrittore dell'applicazione, crearla nuovamente e distribuirla.",
|
||||
"name" : "Nome:",
|
||||
"noInternet" : "La connessione al servizio non è disponibile.",
|
||||
"notificationTitle" : "Notifica del servizio",
|
||||
"notAvailable" : "Non disponibile",
|
||||
"ok" : "OK",
|
||||
"password" : "Password:",
|
||||
"reload" : "Ricarica",
|
||||
"restore" : "Ripristina",
|
||||
"requestTimeout" : "L'applicazione non è riuscita ad effettuare la connessione al servizio.",
|
||||
"responseNotRecognized" : "Risposta non prevista.",
|
||||
"settings" : "Impostazioni",
|
||||
"serverError" : "Errore di richiamo procedura.",
|
||||
"tryAgain" : "Riprova",
|
||||
"userInstanceAccessViolationException" : "Si sta cercando di collegarsi a un'applicazione a cui non si è registrati.",
|
||||
"unexpectedError" : "Il server non è riuscito a elaborare la richiesta dall'applicazione. Riprovare successivamente.",
|
||||
"unresponsiveHost" : "Il servizio attualmente non è disponibile.",
|
||||
"update" : "Aggiorna",
|
||||
"upgrade" : "Esegui l'upgrade",
|
||||
"upgradeGadget" : "La versione dell'applicazione è {0}. È disponibile la versione {1} di questa applicazione. Fare clic su OK per scaricare e installare.",
|
||||
"wlclientInitFailure" : "Errore",
|
||||
"wlSettings" : "Impostazioni di IBM MobileFirst Platform",
|
||||
"userEnrollmentUnsupportedOS" : "Errore di autenticazione del certificato utente: piattaforma client non supportata.",
|
||||
"failureCallingMethod" : "Errore durante il richiamo di {0}",
|
||||
"challengeHandlingCanceled" : "Operazione Challenge Handler annullata.",
|
||||
"unsupportedEnvironment" : "Ambiente non supportato",
|
||||
"redirect" : "Reindirizza"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII ユーザー・インターフェース" ,
|
||||
"accessDenied" : "アクセスは拒否されました",
|
||||
"authFailure" : "アプリケーションからの要求の処理中にエラーが発生しました。",
|
||||
"applicationDenied" : "アプリケーションは使用できません",
|
||||
"browserIsNotSupported" : "{0} は現在サポートされていません。",
|
||||
"cancel" : "キャンセル",
|
||||
"close" : "閉じる",
|
||||
"cookiesAreDisabled" : "Cookie は現在ご使用のブラウザーで無効になっています。 これらを有効にしてアプリケーションが適切に機能するようにしてください。",
|
||||
"copyToClipboard" : "コピー",
|
||||
"details" : "詳細",
|
||||
"diagApp" : "アプリケーション診断",
|
||||
"diagTime" : "時刻",
|
||||
"diagApplicationName" : "アプリケーション名",
|
||||
"diagApplicationVersion" : "アプリケーション・バージョン",
|
||||
"diagServiceURL" : "サービス URL",
|
||||
"diagDevicePlatform" : "デバイス・プラットフォーム",
|
||||
"diagDeviceVersion" : "デバイス・バージョン",
|
||||
"diagScreenResolution" : "画面解像度",
|
||||
"diagAirplaneMode" : "機内モード",
|
||||
"diagUsingNetwork" : "ネットワークの使用",
|
||||
"diagWifiName" : "WiFi 名",
|
||||
"diagMobileNetworkType" : "モバイル・ネットワーク・タイプ",
|
||||
"diagCarrierName" : "通信事業者名",
|
||||
"diagErrorCode" : "エラー・コード",
|
||||
"diagErrorMessage" : "エラー・メッセージ",
|
||||
"diagHttpStatus" : "HTTP 状況",
|
||||
"diagIPAddress" : "IP アドレス",
|
||||
"directUpdateNotificationTitle" : "更新が利用可能",
|
||||
"directUpdateNotificationMessage" : "より新しい Web リソースが利用可能です。 確認して更新してください。 (ファイル・サイズ {0} MB)",
|
||||
"directUpdateNotificationMessageKilobytes" : "より新しい Web リソースが利用可能です。 確認して更新してください。 (ファイル・サイズ {0} KB)",
|
||||
"directUpdateErrorTitle" : "更新が失敗",
|
||||
"directUpdateErrorMessage" : "直接の更新が失敗しました。",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "アプリケーションの更新が利用可能ですが、デバイス上に十分な使用可能スペースがありません (必要なサイズ: {0} MB、使用可能スペース: {1} MB)。",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "アプリケーション更新ファイルのダウンロードが失敗しました。",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "アプリケーション更新ファイルの処理が失敗しました。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "アプリケーション・リソースをダウンロードできません。 「設定」画面の「アプリケーション ID」を指定してください。",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "アプリケーション '{0}' が見つかりません。 最初にそれを IBM MobileFirst Platform Server にデプロイしてください。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "アプリケーション・リソースをダウンロードできません。 「設定」画面の「アプリケーション・バージョン」を指定してください。",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "アプリケーション・リソースをダウンロードできません。 スキン: {0} は存在しません。 getSkinName() の値が確実に有効なスキンになるようにしてください。",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "アプリケーション '{0}' {1} ({2} 用) が見つかりません",
|
||||
"deviceAuthenticationFail" : "接続エラー",
|
||||
"saveCertificateFailure" : "証明書を保存できません",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "サーバーに接続できません。 アプリケーション・リソースをダウンロードできません。",
|
||||
"expandWindow" : "アプリケーションを展開して使用してください",
|
||||
"exit" : "終了",
|
||||
"exitApplication" : "アプリケーションの終了",
|
||||
"error" : "エラー",
|
||||
"gadgetUpdateAvailable" : "アプリケーションの更新が利用可能です",
|
||||
"getNewVersion" : "新バージョンの入手",
|
||||
"handleTimeOut" : "{0} の要求がタイムアウトになりました。 ホスト・アドレスがアプリケーション (特に Android や iPhone のアプリケーション) で使用できることを確認してください。",
|
||||
"invalidUsernamePassword" : "無効なユーザー名またはパスワード",
|
||||
"keepAliveInBackgroundText" : "アプリケーションはバックグラウンドで引き続き稼働中",
|
||||
"loading" : "ロード中",
|
||||
"login" : "ログイン",
|
||||
"minimize" : "最小化",
|
||||
"missingFeatureException" : "アプリケーションに {0} がないため {1} の呼び出しに失敗しました。 アプリケーション記述子に {0} を追加し、再ビルドしデプロイしてください。",
|
||||
"name" : "名前:",
|
||||
"noInternet" : "サービスに接続できません。",
|
||||
"notificationTitle" : "サービス通知",
|
||||
"notAvailable" : "使用不可",
|
||||
"ok" : "OK",
|
||||
"password" : "パスワード:",
|
||||
"reload" : "再ロード",
|
||||
"restore" : "復元",
|
||||
"requestTimeout" : "アプリケーションがサービスへの接続に失敗しました。",
|
||||
"responseNotRecognized" : "予期しない応答。",
|
||||
"settings" : "設定",
|
||||
"serverError" : "プロシージャー呼び出しエラー。",
|
||||
"tryAgain" : "やり直してください",
|
||||
"userInstanceAccessViolationException" : "登録されていないアプリケーションにログインしようとしています。",
|
||||
"unexpectedError" : "サーバーはアプリケーションからの要求を処理できませんでした。 後でもう一度やり直してください。",
|
||||
"unresponsiveHost" : "サービスは現在使用できません。",
|
||||
"update" : "更新",
|
||||
"upgrade" : "アップグレード",
|
||||
"upgradeGadget" : "ご使用のアプリケーションのバージョンは {0} です。 このアプリケーションのバージョン {1} が使用可能です。 これをダウンロードしてインストールするには「OK」をクリックしてください。",
|
||||
"wlclientInitFailure" : "エラー",
|
||||
"wlSettings" : "IBM MobileFirst Platform の設定",
|
||||
"userEnrollmentUnsupportedOS" : "ユーザー証明書認証障害: サポートされていないクライアント・プラットフォーム。",
|
||||
"failureCallingMethod" : "障害呼び出し {0}",
|
||||
"challengeHandlingCanceled" : "Challenge handler の操作がキャンセルされました。",
|
||||
"unsupportedEnvironment" : "非サポート環境",
|
||||
"redirect" : "リダイレクト"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII 사용자 지향" ,
|
||||
"accessDenied" : "액세스 거부됨",
|
||||
"authFailure" : "애플리케이션의 요청을 처리하는 중에 오류가 발생했습니다.",
|
||||
"applicationDenied" : "애플리케이션 사용 안함",
|
||||
"browserIsNotSupported" : "{0}은(는) 현재 지원되지 않습니다.",
|
||||
"cancel" : "취소",
|
||||
"close" : "닫기",
|
||||
"cookiesAreDisabled" : "쿠키는 브라우저에서 현재 사용되지 않습니다. 애플리케이션이 제대로 작동하려면 쿠키를 사용해야 합니다.",
|
||||
"copyToClipboard" : "복사",
|
||||
"details" : "세부사항",
|
||||
"diagApp" : "애플리케이션 진단",
|
||||
"diagTime" : "시간",
|
||||
"diagApplicationName" : "애플리케이션 이름",
|
||||
"diagApplicationVersion" : "애플리케이션 버전",
|
||||
"diagServiceURL" : "서비스 URL",
|
||||
"diagDevicePlatform" : "디바이스 플랫폼",
|
||||
"diagDeviceVersion" : "디바이스 버전",
|
||||
"diagScreenResolution" : "화면 해상도",
|
||||
"diagAirplaneMode" : "통신제한 모드",
|
||||
"diagUsingNetwork" : "사용 중인 네트워크",
|
||||
"diagWifiName" : "WiFi 이름",
|
||||
"diagMobileNetworkType" : "모바일 네트워크 유형",
|
||||
"diagCarrierName" : "통신회사 이름",
|
||||
"diagErrorCode" : "오류 코드",
|
||||
"diagErrorMessage" : "오류 메시지",
|
||||
"diagHttpStatus" : "HTTP 상태",
|
||||
"diagIPAddress" : "IP 주소",
|
||||
"directUpdateNotificationTitle" : "업데이트 사용 가능",
|
||||
"directUpdateNotificationMessage" : "최신 웹 자원이 사용 가능합니다. 업데이트 확인(파일 크기: {0}MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "최신 웹 자원이 사용 가능합니다. 업데이트 확인(파일 크기: {0}KB).",
|
||||
"directUpdateErrorTitle" : "업데이트 실패",
|
||||
"directUpdateErrorMessage" : "직접 업데이트에 실패했습니다.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "애플리케이션에 대한 업데이트를 사용할 수 있지만 디바이스의 사용 가능한 공간이 충분하지 않습니다(필수 크기: {0}MB, 사용 가능한 공간: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "애플리케이션 업데이트 파일을 다운로드하는 데 실패했습니다.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "애플리케이션 업데이트 파일을 처리하는 데 실패했습니다.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "애플리케이션 자원을 다운로드할 수 없습니다. 설정 화면에서 애플리케이션 ID를 지정하십시오.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "'{0}' 애플리케이션을 찾을 수 없습니다. 먼저 IBM MobileFirst Platform Server에 해당 애플리케이션을 배치하십시오.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "애플리케이션 자원을 다운로드할 수 없습니다. 설정 화면에서 애플리케이션 버전을 지정하십시오.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "애플리케이션 자원을 다운로드할 수 없습니다. {0} 스킨이 존재하지 않습니다. getSkinName()이 올바른 스킨에 해석되는지 확인하십시오.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "{2}용 '{0}' {1} 애플리케이션을 찾을 수 없습니다. ",
|
||||
"deviceAuthenticationFail" : "연결성 오류",
|
||||
"saveCertificateFailure" : "인증서를 저장할 수 없습니다.",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "서버에 연결할 수 없습니다. 애플리케이션 자원을 다운로드할 수 없습니다.",
|
||||
"expandWindow" : "사용할 애플리케이션 펼치기",
|
||||
"exit" : "종료",
|
||||
"exitApplication" : "애플리케이션 종료",
|
||||
"error" : "오류",
|
||||
"gadgetUpdateAvailable" : "애플리케이션 업데이트 사용 가능",
|
||||
"getNewVersion" : "새 버전 가져오기",
|
||||
"handleTimeOut" : "{0}에 대한 요청 제한시간이 초과되었습니다. 애플리케이션에 대한 호스트 주소가 사용 가능한지 확인하십시오(특히 Android 및 iPhone 애플리케이션 관련).",
|
||||
"invalidUsernamePassword" : "사용자 이름 또는 비밀번호가 올바르지 않음",
|
||||
"keepAliveInBackgroundText" : "애플리케이션이 배경에서 계속 실행됨",
|
||||
"loading" : "로드 중",
|
||||
"login" : "로그인",
|
||||
"minimize" : "최소화",
|
||||
"missingFeatureException" : "애플리케이션에서 {0}이(가) 누락되어 {1} 호출에 실패했습니다. 애플리케이션 디스크립터에 {0}을(를) 추가하고 다시 빌드하여 배치하십시오. ",
|
||||
"name" : "이름:",
|
||||
"noInternet" : "서비스에 대한 연결을 사용할 수 없습니다.",
|
||||
"notificationTitle" : "서비스 알림",
|
||||
"notAvailable" : "사용할 수 없음",
|
||||
"ok" : "확인",
|
||||
"password" : "비밀번호:",
|
||||
"reload" : "다시 로드",
|
||||
"restore" : "복원",
|
||||
"requestTimeout" : "애플리케이션에서 서비스 연결에 실패했습니다.",
|
||||
"responseNotRecognized" : "예상치 못한 응답입니다.",
|
||||
"settings" : "설정",
|
||||
"serverError" : "프로시저 호출 오류입니다.",
|
||||
"tryAgain" : "다시 시도",
|
||||
"userInstanceAccessViolationException" : "등록되지 않은 애플리케이션에 로그인하는 중입니다.",
|
||||
"unexpectedError" : "서버는 애플리케이션의 요청을 처리할 수 없습니다. 나중에 다시 시도하십시오.",
|
||||
"unresponsiveHost" : "서비스를 현재 사용할 수 없습니다.",
|
||||
"update" : "업데이트",
|
||||
"upgrade" : "업그레이드",
|
||||
"upgradeGadget" : "사용자의 애플리케이션 버전은 {0}입니다. 이 애플리케이션의 {1} 버전을 사용할 수 있습니다. 해당 버전을 다운로드하여 설치하려면 확인을 클릭하십시오.",
|
||||
"wlclientInitFailure" : "오류",
|
||||
"wlSettings" : "IBM MobileFirst Platform 설정",
|
||||
"userEnrollmentUnsupportedOS" : "사용자 인증 실패: 지원되지 않는 클라이언트 플랫폼",
|
||||
"failureCallingMethod" : "{0} 호출 실패",
|
||||
"challengeHandlingCanceled" : "인증 확인 핸들러 조작이 취소되었습니다.",
|
||||
"unsupportedEnvironment" : "지원되지 않는 환경",
|
||||
"redirect" : "경로 재지정"
|
||||
}
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "Access Denied",
|
||||
"authFailure" : "An error was encountered while processing the request from the application.",
|
||||
"applicationDenied" : "Application Disabled",
|
||||
"browserIsNotSupported" : "{0} is currently not supported.",
|
||||
"cancel" : "Cancel",
|
||||
"close" : "Close",
|
||||
"cookiesAreDisabled" : "Cookies are currently disabled in your browser. You must enable them for the application to function properly.",
|
||||
"copyToClipboard" : "Copy",
|
||||
"details" : "Details",
|
||||
"diagApp" : "App Diagnostics",
|
||||
"diagTime" : "Time",
|
||||
"diagApplicationName" : "Application Name",
|
||||
"diagApplicationVersion" : "Application Version",
|
||||
"diagServiceURL" : "Service URL",
|
||||
"diagDevicePlatform" : "Device Platform",
|
||||
"diagDeviceVersion" : "Device Version",
|
||||
"diagScreenResolution" : "Screen Resolution",
|
||||
"diagAirplaneMode" : "Airplane Mode",
|
||||
"diagUsingNetwork" : "Using Network",
|
||||
"diagWifiName" : "WiFi Name",
|
||||
"diagMobileNetworkType" : "Mobile Network Type",
|
||||
"diagCarrierName" : "Carrier Name",
|
||||
"diagErrorCode" : "Error Code",
|
||||
"diagErrorMessage" : "Error Message",
|
||||
"diagHttpStatus" : "HTTP Status",
|
||||
"diagIPAddress" : "IP Address",
|
||||
"directUpdateNotificationTitle" : "Update available",
|
||||
"directUpdateNotificationMessage" : "Newer web resources are available. Confirm to update. (file size is {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Newer web resources are available. Confirm to update. (file size is {0} KB).",
|
||||
"directUpdateErrorTitle" : "Update Failed",
|
||||
"directUpdateErrorMessage" : "Direct Update failure.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "An update for the application is available, but there is not enough space available on the device (required size: {0} MB, available space: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Failed downloading application update file.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Failed processing application update file.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Cannot download app resources. Specify the App ID in the Settings screen.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "Application '{0}' cannot be found. Deploy it first to the IBM MobileFirst Platform Server.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Cannot download app resources. Specify the App Version in the Settings screen.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Cannot download app resources. skin: {0} does not exist. Please make sure getSkinName() resolves to a valid skin.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Cannot find application '{0}' {1} for {2}",
|
||||
"deviceAuthenticationFail" : "Connectivity Error",
|
||||
"saveCertificateFailure" : "Unable to save certificate",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "A connection to the server is not available. Cannot download application resources.",
|
||||
"expandWindow" : "Expand application to use it",
|
||||
"exit" : "Exit",
|
||||
"exitApplication" : "Exit application",
|
||||
"error" : "Error",
|
||||
"gadgetUpdateAvailable" : "Application update available",
|
||||
"getNewVersion" : "Get new version",
|
||||
"handleTimeOut" : "Request timed out for {0}. Make sure the host address is available to the application (especially relevant for Android and iPhone apps).",
|
||||
"invalidUsernamePassword" : "Invalid user name or password",
|
||||
"keepAliveInBackgroundText" : "Application keeps running in background",
|
||||
"loading" : "Loading",
|
||||
"login" : "Login",
|
||||
"minimize" : "Minimize",
|
||||
"missingFeatureException" : "Failed to call {1} because {0} is missing in the application. Add {0} to the application descriptor, rebuild and deploy it.",
|
||||
"name" : "Name:",
|
||||
"noInternet" : "Connection to the service is not available.",
|
||||
"notificationTitle" : "Service Notification",
|
||||
"notAvailable" : "Not Available",
|
||||
"ok" : "OK",
|
||||
"password" : "Password:",
|
||||
"reload" : "Reload",
|
||||
"restore" : "Restore",
|
||||
"requestTimeout" : "The application failed connecting to the service.",
|
||||
"responseNotRecognized" : "Unexpected response.",
|
||||
"settings" : "Settings",
|
||||
"serverError" : "Procedure invocation error.",
|
||||
"tryAgain" : "Try Again",
|
||||
"userInstanceAccessViolationException" : "You are trying to login to an application that is not registered for you.",
|
||||
"unexpectedError" : "The server was unable to process the request from the application. Please try again later.",
|
||||
"unresponsiveHost" : "The service is currently not available.",
|
||||
"update" : "Update",
|
||||
"upgrade" : "Upgrade",
|
||||
"upgradeGadget" : "The version of your application is {0}. Version {1} of this application is available. Click OK to download and install it.",
|
||||
"wlclientInitFailure" : "Error",
|
||||
"wlSettings" : "IBM MobileFirst Platform Settings",
|
||||
"userEnrollmentUnsupportedOS" : "User certificate authentication failure: unsupported client platform.",
|
||||
"failureCallingMethod" : "Failure calling {0}",
|
||||
"challengeHandlingCanceled" : "Challenge handler operation was cancelled.",
|
||||
"unsupportedEnvironment" : "Unsupported environment",
|
||||
"redirect" : "Redirect"
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "Face de Usuário de PII" ,
|
||||
"accessDenied" : "Acesso Negado",
|
||||
"authFailure" : "Um erro foi encontrado ao processar a solicitação do aplicativo.",
|
||||
"applicationDenied" : "Aplicativo Desativado",
|
||||
"browserIsNotSupported" : "{0} não é suportado atualmente.",
|
||||
"cancel" : "Cancelar",
|
||||
"close" : "Fechar",
|
||||
"cookiesAreDisabled" : "Os cookies estão atualmente desativados em seu navegador. Você deve ativá-los para que o aplicativo funcione adequadamente.",
|
||||
"copyToClipboard" : "Copiar",
|
||||
"details" : "Detalhes",
|
||||
"diagApp" : "Diagnósticos do Aplicativo",
|
||||
"diagTime" : "Tempo",
|
||||
"diagApplicationName" : "Nome do Aplicativo",
|
||||
"diagApplicationVersion" : "Versão do Aplicativo",
|
||||
"diagServiceURL" : "URL de Serviço",
|
||||
"diagDevicePlatform" : "Plataforma do Dispositivo",
|
||||
"diagDeviceVersion" : "Versão do Dispositivo",
|
||||
"diagScreenResolution" : "Resolução da Tela",
|
||||
"diagAirplaneMode" : "Modo de Avião",
|
||||
"diagUsingNetwork" : "Usando Rede",
|
||||
"diagWifiName" : "Nome da WiFi",
|
||||
"diagMobileNetworkType" : "Tipo de Rede Remota",
|
||||
"diagCarrierName" : "Nome da Transportadora",
|
||||
"diagErrorCode" : "Código de Erro",
|
||||
"diagErrorMessage" : "Mensagem de Erro",
|
||||
"diagHttpStatus" : "Status de HTTP",
|
||||
"diagIPAddress" : "Endereço IP",
|
||||
"directUpdateNotificationTitle" : "Atualização disponível",
|
||||
"directUpdateNotificationMessage" : "Recursos da web mais recentes estão disponíveis. Confirme para atualizar. (o tamanho do arquivo é de {0} MB).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Recursos da web mais recentes estão disponíveis. Confirme para atualizar. (o tamanho do arquivo é de {0} KB).",
|
||||
"directUpdateErrorTitle" : "Atualização com Falha",
|
||||
"directUpdateErrorMessage" : "Falha na Atualização Direta.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "Uma atualização para o aplicativo está disponível, mas não há espaço suficiente disponível no dispositivo (tamanho necessário: {0} MB, espaço disponível: {1} MB).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Falha ao fazer download do arquivo de atualização do aplicativo.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Falha ao processar o arquivo de atualização do aplicativo.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Não é possível fazer download de recursos do aplicativo. Especifique o ID do Aplicativo na tela Configurações.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "O aplicativo '{0}' não pode ser localizado. Implemente-o primeiro no IBM MobileFirst Platform Server.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Não é possível fazer download de recursos do aplicativo. Especifique a Versão do Aplicativo na tela Configurações.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Não é possível fazer download de recursos do aplicativo. Aparência: {0} não existe. Certifique-se de que getSkinName() seja resolvido para uma aparência válida.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Não é possível localizar o aplicativo '{0}' {1} para {2}",
|
||||
"deviceAuthenticationFail" : "Erro de Conectividade",
|
||||
"saveCertificateFailure" : "Não é possível salvar o certificado",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "Uma conexão com o servidor não está disponível. Não é possível fazer download de recursos do aplicativo.",
|
||||
"expandWindow" : "Expandir aplicativo para usá-lo",
|
||||
"exit" : "Sair",
|
||||
"exitApplication" : "Sair do Aplicativo",
|
||||
"error" : "Erro",
|
||||
"gadgetUpdateAvailable" : "Atualização do aplicativo disponível",
|
||||
"getNewVersion" : "Obter Nova Versão",
|
||||
"handleTimeOut" : "A solicitação atingiu o tempo limite para {0}. Certifique-se de que o endereço do host esteja disponível para o aplicativo (especialmente relevante para aplicativos Android e iPhone).",
|
||||
"invalidUsernamePassword" : "Nome de usuário ou senha inválida",
|
||||
"keepAliveInBackgroundText" : "O aplicativo continua em execução no segundo plano",
|
||||
"loading" : "Carregando",
|
||||
"login" : "Login",
|
||||
"minimize" : "Minimizar",
|
||||
"missingFeatureException" : "Falha ao chamar {1} porque {0} está ausente no aplicativo. Inclua {0} no descritor de aplicativo, reconstrua e implemente-o.",
|
||||
"name" : "Nome:",
|
||||
"noInternet" : "A conexão com o serviço não está disponível.",
|
||||
"notificationTitle" : "Notificação de Serviço",
|
||||
"notAvailable" : "Não Disponível",
|
||||
"ok" : "OK",
|
||||
"password" : "Senha:",
|
||||
"reload" : "Recarregar",
|
||||
"restore" : "Restaurar",
|
||||
"requestTimeout" : "Falha ao conectar o aplicativo com o serviço.",
|
||||
"responseNotRecognized" : "Resposta inesperada.",
|
||||
"settings" : "Configurações",
|
||||
"serverError" : "Erro de chamada de procedimento.",
|
||||
"tryAgain" : "Tentar Novamente",
|
||||
"userInstanceAccessViolationException" : "Você está tentando efetuar login em um aplicativo que não está registrado para você.",
|
||||
"unexpectedError" : "O servidor não pôde processar a solicitação do aplicativo. Tente novamente mais tarde.",
|
||||
"unresponsiveHost" : "O serviço não está atualmente disponível.",
|
||||
"update" : "Atualizar",
|
||||
"upgrade" : "Fazer Upgrade",
|
||||
"upgradeGadget" : "A versão de seu aplicativo é {0}. A versão {1} deste aplicativo está disponível. Clique em OK para fazer download e instalá-la.",
|
||||
"wlclientInitFailure" : "Erro",
|
||||
"wlSettings" : "Configurações do IBM MobileFirst Platform",
|
||||
"userEnrollmentUnsupportedOS" : "Falha de autenticação de certificado de usuário: plataforma do cliente não suportada.",
|
||||
"failureCallingMethod" : "Falha ao chamar {0}",
|
||||
"challengeHandlingCanceled" : "A operação do manipulador de desafios foi cancelada.",
|
||||
"unsupportedEnvironment" : "Ambiente não suportado",
|
||||
"redirect" : "Redirecionar"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "Личные данные для пользователя" ,
|
||||
"accessDenied" : "Доступ запрещен",
|
||||
"authFailure" : "Произошла ошибка при обработке запроса из приложения.",
|
||||
"applicationDenied" : "Приложение выключено",
|
||||
"browserIsNotSupported" : "{0} в настоящее время не поддерживается.",
|
||||
"cancel" : "Отмена",
|
||||
"close" : "Закрыть",
|
||||
"cookiesAreDisabled" : "В данный момент cookie в браузере выключены. Их необходимо включить, чтобы обеспечить правильную работу приложения.",
|
||||
"copyToClipboard" : "Копировать",
|
||||
"details" : "Сведения",
|
||||
"diagApp" : "Диагностика приложения",
|
||||
"diagTime" : "Время",
|
||||
"diagApplicationName" : "Имя приложения",
|
||||
"diagApplicationVersion" : "Версия приложения",
|
||||
"diagServiceURL" : "URL службы",
|
||||
"diagDevicePlatform" : "Платформа",
|
||||
"diagDeviceVersion" : "Версия устройства",
|
||||
"diagScreenResolution" : "Разрешение экрана",
|
||||
"diagAirplaneMode" : "Режим самолета",
|
||||
"diagUsingNetwork" : "Работа с сетью",
|
||||
"diagWifiName" : "Имя WiFi",
|
||||
"diagMobileNetworkType" : "Тип моб. сети",
|
||||
"diagCarrierName" : "Назв. носителя",
|
||||
"diagErrorCode" : "Код ошибки",
|
||||
"diagErrorMessage" : "Сообщение",
|
||||
"diagHttpStatus" : "Состояние HTTP",
|
||||
"diagIPAddress" : "IP-адрес",
|
||||
"directUpdateNotificationTitle" : "Есть обновление",
|
||||
"directUpdateNotificationMessage" : "Доступные новые веб-ресурсы. Подтвердите обновление. (Размер файла: {0} МБ).",
|
||||
"directUpdateNotificationMessageKilobytes" : "Доступные новые веб-ресурсы. Подтвердите обновление. (Размер файла: {0} КБ).",
|
||||
"directUpdateErrorTitle" : "Обновление не выполнено",
|
||||
"directUpdateErrorMessage" : "Сбой прямого обновления.",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "Для приложения доступно обновление, но в устройстве недостаточно памяти (необходимый объем: {0} МБ, доступно: {1} МБ).",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "Не удалось загрузить файл обновления приложения.",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "Не удалось обработать файл обновления приложения.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "Невозможно загрузить ресурсы приложения. Укажите ИД приложения в окне Параметры.",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "Приложение '{0}' не найдено. Разверните его сначала на сервере IBM MobileFirst Platform.",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "Невозможно загрузить ресурсы приложения. Укажите версию приложения в окне Параметры.",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "Невозможно загрузить ресурсы приложения. оболочка {0} не существует. Убедитесь, что getSkinName() преобразуется в правильную оболочку.",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "Не найдено приложение '{0}' {1} для {2}",
|
||||
"deviceAuthenticationFail" : "Ошибка соединения",
|
||||
"saveCertificateFailure" : "Не удалось сохранить сертификат",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "Соединение с сервером недоступно. Невозможно загрузить ресурсы приложения.",
|
||||
"expandWindow" : "Разверните приложение для работы с ним",
|
||||
"exit" : "Выход",
|
||||
"exitApplication" : "Закрыть приложение",
|
||||
"error" : "Ошибка",
|
||||
"gadgetUpdateAvailable" : "Доступно обновление приложения",
|
||||
"getNewVersion" : "Получить новую версию",
|
||||
"handleTimeOut" : "Тайм-аут запроса для {0}. Убедитесь, что адрес хоста доступен для приложения (особенно при работе с приложениями Android и iPhone).",
|
||||
"invalidUsernamePassword" : "Недопустимое имя пользователя или пароль",
|
||||
"keepAliveInBackgroundText" : "Приложение продолжает выполняться в фоновом режиме",
|
||||
"loading" : "Загрузка",
|
||||
"login" : "Вход в систему",
|
||||
"minimize" : "Свернуть",
|
||||
"missingFeatureException" : "Не удалось вызвать {1}, так как в приложении отсутствует {0}. Добавьте {0} в файл описания приложения, перекомпонуйте его и выполните развертывание.",
|
||||
"name" : "Имя:",
|
||||
"noInternet" : "Соединение со службой недоступно.",
|
||||
"notificationTitle" : "Уведомление об обслуживании",
|
||||
"notAvailable" : "Недоступно",
|
||||
"ok" : "OK",
|
||||
"password" : "Пароль:",
|
||||
"reload" : "Заново",
|
||||
"restore" : "Восстановить",
|
||||
"requestTimeout" : "Приложению не удалось подключиться к службе.",
|
||||
"responseNotRecognized" : "Непредвиденный ответ.",
|
||||
"settings" : "Параметры",
|
||||
"serverError" : "Ошибка вызова процедуры.",
|
||||
"tryAgain" : "Повторите попытку",
|
||||
"userInstanceAccessViolationException" : "Попытка входа в систему приложения, которое для вас не зарегистрировано.",
|
||||
"unexpectedError" : "Серверу не удалось обработать запрос из приложения. Повторите операцию позднее.",
|
||||
"unresponsiveHost" : "В данный момент служба недоступна.",
|
||||
"update" : "Обновить",
|
||||
"upgrade" : "Обновить",
|
||||
"upgradeGadget" : "Приложение имеет версию {0}. Доступна версия {1} этого приложения. Для загрузки и установки нажмите OK.",
|
||||
"wlclientInitFailure" : "Ошибка",
|
||||
"wlSettings" : "Параметры платформы IBM MobileFirst",
|
||||
"userEnrollmentUnsupportedOS" : "Ошибка сертификата пользователя: неподдерживаемая платформа клиента.",
|
||||
"failureCallingMethod" : "Ошибка вызова {0}",
|
||||
"challengeHandlingCanceled" : "Операция обработчика вызовов была отменена.",
|
||||
"unsupportedEnvironment" : "Неподдерживаемая среда",
|
||||
"redirect" : "Перенаправление"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII 使用者樣式" ,
|
||||
"accessDenied" : "拒絕存取",
|
||||
"authFailure" : "處理應用程式的要求時發生錯誤。",
|
||||
"applicationDenied" : "應用程式已停用",
|
||||
"browserIsNotSupported" : "目前不支援 {0}。",
|
||||
"cancel" : "取消",
|
||||
"close" : "關閉",
|
||||
"cookiesAreDisabled" : "您的瀏覽器目前已停用 Cookie。 您必須加以啟用,應用程式才能正常運作。",
|
||||
"copyToClipboard" : "複製",
|
||||
"details" : "詳細資料",
|
||||
"diagApp" : "應用程式診斷程式",
|
||||
"diagTime" : "時間",
|
||||
"diagApplicationName" : "應用程式名稱",
|
||||
"diagApplicationVersion" : "應用程式版本",
|
||||
"diagServiceURL" : "服務 URL",
|
||||
"diagDevicePlatform" : "裝置平台",
|
||||
"diagDeviceVersion" : "裝置版本",
|
||||
"diagScreenResolution" : "螢幕解析度",
|
||||
"diagAirplaneMode" : "飛航模式",
|
||||
"diagUsingNetwork" : "使用網路",
|
||||
"diagWifiName" : "WiFi 名稱",
|
||||
"diagMobileNetworkType" : "行動網路類型",
|
||||
"diagCarrierName" : "電信業者名稱",
|
||||
"diagErrorCode" : "錯誤碼",
|
||||
"diagErrorMessage" : "錯誤訊息",
|
||||
"diagHttpStatus" : "HTTP 狀態",
|
||||
"diagIPAddress" : "IP 位址",
|
||||
"directUpdateNotificationTitle" : "有可用的更新項目",
|
||||
"directUpdateNotificationMessage" : "有可用的新版 Web 資源。確認以更新。(檔案大小為 {0} MB)。",
|
||||
"directUpdateNotificationMessageKilobytes" : "有可用的新版 Web 資源。確認以更新。(檔案大小為 {0} KB)。",
|
||||
"directUpdateErrorTitle" : "更新失敗",
|
||||
"directUpdateErrorMessage" : "直接更新失敗。",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "有可用的應用程式更新,但裝置上的可用空間不足(需要大小:{0} MB,可用空間:{1} MB)。",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "下載應用程式更新檔案失敗。",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "處理應用程式更新檔案失敗。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "無法下載應用程式資源。 請在「設定」畫面中指定「應用程式 ID」。",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "找不到應用程式 '{0}'。 請先將其部署到 IBM MobileFirst Platform Server。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "無法下載應用程式資源。 請在「設定」畫面中指定「應用程式版本」。",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "無法下載應用程式資源。 外觀:{0} 不存在。 請確定 getSkinName() 可解析為有效的外觀。",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "找不到 {2} 適用的應用程式 '{0}' {1}",
|
||||
"deviceAuthenticationFail" : "連線功能錯誤",
|
||||
"saveCertificateFailure" : "無法儲存憑證",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "目前無法連線至伺服器。 無法下載應用程式資源。",
|
||||
"expandWindow" : "展開應用程式加以使用",
|
||||
"exit" : "結束",
|
||||
"exitApplication" : "結束應用程式",
|
||||
"error" : "錯誤",
|
||||
"gadgetUpdateAvailable" : "有可用的應用程式更新",
|
||||
"getNewVersion" : "取得新版本",
|
||||
"handleTimeOut" : "{0} 的要求逾時。 請確定應用程式(特別是 Android 與 iPhone 應用程式)可使用該主機位址。",
|
||||
"invalidUsernamePassword" : "無效的使用者名稱或密碼",
|
||||
"keepAliveInBackgroundText" : "應用程式繼續在背景中執行",
|
||||
"loading" : "載入中",
|
||||
"login" : "登入",
|
||||
"minimize" : "最小化",
|
||||
"missingFeatureException" : "應用程式中缺少 {0},所以無法呼叫 {1}。 請在應用程式描述子中新增 {0},然後再行重建及部署。",
|
||||
"name" : "名稱:",
|
||||
"noInternet" : "無法連線至服務。",
|
||||
"notificationTitle" : "服務通知",
|
||||
"notAvailable" : "無法使用",
|
||||
"ok" : "確定",
|
||||
"password" : "密碼:",
|
||||
"reload" : "重新載入",
|
||||
"restore" : "還原",
|
||||
"requestTimeout" : "應用程式無法連線至服務。",
|
||||
"responseNotRecognized" : "非預期的回應。",
|
||||
"settings" : "設定",
|
||||
"serverError" : "程序呼叫錯誤。",
|
||||
"tryAgain" : "重試",
|
||||
"userInstanceAccessViolationException" : "嘗試登入不是為您登錄的應用程式。",
|
||||
"unexpectedError" : "伺服器無法處理應用程式的要求。請稍後再試一次。",
|
||||
"unresponsiveHost" : "服務目前無法使用。",
|
||||
"update" : "更新",
|
||||
"upgrade" : "升級",
|
||||
"upgradeGadget" : "您的應用程式版本為 {0}。此應用程式已有版本 {1} 可供使用。請按一下「確定」予以下載及安裝。",
|
||||
"wlclientInitFailure" : "錯誤",
|
||||
"wlSettings" : "IBM MobileFirst Platform 設定",
|
||||
"userEnrollmentUnsupportedOS" : "使用者憑證鑑別失敗:不受支援的用戶端平台。",
|
||||
"failureCallingMethod" : "呼叫 {0} 失敗",
|
||||
"challengeHandlingCanceled" : "已取消盤查處理程式作業。",
|
||||
"unsupportedEnvironment" : "不支援的環境",
|
||||
"redirect" : "重新導向"
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"IBM-INTERNAL" : "PII user facing" ,
|
||||
"accessDenied" : "拒绝访问",
|
||||
"authFailure" : "处理应用程序请求时遇到错误。",
|
||||
"applicationDenied" : "已禁用应用程序",
|
||||
"browserIsNotSupported" : "当前不支持 {0}。",
|
||||
"cancel" : "取消",
|
||||
"close" : "关闭",
|
||||
"cookiesAreDisabled" : "浏览器当前禁用 Cookie。 要使应用程序正常运行,必须启用 Cookie。",
|
||||
"copyToClipboard" : "复制",
|
||||
"details" : "详细信息",
|
||||
"diagApp" : "应用程序诊断",
|
||||
"diagTime" : "时间",
|
||||
"diagApplicationName" : "应用程序名称",
|
||||
"diagApplicationVersion" : "应用程序版本",
|
||||
"diagServiceURL" : "服务 URL",
|
||||
"diagDevicePlatform" : "设备平台",
|
||||
"diagDeviceVersion" : "设备版本",
|
||||
"diagScreenResolution" : "屏幕分辨率",
|
||||
"diagAirplaneMode" : "飞行模式",
|
||||
"diagUsingNetwork" : "使用网络",
|
||||
"diagWifiName" : "WiFi 名称",
|
||||
"diagMobileNetworkType" : "移动网络类型",
|
||||
"diagCarrierName" : "运营商名称",
|
||||
"diagErrorCode" : "错误代码",
|
||||
"diagErrorMessage" : "错误消息",
|
||||
"diagHttpStatus" : "HTTP 状态",
|
||||
"diagIPAddress" : "IP 地址",
|
||||
"directUpdateNotificationTitle" : "可用更新",
|
||||
"directUpdateNotificationMessage" : "有新的 Web 资源可用,确认更新。(文件大小为 {0} MB)。",
|
||||
"directUpdateNotificationMessageKilobytes" : "有新的 Web 资源可用,确认更新。(文件大小为 {0} KB)。",
|
||||
"directUpdateErrorTitle" : "更新失败",
|
||||
"directUpdateErrorMessage" : "直接更新失败。",
|
||||
"directUpdateErrorMessageNotEnoughStorage" : "该应用程序有一个可用更新,但设备空间不足(所需大小:{0} MB,可用空间:{1} MB)。",
|
||||
"directUpdateErrorMessageFailedDownloadingZipFile" : "下载应用程序更新文件失败。",
|
||||
"directUpdateErrorMessageFailedProcessingZipFile" : "处理应用程序更新文件失败。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppID" : "无法下载应用程序资源。 请在“设置”屏幕上指定应用程序标识。",
|
||||
"downloadAppWebResourcesAppIdNotExist" : "找不到应用程序“{0}”。 请先将该应用程序部署到 IBM MobileFirst Platform 服务器。",
|
||||
"downloadAppWebResourcesPleaseSpecifyAppVersion" : "无法下载应用程序资源。 请在“设置”屏幕上指定应用程序版本。",
|
||||
"downloadAppWebResourcesSkinIsNotValid" : "无法下载应用程序资源。 外表:{0} 不存在。 请确保 getSkinName() 解析为有效外表。",
|
||||
"downloadAppWebResourcesAppVersionNotExist" : "无法为 {2} 找到应用程序“{0}”{1}",
|
||||
"deviceAuthenticationFail" : "连接错误",
|
||||
"saveCertificateFailure" : "无法保存证书",
|
||||
"downloadAppWebResourcesConnectionToServerUnavailable" : "无法连接至服务器。 无法下载应用程序资源。",
|
||||
"expandWindow" : "扩展应用程序以使用它",
|
||||
"exit" : "退出",
|
||||
"exitApplication" : "退出应用程序",
|
||||
"error" : "错误",
|
||||
"gadgetUpdateAvailable" : "应用程序更新可用",
|
||||
"getNewVersion" : "获取新版本",
|
||||
"handleTimeOut" : "对 {0} 的请求超时。 请确保应用程序可以使用该主机地址(尤其适用于 Android 和 iPhone 应用程序)。",
|
||||
"invalidUsernamePassword" : "无效的用户名或密码",
|
||||
"keepAliveInBackgroundText" : "应用程序一直在后台运行",
|
||||
"loading" : "正在装入",
|
||||
"login" : "登录",
|
||||
"minimize" : "最小化",
|
||||
"missingFeatureException" : "由于应用程序缺少 {0},因此调用 {1} 失败。 请将 {0} 添加至应用程序描述符,然后将其重新构建并部署。",
|
||||
"name" : "名称:",
|
||||
"noInternet" : "服务连接不可用。",
|
||||
"notificationTitle" : "服务通知",
|
||||
"notAvailable" : "不可用",
|
||||
"ok" : "确定",
|
||||
"password" : "密码:",
|
||||
"reload" : "重新装入",
|
||||
"restore" : "复原",
|
||||
"requestTimeout" : "应用程序无法连接至服务。",
|
||||
"responseNotRecognized" : "意外响应。",
|
||||
"settings" : "设置",
|
||||
"serverError" : "过程调用错误。",
|
||||
"tryAgain" : "请重试",
|
||||
"userInstanceAccessViolationException" : "您正在尝试登录到自己尚未注册的应用程序。",
|
||||
"unexpectedError" : "服务器无法处理该应用程序的请求。请稍后重试。",
|
||||
"unresponsiveHost" : "服务当前不可用。",
|
||||
"update" : "更新",
|
||||
"upgrade" : "升级",
|
||||
"upgradeGadget" : "您的应用程序版本为 {0}。该应用程序的 V{1} 可用。请单击“确定”以下载并安装该版本。",
|
||||
"wlclientInitFailure" : "错误",
|
||||
"wlSettings" : "IBM MobileFirst Platform 设置",
|
||||
"userEnrollmentUnsupportedOS" : "用户证书认证失败:不受支持的客户机平台。",
|
||||
"failureCallingMethod" : "调用 {0} 失败",
|
||||
"challengeHandlingCanceled" : "验证问题处理程序操作已取消。",
|
||||
"unsupportedEnvironment" : "不支持的环境",
|
||||
"redirect" : "重定向"
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// This is a generated file. Do not edit. See application-descriptor.xml.
|
||||
// WLClient configuration variables.
|
||||
console.log("Running static_app_props.js...");
|
||||
var WL = WL ? WL : {};
|
||||
WL.StaticAppProps = {
|
||||
APP_ID: 'com.gpr.gabinetedigital',
|
||||
APP_VERSION: '0.0.1',
|
||||
WORKLIGHT_PLATFORM_VERSION: '8.0.0.00-20210308-063916',
|
||||
WORKLIGHT_NATIVE_VERSION: '1109370933',
|
||||
LANGUAGE_PREFERENCES: 'en',
|
||||
API_PROXY_URL: '/adapters/MobileAPIProxy',
|
||||
ENVIRONMENT: 'android',
|
||||
WORKLIGHT_ROOT_URL: '/apps/services/api/com.gpr.gabinetedigital/android/',
|
||||
APP_SERVICES_URL: '/apps/services/',
|
||||
APP_DISPLAY_NAME: 'gabinete digital',
|
||||
LOGIN_DISPLAY_TYPE: 'embedded',
|
||||
mfpClientCustomInit: false,
|
||||
MESSAGES_DIR: 'plugins\\cordova-plugin-mfp\\worklight\\messages'
|
||||
};
|
||||
+9753
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
Licensed Materials - Property of IBM
|
||||
|
||||
(C) Copyright 2015 IBM Corp.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* Copyright (C) Worklight Ltd. 2006-2012. All rights reserved. */
|
||||
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
a, button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.floatLeft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.floatRight {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rtl {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ltr {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.max {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/******************************** END BASE CSS ***********************************/
|
||||
|
||||
body {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#blockOuter {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
color: inherit;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 110; /* Must be bigger than authenticator z-index (100). */
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* The id is set in the upgrade version in messages.js */
|
||||
#downloadNewVersion {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
#auth {
|
||||
display: none;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#diagnostic {
|
||||
background-color: white;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.diagnosticTable td {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
font-size: 16px;
|
||||
padding: 2px;
|
||||
color : black;
|
||||
width: 50%;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.diagnosticButtons {
|
||||
font-size:12px;
|
||||
height:40px;
|
||||
width: 93.5px;
|
||||
font-weight: normal;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
/* Start styling for the modal window */
|
||||
#WLdialogContainer {
|
||||
position: static;
|
||||
}
|
||||
|
||||
#WLdialogOverlay {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
filter: alpha(opacity=50);
|
||||
-moz-opacity:0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 16777269;
|
||||
}
|
||||
|
||||
#WLdialog {
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
-o-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
font-family: helvetica, arial, sans-serif;
|
||||
font-size: 12px;
|
||||
margin: 0 auto;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
width: 280px;
|
||||
z-index: 16777270;
|
||||
}
|
||||
|
||||
#WLdialogTitle {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#WLdialogBody {
|
||||
margin: 5px 0;
|
||||
min-height: 48px;
|
||||
}
|
||||
|
||||
#WLdialog button {
|
||||
margin: 0 5px;
|
||||
}
|
||||
/* End styling for the modal window */
|
||||
|
||||
/* Start styling for the busy modal window */
|
||||
#WLbusyContainer {
|
||||
position: static;
|
||||
}
|
||||
|
||||
#WLbusyOverlay {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
filter: alpha(opacity=50);
|
||||
-moz-opacity:0.5;
|
||||
-o-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 9998;
|
||||
}
|
||||
|
||||
#WLbusy {
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
-o-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
width: 240px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#WLbusyTitle {
|
||||
color: #000;
|
||||
font-family: helvetica, arial, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 14px;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* End styling for the busy modal window */
|
||||
|
||||
html, body {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Css for the tab bar.
|
||||
* The HTML structure is like the fo:
|
||||
* <div>
|
||||
* <ul class=">
|
||||
* <li>
|
||||
* <span></span>
|
||||
* </li>
|
||||
* <span></span>
|
||||
* <li>
|
||||
* <span></span>
|
||||
* </li>
|
||||
* </ul>
|
||||
*/
|
||||
.tabBar {
|
||||
position : fixed;
|
||||
border-bottom: 3px solid #CBCBCB;
|
||||
display: block;
|
||||
height:63px;
|
||||
list-style-type: none;
|
||||
width: 100%;
|
||||
background-color: black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-user-select: text;
|
||||
z-index: 99999;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.tabItem {
|
||||
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0B0B0D), color-stop(1, #434949));
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
float: left;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.tabItemActive {
|
||||
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #CBCBCB), color-stop(1, #E4E4E4));
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
.tabSpan {
|
||||
background: center 5px;
|
||||
background-repeat: no-repeat;
|
||||
border-left: 1px solid #000;
|
||||
border-right: 1px solid #000;
|
||||
color: #FFFFFF;
|
||||
line-height: 111px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
height: 63px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tabItemActive .tabSpan {
|
||||
color: #9C9A9C;
|
||||
font-size: 14px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.tabDisabled {
|
||||
filter: alpha(opacity=50);
|
||||
opacity: .50;
|
||||
}
|
||||
|
||||
.tabTouch {
|
||||
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #FF9900), color-stop(1, #FFCA00));
|
||||
}
|
||||
|
||||
.tabBarTouch {
|
||||
border-bottom: 3px solid #FF9900;
|
||||
}
|
||||
+12260
File diff suppressed because one or more lines are too long
Vendored
+157
@@ -0,0 +1,157 @@
|
||||
cordova.define("cordova-plugin-screen-orientation.screenorientation", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
var screenOrientation = {};
|
||||
if (!window.OrientationType) {
|
||||
window.OrientationType = {
|
||||
'portrait-primary': 0,
|
||||
'portrait-secondary': 180,
|
||||
'landscape-primary': 90,
|
||||
'landscape-secondary': -90
|
||||
};
|
||||
}
|
||||
if (!window.OrientationLockType) {
|
||||
window.OrientationLockType = {
|
||||
'portrait-primary': 1,
|
||||
'portrait-secondary': 2,
|
||||
'landscape-primary': 4,
|
||||
'landscape-secondary': 8,
|
||||
'portrait': 3, // either portrait-primary or portrait-secondary.
|
||||
'landscape': 12, // either landscape-primary or landscape-secondary.
|
||||
'any': 15 // All orientations are supported (unlocked orientation)
|
||||
};
|
||||
}
|
||||
var orientationMask = 1;
|
||||
screenOrientation.setOrientation = function(orientation) {
|
||||
orientationMask = window.OrientationLockType[orientation];
|
||||
cordova.exec(null, null, "CDVOrientation", "screenOrientation", [orientationMask, orientation]);
|
||||
};
|
||||
|
||||
if (!screen.orientation) {
|
||||
screen.orientation = {};
|
||||
}
|
||||
|
||||
setOrientationProperties();
|
||||
|
||||
function addScreenOrientationApi(screenObject) {
|
||||
|
||||
if (screenObject.unlock || screenObject.lock) {
|
||||
screenObject.nativeLock = screenObject.lock;
|
||||
}
|
||||
|
||||
screenObject.lock = function(orientation) {
|
||||
var promiseLock;
|
||||
var p = new Promise(function(resolve, reject) {
|
||||
if (screenObject.nativeLock) {
|
||||
promiseLock = screenObject.nativeLock(orientation);
|
||||
promiseLock.then(function success(res) {
|
||||
resolve();
|
||||
}, function error(err) {
|
||||
screenObject.nativeLock = null;
|
||||
resolveOrientation(orientation, resolve, reject);
|
||||
});
|
||||
} else {
|
||||
resolveOrientation(orientation, resolve, reject);
|
||||
}
|
||||
});
|
||||
return p;
|
||||
};
|
||||
screenObject.unlock = function() {
|
||||
screenOrientation.setOrientation('any');
|
||||
};
|
||||
}
|
||||
|
||||
function resolveOrientation(orientation, resolve, reject) {
|
||||
if (!OrientationLockType.hasOwnProperty(orientation)) {
|
||||
var err = new Error();
|
||||
err.name = "NotSupportedError";
|
||||
reject(err); //"cannot change orientation");
|
||||
} else {
|
||||
screenOrientation.setOrientation(orientation);
|
||||
resolve("Orientation set"); // orientation change successful
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
addScreenOrientationApi(screen.orientation);
|
||||
|
||||
var onChangeListener = null;
|
||||
|
||||
Object.defineProperty(screen.orientation, 'onchange', {
|
||||
set: function(listener) {
|
||||
|
||||
if (onChangeListener) {
|
||||
screen.orientation.removeEventListener('change', onChangeListener);
|
||||
}
|
||||
onChangeListener = listener;
|
||||
if (onChangeListener) {
|
||||
screen.orientation.addEventListener('change', onChangeListener);
|
||||
}
|
||||
},
|
||||
get: function() {
|
||||
return (onChangeListener ? onChangeListener : null);
|
||||
},
|
||||
enumerable: true,
|
||||
});
|
||||
|
||||
|
||||
var evtTarget = new XMLHttpRequest(); //document.createElement('div');
|
||||
var orientationchange = function() {
|
||||
setOrientationProperties();
|
||||
var event = document.createEvent('Events');
|
||||
event.initEvent("change", false, false);
|
||||
evtTarget.dispatchEvent(event);
|
||||
};
|
||||
|
||||
screen.orientation.addEventListener = function(a,b,c) {
|
||||
return evtTarget.addEventListener(a,b,c);
|
||||
};
|
||||
|
||||
screen.orientation.removeEventListener = function(a,b,c) {
|
||||
return evtTarget.removeEventListener(a,b,c);
|
||||
};
|
||||
|
||||
function setOrientationProperties() {
|
||||
switch (window.orientation) {
|
||||
case 0:
|
||||
screen.orientation.type = 'portrait-primary';
|
||||
break;
|
||||
case 90:
|
||||
screen.orientation.type = 'landscape-primary';
|
||||
break;
|
||||
case 180:
|
||||
screen.orientation.type = 'portrait-secondary';
|
||||
break;
|
||||
case -90:
|
||||
screen.orientation.type = 'landscape-secondary';
|
||||
break;
|
||||
default:
|
||||
screen.orientation.type = 'portrait-primary';
|
||||
break;
|
||||
}
|
||||
screen.orientation.angle = window.orientation || 0;
|
||||
|
||||
}
|
||||
window.addEventListener("orientationchange", orientationchange, true);
|
||||
|
||||
module.exports = screenOrientation;
|
||||
|
||||
});
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var splashscreen = {
|
||||
show:function() {
|
||||
exec(null, null, "SplashScreen", "show", []);
|
||||
},
|
||||
hide:function() {
|
||||
exec(null, null, "SplashScreen", "hide", []);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = splashscreen;
|
||||
|
||||
});
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) {
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/* global cordova */
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var namedColors = {
|
||||
"black": "#000000",
|
||||
"darkGray": "#A9A9A9",
|
||||
"lightGray": "#D3D3D3",
|
||||
"white": "#FFFFFF",
|
||||
"gray": "#808080",
|
||||
"red": "#FF0000",
|
||||
"green": "#00FF00",
|
||||
"blue": "#0000FF",
|
||||
"cyan": "#00FFFF",
|
||||
"yellow": "#FFFF00",
|
||||
"magenta": "#FF00FF",
|
||||
"orange": "#FFA500",
|
||||
"purple": "#800080",
|
||||
"brown": "#A52A2A"
|
||||
};
|
||||
|
||||
var StatusBar = {
|
||||
|
||||
isVisible: true,
|
||||
|
||||
overlaysWebView: function (doOverlay) {
|
||||
exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
|
||||
},
|
||||
|
||||
styleDefault: function () {
|
||||
// dark text ( to be used on a light background )
|
||||
exec(null, null, "StatusBar", "styleDefault", []);
|
||||
},
|
||||
|
||||
styleLightContent: function () {
|
||||
// light text ( to be used on a dark background )
|
||||
exec(null, null, "StatusBar", "styleLightContent", []);
|
||||
},
|
||||
|
||||
styleBlackTranslucent: function () {
|
||||
// #88000000 ? Apple says to use lightContent instead
|
||||
exec(null, null, "StatusBar", "styleBlackTranslucent", []);
|
||||
},
|
||||
|
||||
styleBlackOpaque: function () {
|
||||
// #FF000000 ? Apple says to use lightContent instead
|
||||
exec(null, null, "StatusBar", "styleBlackOpaque", []);
|
||||
},
|
||||
|
||||
backgroundColorByName: function (colorname) {
|
||||
return StatusBar.backgroundColorByHexString(namedColors[colorname]);
|
||||
},
|
||||
|
||||
backgroundColorByHexString: function (hexString) {
|
||||
if (hexString.charAt(0) !== "#") {
|
||||
hexString = "#" + hexString;
|
||||
}
|
||||
|
||||
if (hexString.length === 4) {
|
||||
var split = hexString.split("");
|
||||
hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
|
||||
}
|
||||
|
||||
exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
|
||||
},
|
||||
|
||||
hide: function () {
|
||||
exec(null, null, "StatusBar", "hide", []);
|
||||
StatusBar.isVisible = false;
|
||||
},
|
||||
|
||||
show: function () {
|
||||
exec(null, null, "StatusBar", "show", []);
|
||||
StatusBar.isVisible = true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// prime it. setTimeout so that proxy gets time to init
|
||||
window.setTimeout(function () {
|
||||
exec(function (res) {
|
||||
if (typeof res == 'object') {
|
||||
if (res.type == 'tap') {
|
||||
cordova.fireWindowEvent('statusTap');
|
||||
}
|
||||
} else {
|
||||
StatusBar.isVisible = res;
|
||||
}
|
||||
}, null, "StatusBar", "_ready", []);
|
||||
}, 0);
|
||||
|
||||
module.exports = StatusBar;
|
||||
|
||||
});
|
||||
+919
@@ -0,0 +1,919 @@
|
||||
cordova.define("cordova-sqlite-storage.SQLitePlugin", function(require, exports, module) {
|
||||
(function() {
|
||||
var DB_STATE_INIT, DB_STATE_OPEN, READ_ONLY_REGEX, SQLiteFactory, SQLitePlugin, SQLitePluginTransaction, SelfTest, argsArray, dblocations, iosLocationMap, newSQLError, nextTick, root, txLocks;
|
||||
|
||||
root = this;
|
||||
|
||||
READ_ONLY_REGEX = /^(\s|;)*(?:alter|create|delete|drop|insert|reindex|replace|update)/i;
|
||||
|
||||
DB_STATE_INIT = "INIT";
|
||||
|
||||
DB_STATE_OPEN = "OPEN";
|
||||
|
||||
txLocks = {};
|
||||
|
||||
newSQLError = function(error, code) {
|
||||
var sqlError;
|
||||
sqlError = error;
|
||||
if (!code) {
|
||||
code = 0;
|
||||
}
|
||||
if (!sqlError) {
|
||||
sqlError = new Error("a plugin had an error but provided no response");
|
||||
sqlError.code = code;
|
||||
}
|
||||
if (typeof sqlError === "string") {
|
||||
sqlError = new Error(error);
|
||||
sqlError.code = code;
|
||||
}
|
||||
if (!sqlError.code && sqlError.message) {
|
||||
sqlError.code = code;
|
||||
}
|
||||
if (!sqlError.code && !sqlError.message) {
|
||||
sqlError = new Error("an unknown error was returned: " + JSON.stringify(sqlError));
|
||||
sqlError.code = code;
|
||||
}
|
||||
return sqlError;
|
||||
};
|
||||
|
||||
nextTick = window.setImmediate || function(fun) {
|
||||
window.setTimeout(fun, 0);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Utility that avoids leaking the arguments object. See
|
||||
https://www.npmjs.org/package/argsarray
|
||||
*/
|
||||
|
||||
argsArray = function(fun) {
|
||||
return function() {
|
||||
var args, i, len;
|
||||
len = arguments.length;
|
||||
if (len) {
|
||||
args = [];
|
||||
i = -1;
|
||||
while (++i < len) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
return fun.call(this, args);
|
||||
} else {
|
||||
return fun.call(this, []);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
SQLitePlugin = function(openargs, openSuccess, openError) {
|
||||
var dbname;
|
||||
if (!(openargs && openargs['name'])) {
|
||||
throw newSQLError("Cannot create a SQLitePlugin db instance without a db name");
|
||||
}
|
||||
dbname = openargs.name;
|
||||
if (typeof dbname !== 'string') {
|
||||
throw newSQLError('sqlite plugin database name must be a string');
|
||||
}
|
||||
this.openargs = openargs;
|
||||
this.dbname = dbname;
|
||||
this.openSuccess = openSuccess;
|
||||
this.openError = openError;
|
||||
this.openSuccess || (this.openSuccess = function() {
|
||||
console.log("DB opened: " + dbname);
|
||||
});
|
||||
this.openError || (this.openError = function(e) {
|
||||
console.log(e.message);
|
||||
});
|
||||
this.open(this.openSuccess, this.openError);
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.databaseFeatures = {
|
||||
isSQLitePluginDatabase: true
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.openDBs = {};
|
||||
|
||||
SQLitePlugin.prototype.addTransaction = function(t) {
|
||||
if (!txLocks[this.dbname]) {
|
||||
txLocks[this.dbname] = {
|
||||
queue: [],
|
||||
inProgress: false
|
||||
};
|
||||
}
|
||||
txLocks[this.dbname].queue.push(t);
|
||||
if (this.dbname in this.openDBs && this.openDBs[this.dbname] !== DB_STATE_INIT) {
|
||||
this.startNextTransaction();
|
||||
} else {
|
||||
if (this.dbname in this.openDBs) {
|
||||
console.log('new transaction is queued, waiting for open operation to finish');
|
||||
} else {
|
||||
console.log('database is closed, new transaction is [stuck] waiting until db is opened again!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.transaction = function(fn, error, success) {
|
||||
if (!this.openDBs[this.dbname]) {
|
||||
error(newSQLError('database not open'));
|
||||
return;
|
||||
}
|
||||
this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, false));
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.readTransaction = function(fn, error, success) {
|
||||
if (!this.openDBs[this.dbname]) {
|
||||
error(newSQLError('database not open'));
|
||||
return;
|
||||
}
|
||||
this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, true));
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.startNextTransaction = function() {
|
||||
var self;
|
||||
self = this;
|
||||
nextTick((function(_this) {
|
||||
return function() {
|
||||
var txLock;
|
||||
if (!(_this.dbname in _this.openDBs) || _this.openDBs[_this.dbname] !== DB_STATE_OPEN) {
|
||||
console.log('cannot start next transaction: database not open');
|
||||
return;
|
||||
}
|
||||
txLock = txLocks[self.dbname];
|
||||
if (!txLock) {
|
||||
console.log('cannot start next transaction: database connection is lost');
|
||||
return;
|
||||
} else if (txLock.queue.length > 0 && !txLock.inProgress) {
|
||||
txLock.inProgress = true;
|
||||
txLock.queue.shift().start();
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.abortAllPendingTransactions = function() {
|
||||
var j, len1, ref, tx, txLock;
|
||||
txLock = txLocks[this.dbname];
|
||||
if (!!txLock && txLock.queue.length > 0) {
|
||||
ref = txLock.queue;
|
||||
for (j = 0, len1 = ref.length; j < len1; j++) {
|
||||
tx = ref[j];
|
||||
tx.abortFromQ(newSQLError('Invalid database handle'));
|
||||
}
|
||||
txLock.queue = [];
|
||||
txLock.inProgress = false;
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.open = function(success, error) {
|
||||
var openerrorcb, opensuccesscb, step2;
|
||||
if (this.dbname in this.openDBs) {
|
||||
console.log('database already open: ' + this.dbname);
|
||||
nextTick((function(_this) {
|
||||
return function() {
|
||||
success(_this);
|
||||
};
|
||||
})(this));
|
||||
} else {
|
||||
console.log('OPEN database: ' + this.dbname);
|
||||
opensuccesscb = (function(_this) {
|
||||
return function() {
|
||||
var txLock;
|
||||
console.log('OPEN database: ' + _this.dbname + ' - OK');
|
||||
if (!_this.openDBs[_this.dbname]) {
|
||||
console.log('database was closed during open operation');
|
||||
}
|
||||
if (_this.dbname in _this.openDBs) {
|
||||
_this.openDBs[_this.dbname] = DB_STATE_OPEN;
|
||||
}
|
||||
if (!!success) {
|
||||
success(_this);
|
||||
}
|
||||
txLock = txLocks[_this.dbname];
|
||||
if (!!txLock && txLock.queue.length > 0 && !txLock.inProgress) {
|
||||
_this.startNextTransaction();
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
openerrorcb = (function(_this) {
|
||||
return function() {
|
||||
console.log('OPEN database: ' + _this.dbname + ' FAILED, aborting any pending transactions');
|
||||
if (!!error) {
|
||||
error(newSQLError('Could not open database'));
|
||||
}
|
||||
delete _this.openDBs[_this.dbname];
|
||||
_this.abortAllPendingTransactions();
|
||||
};
|
||||
})(this);
|
||||
this.openDBs[this.dbname] = DB_STATE_INIT;
|
||||
step2 = (function(_this) {
|
||||
return function() {
|
||||
cordova.exec(opensuccesscb, openerrorcb, "SQLitePlugin", "open", [_this.openargs]);
|
||||
};
|
||||
})(this);
|
||||
cordova.exec(step2, step2, 'SQLitePlugin', 'close', [
|
||||
{
|
||||
path: this.dbname
|
||||
}
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.close = function(success, error) {
|
||||
if (this.dbname in this.openDBs) {
|
||||
if (txLocks[this.dbname] && txLocks[this.dbname].inProgress) {
|
||||
console.log('cannot close: transaction is in progress');
|
||||
error(newSQLError('database cannot be closed while a transaction is in progress'));
|
||||
return;
|
||||
}
|
||||
console.log('CLOSE database: ' + this.dbname);
|
||||
delete this.openDBs[this.dbname];
|
||||
if (txLocks[this.dbname]) {
|
||||
console.log('closing db with transaction queue length: ' + txLocks[this.dbname].queue.length);
|
||||
} else {
|
||||
console.log('closing db with no transaction lock state');
|
||||
}
|
||||
cordova.exec(success, error, "SQLitePlugin", "close", [
|
||||
{
|
||||
path: this.dbname
|
||||
}
|
||||
]);
|
||||
} else {
|
||||
console.log('cannot close: database is not open');
|
||||
if (error) {
|
||||
nextTick(function() {
|
||||
return error();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.executeSql = function(statement, params, success, error) {
|
||||
var myerror, myfn, mysuccess;
|
||||
mysuccess = function(t, r) {
|
||||
if (!!success) {
|
||||
return success(r);
|
||||
}
|
||||
};
|
||||
myerror = function(t, e) {
|
||||
if (!!error) {
|
||||
return error(e);
|
||||
}
|
||||
};
|
||||
myfn = function(tx) {
|
||||
tx.addStatement(statement, params, mysuccess, myerror);
|
||||
};
|
||||
this.addTransaction(new SQLitePluginTransaction(this, myfn, null, null, false, false));
|
||||
};
|
||||
|
||||
SQLitePlugin.prototype.sqlBatch = function(sqlStatements, success, error) {
|
||||
var batchList, j, len1, myfn, st;
|
||||
if (!sqlStatements || sqlStatements.constructor !== Array) {
|
||||
throw newSQLError('sqlBatch expects an array');
|
||||
}
|
||||
batchList = [];
|
||||
for (j = 0, len1 = sqlStatements.length; j < len1; j++) {
|
||||
st = sqlStatements[j];
|
||||
if (st.constructor === Array) {
|
||||
if (st.length === 0) {
|
||||
throw newSQLError('sqlBatch array element of zero (0) length');
|
||||
}
|
||||
batchList.push({
|
||||
sql: st[0],
|
||||
params: st.length === 0 ? [] : st[1]
|
||||
});
|
||||
} else {
|
||||
batchList.push({
|
||||
sql: st,
|
||||
params: []
|
||||
});
|
||||
}
|
||||
}
|
||||
myfn = function(tx) {
|
||||
var elem, k, len2, results;
|
||||
results = [];
|
||||
for (k = 0, len2 = batchList.length; k < len2; k++) {
|
||||
elem = batchList[k];
|
||||
results.push(tx.addStatement(elem.sql, elem.params, null, null));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
this.addTransaction(new SQLitePluginTransaction(this, myfn, error, success, true, false));
|
||||
};
|
||||
|
||||
SQLitePluginTransaction = function(db, fn, error, success, txlock, readOnly) {
|
||||
if (typeof fn !== "function") {
|
||||
|
||||
/*
|
||||
This is consistent with the implementation in Chrome -- it
|
||||
throws if you pass anything other than a function. This also
|
||||
prevents us from stalling our txQueue if somebody passes a
|
||||
false value for fn.
|
||||
*/
|
||||
throw newSQLError("transaction expected a function");
|
||||
}
|
||||
this.db = db;
|
||||
this.fn = fn;
|
||||
this.error = error;
|
||||
this.success = success;
|
||||
this.txlock = txlock;
|
||||
this.readOnly = readOnly;
|
||||
this.executes = [];
|
||||
if (txlock) {
|
||||
this.addStatement("BEGIN", [], null, function(tx, err) {
|
||||
throw newSQLError("unable to begin transaction: " + err.message, err.code);
|
||||
});
|
||||
} else {
|
||||
this.addStatement("SELECT 1", [], null, null);
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.start = function() {
|
||||
var err;
|
||||
try {
|
||||
this.fn(this);
|
||||
this.run();
|
||||
} catch (error1) {
|
||||
err = error1;
|
||||
txLocks[this.db.dbname].inProgress = false;
|
||||
this.db.startNextTransaction();
|
||||
if (this.error) {
|
||||
this.error(newSQLError(err));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.executeSql = function(sql, values, success, error) {
|
||||
if (this.finalized) {
|
||||
throw {
|
||||
message: 'InvalidStateError: DOM Exception 11: This transaction is already finalized. Transactions are committed after its success or failure handlers are called. If you are using a Promise to handle callbacks, be aware that implementations following the A+ standard adhere to run-to-completion semantics and so Promise resolution occurs on a subsequent tick and therefore after the transaction commits.',
|
||||
code: 11
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (this.readOnly && READ_ONLY_REGEX.test(sql)) {
|
||||
this.handleStatementFailure(error, {
|
||||
message: 'invalid sql for a read-only transaction'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.addStatement(sql, values, success, error);
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.addStatement = function(sql, values, success, error) {
|
||||
var j, len1, params, sqlStatement, t, v;
|
||||
sqlStatement = typeof sql === 'string' ? sql : sql.toString();
|
||||
params = [];
|
||||
if (!!values && values.constructor === Array) {
|
||||
for (j = 0, len1 = values.length; j < len1; j++) {
|
||||
v = values[j];
|
||||
t = typeof v;
|
||||
params.push((v === null || v === void 0 ? null : t === 'number' || t === 'string' ? v : v.toString()));
|
||||
}
|
||||
}
|
||||
this.executes.push({
|
||||
success: success,
|
||||
error: error,
|
||||
sql: sqlStatement,
|
||||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.handleStatementSuccess = function(handler, response) {
|
||||
var payload, rows;
|
||||
if (!handler) {
|
||||
return;
|
||||
}
|
||||
rows = response.rows || [];
|
||||
payload = {
|
||||
rows: {
|
||||
item: function(i) {
|
||||
return rows[i];
|
||||
},
|
||||
length: rows.length
|
||||
},
|
||||
rowsAffected: response.rowsAffected || 0,
|
||||
insertId: response.insertId || void 0
|
||||
};
|
||||
handler(this, payload);
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.handleStatementFailure = function(handler, response) {
|
||||
if (!handler) {
|
||||
throw newSQLError("a statement with no error handler failed: " + response.message, response.code);
|
||||
}
|
||||
if (handler(this, response) !== false) {
|
||||
throw newSQLError("a statement error callback did not return false: " + response.message, response.code);
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.run = function() {
|
||||
var batchExecutes, handlerFor, i, mycb, mycbmap, request, tropts, tx, txFailure, waiting;
|
||||
txFailure = null;
|
||||
tropts = [];
|
||||
batchExecutes = this.executes;
|
||||
waiting = batchExecutes.length;
|
||||
this.executes = [];
|
||||
tx = this;
|
||||
handlerFor = function(index, didSucceed) {
|
||||
return function(response) {
|
||||
var err;
|
||||
if (!txFailure) {
|
||||
try {
|
||||
if (didSucceed) {
|
||||
tx.handleStatementSuccess(batchExecutes[index].success, response);
|
||||
} else {
|
||||
tx.handleStatementFailure(batchExecutes[index].error, newSQLError(response));
|
||||
}
|
||||
} catch (error1) {
|
||||
err = error1;
|
||||
txFailure = newSQLError(err);
|
||||
}
|
||||
}
|
||||
if (--waiting === 0) {
|
||||
if (txFailure) {
|
||||
tx.executes = [];
|
||||
tx.abort(txFailure);
|
||||
} else if (tx.executes.length > 0) {
|
||||
tx.run();
|
||||
} else {
|
||||
tx.finish();
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
mycbmap = {};
|
||||
i = 0;
|
||||
while (i < batchExecutes.length) {
|
||||
request = batchExecutes[i];
|
||||
mycbmap[i] = {
|
||||
success: handlerFor(i, true),
|
||||
error: handlerFor(i, false)
|
||||
};
|
||||
tropts.push({
|
||||
sql: request.sql,
|
||||
params: request.params
|
||||
});
|
||||
i++;
|
||||
}
|
||||
mycb = function(result) {
|
||||
var j, q, r, ref, res, resultIndex, type;
|
||||
for (resultIndex = j = 0, ref = result.length - 1; 0 <= ref ? j <= ref : j >= ref; resultIndex = 0 <= ref ? ++j : --j) {
|
||||
r = result[resultIndex];
|
||||
type = r.type;
|
||||
res = r.result;
|
||||
q = mycbmap[resultIndex];
|
||||
if (q) {
|
||||
if (q[type]) {
|
||||
q[type](res);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
cordova.exec(mycb, null, "SQLitePlugin", "backgroundExecuteSqlBatch", [
|
||||
{
|
||||
dbargs: {
|
||||
dbname: this.db.dbname
|
||||
},
|
||||
executes: tropts
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.abort = function(txFailure) {
|
||||
var failed, succeeded, tx;
|
||||
if (this.finalized) {
|
||||
return;
|
||||
}
|
||||
tx = this;
|
||||
succeeded = function(tx) {
|
||||
txLocks[tx.db.dbname].inProgress = false;
|
||||
tx.db.startNextTransaction();
|
||||
if (tx.error && typeof tx.error === 'function') {
|
||||
tx.error(txFailure);
|
||||
}
|
||||
};
|
||||
failed = function(tx, err) {
|
||||
txLocks[tx.db.dbname].inProgress = false;
|
||||
tx.db.startNextTransaction();
|
||||
if (tx.error && typeof tx.error === 'function') {
|
||||
tx.error(newSQLError('error while trying to roll back: ' + err.message, err.code));
|
||||
}
|
||||
};
|
||||
this.finalized = true;
|
||||
if (this.txlock) {
|
||||
this.addStatement("ROLLBACK", [], succeeded, failed);
|
||||
this.run();
|
||||
} else {
|
||||
succeeded(tx);
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.finish = function() {
|
||||
var failed, succeeded, tx;
|
||||
if (this.finalized) {
|
||||
return;
|
||||
}
|
||||
tx = this;
|
||||
succeeded = function(tx) {
|
||||
txLocks[tx.db.dbname].inProgress = false;
|
||||
tx.db.startNextTransaction();
|
||||
if (tx.success && typeof tx.success === 'function') {
|
||||
tx.success();
|
||||
}
|
||||
};
|
||||
failed = function(tx, err) {
|
||||
txLocks[tx.db.dbname].inProgress = false;
|
||||
tx.db.startNextTransaction();
|
||||
if (tx.error && typeof tx.error === 'function') {
|
||||
tx.error(newSQLError('error while trying to commit: ' + err.message, err.code));
|
||||
}
|
||||
};
|
||||
this.finalized = true;
|
||||
if (this.txlock) {
|
||||
this.addStatement("COMMIT", [], succeeded, failed);
|
||||
this.run();
|
||||
} else {
|
||||
succeeded(tx);
|
||||
}
|
||||
};
|
||||
|
||||
SQLitePluginTransaction.prototype.abortFromQ = function(sqlerror) {
|
||||
if (this.error) {
|
||||
this.error(sqlerror);
|
||||
}
|
||||
};
|
||||
|
||||
dblocations = ["docs", "libs", "nosync"];
|
||||
|
||||
iosLocationMap = {
|
||||
'default': 'nosync',
|
||||
'Documents': 'docs',
|
||||
'Library': 'libs'
|
||||
};
|
||||
|
||||
SQLiteFactory = {
|
||||
|
||||
/*
|
||||
NOTE: this function should NOT be translated from Javascript
|
||||
back to CoffeeScript by js2coffee.
|
||||
If this function is edited in Javascript then someone will
|
||||
have to translate it back to CoffeeScript by hand.
|
||||
*/
|
||||
openDatabase: argsArray(function(args) {
|
||||
var dblocation, errorcb, okcb, openargs;
|
||||
if (args.length < 1 || !args[0]) {
|
||||
throw newSQLError('Sorry missing mandatory open arguments object in openDatabase call');
|
||||
}
|
||||
if (args[0].constructor === String) {
|
||||
throw newSQLError('Sorry first openDatabase argument must be an object');
|
||||
}
|
||||
openargs = args[0];
|
||||
if (!openargs.name) {
|
||||
throw newSQLError('Database name value is missing in openDatabase call');
|
||||
}
|
||||
if (!openargs.iosDatabaseLocation && !openargs.location && openargs.location !== 0) {
|
||||
throw newSQLError('Database location or iosDatabaseLocation setting is now mandatory in openDatabase call.');
|
||||
}
|
||||
if (!!openargs.location && !!openargs.iosDatabaseLocation) {
|
||||
throw newSQLError('AMBIGUOUS: both location and iosDatabaseLocation settings are present in openDatabase call. Please use either setting, not both.');
|
||||
}
|
||||
dblocation = !!openargs.location && openargs.location === 'default' ? iosLocationMap['default'] : !!openargs.iosDatabaseLocation ? iosLocationMap[openargs.iosDatabaseLocation] : dblocations[openargs.location];
|
||||
if (!dblocation) {
|
||||
throw newSQLError('Valid iOS database location could not be determined in openDatabase call');
|
||||
}
|
||||
openargs.dblocation = dblocation;
|
||||
if (!!openargs.createFromLocation && openargs.createFromLocation === 1) {
|
||||
openargs.createFromResource = "1";
|
||||
}
|
||||
if (!!openargs.androidDatabaseProvider && !!openargs.androidDatabaseImplementation) {
|
||||
throw newSQLError('AMBIGUOUS: both androidDatabaseProvider and deprecated androidDatabaseImplementation settings are present in openDatabase call. Please drop androidDatabaseImplementation in favor of androidDatabaseProvider.');
|
||||
}
|
||||
if (openargs.androidDatabaseProvider !== void 0 && openargs.androidDatabaseProvider !== 'default' && openargs.androidDatabaseProvider !== 'system') {
|
||||
throw newSQLError("Incorrect androidDatabaseProvider value. Valid values are: 'default', 'system'");
|
||||
}
|
||||
if (!!openargs.androidDatabaseProvider && openargs.androidDatabaseProvider === 'system') {
|
||||
openargs.androidOldDatabaseImplementation = 1;
|
||||
}
|
||||
if (!!openargs.androidDatabaseImplementation && openargs.androidDatabaseImplementation === 2) {
|
||||
openargs.androidOldDatabaseImplementation = 1;
|
||||
}
|
||||
if (!!openargs.androidLockWorkaround && openargs.androidLockWorkaround === 1) {
|
||||
openargs.androidBugWorkaround = 1;
|
||||
}
|
||||
okcb = null;
|
||||
errorcb = null;
|
||||
if (args.length >= 2) {
|
||||
okcb = args[1];
|
||||
if (args.length > 2) {
|
||||
errorcb = args[2];
|
||||
}
|
||||
}
|
||||
return new SQLitePlugin(openargs, okcb, errorcb);
|
||||
}),
|
||||
deleteDatabase: function(first, success, error) {
|
||||
var args, dblocation, dbname;
|
||||
args = {};
|
||||
if (first.constructor === String) {
|
||||
throw newSQLError('Sorry first deleteDatabase argument must be an object');
|
||||
} else {
|
||||
if (!(first && first['name'])) {
|
||||
throw new Error("Please specify db name");
|
||||
}
|
||||
dbname = first.name;
|
||||
if (typeof dbname !== 'string') {
|
||||
throw newSQLError('delete database name must be a string');
|
||||
}
|
||||
args.path = dbname;
|
||||
}
|
||||
if (!first.iosDatabaseLocation && !first.location && first.location !== 0) {
|
||||
throw newSQLError('Database location or iosDatabaseLocation setting is now mandatory in deleteDatabase call.');
|
||||
}
|
||||
if (!!first.location && !!first.iosDatabaseLocation) {
|
||||
throw newSQLError('AMBIGUOUS: both location and iosDatabaseLocation settings are present in deleteDatabase call. Please use either setting value, not both.');
|
||||
}
|
||||
dblocation = !!first.location && first.location === 'default' ? iosLocationMap['default'] : !!first.iosDatabaseLocation ? iosLocationMap[first.iosDatabaseLocation] : dblocations[first.location];
|
||||
if (!dblocation) {
|
||||
throw newSQLError('Valid iOS database location could not be determined in deleteDatabase call');
|
||||
}
|
||||
args.dblocation = dblocation;
|
||||
delete SQLitePlugin.prototype.openDBs[args.path];
|
||||
return cordova.exec(success, error, "SQLitePlugin", "delete", [args]);
|
||||
}
|
||||
};
|
||||
|
||||
SelfTest = {
|
||||
DBNAME: '___$$$___litehelpers___$$$___test___$$$___.db',
|
||||
start: function(successcb, errorcb) {
|
||||
SQLiteFactory.deleteDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, (function() {
|
||||
return SelfTest.step1(successcb, errorcb);
|
||||
}), (function() {
|
||||
return SelfTest.step1(successcb, errorcb);
|
||||
}));
|
||||
},
|
||||
step1: function(successcb, errorcb) {
|
||||
SQLiteFactory.openDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, function(db) {
|
||||
var check1;
|
||||
check1 = false;
|
||||
db.transaction(function(tx) {
|
||||
tx.executeSql('SELECT UPPER("Test") AS upperText', [], function(ignored, resutSet) {
|
||||
if (!resutSet.rows) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows');
|
||||
}
|
||||
if (!resutSet.rows.length) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length');
|
||||
}
|
||||
if (resutSet.rows.length !== 1) {
|
||||
return SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.length value: " + resutSet.rows.length + " (expected: 1)");
|
||||
}
|
||||
if (!resutSet.rows.item(0).upperText) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.item(0).upperText');
|
||||
}
|
||||
if (resutSet.rows.item(0).upperText !== 'TEST') {
|
||||
return SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.item(0).upperText value: " + (resutSet.rows.item(0).upperText) + " (expected: 'TEST')");
|
||||
}
|
||||
check1 = true;
|
||||
}, function(ignored, tx_sql_err) {
|
||||
return SelfTest.finishWithError(errorcb, "TX SQL error: " + tx_sql_err);
|
||||
});
|
||||
}, function(tx_err) {
|
||||
return SelfTest.finishWithError(errorcb, "TRANSACTION error: " + tx_err);
|
||||
}, function() {
|
||||
if (!check1) {
|
||||
return SelfTest.finishWithError(errorcb, 'Did not get expected upperText result data');
|
||||
}
|
||||
db.executeSql('BEGIN', null, function(ignored) {
|
||||
return nextTick(function() {
|
||||
delete db.openDBs[SelfTest.DBNAME];
|
||||
delete txLocks[SelfTest.DBNAME];
|
||||
nextTick(function() {
|
||||
db.transaction(function(tx2) {
|
||||
tx2.executeSql('SELECT 1');
|
||||
}, function(tx_err) {
|
||||
if (!tx_err) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing error object');
|
||||
}
|
||||
SelfTest.step2(successcb, errorcb);
|
||||
}, function() {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing error object');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}, function(open_err) {
|
||||
return SelfTest.finishWithError(errorcb, "Open database error: " + open_err);
|
||||
});
|
||||
},
|
||||
step2: function(successcb, errorcb) {
|
||||
SQLiteFactory.openDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, function(db) {
|
||||
db.transaction(function(tx) {
|
||||
tx.executeSql('SELECT ? AS myResult', [null], function(ignored, resutSet) {
|
||||
if (!resutSet.rows) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows');
|
||||
}
|
||||
if (!resutSet.rows.length) {
|
||||
return SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length');
|
||||
}
|
||||
if (resutSet.rows.length !== 1) {
|
||||
return SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.length value: " + resutSet.rows.length + " (expected: 1)");
|
||||
}
|
||||
SelfTest.step3(successcb, errorcb);
|
||||
});
|
||||
}, function(txError) {
|
||||
return SelfTest.finishWithError(errorcb, "UNEXPECTED TRANSACTION ERROR: " + txError);
|
||||
});
|
||||
}, function(open_err) {
|
||||
return SelfTest.finishWithError(errorcb, "Open database error: " + open_err);
|
||||
});
|
||||
},
|
||||
step3: function(successcb, errorcb) {
|
||||
SQLiteFactory.openDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, function(db) {
|
||||
return db.sqlBatch(['CREATE TABLE TestTable(id integer primary key autoincrement unique, data);', ['INSERT INTO TestTable (data) VALUES (?);', ['test-value']]], function() {
|
||||
var firstid;
|
||||
firstid = -1;
|
||||
return db.executeSql('SELECT id, data FROM TestTable', [], function(resutSet) {
|
||||
if (!resutSet.rows) {
|
||||
SelfTest.finishWithError(errorcb, 'Missing resutSet.rows');
|
||||
return;
|
||||
}
|
||||
if (!resutSet.rows.length) {
|
||||
SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.length');
|
||||
return;
|
||||
}
|
||||
if (resutSet.rows.length !== 1) {
|
||||
SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.length value: " + resutSet.rows.length + " (expected: 1)");
|
||||
return;
|
||||
}
|
||||
if (resutSet.rows.item(0).id === void 0) {
|
||||
SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.item(0).id');
|
||||
return;
|
||||
}
|
||||
firstid = resutSet.rows.item(0).id;
|
||||
if (!resutSet.rows.item(0).data) {
|
||||
SelfTest.finishWithError(errorcb, 'Missing resutSet.rows.item(0).data');
|
||||
return;
|
||||
}
|
||||
if (resutSet.rows.item(0).data !== 'test-value') {
|
||||
SelfTest.finishWithError(errorcb, "Incorrect resutSet.rows.item(0).data value: " + (resutSet.rows.item(0).data) + " (expected: 'test-value')");
|
||||
return;
|
||||
}
|
||||
return db.transaction(function(tx) {
|
||||
return tx.executeSql('UPDATE TestTable SET data = ?', ['new-value']);
|
||||
}, function(tx_err) {
|
||||
return SelfTest.finishWithError(errorcb, "UPDATE transaction error: " + tx_err);
|
||||
}, function() {
|
||||
var readTransactionFinished;
|
||||
readTransactionFinished = false;
|
||||
return db.readTransaction(function(tx2) {
|
||||
return tx2.executeSql('SELECT id, data FROM TestTable', [], function(ignored, resutSet2) {
|
||||
if (!resutSet2.rows) {
|
||||
throw newSQLError('Missing resutSet2.rows');
|
||||
}
|
||||
if (!resutSet2.rows.length) {
|
||||
throw newSQLError('Missing resutSet2.rows.length');
|
||||
}
|
||||
if (resutSet2.rows.length !== 1) {
|
||||
throw newSQLError("Incorrect resutSet2.rows.length value: " + resutSet2.rows.length + " (expected: 1)");
|
||||
}
|
||||
if (!resutSet2.rows.item(0).id) {
|
||||
throw newSQLError('Missing resutSet2.rows.item(0).id');
|
||||
}
|
||||
if (resutSet2.rows.item(0).id !== firstid) {
|
||||
throw newSQLError("resutSet2.rows.item(0).id value " + (resutSet2.rows.item(0).id) + " does not match previous primary key id value (" + firstid + ")");
|
||||
}
|
||||
if (!resutSet2.rows.item(0).data) {
|
||||
throw newSQLError('Missing resutSet2.rows.item(0).data');
|
||||
}
|
||||
if (resutSet2.rows.item(0).data !== 'new-value') {
|
||||
throw newSQLError("Incorrect resutSet2.rows.item(0).data value: " + (resutSet2.rows.item(0).data) + " (expected: 'test-value')");
|
||||
}
|
||||
return readTransactionFinished = true;
|
||||
});
|
||||
}, function(tx2_err) {
|
||||
return SelfTest.finishWithError(errorcb, "readTransaction error: " + tx2_err);
|
||||
}, function() {
|
||||
if (!readTransactionFinished) {
|
||||
SelfTest.finishWithError(errorcb, 'readTransaction did not finish');
|
||||
return;
|
||||
}
|
||||
return db.transaction(function(tx3) {
|
||||
tx3.executeSql('DELETE FROM TestTable');
|
||||
return tx3.executeSql('INSERT INTO TestTable (data) VALUES(?)', [123]);
|
||||
}, function(tx3_err) {
|
||||
return SelfTest.finishWithError(errorcb, "DELETE transaction error: " + tx3_err);
|
||||
}, function() {
|
||||
var secondReadTransactionFinished;
|
||||
secondReadTransactionFinished = false;
|
||||
return db.readTransaction(function(tx4) {
|
||||
return tx4.executeSql('SELECT id, data FROM TestTable', [], function(ignored, resutSet3) {
|
||||
if (!resutSet3.rows) {
|
||||
throw newSQLError('Missing resutSet3.rows');
|
||||
}
|
||||
if (!resutSet3.rows.length) {
|
||||
throw newSQLError('Missing resutSet3.rows.length');
|
||||
}
|
||||
if (resutSet3.rows.length !== 1) {
|
||||
throw newSQLError("Incorrect resutSet3.rows.length value: " + resutSet3.rows.length + " (expected: 1)");
|
||||
}
|
||||
if (!resutSet3.rows.item(0).id) {
|
||||
throw newSQLError('Missing resutSet3.rows.item(0).id');
|
||||
}
|
||||
if (resutSet3.rows.item(0).id === firstid) {
|
||||
throw newSQLError("resutSet3.rows.item(0).id value " + (resutSet3.rows.item(0).id) + " incorrectly matches previous unique key id value value (" + firstid + ")");
|
||||
}
|
||||
if (!resutSet3.rows.item(0).data) {
|
||||
throw newSQLError('Missing resutSet3.rows.item(0).data');
|
||||
}
|
||||
if (resutSet3.rows.item(0).data !== 123) {
|
||||
throw newSQLError("Incorrect resutSet3.rows.item(0).data value: " + (resutSet3.rows.item(0).data) + " (expected 123)");
|
||||
}
|
||||
return secondReadTransactionFinished = true;
|
||||
});
|
||||
}, function(tx4_err) {
|
||||
return SelfTest.finishWithError(errorcb, "second readTransaction error: " + tx4_err);
|
||||
}, function() {
|
||||
if (!secondReadTransactionFinished) {
|
||||
SelfTest.finishWithError(errorcb, 'second readTransaction did not finish');
|
||||
return;
|
||||
}
|
||||
db.close(function() {
|
||||
SelfTest.cleanupAndFinish(successcb, errorcb);
|
||||
}, function(close_err) {
|
||||
SelfTest.finishWithError(errorcb, "close error: " + close_err);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}, function(select_err) {
|
||||
return SelfTest.finishWithError(errorcb, "SELECT error: " + select_err);
|
||||
});
|
||||
}, function(batch_err) {
|
||||
return SelfTest.finishWithError(errorcb, "sql batch error: " + batch_err);
|
||||
});
|
||||
}, function(open_err) {
|
||||
return SelfTest.finishWithError(errorcb, "Open database error: " + open_err);
|
||||
});
|
||||
},
|
||||
cleanupAndFinish: function(successcb, errorcb) {
|
||||
SQLiteFactory.deleteDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, successcb, function(cleanup_err) {
|
||||
SelfTest.finishWithError(errorcb, "CLEANUP DELETE ERROR: " + cleanup_err);
|
||||
});
|
||||
},
|
||||
finishWithError: function(errorcb, message) {
|
||||
console.log("selfTest ERROR with message: " + message);
|
||||
SQLiteFactory.deleteDatabase({
|
||||
name: SelfTest.DBNAME,
|
||||
location: 'default'
|
||||
}, function() {
|
||||
errorcb(newSQLError(message));
|
||||
}, function(err2) {
|
||||
console.log("selfTest CLEANUP DELETE ERROR " + err2);
|
||||
errorcb(newSQLError("CLEANUP DELETE ERROR: " + err2 + " for error: " + message));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
root.sqlitePlugin = {
|
||||
sqliteFeatures: {
|
||||
isSQLitePlugin: true
|
||||
},
|
||||
echoTest: function(okcb, errorcb) {
|
||||
var error, ok;
|
||||
ok = function(s) {
|
||||
if (s === 'test-string') {
|
||||
return okcb();
|
||||
} else {
|
||||
return errorcb("Mismatch: got: '" + s + "' expected 'test-string'");
|
||||
}
|
||||
};
|
||||
error = function(e) {
|
||||
return errorcb(e);
|
||||
};
|
||||
return cordova.exec(ok, error, "SQLitePlugin", "echoStringValue", [
|
||||
{
|
||||
value: 'test-string'
|
||||
}
|
||||
]);
|
||||
},
|
||||
selfTest: SelfTest.start,
|
||||
openDatabase: SQLiteFactory.openDatabase,
|
||||
deleteDatabase: SQLiteFactory.deleteDatabase
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user