diff --git a/2.0/project/one2/config.xml b/2.0/project/one2/config.xml index f8082a1..4db5b79 100644 --- a/2.0/project/one2/config.xml +++ b/2.0/project/one2/config.xml @@ -1,24 +1,20 @@ - - - ONE - - ONE Unofficial App. - - 一个 - - anpho - - - - - - - - - - - - - - - + + ONE + 一个 + ONE Unofficial App. + + + + + + + + + + + + + anpho + \ No newline at end of file diff --git a/2.0/project/one2/img/logo.png b/2.0/project/one2/img/logo.png new file mode 100644 index 0000000..c04af27 Binary files /dev/null and b/2.0/project/one2/img/logo.png differ diff --git a/2.0/project/one2/platforms/blackberry10/VERSION b/2.0/project/one2/platforms/blackberry10/VERSION index 0762dcf..3c22956 100644 --- a/2.0/project/one2/platforms/blackberry10/VERSION +++ b/2.0/project/one2/platforms/blackberry10/VERSION @@ -1 +1 @@ -v2.1.0.13 +v2.2.0.15 diff --git a/2.0/project/one2/platforms/blackberry10/build/device/bb10app.bar b/2.0/project/one2/platforms/blackberry10/build/device/bb10app.bar deleted file mode 100644 index 2d52232..0000000 Binary files a/2.0/project/one2/platforms/blackberry10/build/device/bb10app.bar and /dev/null differ diff --git a/2.0/project/one2/platforms/blackberry10/build/device/bb10app.zip b/2.0/project/one2/platforms/blackberry10/build/device/bb10app.zip deleted file mode 100644 index 1a2c804..0000000 Binary files a/2.0/project/one2/platforms/blackberry10/build/device/bb10app.zip and /dev/null differ diff --git a/2.0/project/one2/platforms/blackberry10/build/options b/2.0/project/one2/platforms/blackberry10/build/options deleted file mode 100644 index 8a22dd2..0000000 --- a/2.0/project/one2/platforms/blackberry10/build/options +++ /dev/null @@ -1,79 +0,0 @@ --package --buildId -607 -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\device\bb10app.bar --barVersion -1.5 --C -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src -bar-descriptor.xml -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\about.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\about_tw.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\cached.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\calendar.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\config.xml -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\cordova.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\cordova_plugins.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\index.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\main.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\settings.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\wwe -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\frameworkModules.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\index.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\require.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\ui.html -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\lib\exception.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\chrome\lib\utils.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\css\bbui.css -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\css\one.css -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\153. Calendar - month.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\BFB1.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\BFB2.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_browser.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_delete.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_email.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_favorite.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_feedback.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_help.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_history.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_info.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_notes.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_settings.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_share.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\ic_view_image.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\logo.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\splash-1280x720.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\splash-1280x768.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\splash-720x1280.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\splash-720x720.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\splash-768x1280.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\img\welcome.png -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\app.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\bbui.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\bfb_bootstrap.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\bfb_bootstrap.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\cache.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\cache.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\chinese.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\hammer.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\i18n.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\jquery-2.1.0.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\one.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\one.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\shortcut.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\shortcut.min.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\js\translation.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.app\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.invoke\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.invoke.card\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.io\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.io.filetransfer\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.system\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.ui.contextmenu\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.ui.dialog\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\com.blackberry.ui.toast\www\client.js -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\jnext\auth.txt -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\jnext\libfiletransfer.so -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\jnext\libjpps.so -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\jnext\libutils.so -C:\Users\Merrick\Documents\GitHub\one\2.0\project\one2\platforms\blackberry10\build\src\plugins\org.apache.cordova.splashscreen\www\splashscreen.js diff --git a/2.0/project/one2/platforms/blackberry10/build/simulator/bb10app.bar b/2.0/project/one2/platforms/blackberry10/build/simulator/bb10app.bar deleted file mode 100644 index 9b1ff6b..0000000 Binary files a/2.0/project/one2/platforms/blackberry10/build/simulator/bb10app.bar and /dev/null differ diff --git a/2.0/project/one2/platforms/blackberry10/cordova/bb10-ndk-version b/2.0/project/one2/platforms/blackberry10/cordova/bb10-ndk-version index cdbadf6..3964910 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/bb10-ndk-version +++ b/2.0/project/one2/platforms/blackberry10/cordova/bb10-ndk-version @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash < ', 'Signing key password') .option('-buildId ', '[deprecated] Use --buildId.') @@ -30,7 +30,8 @@ command .option('-p, --params ', 'Specifies additional parameters to pass to downstream tools.') .option('--appdesc ', 'Optionally specifies the path to the bar descriptor file (bar-descriptor.xml). For internal use only.') .option('-v, --verbose', 'Turn on verbose messages') - .option('-l, --loglevel ', 'set the logging level (error, warn, verbose)'); + .option('-l, --loglevel ', 'set the logging level (error, warn, verbose)') + .option('--signing', 'indicates the build process is trying to sign the app'); // --signing won't be passed to blackberry-nativepackager, package-validator.js uses this flag to check indicate if it is signing function parseArgs(args) { var option, @@ -50,14 +51,14 @@ function parseArgs(args) { command.parse(args); //Check for any invalid command line args - for (i = 0; i < args.length; i++) { - //Remove leading dashes if any - option = args[i].substring(2); - if (args[i].indexOf("--") === 0 && !command[option]) { - throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", args[i]); + args.forEach(function (arg) { + if (typeof arg === "string" && arg.indexOf("--") === 0) { + var option = arg.substring(2); + if (!command[option]) { + throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", arg); + } } - } - + }); return this; } diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/config-parser.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/config-parser.js index 3fb87c8..a0c6d83 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/config-parser.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/config-parser.js @@ -151,6 +151,7 @@ function processWidgetData(data, widgetConfig, session) { widgetConfig.autoDeferNetworkingAndJavaScript = true; widgetConfig.theme = "default"; widgetConfig.autoHideSplashScreen = "true"; + widgetConfig.useSpatialNavigation = false; //set locally available features to access list if (data.feature) { @@ -539,6 +540,7 @@ function processNameAndDescription(data, widgetConfig) { function processCordovaPreferences(data, widgetConfig) { if (data.preference) { var preference = JSON.parse(JSON.stringify(processParamObj(data.preference)).toLowerCase()), + spatialNavigation = preference.spatialnavigation, hideFormControl = preference.hidekeyboardformaccessorybar; widgetConfig.packageCordovaJs = preference.packagecordovajs === "enable"; @@ -555,7 +557,7 @@ function processCordovaPreferences(data, widgetConfig) { } // - if (preference.hidekeyboardformaccessorybar) { + if (hideFormControl) { widgetConfig.enableFormControl = (hideFormControl !== 'enable') && (hideFormControl !== 'true'); } @@ -591,6 +593,11 @@ function processCordovaPreferences(data, widgetConfig) { if (preference.diskcache) { widgetConfig.enableDiskCache = (preference.diskcache === 'enable'); } + + // + if (spatialNavigation) { + widgetConfig.useSpatialNavigation = (spatialNavigation === 'enable') || (spatialNavigation === 'true'); + } } } diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/localize.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/localize.js index 571304d..1f9ed01 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/localize.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/localize.js @@ -29,13 +29,13 @@ var Localize = require("localize"), "en": "Build ID set in config.xml [version], but signing key file was not found: $[1]" }, "EXCEPTION_MISSING_SIGNING_PASSWORD": { - "en": "Cannot sign application - No signing password provided [-g]" + "en": "Cannot sign application - No signing password provided [--keystorepass]" }, "WARNING_SIGNING_PASSWORD_EXPECTED": { - "en": "Build ID set in config.xml [version], but no signing password was provided [-g]. Bar will be unsigned" + "en": "Build ID set in config.xml [version], but no signing password was provided [--keystorepass]. Bar will be unsigned" }, "EXCEPTION_DEBUG_TOKEN_NOT_FOUND": { - "en": "Failed to find debug token. If you have an existing debug token, please copy it to $[1]/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute the 'run' command." + "en": "Failed to find debug token. If you have an existing debug token, please copy it to $[1]. To generate a new debug token, execute the 'run' command." }, "EXCEPTION_DEBUG_TOKEN_WRONG_FILE_EXTENSION": { "en": "Specified debug token not a .bar extension" diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/native-packager.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/native-packager.js index 0ffc0b4..9f53779 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/native-packager.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/native-packager.js @@ -218,7 +218,7 @@ function generateOptionsFile(session, target, config) { optionsStr += "-debugToken" + NL; optionsStr += conf.DEBUG_TOKEN + NL; } else { - logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND", pkgrUtils.homedir())); + logger.warn(localize.translate("EXCEPTION_DEBUG_TOKEN_NOT_FOUND", path.join(pkgrUtils.homedir(), '.cordova', 'blackberry10debugtoken.bar'))); } optionsStr += "-devMode" + NL; } diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/packager-validator.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/packager-validator.js index 985e137..c60caf0 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/packager-validator.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/packager-validator.js @@ -40,6 +40,7 @@ _self = { keysPassword = session.storepass && typeof session.storepass === "string", commandLinebuildId = session.buildId && typeof session.buildId === "string",//--buildId buildId = widgetConfig.buildId && typeof widgetConfig.buildId === "string",//Finalized Build ID + signing = session.signing, //Constants AUTHOR_P12 = "author.p12", @@ -55,35 +56,37 @@ _self = { throw localize.translate("EXCEPTION_MISSING_SIGNING_KEY_FILE", file); }; - //If -g or --buildId is set, but signing key files are missing, throw an error - if (keysPassword || commandLinebuildId) { - if (!keysFound) { - signingFileError(AUTHOR_P12); - } else if (keysDefault && !cskFound && !bbidFound) { - //Only warn about BBID since the old tokens are deprecated - signingFileError(BARSIGNER_BBID); - } else if (keysDefault && cskFound && !dbFound) { - signingFileError(BARSIGNER_DB); - } + if (signing) { + //If -g or --buildId is set, but signing key files are missing, throw an error + if ((keysPassword || commandLinebuildId)) { + if (!keysFound) { + signingFileError(AUTHOR_P12); + } else if (keysDefault && !cskFound && !bbidFound) { + //Only warn about BBID since the old tokens are deprecated + signingFileError(BARSIGNER_BBID); + } else if (keysDefault && cskFound && !dbFound) { + signingFileError(BARSIGNER_DB); + } - //If a buildId exists in config, but no keys were found, throw a warning - } else if (buildId) { - if (!keysFound) { - signingFileWarn(AUTHOR_P12); - } else if (keysDefault && !cskFound && !bbidFound) { - //Only warn about BBID since the old tokens are deprecated - signingFileWarn(BARSIGNER_BBID); - } else if (keysDefault && cskFound && !dbFound) { - signingFileWarn(BARSIGNER_DB); + //If a buildId exists in config, but no keys were found, throw a warning + } else if (buildId) { + if (!keysFound) { + signingFileWarn(AUTHOR_P12); + } else if (keysDefault && !cskFound && !bbidFound) { + //Only warn about BBID since the old tokens are deprecated + signingFileWarn(BARSIGNER_BBID); + } else if (keysDefault && cskFound && !dbFound) { + signingFileWarn(BARSIGNER_DB); + } } - } - if (commandLinebuildId && !keysPassword) { - //if --buildId was provided with NO password, throw error - throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD"); + if (commandLinebuildId && !keysPassword) { + //if --buildId was provided with NO password, throw error + throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD"); + } } - //if --appdesc was provided, but the file is not existing, throw an error + //if --appdesc was provided, but the file does not exist, throw an error if (session.appdesc && !fs.existsSync(session.appdesc)) { throw localize.translate("EXCEPTION_APPDESC_NOT_FOUND", session.appdesc); } diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/run-utils.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/run-utils.js index 78df1fc..fb7fefd 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/run-utils.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/run-utils.js @@ -99,7 +99,7 @@ function validateTarget(options, targetName, allDone) { } } - if (!deployTarget.password && deployTarget.password !== "") { + if (err === undefined && !deployTarget.password && deployTarget.password !== "") { if (options.devicepass || options.devicepass === "") { deployTarget.password = options.devicepass; } else { diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/session.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/session.js index 3dd8763..7cd8af1 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/session.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/session.js @@ -57,7 +57,8 @@ module.exports = { buildId = cmdline.buildId, signerParams = getParams("blackberry-signer", cmdline) || {}, keystore = signerParams["-keystore"], - bbidtoken = signerParams["-bbidtoken"]; + bbidtoken = signerParams["-bbidtoken"], + signing = cmdline.signing; //If -o option was not provided, default output location is the same as .zip outputDir = outputDir || path.dirname(archivePath); @@ -113,6 +114,7 @@ module.exports = { "storepass": signingPassword, "buildId": buildId, "appdesc" : appdesc, + "signing" : signing, getParams: function (toolName) { return getParams(toolName, cmdline); }, diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/signing-utils.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/signing-utils.js index 60445b3..2f3b398 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/signing-utils.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/signing-utils.js @@ -30,12 +30,12 @@ function getDefaultPath(file) { // UNIX or Linux: ~/.rim var p = ""; if (os.type().toLowerCase().indexOf("windows") >= 0) { - // Try Windows XP location - p = process.env.USERPROFILE + "\\Local Settings\\Application Data\\Research In Motion\\"; - if (!fs.existsSync(p)) { - // Try Windows Vista and Windows 7 location - p = process.env.USERPROFILE + "\\AppData\\Local\\Research In Motion\\"; - } + p = process.env.LOCALAPPDATA === undefined ? + /* ...-XP */ + process.env.USERPROFILE + "\\Local Settings\\Application Data" : + /* Vista+ */ + process.env.LOCALAPPDATA; + p += "\\Research In Motion\\"; } else if (os.type().toLowerCase().indexOf("darwin") >= 0) { // Try Mac OS location p = process.env.HOME + "/Library/Research In Motion/"; diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/target-utils.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/target-utils.js index b3395c1..bb3b34d 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/target-utils.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/target-utils.js @@ -209,7 +209,7 @@ _self = { fs.readFile(pathVmDhcpLeases, 'utf8', function (err, data) { if (!err) { // Find all lines that start with "lease xxx.xxx.xxx.xxx " - dhcpIPs = data.match(/lease \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} /g); + dhcpIPs = data.match(/lease \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} /g) || []; dhcpIPs = dhcpIPs.map(function (result) { return result.substr(6, result.indexOf(' ', 7) - 6); }); diff --git a/2.0/project/one2/platforms/blackberry10/cordova/lib/utils.js b/2.0/project/one2/platforms/blackberry10/cordova/lib/utils.js index df5e9b7..944ce7e 100644 --- a/2.0/project/one2/platforms/blackberry10/cordova/lib/utils.js +++ b/2.0/project/one2/platforms/blackberry10/cordova/lib/utils.js @@ -300,7 +300,12 @@ _self = { }, getProperties: function () { - var props = require(_self.getPropertiesFilePath()); + var props; + try { + props = require(_self.getPropertiesFilePath()); + } catch (e) { + props = {}; + } if (!props.targets) { props.targets = {}; } diff --git a/2.0/project/one2/platforms/blackberry10/lib/cordova.v2.1.0.13/javascript/cordova.js b/2.0/project/one2/platforms/blackberry10/lib/cordova.v2.2.0.15/javascript/cordova.js similarity index 89% rename from 2.0/project/one2/platforms/blackberry10/lib/cordova.v2.1.0.13/javascript/cordova.js rename to 2.0/project/one2/platforms/blackberry10/lib/cordova.v2.2.0.15/javascript/cordova.js index eb28874..1f40cd1 100644 --- a/2.0/project/one2/platforms/blackberry10/lib/cordova.v2.1.0.13/javascript/cordova.js +++ b/2.0/project/one2/platforms/blackberry10/lib/cordova.v2.2.0.15/javascript/cordova.js @@ -1,5 +1,5 @@ // Platform: blackberry10 -// 3.5.0-dev-2beb2fa +// 3.6.0-dev-7e845f3 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var CORDOVA_JS_BUILD_LABEL = '3.5.0-dev-2beb2fa'; +var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-7e845f3'; // file: src/scripts/require.js /*jshint -W079 */ @@ -392,6 +392,16 @@ base64.fromArrayBuffer = function(arrayBuffer) { return uint8ToBase64(array); }; +base64.toArrayBuffer = function(str) { + var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary'); + var arrayBuffer = new ArrayBuffer(decodedStr.length); + var array = new Uint8Array(arrayBuffer); + for (var i=0, len=decodedStr.length; i < len; i++) { + array[i] = decodedStr.charCodeAt(i); + } + return arrayBuffer; +}; + //------------------------------------------------------------------------------ /* This code is based on the performance tests at http://jsperf.com/b64tests @@ -770,6 +780,7 @@ channel.createSticky('onNativeReady'); channel.createSticky('onCordovaReady'); // Event to indicate that all automatically loaded JS plugins are loaded and ready. +// FIXME remove this channel.createSticky('onPluginsReady'); // Event to indicate that Cordova is ready @@ -1039,9 +1050,13 @@ modulemapper.clobbers('cordova/exec', 'Cordova.exec'); // Call the platform-specific initialization. platform.bootstrap && platform.bootstrap(); -pluginloader.load(function() { - channel.onPluginsReady.fire(); -}); +// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. +// The delay allows the attached modules to be defined before the plugin loader looks for them. +setTimeout(function() { + pluginloader.load(function() { + channel.onPluginsReady.fire(); + }); +}, 0); /** * Create all cordova objects once native side is ready. @@ -1064,6 +1079,111 @@ channel.join(function() { }, platformInitChannelsArray); +}); + +// file: src/common/init_b.js +define("cordova/init_b", function(require, exports, module) { + +var channel = require('cordova/channel'); +var cordova = require('cordova'); +var platform = require('cordova/platform'); + +var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady]; + +// setting exec +cordova.exec = require('cordova/exec'); + +function logUnfiredChannels(arr) { + for (var i = 0; i < arr.length; ++i) { + if (arr[i].state != 2) { + console.log('Channel not fired: ' + arr[i].type); + } + } +} + +window.setTimeout(function() { + if (channel.onDeviceReady.state != 2) { + console.log('deviceready has not fired after 5 seconds.'); + logUnfiredChannels(platformInitChannelsArray); + logUnfiredChannels(channel.deviceReadyChannelsArray); + } +}, 5000); + +// Replace navigator before any modules are required(), to ensure it happens as soon as possible. +// We replace it so that properties that can't be clobbered can instead be overridden. +function replaceNavigator(origNavigator) { + var CordovaNavigator = function() {}; + CordovaNavigator.prototype = origNavigator; + var newNavigator = new CordovaNavigator(); + // This work-around really only applies to new APIs that are newer than Function.bind. + // Without it, APIs such as getGamepads() break. + if (CordovaNavigator.bind) { + for (var key in origNavigator) { + if (typeof origNavigator[key] == 'function') { + newNavigator[key] = origNavigator[key].bind(origNavigator); + } + } + } + return newNavigator; +} +if (window.navigator) { + window.navigator = replaceNavigator(window.navigator); +} + +if (!window.console) { + window.console = { + log: function(){} + }; +} +if (!window.console.warn) { + window.console.warn = function(msg) { + this.log("warn: " + msg); + }; +} + +// Register pause, resume and deviceready channels as events on document. +channel.onPause = cordova.addDocumentEventHandler('pause'); +channel.onResume = cordova.addDocumentEventHandler('resume'); +channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); + +// Listen for DOMContentLoaded and notify our channel subscribers. +if (document.readyState == 'complete' || document.readyState == 'interactive') { + channel.onDOMContentLoaded.fire(); +} else { + document.addEventListener('DOMContentLoaded', function() { + channel.onDOMContentLoaded.fire(); + }, false); +} + +// _nativeReady is global variable that the native side can set +// to signify that the native code is ready. It is a global since +// it may be called before any cordova JS is ready. +if (window._nativeReady) { + channel.onNativeReady.fire(); +} + +// Call the platform-specific initialization. +platform.bootstrap && platform.bootstrap(); + +/** + * Create all cordova objects once native side is ready. + */ +channel.join(function() { + + platform.initialize && platform.initialize(); + + // Fire event to notify that all objects are created + channel.onCordovaReady.fire(); + + // Fire onDeviceReady event once page has fully loaded, all + // constructors have run and cordova info has been received from native + // side. + channel.join(function() { + require('cordova').fireDocumentEvent('deviceready'); + }, channel.deviceReadyChannelsArray); + +}, platformInitChannelsArray); + }); // file: src/common/modulemapper.js @@ -1216,43 +1336,51 @@ var modulemapper = require('cordova/modulemapper'); var urlutil = require('cordova/urlutil'); // Helper function to inject a + +``` + +## Documentation + +### Collections + +* [each](#each) +* [map](#map) +* [filter](#filter) +* [reject](#reject) +* [reduce](#reduce) +* [detect](#detect) +* [sortBy](#sortBy) +* [some](#some) +* [every](#every) +* [concat](#concat) + +### Control Flow + +* [series](#series) +* [parallel](#parallel) +* [whilst](#whilst) +* [doWhilst](#doWhilst) +* [until](#until) +* [doUntil](#doUntil) +* [forever](#forever) +* [waterfall](#waterfall) +* [compose](#compose) +* [applyEach](#applyEach) +* [queue](#queue) +* [cargo](#cargo) +* [auto](#auto) +* [iterator](#iterator) +* [apply](#apply) +* [nextTick](#nextTick) +* [times](#times) +* [timesSeries](#timesSeries) + +### Utils + +* [memoize](#memoize) +* [unmemoize](#unmemoize) +* [log](#log) +* [dir](#dir) +* [noConflict](#noConflict) + + +## Collections + + + +### each(arr, iterator, callback) + +Applies an iterator function to each item in an array, in parallel. +The iterator is called with an item from the list and a callback for when it +has finished. If the iterator passes an error to this callback, the main +callback for the each function is immediately called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err) which must be called once it has + completed. If no error has occured, the callback should be run without + arguments or with an explicit null argument. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +--------------------------------------- + + + +### eachSeries(arr, iterator, callback) + +The same as each only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. This means the iterator functions will complete in order. + + +--------------------------------------- + + + +### eachLimit(arr, limit, iterator, callback) + +The same as each only no more than "limit" iterators will be simultaneously +running at any time. + +Note that the items are not processed in batches, so there is no guarantee that + the first "limit" iterator functions will complete before any others are +started. + +__Arguments__ + +* arr - An array to iterate over. +* limit - The maximum number of iterators to run at any time. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err) which must be called once it has + completed. If no error has occured, the callback should be run without + arguments or with an explicit null argument. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + +```js +// Assume documents is an array of JSON objects and requestApi is a +// function that interacts with a rate-limited REST api. + +async.eachLimit(documents, 20, requestApi, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +--------------------------------------- + + +### map(arr, iterator, callback) + +Produces a new array of values by mapping each value in the given array through +the iterator function. The iterator is called with an item from the array and a +callback for when it has finished processing. The callback takes 2 arguments, +an error and the transformed item from the array. If the iterator passes an +error to this callback, the main callback for the map function is immediately +called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order, however +the results array will be in the same order as the original array. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, transformed) which must be called once + it has completed with an error (which can be null) and a transformed item. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array of the + transformed items from the original array. + +__Example__ + +```js +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +--------------------------------------- + + +### mapSeries(arr, iterator, callback) + +The same as map only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + + +--------------------------------------- + + +### mapLimit(arr, limit, iterator, callback) + +The same as map only no more than "limit" iterators will be simultaneously +running at any time. + +Note that the items are not processed in batches, so there is no guarantee that + the first "limit" iterator functions will complete before any others are +started. + +__Arguments__ + +* arr - An array to iterate over. +* limit - The maximum number of iterators to run at any time. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, transformed) which must be called once + it has completed with an error (which can be null) and a transformed item. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array of the + transformed items from the original array. + +__Example__ + +```js +async.map(['file1','file2','file3'], 1, fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +--------------------------------------- + + +### filter(arr, iterator, callback) + +__Alias:__ select + +Returns a new array of all the values which pass an async truth test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(results) - A callback which is called after all the iterator + functions have finished. + +__Example__ + +```js +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); +``` + +--------------------------------------- + + +### filterSeries(arr, iterator, callback) + +__alias:__ selectSeries + +The same as filter only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + +--------------------------------------- + + +### reject(arr, iterator, callback) + +The opposite of filter. Removes values that pass an async truth test. + +--------------------------------------- + + +### rejectSeries(arr, iterator, callback) + +The same as reject, only the iterator is applied to each item in the array +in series. + + +--------------------------------------- + + +### reduce(arr, memo, iterator, callback) + +__aliases:__ inject, foldl + +Reduces a list of values into a single value using an async iterator to return +each successive step. Memo is the initial state of the reduction. This +function only operates in series. For performance reasons, it may make sense to +split a call to this function into a parallel map, then use the normal +Array.prototype.reduce on the results. This function is for situations where +each step in the reduction needs to be async, if you can get the data before +reducing it then it's probably a good idea to do so. + +__Arguments__ + +* arr - An array to iterate over. +* memo - The initial state of the reduction. +* iterator(memo, item, callback) - A function applied to each item in the + array to produce the next step in the reduction. The iterator is passed a + callback(err, reduction) which accepts an optional error as its first + argument, and the state of the reduction as the second. If an error is + passed to the callback, the reduction is stopped and the main callback is + immediately called with the error. +* callback(err, result) - A callback which is called after all the iterator + functions have finished. Result is the reduced value. + +__Example__ + +```js +async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); +}, function(err, result){ + // result is now equal to the last value of memo, which is 6 +}); +``` + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, callback) + +__Alias:__ foldr + +Same as reduce, only operates on the items in the array in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, callback) + +Returns the first value in a list that passes an async truth test. The +iterator is applied in parallel, meaning the first iterator to return true will +fire the detect callback with that result. That means the result might not be +the first item in the original array (in terms of order) that passes the test. + +If order within the original array is important then look at detectSeries. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value undefined if none passed. + +__Example__ + +```js +async.detect(['file1','file2','file3'], fs.exists, function(result){ + // result now equals the first file in the list that exists +}); +``` + +--------------------------------------- + + +### detectSeries(arr, iterator, callback) + +The same as detect, only the iterator is applied to each item in the array +in series. This means the result is always the first in the original array (in +terms of array order) that passes the truth test. + + +--------------------------------------- + + +### sortBy(arr, iterator, callback) + +Sorts a list by the results of running each value through an async iterator. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, sortValue) which must be called once it + has completed with an error (which can be null) and a value to use as the sort + criteria. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is the items from + the original array sorted by the values returned by the iterator calls. + +__Example__ + +```js +async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); +}, function(err, results){ + // results is now the original array of files sorted by + // modified date +}); +``` + +--------------------------------------- + + +### some(arr, iterator, callback) + +__Alias:__ any + +Returns true if at least one element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. Once any iterator +call returns true, the main callback is immediately called. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + either true or false depending on the values of the async tests. + +__Example__ + +```js +async.some(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then at least one of the files exists +}); +``` + +--------------------------------------- + + +### every(arr, iterator, callback) + +__Alias:__ all + +Returns true if every element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like fs.exists. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback(truthValue) which must be called with a + boolean argument once it has completed. +* callback(result) - A callback which is called after all the iterator + functions have finished. Result will be either true or false depending on + the values of the async tests. + +__Example__ + +```js +async.every(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then every file exists +}); +``` + +--------------------------------------- + + +### concat(arr, iterator, callback) + +Applies an iterator to each item in a list, concatenating the results. Returns the +concatenated list. The iterators are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of the arguments passed to the iterator function. + +__Arguments__ + +* arr - An array to iterate over +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback(err, results) which must be called once it + has completed with an error (which can be null) and an array of results. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array containing + the concatenated results of the iterator function. + +__Example__ + +```js +async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories +}); +``` + +--------------------------------------- + + +### concatSeries(arr, iterator, callback) + +Same as async.concat, but executes in series instead of parallel. + + +## Control Flow + + +### series(tasks, [callback]) + +Run an array of functions in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run and the callback for the series is +immediately called with the value of the error. Once the tasks have completed, +the results are passed to the final callback as an array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.series. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + } +], +// optional callback +function(err, results){ + // results is now equal to ['one', 'two'] +}); + + +// an example using an object instead of an array +async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equal to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run an array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main callback is immediately called with the value of the error. +Once the tasks have completed, the results are passed to the final callback as an +array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.parallel. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + } +], +// optional callback +function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}); + + +// an example using an object instead of an array +async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equals to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallelLimit(tasks, limit, [callback]) + +The same as parallel only the tasks are executed in parallel with a maximum of "limit" +tasks executing at any time. + +Note that the tasks are not executed in batches, so there is no guarantee that +the first "limit" tasks will complete before any others are started. + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback(err, result) it must call on completion with an error (which can + be null) and an optional result value. +* limit - The maximum number of tasks to run at any time. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call fn, while test returns true. Calls the callback when stopped, +or an error occurs. + +__Arguments__ + +* test() - synchronous truth test to perform before each execution of fn. +* fn(callback) - A function to call each time the test passes. The function is + passed a callback(err) which must be called once it has completed with an + optional error argument. +* callback(err) - A callback which is called after the test fails and repeated + execution of fn has stopped. + +__Example__ + +```js +var count = 0; + +async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doWhilst(fn, test, callback) + +The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call fn, until test returns true. Calls the callback when stopped, +or an error occurs. + +The inverse of async.whilst. + +--------------------------------------- + + +### doUntil(fn, test, callback) + +Like doWhilst except the test is inverted. Note the argument ordering differs from `until`. + +--------------------------------------- + + +### forever(fn, callback) + +Calls the asynchronous function 'fn' repeatedly, in series, indefinitely. +If an error is passed to fn's callback then 'callback' is called with the +error, otherwise it will never be called. + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs an array of functions in series, each passing their results to the next in +the array. However, if any of the functions pass an error to the callback, the +next function is not executed and the main callback is immediately called with +the error. + +__Arguments__ + +* tasks - An array of functions to run, each function is passed a + callback(err, result1, result2, ...) it must call on completion. The first + argument is an error (which can be null) and any further arguments will be + passed as arguments in order to the next task. +* callback(err, [results]) - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + +```js +async.waterfall([ + function(callback){ + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback){ + callback(null, 'three'); + }, + function(arg1, callback){ + // arg1 now equals 'three' + callback(null, 'done'); + } +], function (err, result) { + // result now equals 'done' +}); +``` + +--------------------------------------- + +### compose(fn1, fn2...) + +Creates a function which is a composition of the passed asynchronous +functions. Each function consumes the return value of the function that +follows. Composing functions f(), g() and h() would produce the result of +f(g(h())), only this version uses callbacks to obtain the return values. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* functions... - the asynchronous functions to compose + + +__Example__ + +```js +function add1(n, callback) { + setTimeout(function () { + callback(null, n + 1); + }, 10); +} + +function mul3(n, callback) { + setTimeout(function () { + callback(null, n * 3); + }, 10); +} + +var add1mul3 = async.compose(mul3, add1); + +add1mul3(4, function (err, result) { + // result now equals 15 +}); +``` + +--------------------------------------- + +### applyEach(fns, args..., callback) + +Applies the provided arguments to each function in the array, calling the +callback after all functions have completed. If you only provide the first +argument then it will return a function which lets you pass in the +arguments as if it were a single function call. + +__Arguments__ + +* fns - the asynchronous functions to all call with the same arguments +* args... - any number of separate arguments to pass to the function +* callback - the final argument should be the callback, called when all + functions have completed processing + + +__Example__ + +```js +async.applyEach([enableSearch, updateSchema], 'bucket', callback); + +// partial application example: +async.each( + buckets, + async.applyEach([enableSearch, updateSchema]), + callback +); +``` + +--------------------------------------- + + +### applyEachSeries(arr, iterator, callback) + +The same as applyEach only the functions are applied in series. + +--------------------------------------- + + +### queue(worker, concurrency) + +Creates a queue object with the specified concurrency. Tasks added to the +queue will be processed in parallel (up to the concurrency limit). If all +workers are in progress, the task is queued until one is available. Once +a worker has completed a task, the task's callback is called. + +__Arguments__ + +* worker(task, callback) - An asynchronous function for processing a queued + task, which must call its callback(err) argument when finished, with an + optional error as an argument. +* concurrency - An integer for determining how many worker functions should be + run in parallel. + +__Queue objects__ + +The queue object returned by this function has the following properties and +methods: + +* length() - a function returning the number of items waiting to be processed. +* concurrency - an integer for determining how many worker functions should be + run in parallel. This property can be changed after a queue is created to + alter the concurrency on-the-fly. +* push(task, [callback]) - add a new task to the queue, the callback is called + once the worker has finished processing the task. + instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. +* unshift(task, [callback]) - add a new task to the front of the queue. +* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued +* empty - a callback that is called when the last item from the queue is given to a worker +* drain - a callback that is called when the last item from the queue has returned from the worker + +__Example__ + +```js +// create a queue object with concurrency 2 + +var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); +}, 2); + + +// assign a callback +q.drain = function() { + console.log('all items have been processed'); +} + +// add some items to the queue + +q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); +}); +q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); + +// add some items to the queue (batch-wise) + +q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing bar'); +}); + +// add some items to the front of the queue + +q.unshift({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); +``` + +--------------------------------------- + + +### cargo(worker, [payload]) + +Creates a cargo object with the specified payload. Tasks added to the +cargo will be processed altogether (up to the payload limit). If the +worker is in progress, the task is queued until it is available. Once +the worker has completed some tasks, each callback of those tasks is called. + +__Arguments__ + +* worker(tasks, callback) - An asynchronous function for processing an array of + queued tasks, which must call its callback(err) argument when finished, with + an optional error as an argument. +* payload - An optional integer for determining how many tasks should be + processed per round; if omitted, the default is unlimited. + +__Cargo objects__ + +The cargo object returned by this function has the following properties and +methods: + +* length() - a function returning the number of items waiting to be processed. +* payload - an integer for determining how many tasks should be + process per round. This property can be changed after a cargo is created to + alter the payload on-the-fly. +* push(task, [callback]) - add a new task to the queue, the callback is called + once the worker has finished processing the task. + instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. +* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued +* empty - a callback that is called when the last item from the queue is given to a worker +* drain - a callback that is called when the last item from the queue has returned from the worker + +__Example__ + +```js +// create a cargo object with payload 2 + +var cargo = async.cargo(function (tasks, callback) { + for(var i=0; i +### auto(tasks, [callback]) + +Determines the best order for running functions based on their requirements. +Each function can optionally depend on other functions being completed first, +and each function is run as soon as its requirements are satisfied. If any of +the functions pass an error to their callback, that function will not complete +(so any other functions depending on it will not run) and the main callback +will be called immediately with the error. Functions also receive an object +containing the results of functions which have completed so far. + +Note, all functions are called with a results object as a second argument, +so it is unsafe to pass functions in the tasks object which cannot handle the +extra argument. For example, this snippet of code: + +```js +async.auto({ + readData: async.apply(fs.readFile, 'data.txt', 'utf-8'); +}, callback); +``` + +will have the effect of calling readFile with the results object as the last +argument, which will fail: + +```js +fs.readFile('data.txt', 'utf-8', cb, {}); +``` + +Instead, wrap the call to readFile in a function which does not forward the +results object: + +```js +async.auto({ + readData: function(cb, results){ + fs.readFile('data.txt', 'utf-8', cb); + } +}, callback); +``` + +__Arguments__ + +* tasks - An object literal containing named functions or an array of + requirements, with the function itself the last item in the array. The key + used for each function or array is used when specifying requirements. The + function receives two arguments: (1) a callback(err, result) which must be + called when finished, passing an error (which can be null) and the result of + the function's execution, and (2) a results object, containing the results of + the previously executed functions. +* callback(err, results) - An optional callback which is called when all the + tasks have been completed. The callback will receive an error as an argument + if any tasks pass an error to their callback. Results will always be passed + but if an error occurred, no other tasks will be performed, and the results + object will only contain partial results. + + +__Example__ + +```js +async.auto({ + get_data: function(callback){ + // async code to get some data + }, + make_folder: function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + }, + write_file: ['get_data', 'make_folder', function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, filename); + }], + email_link: ['write_file', function(callback, results){ + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + }] +}); +``` + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + +```js +async.parallel([ + function(callback){ + // async code to get some data + }, + function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + } +], +function(err, results){ + async.series([ + function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + }, + function(callback){ + // once the file is written let's email a link to it... + } + ]); +}); +``` + +For a complicated series of async tasks using the auto function makes adding +new tasks much easier and makes the code more readable. + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the array, +returning a continuation to call the next one after that. It's also possible to +'peek' the next iterator by doing iterator.next(). + +This function is used internally by the async module but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* tasks - An array of functions to run. + +__Example__ + +```js +var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } +]); + +node> var iterator2 = iterator(); +'one' +node> var iterator3 = iterator2(); +'two' +node> iterator3(); +'three' +node> var nextfn = iterator2.next(); +node> nextfn(); +'three' +``` + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied, a useful +shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + +```js +// using apply + +async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), +]); + + +// the same process without using apply + +async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + } +]); +``` + +It's possible to pass any number of additional arguments when calling the +continuation: + +```js +node> var fn = async.apply(sys.puts, 'one'); +node> fn('two', 'three'); +one +two +three +``` + +--------------------------------------- + + +### nextTick(callback) + +Calls the callback on a later loop around the event loop. In node.js this just +calls process.nextTick, in the browser it falls back to setImmediate(callback) +if available, otherwise setTimeout(callback, 0), which means other higher priority +events may precede the execution of the callback. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* callback - The function to call on a later loop around the event loop. + +__Example__ + +```js +var call_order = []; +async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two'] +}); +call_order.push('one') +``` + + +### times(n, callback) + +Calls the callback n times and accumulates results in the same manner +you would use with async.map. + +__Arguments__ + +* n - The number of times to run the function. +* callback - The function to call n times. + +__Example__ + +```js +// Pretend this is some complicated async factory +var createUser = function(id, callback) { + callback(null, { + id: 'user' + id + }) +} +// generate 5 users +async.times(5, function(n, next){ + createUser(n, function(err, user) { + next(err, user) + }) +}, function(err, users) { + // we should now have 5 users +}); +``` + + +### timesSeries(n, callback) + +The same as times only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an async function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +The cache of results is exposed as the `memo` property of the function returned +by `memoize`. + +__Arguments__ + +* fn - the function you to proxy and cache results from. +* hasher - an optional function for generating a custom hash for storing + results, it has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + +```js +var slow_fn = function (name, callback) { + // do something + callback(null, result); +}; +var fn = async.memoize(slow_fn); + +// fn can now be used as if it were slow_fn +fn('some name', function () { + // callback +}); +``` + + +### unmemoize(fn) + +Undoes a memoized function, reverting it to the original, unmemoized +form. Comes handy in tests. + +__Arguments__ + +* fn - the memoized function + + +### log(function, arguments) + +Logs the result of an async function to the console. Only works in node.js or +in browsers that support console.log and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.log is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); +}; +``` +```js +node> async.log(hello, 'world'); +'hello world' +``` + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an async function to the console using console.dir to +display the properties of the resulting object. Only works in node.js or +in browsers that support console.dir and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.dir is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); +}; +``` +```js +node> async.dir(hello, 'world'); +{hello: 'world'} +``` + +--------------------------------------- + + +### noConflict() + +Changes the value of async back to its original value, returning a reference to the +async object. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/async/component.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/async/component.json new file mode 100644 index 0000000..bbb0115 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/async/component.json @@ -0,0 +1,11 @@ +{ + "name": "async", + "repo": "caolan/async", + "description": "Higher-order functions and common patterns for asynchronous code", + "version": "0.1.23", + "keywords": [], + "dependencies": {}, + "development": {}, + "main": "lib/async.js", + "scripts": [ "lib/async.js" ] +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/async/lib/async.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/async/lib/async.js new file mode 100644 index 0000000..cb6320d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/async/lib/async.js @@ -0,0 +1,955 @@ +/*global setImmediate: false, setTimeout: false, console: false */ +(function () { + + var async = {}; + + // global on the server, window in the browser + var root, previous_async; + + root = this; + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + var called = false; + return function() { + if (called) throw new Error("Callback was already called."); + called = true; + fn.apply(root, arguments); + } + } + + //// cross-browser compatiblity functions //// + + var _each = function (arr, iterator) { + if (arr.forEach) { + return arr.forEach(iterator); + } + for (var i = 0; i < arr.length; i += 1) { + iterator(arr[i], i, arr); + } + }; + + var _map = function (arr, iterator) { + if (arr.map) { + return arr.map(iterator); + } + var results = []; + _each(arr, function (x, i, a) { + results.push(iterator(x, i, a)); + }); + return results; + }; + + var _reduce = function (arr, iterator, memo) { + if (arr.reduce) { + return arr.reduce(iterator, memo); + } + _each(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + }; + + var _keys = function (obj) { + if (Object.keys) { + return Object.keys(obj); + } + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + if (typeof process === 'undefined' || !(process.nextTick)) { + if (typeof setImmediate === 'function') { + async.nextTick = function (fn) { + // not a direct alias for IE10 compatibility + setImmediate(fn); + }; + async.setImmediate = async.nextTick; + } + else { + async.nextTick = function (fn) { + setTimeout(fn, 0); + }; + async.setImmediate = async.nextTick; + } + } + else { + async.nextTick = process.nextTick; + if (typeof setImmediate !== 'undefined') { + async.setImmediate = setImmediate; + } + else { + async.setImmediate = async.nextTick; + } + } + + async.each = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + _each(arr, function (x) { + iterator(x, only_once(function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + } + })); + }); + }; + async.forEach = async.each; + + async.eachSeries = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + var iterate = function () { + iterator(arr[completed], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + else { + iterate(); + } + } + }); + }; + iterate(); + }; + async.forEachSeries = async.eachSeries; + + async.eachLimit = function (arr, limit, iterator, callback) { + var fn = _eachLimit(limit); + fn.apply(null, [arr, iterator, callback]); + }; + async.forEachLimit = async.eachLimit; + + var _eachLimit = function (limit) { + + return function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length || limit <= 0) { + return callback(); + } + var completed = 0; + var started = 0; + var running = 0; + + (function replenish () { + if (completed >= arr.length) { + return callback(); + } + + while (running < limit && started < arr.length) { + started += 1; + running += 1; + iterator(arr[started - 1], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + running -= 1; + if (completed >= arr.length) { + callback(); + } + else { + replenish(); + } + } + }); + } + })(); + }; + }; + + + var doParallel = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.each].concat(args)); + }; + }; + var doParallelLimit = function(limit, fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [_eachLimit(limit)].concat(args)); + }; + }; + var doSeries = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.eachSeries].concat(args)); + }; + }; + + + var _asyncMap = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (err, v) { + results[x.index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + }; + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = function (arr, limit, iterator, callback) { + return _mapLimit(limit)(arr, iterator, callback); + }; + + var _mapLimit = function(limit) { + return doParallelLimit(limit, _asyncMap); + }; + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.reduce = function (arr, memo, iterator, callback) { + async.eachSeries(arr, function (x, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + // inject alias + async.inject = async.reduce; + // foldl alias + async.foldl = async.reduce; + + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, function (x) { + return x; + }).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + // foldr alias + async.foldr = async.reduceRight; + + var _filter = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.filter = doParallel(_filter); + async.filterSeries = doSeries(_filter); + // select alias + async.select = async.filter; + async.selectSeries = async.filterSeries; + + var _reject = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (!v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.reject = doParallel(_reject); + async.rejectSeries = doSeries(_reject); + + var _detect = function (eachfn, arr, iterator, main_callback) { + eachfn(arr, function (x, callback) { + iterator(x, function (result) { + if (result) { + main_callback(x); + main_callback = function () {}; + } + else { + callback(); + } + }); + }, function (err) { + main_callback(); + }); + }; + async.detect = doParallel(_detect); + async.detectSeries = doSeries(_detect); + + async.some = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (v) { + main_callback(true); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(false); + }); + }; + // any alias + async.any = async.some; + + async.every = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (!v) { + main_callback(false); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(true); + }); + }; + // all alias + async.all = async.every; + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + var fn = function (left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }; + callback(null, _map(results.sort(fn), function (x) { + return x.value; + })); + } + }); + }; + + async.auto = function (tasks, callback) { + callback = callback || function () {}; + var keys = _keys(tasks); + if (!keys.length) { + return callback(null); + } + + var results = {}; + + var listeners = []; + var addListener = function (fn) { + listeners.unshift(fn); + }; + var removeListener = function (fn) { + for (var i = 0; i < listeners.length; i += 1) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + return; + } + } + }; + var taskComplete = function () { + _each(listeners.slice(0), function (fn) { + fn(); + }); + }; + + addListener(function () { + if (_keys(results).length === keys.length) { + callback(null, results); + callback = function () {}; + } + }); + + _each(keys, function (k) { + var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; + var taskCallback = function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _each(_keys(results), function(rkey) { + safeResults[rkey] = results[rkey]; + }); + safeResults[k] = args; + callback(err, safeResults); + // stop subsequent errors hitting callback multiple times + callback = function () {}; + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }; + var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var ready = function () { + return _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + }; + if (ready()) { + task[task.length - 1](taskCallback, results); + } + else { + var listener = function () { + if (ready()) { + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + }; + addListener(listener); + } + }); + }; + + async.waterfall = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor !== Array) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + var wrapIterator = function (iterator) { + return function (err) { + if (err) { + callback.apply(null, arguments); + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + async.setImmediate(function () { + iterator.apply(null, args); + }); + } + }; + }; + wrapIterator(async.iterator(tasks))(); + }; + + var _parallel = function(eachfn, tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + eachfn.map(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + eachfn.each(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.parallel = function (tasks, callback) { + _parallel({ map: async.map, each: async.each }, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); + }; + + async.series = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.mapSeries(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.eachSeries(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.iterator = function (tasks) { + var makeCallback = function (index) { + var fn = function () { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + }; + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + }; + return makeCallback(0); + }; + + async.apply = function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return fn.apply( + null, args.concat(Array.prototype.slice.call(arguments)) + ); + }; + }; + + var _concat = function (eachfn, arr, fn, callback) { + var r = []; + eachfn(arr, function (x, cb) { + fn(x, function (err, y) { + r = r.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, r); + }); + }; + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + if (test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.whilst(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doWhilst = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (test()) { + async.doWhilst(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.until = function (test, iterator, callback) { + if (!test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.until(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doUntil = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (!test()) { + async.doUntil(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.queue = function (worker, concurrency) { + if (concurrency === undefined) { + concurrency = 1; + } + function _insert(q, data, pos, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + var item = { + data: task, + callback: typeof callback === 'function' ? callback : null + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.saturated && q.tasks.length === concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + var workers = 0; + var q = { + tasks: [], + concurrency: concurrency, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + if (workers < q.concurrency && q.tasks.length) { + var task = q.tasks.shift(); + if (q.empty && q.tasks.length === 0) { + q.empty(); + } + workers += 1; + var next = function () { + workers -= 1; + if (task.callback) { + task.callback.apply(task, arguments); + } + if (q.drain && q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + var cb = only_once(next); + worker(task.data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + } + }; + return q; + }; + + async.cargo = function (worker, payload) { + var working = false, + tasks = []; + + var cargo = { + tasks: tasks, + payload: payload, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + tasks.push({ + data: task, + callback: typeof callback === 'function' ? callback : null + }); + if (cargo.saturated && tasks.length === payload) { + cargo.saturated(); + } + }); + async.setImmediate(cargo.process); + }, + process: function process() { + if (working) return; + if (tasks.length === 0) { + if(cargo.drain) cargo.drain(); + return; + } + + var ts = typeof payload === 'number' + ? tasks.splice(0, payload) + : tasks.splice(0); + + var ds = _map(ts, function (task) { + return task.data; + }); + + if(cargo.empty) cargo.empty(); + working = true; + worker(ds, function () { + working = false; + + var args = arguments; + _each(ts, function (data) { + if (data.callback) { + data.callback.apply(null, args); + } + }); + + process(); + }); + }, + length: function () { + return tasks.length; + }, + running: function () { + return working; + } + }; + return cargo; + }; + + var _console_fn = function (name) { + return function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + fn.apply(null, args.concat([function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (typeof console !== 'undefined') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _each(args, function (x) { + console[name](x); + }); + } + } + }])); + }; + }; + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || function (x) { + return x; + }; + var memoized = function () { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + callback.apply(null, memo[key]); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([function () { + memo[key] = arguments; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, arguments); + } + }])); + } + }; + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + async.times = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.map(counter, iterator, callback); + }; + + async.timesSeries = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.mapSeries(counter, iterator, callback); + }; + + async.compose = function (/* functions... */) { + var fns = Array.prototype.reverse.call(arguments); + return function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([function () { + var err = arguments[0]; + var nextargs = Array.prototype.slice.call(arguments, 1); + cb(err, nextargs); + }])) + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }; + }; + + var _applyEach = function (eachfn, fns /*args...*/) { + var go = function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + return eachfn(fns, function (fn, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }; + if (arguments.length > 2) { + var args = Array.prototype.slice.call(arguments, 2); + return go.apply(this, args); + } + else { + return go; + } + }; + async.applyEach = doParallel(_applyEach); + async.applyEachSeries = doSeries(_applyEach); + + async.forever = function (fn, callback) { + function next(err) { + if (err) { + if (callback) { + return callback(err); + } + throw err; + } + fn(next); + } + next(); + }; + + // AMD / RequireJS + if (typeof define !== 'undefined' && define.amd) { + define([], function () { + return async; + }); + } + // Node.js + else if (typeof module !== 'undefined' && module.exports) { + module.exports = async; + } + // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8');\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", + "readmeFilename": "README.md", + "_id": "async@0.2.9", + "dist": { + "shasum": "1d805cdf65c236e4b351b9265610066e4ae4185c" + }, + "_from": "async@0.2.9", + "_resolved": "https://registry.npmjs.org/async/-/async-0.2.9.tgz" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.travis.yml b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/History.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/History.md new file mode 100644 index 0000000..4961d2e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/History.md @@ -0,0 +1,107 @@ + +0.6.1 / 2012-06-01 +================== + + * Added: append (yes or no) on confirmation + * Added: allow node.js v0.7.x + +0.6.0 / 2012-04-10 +================== + + * Added `.prompt(obj, callback)` support. Closes #49 + * Added default support to .choose(). Closes #41 + * Fixed the choice example + +0.5.1 / 2011-12-20 +================== + + * Fixed `password()` for recent nodes. Closes #36 + +0.5.0 / 2011-12-04 +================== + + * Added sub-command option support [itay] + +0.4.3 / 2011-12-04 +================== + + * Fixed custom help ordering. Closes #32 + +0.4.2 / 2011-11-24 +================== + + * Added travis support + * Fixed: line-buffered input automatically trimmed. Closes #31 + +0.4.1 / 2011-11-18 +================== + + * Removed listening for "close" on --help + +0.4.0 / 2011-11-15 +================== + + * Added support for `--`. Closes #24 + +0.3.3 / 2011-11-14 +================== + + * Fixed: wait for close event when writing help info [Jerry Hamlet] + +0.3.2 / 2011-11-01 +================== + + * Fixed long flag definitions with values [felixge] + +0.3.1 / 2011-10-31 +================== + + * Changed `--version` short flag to `-V` from `-v` + * Changed `.version()` so it's configurable [felixge] + +0.3.0 / 2011-10-31 +================== + + * Added support for long flags only. Closes #18 + +0.2.1 / 2011-10-24 +================== + + * "node": ">= 0.4.x < 0.7.0". Closes #20 + +0.2.0 / 2011-09-26 +================== + + * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] + +0.1.0 / 2011-08-24 +================== + + * Added support for custom `--help` output + +0.0.5 / 2011-08-18 +================== + + * Changed: when the user enters nothing prompt for password again + * Fixed issue with passwords beginning with numbers [NuckChorris] + +0.0.4 / 2011-08-15 +================== + + * Fixed `Commander#args` + +0.0.3 / 2011-08-15 +================== + + * Added default option value support + +0.0.2 / 2011-08-15 +================== + + * Added mask support to `Command#password(str[, mask], fn)` + * Added `Command#password(str, fn)` + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Makefile b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Makefile new file mode 100644 index 0000000..0074625 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Makefile @@ -0,0 +1,7 @@ + +TESTS = $(shell find test/test.*.js) + +test: + @./test/run $(TESTS) + +.PHONY: test \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Readme.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Readme.md new file mode 100644 index 0000000..b8328c3 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/Readme.md @@ -0,0 +1,262 @@ +# Commander.js + + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). + + [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) + +## Installation + + $ npm install commander + +## Option parsing + + Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.0.1') + .option('-p, --peppers', 'Add peppers') + .option('-P, --pineapple', 'Add pineapple') + .option('-b, --bbq', 'Add bbq sauce') + .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') + .parse(process.argv); + +console.log('you ordered a pizza with:'); +if (program.peppers) console.log(' - peppers'); +if (program.pineapple) console.log(' - pineappe'); +if (program.bbq) console.log(' - bbq'); +console.log(' - %s cheese', program.cheese); +``` + + Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. + +## Automated --help + + The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: + +``` + $ ./examples/pizza --help + + Usage: pizza [options] + + Options: + + -V, --version output the version number + -p, --peppers Add peppers + -P, --pineapple Add pineappe + -b, --bbq Add bbq sauce + -c, --cheese Add the specified type of cheese [marble] + -h, --help output usage information + +``` + +## Coercion + +```js +function range(val) { + return val.split('..').map(Number); +} + +function list(val) { + return val.split(','); +} + +program + .version('0.0.1') + .usage('[options] ') + .option('-i, --integer ', 'An integer argument', parseInt) + .option('-f, --float ', 'A float argument', parseFloat) + .option('-r, --range ..', 'A range', range) + .option('-l, --list ', 'A list', list) + .option('-o, --optional [value]', 'An optional value') + .parse(process.argv); + +console.log(' int: %j', program.integer); +console.log(' float: %j', program.float); +console.log(' optional: %j', program.optional); +program.range = program.range || []; +console.log(' range: %j..%j', program.range[0], program.range[1]); +console.log(' list: %j', program.list); +console.log(' args: %j', program.args); +``` + +## Custom help + + You can display arbitrary `-h, --help` information + by listening for "--help". Commander will automatically + exit once you are done so that the remainder of your program + does not execute causing undesired behaviours, for example + in the following executable "stuff" will not output when + `--help` is used. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('../'); + +function list(val) { + return val.split(',').map(Number); +} + +program + .version('0.0.1') + .option('-f, --foo', 'enable some foo') + .option('-b, --bar', 'enable some bar') + .option('-B, --baz', 'enable some baz'); + +// must be before .parse() since +// node's emit() is immediate + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ custom-help --help'); + console.log(' $ custom-help -h'); + console.log(''); +}); + +program.parse(process.argv); + +console.log('stuff'); +``` + +yielding the following help output: + +``` + +Usage: custom-help [options] + +Options: + + -h, --help output usage information + -V, --version output the version number + -f, --foo enable some foo + -b, --bar enable some bar + -B, --baz enable some baz + +Examples: + + $ custom-help --help + $ custom-help -h + +``` + +## .prompt(msg, fn) + + Single-line prompt: + +```js +program.prompt('name: ', function(name){ + console.log('hi %s', name); +}); +``` + + Multi-line prompt: + +```js +program.prompt('description:', function(name){ + console.log('hi %s', name); +}); +``` + + Coercion: + +```js +program.prompt('Age: ', Number, function(age){ + console.log('age: %j', age); +}); +``` + +```js +program.prompt('Birthdate: ', Date, function(date){ + console.log('date: %s', date); +}); +``` + +## .password(msg[, mask], fn) + +Prompt for password without echoing: + +```js +program.password('Password: ', function(pass){ + console.log('got "%s"', pass); + process.stdin.destroy(); +}); +``` + +Prompt for password with mask char "*": + +```js +program.password('Password: ', '*', function(pass){ + console.log('got "%s"', pass); + process.stdin.destroy(); +}); +``` + +## .confirm(msg, fn) + + Confirm with the given `msg`: + +```js +program.confirm('continue? ', function(ok){ + console.log(' got %j', ok); +}); +``` + +## .choose(list, fn) + + Let the user choose from a `list`: + +```js +var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; + +console.log('Choose the coolest pet:'); +program.choose(list, function(i){ + console.log('you chose %d "%s"', i, list[i]); +}); +``` + +## Links + + - [API documentation](http://visionmedia.github.com/commander.js/) + - [ascii tables](https://github.com/LearnBoost/cli-table) + - [progress bars](https://github.com/visionmedia/node-progress) + - [more progress bars](https://github.com/substack/node-multimeter) + - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) + +## License + +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/index.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/index.js new file mode 100644 index 0000000..06ec1e4 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/lib/commander.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/lib/commander.js new file mode 100644 index 0000000..5ba87eb --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/lib/commander.js @@ -0,0 +1,1026 @@ + +/*! + * commander + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter + , path = require('path') + , tty = require('tty') + , basename = path.basename; + +/** + * Expose the root command. + */ + +exports = module.exports = new Command; + +/** + * Expose `Command`. + */ + +exports.Command = Command; + +/** + * Expose `Option`. + */ + +exports.Option = Option; + +/** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {String} flags + * @param {String} description + * @api public + */ + +function Option(flags, description) { + this.flags = flags; + this.required = ~flags.indexOf('<'); + this.optional = ~flags.indexOf('['); + this.bool = !~flags.indexOf('-no-'); + flags = flags.split(/[ ,|]+/); + if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); + this.long = flags.shift(); + this.description = description; +} + +/** + * Return option name. + * + * @return {String} + * @api private + */ + +Option.prototype.name = function(){ + return this.long + .replace('--', '') + .replace('no-', ''); +}; + +/** + * Check if `arg` matches the short or long flag. + * + * @param {String} arg + * @return {Boolean} + * @api private + */ + +Option.prototype.is = function(arg){ + return arg == this.short + || arg == this.long; +}; + +/** + * Initialize a new `Command`. + * + * @param {String} name + * @api public + */ + +function Command(name) { + this.commands = []; + this.options = []; + this.args = []; + this.name = name; +} + +/** + * Inherit from `EventEmitter.prototype`. + */ + +Command.prototype.__proto__ = EventEmitter.prototype; + +/** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * Examples: + * + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function(){ + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd){ + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env){ + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {String} name + * @return {Command} the new command + * @api public + */ + +Command.prototype.command = function(name){ + var args = name.split(/ +/); + var cmd = new Command(args.shift()); + this.commands.push(cmd); + cmd.parseExpectedArgs(args); + cmd.parent = this; + return cmd; +}; + +/** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {Array} args + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parseExpectedArgs = function(args){ + if (!args.length) return; + var self = this; + args.forEach(function(arg){ + switch (arg[0]) { + case '<': + self.args.push({ required: true, name: arg.slice(1, -1) }); + break; + case '[': + self.args.push({ required: false, name: arg.slice(1, -1) }); + break; + } + }); + return this; +}; + +/** + * Register callback `fn` for the command. + * + * Examples: + * + * program + * .command('help') + * .description('display verbose help') + * .action(function(){ + * // output help here + * }); + * + * @param {Function} fn + * @return {Command} for chaining + * @api public + */ + +Command.prototype.action = function(fn){ + var self = this; + this.parent.on(this.name, function(args, unknown){ + // Parse any so-far unknown options + unknown = unknown || []; + var parsed = self.parseOptions(unknown); + + // Output help if necessary + outputHelpIfNecessary(self, parsed.unknown); + + // If there are still any unknown options, then we simply + // die, unless someone asked for help, in which case we give it + // to them, and then we die. + if (parsed.unknown.length > 0) { + self.unknownOption(parsed.unknown[0]); + } + + self.args.forEach(function(arg, i){ + if (arg.required && null == args[i]) { + self.missingArgument(arg.name); + } + }); + + // Always append ourselves to the end of the arguments, + // to make sure we match the number of arguments the user + // expects + if (self.args.length) { + args[self.args.length] = self; + } else { + args.push(self); + } + + fn.apply(this, args); + }); + return this; +}; + +/** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * Examples: + * + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to false + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => true + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {String} flags + * @param {String} description + * @param {Function|Mixed} fn or default + * @param {Mixed} defaultValue + * @return {Command} for chaining + * @api public + */ + +Command.prototype.option = function(flags, description, fn, defaultValue){ + var self = this + , option = new Option(flags, description) + , oname = option.name() + , name = camelcase(oname); + + // default as 3rd arg + if ('function' != typeof fn) defaultValue = fn, fn = null; + + // preassign default value only for --no-*, [optional], or + if (false == option.bool || option.optional || option.required) { + // when --no-* we make sure default is true + if (false == option.bool) defaultValue = true; + // preassign only if we have a default + if (undefined !== defaultValue) self[name] = defaultValue; + } + + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on(oname, function(val){ + // coercion + if (null != val && fn) val = fn(val); + + // unassigned or bool + if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { + // if no value, bool true, and we have a default, then use it! + if (null == val) { + self[name] = option.bool + ? defaultValue || true + : false; + } else { + self[name] = val; + } + } else if (null !== val) { + // reassign + self[name] = val; + } + }); + + return this; +}; + +/** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {Array} argv + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parse = function(argv){ + // store raw args + this.rawArgs = argv; + + // guess name + if (!this.name) this.name = basename(argv[1]); + + // process argv + var parsed = this.parseOptions(this.normalize(argv.slice(2))); + this.args = parsed.args; + return this.parseArgs(this.args, parsed.unknown); +}; + +/** + * Normalize `args`, splitting joined short flags. For example + * the arg "-abc" is equivalent to "-a -b -c". + * + * @param {Array} args + * @return {Array} + * @api private + */ + +Command.prototype.normalize = function(args){ + var ret = [] + , arg; + + for (var i = 0, len = args.length; i < len; ++i) { + arg = args[i]; + if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { + arg.slice(1).split('').forEach(function(c){ + ret.push('-' + c); + }); + } else { + ret.push(arg); + } + } + + return ret; +}; + +/** + * Parse command `args`. + * + * When listener(s) are available those + * callbacks are invoked, otherwise the "*" + * event is emitted and those actions are invoked. + * + * @param {Array} args + * @return {Command} for chaining + * @api private + */ + +Command.prototype.parseArgs = function(args, unknown){ + var cmds = this.commands + , len = cmds.length + , name; + + if (args.length) { + name = args[0]; + if (this.listeners(name).length) { + this.emit(args.shift(), args, unknown); + } else { + this.emit('*', args); + } + } else { + outputHelpIfNecessary(this, unknown); + + // If there were no args and we have unknown options, + // then they are extraneous and we need to error. + if (unknown.length > 0) { + this.unknownOption(unknown[0]); + } + } + + return this; +}; + +/** + * Return an option matching `arg` if any. + * + * @param {String} arg + * @return {Option} + * @api private + */ + +Command.prototype.optionFor = function(arg){ + for (var i = 0, len = this.options.length; i < len; ++i) { + if (this.options[i].is(arg)) { + return this.options[i]; + } + } +}; + +/** + * Parse options from `argv` returning `argv` + * void of these options. + * + * @param {Array} argv + * @return {Array} + * @api public + */ + +Command.prototype.parseOptions = function(argv){ + var args = [] + , len = argv.length + , literal + , option + , arg; + + var unknownOptions = []; + + // parse options + for (var i = 0; i < len; ++i) { + arg = argv[i]; + + // literal args after -- + if ('--' == arg) { + literal = true; + continue; + } + + if (literal) { + args.push(arg); + continue; + } + + // find matching Option + option = this.optionFor(arg); + + // option is defined + if (option) { + // requires arg + if (option.required) { + arg = argv[++i]; + if (null == arg) return this.optionMissingArgument(option); + if ('-' == arg[0]) return this.optionMissingArgument(option, arg); + this.emit(option.name(), arg); + // optional arg + } else if (option.optional) { + arg = argv[i+1]; + if (null == arg || '-' == arg[0]) { + arg = null; + } else { + ++i; + } + this.emit(option.name(), arg); + // bool + } else { + this.emit(option.name()); + } + continue; + } + + // looks like an option + if (arg.length > 1 && '-' == arg[0]) { + unknownOptions.push(arg); + + // If the next argument looks like it might be + // an argument for this option, we pass it on. + // If it isn't, then it'll simply be ignored + if (argv[i+1] && '-' != argv[i+1][0]) { + unknownOptions.push(argv[++i]); + } + continue; + } + + // arg + args.push(arg); + } + + return { args: args, unknown: unknownOptions }; +}; + +/** + * Argument `name` is missing. + * + * @param {String} name + * @api private + */ + +Command.prototype.missingArgument = function(name){ + console.error(); + console.error(" error: missing required argument `%s'", name); + console.error(); + process.exit(1); +}; + +/** + * `Option` is missing an argument, but received `flag` or nothing. + * + * @param {String} option + * @param {String} flag + * @api private + */ + +Command.prototype.optionMissingArgument = function(option, flag){ + console.error(); + if (flag) { + console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); + } else { + console.error(" error: option `%s' argument missing", option.flags); + } + console.error(); + process.exit(1); +}; + +/** + * Unknown option `flag`. + * + * @param {String} flag + * @api private + */ + +Command.prototype.unknownOption = function(flag){ + console.error(); + console.error(" error: unknown option `%s'", flag); + console.error(); + process.exit(1); +}; + +/** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {String} str + * @param {String} flags + * @return {Command} for chaining + * @api public + */ + +Command.prototype.version = function(str, flags){ + if (0 == arguments.length) return this._version; + this._version = str; + flags = flags || '-V, --version'; + this.option(flags, 'output the version number'); + this.on('version', function(){ + console.log(str); + process.exit(0); + }); + return this; +}; + +/** + * Set the description `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.description = function(str){ + if (0 == arguments.length) return this._description; + this._description = str; + return this; +}; + +/** + * Set / get the command usage `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.usage = function(str){ + var args = this.args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }); + + var usage = '[options' + + (this.commands.length ? '] [command' : '') + + ']' + + (this.args.length ? ' ' + args : ''); + if (0 == arguments.length) return this._usage || usage; + this._usage = str; + + return this; +}; + +/** + * Return the largest option length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestOptionLength = function(){ + return this.options.reduce(function(max, option){ + return Math.max(max, option.flags.length); + }, 0); +}; + +/** + * Return help for options. + * + * @return {String} + * @api private + */ + +Command.prototype.optionHelp = function(){ + var width = this.largestOptionLength(); + + // Prepend the help information + return [pad('-h, --help', width) + ' ' + 'output usage information'] + .concat(this.options.map(function(option){ + return pad(option.flags, width) + + ' ' + option.description; + })) + .join('\n'); +}; + +/** + * Return command help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.commandHelp = function(){ + if (!this.commands.length) return ''; + return [ + '' + , ' Commands:' + , '' + , this.commands.map(function(cmd){ + var args = cmd.args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }).join(' '); + + return cmd.name + + (cmd.options.length + ? ' [options]' + : '') + ' ' + args + + (cmd.description() + ? '\n' + cmd.description() + : ''); + }).join('\n\n').replace(/^/gm, ' ') + , '' + ].join('\n'); +}; + +/** + * Return program help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.helpInformation = function(){ + return [ + '' + , ' Usage: ' + this.name + ' ' + this.usage() + , '' + this.commandHelp() + , ' Options:' + , '' + , '' + this.optionHelp().replace(/^/gm, ' ') + , '' + , '' + ].join('\n'); +}; + +/** + * Prompt for a `Number`. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptForNumber = function(str, fn){ + var self = this; + this.promptSingleLine(str, function parseNumber(val){ + val = Number(val); + if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); + fn(val); + }); +}; + +/** + * Prompt for a `Date`. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptForDate = function(str, fn){ + var self = this; + this.promptSingleLine(str, function parseDate(val){ + val = new Date(val); + if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); + fn(val); + }); +}; + +/** + * Single-line prompt. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptSingleLine = function(str, fn){ + if ('function' == typeof arguments[2]) { + return this['promptFor' + (fn.name || fn)](str, arguments[2]); + } + + process.stdout.write(str); + process.stdin.setEncoding('utf8'); + process.stdin.once('data', function(val){ + fn(val.trim()); + }).resume(); +}; + +/** + * Multi-line prompt. + * + * @param {String} str + * @param {Function} fn + * @api private + */ + +Command.prototype.promptMultiLine = function(str, fn){ + var buf = []; + console.log(str); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function(val){ + if ('\n' == val || '\r\n' == val) { + process.stdin.removeAllListeners('data'); + fn(buf.join('\n')); + } else { + buf.push(val.trimRight()); + } + }).resume(); +}; + +/** + * Prompt `str` and callback `fn(val)` + * + * Commander supports single-line and multi-line prompts. + * To issue a single-line prompt simply add white-space + * to the end of `str`, something like "name: ", whereas + * for a multi-line prompt omit this "description:". + * + * + * Examples: + * + * program.prompt('Username: ', function(name){ + * console.log('hi %s', name); + * }); + * + * program.prompt('Description:', function(desc){ + * console.log('description was "%s"', desc.trim()); + * }); + * + * @param {String|Object} str + * @param {Function} fn + * @api public + */ + +Command.prototype.prompt = function(str, fn){ + var self = this; + + if ('string' == typeof str) { + if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); + this.promptMultiLine(str, fn); + } else { + var keys = Object.keys(str) + , obj = {}; + + function next() { + var key = keys.shift() + , label = str[key]; + + if (!key) return fn(obj); + self.prompt(label, function(val){ + obj[key] = val; + next(); + }); + } + + next(); + } +}; + +/** + * Prompt for password with `str`, `mask` char and callback `fn(val)`. + * + * The mask string defaults to '', aka no output is + * written while typing, you may want to use "*" etc. + * + * Examples: + * + * program.password('Password: ', function(pass){ + * console.log('got "%s"', pass); + * process.stdin.destroy(); + * }); + * + * program.password('Password: ', '*', function(pass){ + * console.log('got "%s"', pass); + * process.stdin.destroy(); + * }); + * + * @param {String} str + * @param {String} mask + * @param {Function} fn + * @api public + */ + +Command.prototype.password = function(str, mask, fn){ + var self = this + , buf = ''; + + // default mask + if ('function' == typeof mask) { + fn = mask; + mask = ''; + } + + process.stdin.resume(); + tty.setRawMode(true); + process.stdout.write(str); + + // keypress + process.stdin.on('keypress', function(c, key){ + if (key && 'enter' == key.name) { + console.log(); + process.stdin.removeAllListeners('keypress'); + tty.setRawMode(false); + if (!buf.trim().length) return self.password(str, mask, fn); + fn(buf); + return; + } + + if (key && key.ctrl && 'c' == key.name) { + console.log('%s', buf); + process.exit(); + } + + process.stdout.write(mask); + buf += c; + }).resume(); +}; + +/** + * Confirmation prompt with `str` and callback `fn(bool)` + * + * Examples: + * + * program.confirm('continue? ', function(ok){ + * console.log(' got %j', ok); + * process.stdin.destroy(); + * }); + * + * @param {String} str + * @param {Function} fn + * @api public + */ + + +Command.prototype.confirm = function(str, fn, verbose){ + var self = this; + this.prompt(str, function(ok){ + if (!ok.trim()) { + if (!verbose) str += '(yes or no) '; + return self.confirm(str, fn, true); + } + fn(parseBool(ok)); + }); +}; + +/** + * Choice prompt with `list` of items and callback `fn(index, item)` + * + * Examples: + * + * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; + * + * console.log('Choose the coolest pet:'); + * program.choose(list, function(i){ + * console.log('you chose %d "%s"', i, list[i]); + * process.stdin.destroy(); + * }); + * + * @param {Array} list + * @param {Number|Function} index or fn + * @param {Function} fn + * @api public + */ + +Command.prototype.choose = function(list, index, fn){ + var self = this + , hasDefault = 'number' == typeof index; + + if (!hasDefault) { + fn = index; + index = null; + } + + list.forEach(function(item, i){ + if (hasDefault && i == index) { + console.log('* %d) %s', i + 1, item); + } else { + console.log(' %d) %s', i + 1, item); + } + }); + + function again() { + self.prompt(' : ', function(val){ + val = parseInt(val, 10) - 1; + if (hasDefault && isNaN(val)) val = index; + + if (null == list[val]) { + again(); + } else { + fn(val, list[val]); + } + }); + } + + again(); +}; + +/** + * Camel-case the given `flag` + * + * @param {String} flag + * @return {String} + * @api private + */ + +function camelcase(flag) { + return flag.split('-').reduce(function(str, word){ + return str + word[0].toUpperCase() + word.slice(1); + }); +} + +/** + * Parse a boolean `str`. + * + * @param {String} str + * @return {Boolean} + * @api private + */ + +function parseBool(str) { + return /^y|yes|ok|true$/i.test(str); +} + +/** + * Pad `str` to `width`. + * + * @param {String} str + * @param {Number} width + * @return {String} + * @api private + */ + +function pad(str, width) { + var len = Math.max(0, width - str.length); + return str + Array(len + 1).join(' '); +} + +/** + * Output help information if necessary + * + * @param {Command} command to output help for + * @param {Array} array of options to search for -h or --help + * @api private + */ + +function outputHelpIfNecessary(cmd, options) { + options = options || []; + for (var i = 0; i < options.length; i++) { + if (options[i] == '--help' || options[i] == '-h') { + process.stdout.write(cmd.helpInformation()); + cmd.emit('--help'); + process.exit(0); + } + } +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/package.json new file mode 100644 index 0000000..052b181 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/commander/package.json @@ -0,0 +1,38 @@ +{ + "name": "commander", + "version": "0.5.2", + "description": "the complete solution for node.js command-line programs", + "keywords": [ + "command", + "option", + "parser", + "prompt", + "stdin" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "repository": { + "type": "git", + "url": "https://github.com/visionmedia/commander.js.git" + }, + "dependencies": {}, + "devDependencies": { + "should": ">= 0.0.1" + }, + "scripts": { + "test": "make test" + }, + "main": "index", + "engines": { + "node": ">= 0.4.x" + }, + "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", + "readmeFilename": "Readme.md", + "bugs": { + "url": "https://github.com/visionmedia/commander.js/issues" + }, + "_id": "commander@0.5.2", + "_from": "commander@0.5.2" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.travis.yml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.travis.yml new file mode 100644 index 0000000..6f27c96 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/.travis.yml @@ -0,0 +1,10 @@ +language: node_js + +node_js: + - 0.6 + +script: make test + +notifications: + email: + - tomaz+travisci@tomaz.me diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/CHANGES.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/CHANGES.md new file mode 100644 index 0000000..83bd61b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/CHANGES.md @@ -0,0 +1,34 @@ +elementtree v0.1.5 (in development) + +* Fix a bug in the find() and findtext() method which could manifest itself + under some conditions. + [metagriffin] + +elementtree v0.1.4 + +* Allow user to use namespaced attributes when using find* functions. + [Andrew Lunny] + +elementtree v0.1.3 + +* Improve the output of text content in the tags (strip unnecessary line break + characters). + +[Darryl Pogue] + +elementtree v0.1.2 + + * Allow user to pass 'indent' option to ElementTree.write method. If this + option is specified (e.g. {'indent': 4}). XML will be pretty printed. + [Darryl Pogue, Tomaz Muraus] + + * Bump sax dependency version. + +elementtree v0.1.1 - 2011-09-23 + + * Improve special character escaping. + [Ryan Phillips] + +elementtree v0.1.0 - 2011-09-05 + + * Initial release. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/LICENSE.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/Makefile b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/Makefile new file mode 100644 index 0000000..ab7c4e0 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/Makefile @@ -0,0 +1,21 @@ +TESTS := \ + tests/test-simple.js + + + +PATH := ./node_modules/.bin:$(PATH) + +WHISKEY := $(shell bash -c 'PATH=$(PATH) type -p whiskey') + +default: test + +test: + NODE_PATH=`pwd`/lib/ ${WHISKEY} --scope-leaks --sequential --real-time --tests "${TESTS}" + +tap: + NODE_PATH=`pwd`/lib/ ${WHISKEY} --test-reporter tap --sequential --real-time --tests "${TESTS}" + +coverage: + NODE_PATH=`pwd`/lib/ ${WHISKEY} --sequential --coverage --coverage-reporter html --coverage-dir coverage_html --tests "${TESTS}" + +.PHONY: default test coverage tap scope diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/NOTICE b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/NOTICE new file mode 100644 index 0000000..28ad70a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/NOTICE @@ -0,0 +1,5 @@ +node-elementtree +Copyright (c) 2011, Rackspace, Inc. + +The ElementTree toolkit is Copyright (c) 1999-2007 by Fredrik Lundh + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/README.md new file mode 100644 index 0000000..8a7e710 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/README.md @@ -0,0 +1,27 @@ +node-elementtree +==================== + +node-elementtree is a [Node.js](http://nodejs.org) XML parser and serializer based upon the [Python ElementTree v1.3](http://effbot.org/zone/element-index.htm) module. + +Installation +==================== + + $ npm install elementtree + +Using the library +==================== + +For the usage refer to the Python ElementTree library documentation - [http://effbot.org/zone/element-index.htm#usage](http://effbot.org/zone/element-index.htm#usage). + +Supported XPath expressions in `find`, `findall` and `findtext` methods are listed on [http://effbot.org/zone/element-xpath.htm](http://effbot.org/zone/element-xpath.htm). + +Build status +==================== + +[![Build Status](https://secure.travis-ci.org/racker/node-elementtree.png)](http://travis-ci.org/racker/node-elementtree) + + +License +==================== + +node-elementtree is distributed under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/constants.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/constants.js new file mode 100644 index 0000000..b057faf --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/constants.js @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Rackspace + * + * Licensed 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 DEFAULT_PARSER = 'sax'; + +exports.DEFAULT_PARSER = DEFAULT_PARSER; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementpath.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementpath.js new file mode 100644 index 0000000..2e93f47 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementpath.js @@ -0,0 +1,343 @@ +/** + * Copyright 2011 Rackspace + * + * Licensed 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 sprintf = require('./sprintf').sprintf; + +var utils = require('./utils'); +var SyntaxError = require('./errors').SyntaxError; + +var _cache = {}; + +var RE = new RegExp( + "(" + + "'[^']*'|\"[^\"]*\"|" + + "::|" + + "//?|" + + "\\.\\.|" + + "\\(\\)|" + + "[/.*:\\[\\]\\(\\)@=])|" + + "((?:\\{[^}]+\\})?[^/\\[\\]\\(\\)@=\\s]+)|" + + "\\s+", 'g' +); + +var xpath_tokenizer = utils.findall.bind(null, RE); + +function prepare_tag(next, token) { + var tag = token[0]; + + function select(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + elem._children.forEach(function(e) { + if (e.tag === tag) { + rv.push(e); + } + }); + } + + return rv; + } + + return select; +} + +function prepare_star(next, token) { + function select(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + elem._children.forEach(function(e) { + rv.push(e); + }); + } + + return rv; + } + + return select; +} + +function prepare_dot(next, token) { + function select(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + rv.push(elem); + } + + return rv; + } + + return select; +} + +function prepare_iter(next, token) { + var tag; + token = next(); + + if (token[1] === '*') { + tag = '*'; + } + else if (!token[1]) { + tag = token[0] || ''; + } + else { + throw new SyntaxError(token); + } + + function select(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + elem.iter(tag, function(e) { + if (e !== elem) { + rv.push(e); + } + }); + } + + return rv; + } + + return select; +} + +function prepare_dot_dot(next, token) { + function select(context, result) { + var i, len, elem, rv = [], parent_map = context.parent_map; + + if (!parent_map) { + context.parent_map = parent_map = {}; + + context.root.iter(null, function(p) { + p._children.forEach(function(e) { + parent_map[e] = p; + }); + }); + } + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + + if (parent_map.hasOwnProperty(elem)) { + rv.push(parent_map[elem]); + } + } + + return rv; + } + + return select; +} + + +function prepare_predicate(next, token) { + var tag, key, value, select; + token = next(); + + if (token[1] === '@') { + // attribute + token = next(); + + if (token[1]) { + throw new SyntaxError(token, 'Invalid attribute predicate'); + } + + key = token[0]; + token = next(); + + if (token[1] === ']') { + select = function(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + + if (elem.get(key)) { + rv.push(elem); + } + } + + return rv; + }; + } + else if (token[1] === '=') { + value = next()[1]; + + if (value[0] === '"' || value[value.length - 1] === '\'') { + value = value.slice(1, value.length - 1); + } + else { + throw new SyntaxError(token, 'Ivalid comparison target'); + } + + token = next(); + select = function(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + + if (elem.get(key) === value) { + rv.push(elem); + } + } + + return rv; + }; + } + + if (token[1] !== ']') { + throw new SyntaxError(token, 'Invalid attribute predicate'); + } + } + else if (!token[1]) { + tag = token[0] || ''; + token = next(); + + if (token[1] !== ']') { + throw new SyntaxError(token, 'Invalid node predicate'); + } + + select = function(context, result) { + var i, len, elem, rv = []; + + for (i = 0, len = result.length; i < len; i++) { + elem = result[i]; + + if (elem.find(tag)) { + rv.push(elem); + } + } + + return rv; + }; + } + else { + throw new SyntaxError(null, 'Invalid predicate'); + } + + return select; +} + + + +var ops = { + "": prepare_tag, + "*": prepare_star, + ".": prepare_dot, + "..": prepare_dot_dot, + "//": prepare_iter, + "[": prepare_predicate, +}; + +function _SelectorContext(root) { + this.parent_map = null; + this.root = root; +} + +function findall(elem, path) { + var selector, result, i, len, token, value, select, context; + + if (_cache.hasOwnProperty(path)) { + selector = _cache[path]; + } + else { + // TODO: Use smarter cache purging approach + if (Object.keys(_cache).length > 100) { + _cache = {}; + } + + if (path.charAt(0) === '/') { + throw new SyntaxError(null, 'Cannot use absolute path on element'); + } + + result = xpath_tokenizer(path); + selector = []; + + function getToken() { + return result.shift(); + } + + token = getToken(); + while (true) { + var c = token[1] || ''; + value = ops[c](getToken, token); + + if (!value) { + throw new SyntaxError(null, sprintf('Invalid path: %s', path)); + } + + selector.push(value); + token = getToken(); + + if (!token) { + break; + } + else if (token[1] === '/') { + token = getToken(); + } + + if (!token) { + break; + } + } + + _cache[path] = selector; + } + + // Execute slector pattern + result = [elem]; + context = new _SelectorContext(elem); + + for (i = 0, len = selector.length; i < len; i++) { + select = selector[i]; + result = select(context, result); + } + + return result || []; +} + +function find(element, path) { + var resultElements = findall(element, path); + + if (resultElements && resultElements.length > 0) { + return resultElements[0]; + } + + return null; +} + +function findtext(element, path, defvalue) { + var resultElements = findall(element, path); + + if (resultElements && resultElements.length > 0) { + return resultElements[0].text; + } + + return defvalue; +} + + +exports.find = find; +exports.findall = findall; +exports.findtext = findtext; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementtree.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementtree.js new file mode 100644 index 0000000..b46268c --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/elementtree.js @@ -0,0 +1,598 @@ +/** + * Copyright 2011 Rackspace + * + * Licensed 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 sprintf = require('./sprintf').sprintf; + +var utils = require('./utils'); +var ElementPath = require('./elementpath'); +var TreeBuilder = require('./treebuilder').TreeBuilder; +var get_parser = require('./parser').get_parser; +var constants = require('./constants'); + +var element_ids = 0; + +function Element(tag, attrib) +{ + this._id = element_ids++; + this.tag = tag; + this.attrib = {}; + this.text = null; + this.tail = null; + this._children = []; + + if (attrib) { + this.attrib = utils.merge(this.attrib, attrib); + } +} + +Element.prototype.toString = function() +{ + return sprintf("", this.tag, this._id); +}; + +Element.prototype.makeelement = function(tag, attrib) +{ + return new Element(tag, attrib); +}; + +Element.prototype.len = function() +{ + return this._children.length; +}; + +Element.prototype.getItem = function(index) +{ + return this._children[index]; +}; + +Element.prototype.setItem = function(index, element) +{ + this._children[index] = element; +}; + +Element.prototype.delItem = function(index) +{ + this._children.splice(index, 1); +}; + +Element.prototype.getSlice = function(start, stop) +{ + return this._children.slice(start, stop); +}; + +Element.prototype.setSlice = function(start, stop, elements) +{ + var i; + var k = 0; + for (i = start; i < stop; i++, k++) { + this._children[i] = elements[k]; + } +}; + +Element.prototype.delSlice = function(start, stop) +{ + this._children.splice(start, stop - start); +}; + +Element.prototype.append = function(element) +{ + this._children.push(element); +}; + +Element.prototype.extend = function(elements) +{ + this._children.concat(elements); +}; + +Element.prototype.insert = function(index, element) +{ + this._children[index] = element; +}; + +Element.prototype.remove = function(index, element) +{ + this._children = this._children.filter(function(e) { + /* TODO: is this the right way to do this? */ + if (e._id === element._id) { + return false; + } + return true; + }); +}; + +Element.prototype.getchildren = function() { + return this._children; +}; + +Element.prototype.find = function(path) +{ + return ElementPath.find(this, path); +}; + +Element.prototype.findtext = function(path, defvalue) +{ + return ElementPath.findtext(this, path, defvalue); +}; + +Element.prototype.findall = function(path, defvalue) +{ + return ElementPath.findall(this, path, defvalue); +}; + +Element.prototype.clear = function() +{ + this.attrib = {}; + this._children = []; + this.text = null; + this.tail = null; +}; + +Element.prototype.get = function(key, defvalue) +{ + if (this.attrib[key] !== undefined) { + return this.attrib[key]; + } + else { + return defvalue; + } +}; + +Element.prototype.set = function(key, value) +{ + this.attrib[key] = value; +}; + +Element.prototype.keys = function() +{ + return Object.keys(this.attrib); +}; + +Element.prototype.items = function() +{ + return utils.items(this.attrib); +}; + +/* + * In python this uses a generator, but in v8 we don't have em, + * so we use a callback instead. + **/ +Element.prototype.iter = function(tag, callback) +{ + var self = this; + var i, child; + + if (tag === "*") { + tag = null; + } + + if (tag === null || this.tag === tag) { + callback(self); + } + + for (i = 0; i < this._children.length; i++) { + child = this._children[i]; + child.iter(tag, function(e) { + callback(e); + }); + } +}; + +Element.prototype.itertext = function(callback) +{ + this.iter(null, function(e) { + if (e.text) { + callback(e.text); + } + + if (e.tail) { + callback(e.tail); + } + }); +}; + + +function SubElement(parent, tag, attrib) { + var element = parent.makeelement(tag, attrib); + parent.append(element); + return element; +} + +function Comment(text) { + var element = new Element(Comment); + if (text) { + element.text = text; + } + return element; +} + +function ProcessingInstruction(target, text) +{ + var element = new Element(ProcessingInstruction); + element.text = target; + if (text) { + element.text = element.text + " " + text; + } + return element; +} + +function QName(text_or_uri, tag) +{ + if (tag) { + text_or_uri = sprintf("{%s}%s", text_or_uri, tag); + } + this.text = text_or_uri; +} + +QName.prototype.toString = function() { + return this.text; +}; + +function ElementTree(element) +{ + this._root = element; +} + +ElementTree.prototype.getroot = function() { + return this._root; +}; + +ElementTree.prototype._setroot = function(element) { + this._root = element; +}; + +ElementTree.prototype.parse = function(source, parser) { + if (!parser) { + parser = get_parser(constants.DEFAULT_PARSER); + parser = new parser.XMLParser(new TreeBuilder()); + } + + parser.feed(source); + this._root = parser.close(); + return this._root; +}; + +ElementTree.prototype.iter = function(tag, callback) { + this._root.iter(tag, callback); +}; + +ElementTree.prototype.find = function(path) { + return this._root.find(path); +}; + +ElementTree.prototype.findtext = function(path, defvalue) { + return this._root.findtext(path, defvalue); +}; + +ElementTree.prototype.findall = function(path) { + return this._root.findall(path); +}; + +/** + * Unlike ElementTree, we don't write to a file, we return you a string. + */ +ElementTree.prototype.write = function(options) { + var sb = []; + options = utils.merge({ + encoding: 'utf-8', + xml_declaration: null, + default_namespace: null, + method: 'xml'}, options); + + if (options.xml_declaration !== false) { + sb.push("\n"); + } + + if (options.method === "text") { + _serialize_text(sb, self._root, encoding); + } + else { + var qnames, namespaces, indent, indent_string; + var x = _namespaces(this._root, options.encoding, options.default_namespace); + qnames = x[0]; + namespaces = x[1]; + + if (options.hasOwnProperty('indent')) { + indent = 0; + indent_string = new Array(options.indent + 1).join(' '); + } + else { + indent = false; + } + + if (options.method === "xml") { + _serialize_xml(function(data) { + sb.push(data); + }, this._root, options.encoding, qnames, namespaces, indent, indent_string); + } + else { + /* TODO: html */ + throw new Error("unknown serialization method "+ options.method); + } + } + + return sb.join(""); +}; + +var _namespace_map = { + /* "well-known" namespace prefixes */ + "http://www.w3.org/XML/1998/namespace": "xml", + "http://www.w3.org/1999/xhtml": "html", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", + "http://schemas.xmlsoap.org/wsdl/": "wsdl", + /* xml schema */ + "http://www.w3.org/2001/XMLSchema": "xs", + "http://www.w3.org/2001/XMLSchema-instance": "xsi", + /* dublic core */ + "http://purl.org/dc/elements/1.1/": "dc", +}; + +function register_namespace(prefix, uri) { + if (/ns\d+$/.test(prefix)) { + throw new Error('Prefix format reserved for internal use'); + } + + if (_namespace_map.hasOwnProperty(uri) && _namespace_map[uri] === prefix) { + delete _namespace_map[uri]; + } + + _namespace_map[uri] = prefix; +} + + +function _escape(text, encoding, isAttribute, isText) { + if (text) { + text = text.toString(); + text = text.replace(/&/g, '&'); + text = text.replace(//g, '>'); + if (!isText) { + text = text.replace(/\n/g, ' '); + text = text.replace(/\r/g, ' '); + } + if (isAttribute) { + text = text.replace(/"/g, '"'); + } + } + return text; +} + +/* TODO: benchmark single regex */ +function _escape_attrib(text, encoding) { + return _escape(text, encoding, true); +} + +function _escape_cdata(text, encoding) { + return _escape(text, encoding, false); +} + +function _escape_text(text, encoding) { + return _escape(text, encoding, false, true); +} + +function _namespaces(elem, encoding, default_namespace) { + var qnames = {}; + var namespaces = {}; + + if (default_namespace) { + namespaces[default_namespace] = ""; + } + + function encode(text) { + return text; + } + + function add_qname(qname) { + if (qname[0] === "{") { + var tmp = qname.substring(1).split("}", 2); + var uri = tmp[0]; + var tag = tmp[1]; + var prefix = namespaces[uri]; + + if (prefix === undefined) { + prefix = _namespace_map[uri]; + if (prefix === undefined) { + prefix = "ns" + Object.keys(namespaces).length; + } + if (prefix !== "xml") { + namespaces[uri] = prefix; + } + } + + if (prefix) { + qnames[qname] = sprintf("%s:%s", prefix, tag); + } + else { + qnames[qname] = tag; + } + } + else { + if (default_namespace) { + throw new Error('cannot use non-qualified names with default_namespace option'); + } + + qnames[qname] = qname; + } + } + + + elem.iter(null, function(e) { + var i; + var tag = e.tag; + var text = e.text; + var items = e.items(); + + if (tag instanceof QName && qnames[tag.text] === undefined) { + add_qname(tag.text); + } + else if (typeof(tag) === "string") { + add_qname(tag); + } + else if (tag !== null && tag !== Comment && tag !== ProcessingInstruction) { + throw new Error('Invalid tag type for serialization: '+ tag); + } + + if (text instanceof QName && qnames[text.text] === undefined) { + add_qname(text.text); + } + + items.forEach(function(item) { + var key = item[0], + value = item[1]; + if (key instanceof QName) { + key = key.text; + } + + if (qnames[key] === undefined) { + add_qname(key); + } + + if (value instanceof QName && qnames[value.text] === undefined) { + add_qname(value.text); + } + }); + }); + return [qnames, namespaces]; +} + +function _serialize_xml(write, elem, encoding, qnames, namespaces, indent, indent_string) { + var tag = elem.tag; + var text = elem.text; + var items; + var i; + + var newlines = indent || (indent === 0); + write(Array(indent + 1).join(indent_string)); + + if (tag === Comment) { + write(sprintf("", _escape_cdata(text, encoding))); + } + else if (tag === ProcessingInstruction) { + write(sprintf("", _escape_cdata(text, encoding))); + } + else { + tag = qnames[tag]; + if (tag === undefined) { + if (text) { + write(_escape_text(text, encoding)); + } + elem.iter(function(e) { + _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string); + }); + } + else { + write("<" + tag); + items = elem.items(); + + if (items || namespaces) { + items.sort(); // lexical order + + items.forEach(function(item) { + var k = item[0], + v = item[1]; + + if (k instanceof QName) { + k = k.text; + } + + if (v instanceof QName) { + v = qnames[v.text]; + } + else { + v = _escape_attrib(v, encoding); + } + write(sprintf(" %s=\"%s\"", qnames[k], v)); + }); + + if (namespaces) { + items = utils.items(namespaces); + items.sort(function(a, b) { return a[1] < b[1]; }); + + items.forEach(function(item) { + var k = item[1], + v = item[0]; + + if (k) { + k = ':' + k; + } + + write(sprintf(" xmlns%s=\"%s\"", k, _escape_attrib(v, encoding))); + }); + } + } + + if (text || elem.len()) { + if (text && text.toString().match(/^\s*$/)) { + text = null; + } + + write(">"); + if (!text && newlines) { + write("\n"); + } + + if (text) { + write(_escape_text(text, encoding)); + } + elem._children.forEach(function(e) { + _serialize_xml(write, e, encoding, qnames, null, newlines ? indent + 1 : false, indent_string); + }); + + if (!text && indent) { + write(Array(indent + 1).join(indent_string)); + } + write(""); + } + else { + write(" />"); + } + } + } + + if (newlines) { + write("\n"); + } +} + +function parse(source, parser) { + var tree = new ElementTree(); + tree.parse(source, parser); + return tree; +} + +function tostring(element, options) { + return new ElementTree(element).write(options); +} + +exports.PI = ProcessingInstruction; +exports.Comment = Comment; +exports.ProcessingInstruction = ProcessingInstruction; +exports.SubElement = SubElement; +exports.QName = QName; +exports.ElementTree = ElementTree; +exports.ElementPath = ElementPath; +exports.Element = function(tag, attrib) { + return new Element(tag, attrib); +}; + +exports.XML = function(data) { + var et = new ElementTree(); + return et.parse(data); +}; + +exports.parse = parse; +exports.register_namespace = register_namespace; +exports.tostring = tostring; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/errors.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/errors.js new file mode 100644 index 0000000..e8742be --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/errors.js @@ -0,0 +1,31 @@ +/** + * Copyright 2011 Rackspace + * + * Licensed 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 util = require('util'); + +var sprintf = require('./sprintf').sprintf; + +function SyntaxError(token, msg) { + msg = msg || sprintf('Syntax Error at token %s', token.toString()); + this.token = token; + this.message = msg; + Error.call(this, msg); +} + +util.inherits(SyntaxError, Error); + +exports.SyntaxError = SyntaxError; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parser.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parser.js new file mode 100644 index 0000000..7307ee4 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parser.js @@ -0,0 +1,33 @@ +/* + * Copyright 2011 Rackspace + * + * Licensed 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. + * + */ + +/* TODO: support node-expat C++ module optionally */ + +var util = require('util'); +var parsers = require('./parsers/index'); + +function get_parser(name) { + if (name === 'sax') { + return parsers.sax; + } + else { + throw new Error('Invalid parser: ' + name); + } +} + + +exports.get_parser = get_parser; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/index.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/index.js new file mode 100644 index 0000000..5eac5c8 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/index.js @@ -0,0 +1 @@ +exports.sax = require('./sax'); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/sax.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/sax.js new file mode 100644 index 0000000..69b0a59 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/parsers/sax.js @@ -0,0 +1,56 @@ +var util = require('util'); + +var sax = require('sax'); + +var TreeBuilder = require('./../treebuilder').TreeBuilder; + +function XMLParser(target) { + this.parser = sax.parser(true); + + this.target = (target) ? target : new TreeBuilder(); + + this.parser.onopentag = this._handleOpenTag.bind(this); + this.parser.ontext = this._handleText.bind(this); + this.parser.oncdata = this._handleCdata.bind(this); + this.parser.ondoctype = this._handleDoctype.bind(this); + this.parser.oncomment = this._handleComment.bind(this); + this.parser.onclosetag = this._handleCloseTag.bind(this); + this.parser.onerror = this._handleError.bind(this); +} + +XMLParser.prototype._handleOpenTag = function(tag) { + this.target.start(tag.name, tag.attributes); +}; + +XMLParser.prototype._handleText = function(text) { + this.target.data(text); +}; + +XMLParser.prototype._handleCdata = function(text) { + this.target.data(text); +}; + +XMLParser.prototype._handleDoctype = function(text) { +}; + +XMLParser.prototype._handleComment = function(comment) { +}; + +XMLParser.prototype._handleCloseTag = function(tag) { + this.target.end(tag); +}; + +XMLParser.prototype._handleError = function(err) { + throw err; +}; + +XMLParser.prototype.feed = function(chunk) { + this.parser.write(chunk); +}; + +XMLParser.prototype.close = function() { + this.parser.close(); + return this.target.close(); +}; + +exports.XMLParser = XMLParser; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/sprintf.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/sprintf.js new file mode 100644 index 0000000..f802c1b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/sprintf.js @@ -0,0 +1,86 @@ +/* + * Copyright 2011 Rackspace + * + * Licensed 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 cache = {}; + + +// Do any others need escaping? +var TO_ESCAPE = { + '\'': '\\\'', + '\n': '\\n' +}; + + +function populate(formatter) { + var i, type, + key = formatter, + prev = 0, + arg = 1, + builder = 'return \''; + + for (i = 0; i < formatter.length; i++) { + if (formatter[i] === '%') { + type = formatter[i + 1]; + + switch (type) { + case 's': + builder += formatter.slice(prev, i) + '\' + arguments[' + arg + '] + \''; + prev = i + 2; + arg++; + break; + case 'j': + builder += formatter.slice(prev, i) + '\' + JSON.stringify(arguments[' + arg + ']) + \''; + prev = i + 2; + arg++; + break; + case '%': + builder += formatter.slice(prev, i + 1); + prev = i + 2; + i++; + break; + } + + + } else if (TO_ESCAPE[formatter[i]]) { + builder += formatter.slice(prev, i) + TO_ESCAPE[formatter[i]]; + prev = i + 1; + } + } + + builder += formatter.slice(prev) + '\';'; + cache[key] = new Function(builder); +} + + +/** + * A fast version of sprintf(), which currently only supports the %s and %j. + * This caches a formatting function for each format string that is used, so + * you should only use this sprintf() will be called many times with a single + * format string and a limited number of format strings will ever be used (in + * general this means that format strings should be string literals). + * + * @param {String} formatter A format string. + * @param {...String} var_args Values that will be formatted by %s and %j. + * @return {String} The formatted output. + */ +exports.sprintf = function(formatter, var_args) { + if (!cache[formatter]) { + populate(formatter); + } + + return cache[formatter].apply(null, arguments); +}; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/treebuilder.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/treebuilder.js new file mode 100644 index 0000000..393a98f --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/treebuilder.js @@ -0,0 +1,60 @@ +function TreeBuilder(element_factory) { + this._data = []; + this._elem = []; + this._last = null; + this._tail = null; + if (!element_factory) { + /* evil circular dep */ + element_factory = require('./elementtree').Element; + } + this._factory = element_factory; +} + +TreeBuilder.prototype.close = function() { + return this._last; +}; + +TreeBuilder.prototype._flush = function() { + if (this._data) { + if (this._last !== null) { + var text = this._data.join(""); + if (this._tail) { + this._last.tail = text; + } + else { + this._last.text = text; + } + } + this._data = []; + } +}; + +TreeBuilder.prototype.data = function(data) { + this._data.push(data); +}; + +TreeBuilder.prototype.start = function(tag, attrs) { + this._flush(); + var elem = this._factory(tag, attrs); + this._last = elem; + + if (this._elem.length) { + this._elem[this._elem.length - 1].append(elem); + } + + this._elem.push(elem); + + this._tail = null; +}; + +TreeBuilder.prototype.end = function(tag) { + this._flush(); + this._last = this._elem.pop(); + if (this._last.tag !== tag) { + throw new Error("end tag mismatch"); + } + this._tail = 1; + return this._last; +}; + +exports.TreeBuilder = TreeBuilder; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/utils.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/utils.js new file mode 100644 index 0000000..b08a670 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/lib/utils.js @@ -0,0 +1,72 @@ +/** + * Copyright 2011 Rackspace + * + * Licensed 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. + * + */ + +/** + * @param {Object} hash. + * @param {Array} ignored. + */ +function items(hash, ignored) { + ignored = ignored || null; + var k, rv = []; + + function is_ignored(key) { + if (!ignored || ignored.length === 0) { + return false; + } + + return ignored.indexOf(key); + } + + for (k in hash) { + if (hash.hasOwnProperty(k) && !(is_ignored(ignored))) { + rv.push([k, hash[k]]); + } + } + + return rv; +} + + +function findall(re, str) { + var match, matches = []; + + while ((match = re.exec(str))) { + matches.push(match); + } + + return matches; +} + +function merge(a, b) { + var c = {}, attrname; + + for (attrname in a) { + if (a.hasOwnProperty(attrname)) { + c[attrname] = a[attrname]; + } + } + for (attrname in b) { + if (b.hasOwnProperty(attrname)) { + c[attrname] = b[attrname]; + } + } + return c; +} + +exports.items = items; +exports.findall = findall; +exports.merge = merge; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/AUTHORS b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/AUTHORS new file mode 100644 index 0000000..26d8659 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/AUTHORS @@ -0,0 +1,9 @@ +# contributors sorted by whether or not they're me. +Isaac Z. Schlueter +Stein Martin Hustad +Mikeal Rogers +Laurie Harper +Jann Horn +Elijah Insua +Henry Rawas +Justin Makeig diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/LICENSE b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/README.md new file mode 100644 index 0000000..9c63dc4 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/README.md @@ -0,0 +1,213 @@ +# sax js + +A sax-style parser for XML and HTML. + +Designed with [node](http://nodejs.org/) in mind, but should work fine in +the browser or other CommonJS implementations. + +## What This Is + +* A very simple tool to parse through an XML string. +* A stepping stone to a streaming HTML parser. +* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML + docs. + +## What This Is (probably) Not + +* An HTML Parser - That's a fine goal, but this isn't it. It's just + XML. +* A DOM Builder - You can use it to build an object model out of XML, + but it doesn't do that out of the box. +* XSLT - No DOM = no querying. +* 100% Compliant with (some other SAX implementation) - Most SAX + implementations are in Java and do a lot more than this does. +* An XML Validator - It does a little validation when in strict mode, but + not much. +* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic + masochism. +* A DTD-aware Thing - Fetching DTDs is a much bigger job. + +## Regarding `Hello, world!').close(); + + // stream usage + // takes the same options as the parser + var saxStream = require("sax").createStream(strict, options) + saxStream.on("error", function (e) { + // unhandled errors will throw, since this is a proper node + // event emitter. + console.error("error!", e) + // clear the error + this._parser.error = null + this._parser.resume() + }) + saxStream.on("opentag", function (node) { + // same object as above + }) + // pipe is supported, and it's readable/writable + // same chunks coming in also go out. + fs.createReadStream("file.xml") + .pipe(saxStream) + .pipe(fs.createReadStream("file-copy.xml")) + + + +## Arguments + +Pass the following arguments to the parser function. All are optional. + +`strict` - Boolean. Whether or not to be a jerk. Default: `false`. + +`opt` - Object bag of settings regarding string formatting. All default to `false`. + +Settings supported: + +* `trim` - Boolean. Whether or not to trim text and comment nodes. +* `normalize` - Boolean. If true, then turn any whitespace into a single + space. +* `lowercasetags` - Boolean. If true, then lowercase tags in loose mode, + rather than uppercasing them. +* `xmlns` - Boolean. If true, then namespaces are supported. + +## Methods + +`write` - Write bytes onto the stream. You don't have to do this all at +once. You can keep writing as much as you want. + +`close` - Close the stream. Once closed, no more data may be written until +it is done processing the buffer, which is signaled by the `end` event. + +`resume` - To gracefully handle errors, assign a listener to the `error` +event. Then, when the error is taken care of, you can call `resume` to +continue parsing. Otherwise, the parser will not continue while in an error +state. + +## Members + +At all times, the parser object will have the following members: + +`line`, `column`, `position` - Indications of the position in the XML +document where the parser currently is looking. + +`startTagPosition` - Indicates the position where the current tag starts. + +`closed` - Boolean indicating whether or not the parser can be written to. +If it's `true`, then wait for the `ready` event to write again. + +`strict` - Boolean indicating whether or not the parser is a jerk. + +`opt` - Any options passed into the constructor. + +`tag` - The current tag being dealt with. + +And a bunch of other stuff that you probably shouldn't touch. + +## Events + +All events emit with a single argument. To listen to an event, assign a +function to `on`. Functions get executed in the this-context of +the parser object. The list of supported events are also in the exported +`EVENTS` array. + +When using the stream interface, assign handlers using the EventEmitter +`on` function in the normal fashion. + +`error` - Indication that something bad happened. The error will be hanging +out on `parser.error`, and must be deleted before parsing can continue. By +listening to this event, you can keep an eye on that kind of stuff. Note: +this happens *much* more in strict mode. Argument: instance of `Error`. + +`text` - Text node. Argument: string of text. + +`doctype` - The ``. Argument: +object with `name` and `body` members. Attributes are not parsed, as +processing instructions have implementation dependent semantics. + +`sgmldeclaration` - Random SGML declarations. Stuff like `` +would trigger this kind of event. This is a weird thing to support, so it +might go away at some point. SAX isn't intended to be used to parse SGML, +after all. + +`opentag` - An opening tag. Argument: object with `name` and `attributes`. +In non-strict mode, tag names are uppercased, unless the `lowercasetags` +option is set. If the `xmlns` option is set, then it will contain +namespace binding information on the `ns` member, and will have a +`local`, `prefix`, and `uri` member. + +`closetag` - A closing tag. In loose mode, tags are auto-closed if their +parent closes. In strict mode, well-formedness is enforced. Note that +self-closing tags will have `closeTag` emitted immediately after `openTag`. +Argument: tag name. + +`attribute` - An attribute node. Argument: object with `name` and `value`, +and also namespace information if the `xmlns` option flag is set. + +`comment` - A comment node. Argument: the string of the comment. + +`opencdata` - The opening tag of a ``) of a `` tags trigger a `"script"` +event, and their contents are not checked for special xml characters. +If you pass `noscript: true`, then this behavior is suppressed. + +## Reporting Problems + +It's best to write a failing test if you find an issue. I will always +accept pull requests with failing tests if they demonstrate intended +behavior, but it is very hard to figure out what issue you're describing +without a test. Writing a test is also the best way for you yourself +to figure out if you really understand the issue you think you have with +sax-js. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/big-not-pretty.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/big-not-pretty.xml new file mode 100644 index 0000000..fb5265d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/big-not-pretty.xml @@ -0,0 +1,8002 @@ + + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + + something blerm a bit down here + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/example.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/example.js new file mode 100644 index 0000000..e7f81e6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/example.js @@ -0,0 +1,41 @@ + +var fs = require("fs"), + sys = require("sys"), + path = require("path"), + xml = fs.cat(path.join(__dirname, "test.xml")), + sax = require("../lib/sax"), + strict = sax.parser(true), + loose = sax.parser(false, {trim:true}), + inspector = function (ev) { return function (data) { + // sys.error(""); + // sys.error(ev+": "+sys.inspect(data)); + // for (var i in data) sys.error(i+ " "+sys.inspect(data[i])); + // sys.error(this.line+":"+this.column); + }}; + +xml.addCallback(function (xml) { + // strict.write(xml); + + sax.EVENTS.forEach(function (ev) { + loose["on"+ev] = inspector(ev); + }); + loose.onend = function () { + // sys.error("end"); + // sys.error(sys.inspect(loose)); + }; + + // do this one char at a time to verify that it works. + // (function () { + // if (xml) { + // loose.write(xml.substr(0,1000)); + // xml = xml.substr(1000); + // process.nextTick(arguments.callee); + // } else loose.close(); + // })(); + + for (var i = 0; i < 1000; i ++) { + loose.write(xml); + loose.close(); + } + +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/get-products.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/get-products.js new file mode 100644 index 0000000..9e8d74a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/get-products.js @@ -0,0 +1,58 @@ +// pull out /GeneralSearchResponse/categories/category/items/product tags +// the rest we don't care about. + +var sax = require("../lib/sax.js") +var fs = require("fs") +var path = require("path") +var xmlFile = path.resolve(__dirname, "shopping.xml") +var util = require("util") +var http = require("http") + +fs.readFile(xmlFile, function (er, d) { + http.createServer(function (req, res) { + if (er) throw er + var xmlstr = d.toString("utf8") + + var parser = sax.parser(true) + var products = [] + var product = null + var currentTag = null + + parser.onclosetag = function (tagName) { + if (tagName === "product") { + products.push(product) + currentTag = product = null + return + } + if (currentTag && currentTag.parent) { + var p = currentTag.parent + delete currentTag.parent + currentTag = p + } + } + + parser.onopentag = function (tag) { + if (tag.name !== "product" && !product) return + if (tag.name === "product") { + product = tag + } + tag.parent = currentTag + tag.children = [] + tag.parent && tag.parent.children.push(tag) + currentTag = tag + } + + parser.ontext = function (text) { + if (currentTag) currentTag.children.push(text) + } + + parser.onend = function () { + var out = util.inspect(products, false, 3, true) + res.writeHead(200, {"content-type":"application/json"}) + res.end("{\"ok\":true}") + // res.end(JSON.stringify(products)) + } + + parser.write(xmlstr).end() + }).listen(1337) +}) diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/hello-world.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/hello-world.js new file mode 100644 index 0000000..cbfa518 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/hello-world.js @@ -0,0 +1,4 @@ +require("http").createServer(function (req, res) { + res.writeHead(200, {"content-type":"application/json"}) + res.end(JSON.stringify({ok: true})) +}).listen(1337) diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/not-pretty.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/not-pretty.xml new file mode 100644 index 0000000..9592852 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/not-pretty.xml @@ -0,0 +1,8 @@ + + something blerm a bit down here diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/pretty-print.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/pretty-print.js new file mode 100644 index 0000000..cd6aca9 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/pretty-print.js @@ -0,0 +1,74 @@ +var sax = require("../lib/sax") + , printer = sax.createStream(false, {lowercasetags:true, trim:true}) + , fs = require("fs") + +function entity (str) { + return str.replace('"', '"') +} + +printer.tabstop = 2 +printer.level = 0 +printer.indent = function () { + print("\n") + for (var i = this.level; i > 0; i --) { + for (var j = this.tabstop; j > 0; j --) { + print(" ") + } + } +} +printer.on("opentag", function (tag) { + this.indent() + this.level ++ + print("<"+tag.name) + for (var i in tag.attributes) { + print(" "+i+"=\""+entity(tag.attributes[i])+"\"") + } + print(">") +}) + +printer.on("text", ontext) +printer.on("doctype", ontext) +function ontext (text) { + this.indent() + print(text) +} + +printer.on("closetag", function (tag) { + this.level -- + this.indent() + print("") +}) + +printer.on("cdata", function (data) { + this.indent() + print("") +}) + +printer.on("comment", function (comment) { + this.indent() + print("") +}) + +printer.on("error", function (error) { + console.error(error) + throw error +}) + +if (!process.argv[2]) { + throw new Error("Please provide an xml file to prettify\n"+ + "TODO: read from stdin or take a file") +} +var xmlfile = require("path").join(process.cwd(), process.argv[2]) +var fstr = fs.createReadStream(xmlfile, { encoding: "utf8" }) + +function print (c) { + if (!process.stdout.write(c)) { + fstr.pause() + } +} + +process.stdout.on("drain", function () { + fstr.resume() +}) + +fstr.pipe(printer) diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/shopping.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/shopping.xml new file mode 100644 index 0000000..223c6c6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/shopping.xml @@ -0,0 +1,2 @@ + +sandbox3.1 r31.Kadu4DC.phase357782011.10.06 15:37:23 PSTp2.a121bc2aaf029435dce62011-10-21T18:38:45.982-04:00P0Y0M0DT0H0M0.169S1112You are currently using the SDC API sandbox environment! No clicks to merchant URLs from this response will be paid. Please change the host of your API requests to 'publisher.api.shopping.com' when you have finished development and testinghttp://statTest.dealtime.com/pixel/noscript?PV_EvnTyp=APPV&APPV_APITSP=10%2F21%2F11_06%3A38%3A45_PM&APPV_DSPRQSID=p2.a121bc2aaf029435dce6&APPV_IMGURL=http://img.shopping.com/sc/glb/sdc_logo_106x19.gif&APPV_LI_LNKINID=7000610&APPV_LI_SBMKYW=nikon&APPV_MTCTYP=1000&APPV_PRTID=2002&APPV_BrnID=14804http://www.shopping.com/digital-cameras/productsDigital CamerasDigital CamerasElectronicshttp://www.shopping.com/xCH-electronics-nikon~linkin_id-7000610?oq=nikonCameras and Photographyhttp://www.shopping.com/xCH-cameras_and_photography-nikon~linkin_id-7000610?oq=nikonDigital Camerashttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610nikonnikonDigital Camerashttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610Nikon D3100 Digital Camera14.2 Megapixel, SLR Camera, 3 in. LCD Screen, With High Definition Video, Weight: 1 lb.The Nikon D3100 digital SLR camera speaks to the growing ranks of enthusiastic D-SLR users and aspiring photographers by providing an easy-to-use and affordable entrance to the world of Nikon D-SLR’s. The 14.2-megapixel D3100 has powerful features, such as the enhanced Guide Mode that makes it easy to unleash creative potential and capture memories with still images and full HD video. Like having a personal photo tutor at your fingertips, this unique feature provides a simple graphical interface on the camera’s LCD that guides users by suggesting and/or adjusting camera settings to achieve the desired end result images. The D3100 is also the world’s first D-SLR to introduce full time auto focus (AF) in Live View and D-Movie mode to effortlessly achieve the critical focus needed when shooting Full HD 1080p video.http://di1.shopping.com/images/pi/93/bc/04/101677489-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-606x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=194.56http://img.shopping.com/sc/pr/sdc_stars_sm_4.5.gifhttp://www.shopping.com/Nikon-D3100/reviews~linkin_id-7000610429.001360.00http://www.shopping.com/Nikon-D3100/prices~linkin_id-7000610http://www.shopping.com/Nikon-D3100/info~linkin_id-7000610Nikon D3100 Digital SLR Camera with 18-55mm NIKKOR VR LensThe Nikon D3100 Digital SLR Camera is an affordable compact and lightweight photographic power-house. It features the all-purpose 18-55mm VR lens a high-resolution 14.2 MP CMOS sensor along with a feature set that's comprehensive yet easy to navigate - the intuitive onboard learn-as-you grow guide mode allows the photographer to understand what the 3100 can do quickly and easily. Capture beautiful pictures and amazing Full HD 1080p movies with sound and full-time autofocus. Availabilty: In Stock!7185Nikonhttp://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-350x350-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockFree Shipping with Any Purchase!529.000.00799.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=647&BEFID=7185&aon=%5E1&MerchantID=475674&crawler_id=475674&dealId=-ZW6BMZqz6fbS-aULwga_g%3D%3D&url=http%3A%2F%2Fwww.fumfie.com%2Fproduct%2F343.5%2Fshopping-com%3F&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+Digital+SLR+Camera+with+18-55mm+NIKKOR+VR+Lens&dlprc=529.0&crn=&istrsmrc=1&isathrsl=0&AR=1&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=1&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=658&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=FumFiehttp://img.shopping.com/cctool/merch_logos/475674.gif866 666 91985604.27http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_fumfie~MRD-475674~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSF343C5Nikon Nikon D3100 14.2MP Digital SLR Camera with 18-55mm f/3.5-5.6 AF-S DX VR, CamerasNikon D3100 14.2MP Digital SLR Camera with 18-55mm f/3.5-5.6 AF-S DX VR7185Nikonhttp://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-385x352-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stock549.000.00549.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=779&BEFID=7185&aon=%5E1&MerchantID=305814&crawler_id=305814&dealId=md1e9lD8vdOu4FHQfJqKng%3D%3D&url=http%3A%2F%2Fwww.electronics-expo.com%2Findex.php%3Fpage%3Ditem%26id%3DNIKD3100%26source%3DSideCar%26scpid%3D8%26scid%3Dscsho318727%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Nikon+D3100+14.2MP+Digital+SLR+Camera+with+18-55mm+f%2F3.5-5.6+AF-S+DX+VR%2C+Cameras&dlprc=549.0&crn=&istrsmrc=1&isathrsl=0&AR=9&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=9&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=771&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Electronics Expohttp://img.shopping.com/cctool/merch_logos/305814.gif1-888-707-EXPO3713.90http://img.shopping.com/sc/mr/sdc_checks_4.gifhttp://www.shopping.com/xMR-store_electronics_expo~MRD-305814~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSNIKD3100Nikon D3100 14.2-Megapixel Digital SLR Camera With 18-55mm Zoom-Nikkor Lens, BlackSplit-second shutter response captures shots other cameras may have missed Helps eliminate the frustration of shutter delay! 14.2-megapixels for enlargements worth framing and hanging. Takes breathtaking 1080p HD movies. ISO sensitivity from 100-1600 for bright or dimly lit settings. 3.0in. color LCD for beautiful, wide-angle framing and viewing. In-camera image editing lets you retouch with no PC. Automatic scene modes include Child, Sports, Night Portrait and more. Accepts SDHC memory cards. Nikon D3100 14.2-Megapixel Digital SLR Camera With 18-55mm Zoom-Nikkor Lens, Black is one of many Digital SLR Cameras available through Office Depot. Made by Nikon.7185Nikonhttp://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-250x250-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock549.990.00699.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=698&BEFID=7185&aon=%5E1&MerchantID=467671&crawler_id=467671&dealId=yYuaXnDFtCY7rDUjkY2aaw%3D%3D&url=http%3A%2F%2Flink.mercent.com%2Fredirect.ashx%3Fmr%3AmerchantID%3DOfficeDepot%26mr%3AtrackingCode%3DCEC9669E-6ABC-E011-9F24-0019B9C043EB%26mr%3AtargetUrl%3Dhttp%3A%2F%2Fwww.officedepot.com%2Fa%2Fproducts%2F486292%2FNikon-D3100-142-Megapixel-Digital-SLR%2F%253fcm_mmc%253dMercent-_-Shopping-_-Cameras_and_Camcorders-_-486292&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+14.2-Megapixel+Digital+SLR+Camera+With+18-55mm+Zoom-Nikkor+Lens%2C+Black&dlprc=549.99&crn=&istrsmrc=1&isathrsl=0&AR=10&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=10&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=690&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Office Depothttp://img.shopping.com/cctool/merch_logos/467671.gif1-800-GO-DEPOT1352.37http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_office_depot_4158555~MRD-467671~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS486292Nikon® D3100™ 14.2MP Digital SLR with 18-55mm LensThe Nikon D3100 DSLR will surprise you with its simplicity and impress you with superb results.7185Nikonhttp://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock549.996.05549.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=Rl56U7CuiTYsH4MGZ02lxQ%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D903483107%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D3100%E2%84%A2+14.2MP+Digital+SLR+with+18-55mm+Lens&dlprc=549.99&crn=&istrsmrc=0&isathrsl=0&AR=11&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=11&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS9614867Nikon D3100 SLR w/Nikon 18-55mm VR & 55-200mm VR Lenses14.2 Megapixels3" LCDLive ViewHD 1080p Video w/ Sound & Autofocus11-point Autofocus3 Frames per Second ShootingISO 100 to 3200 (Expand to 12800-Hi2)Self Cleaning SensorEXPEED 2, Image Processing EngineScene Recognition System7185Nikonhttp://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-345x345-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stock695.000.00695.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=huS6xZKDKaKMTMP71eI6DA%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D32983%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+SLR+w%2FNikon+18-55mm+VR+%26+55-200mm+VR+Lenses&dlprc=695.0&crn=&istrsmrc=0&isathrsl=0&AR=15&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=15&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS32983Nikon COOLPIX S203 Digital Camera10 Megapixel, Ultra-Compact Camera, 2.5 in. LCD Screen, 3x Optical Zoom, With Video Capability, Weight: 0.23 lb.With 10.34 mega pixel, electronic VR vibration reduction, 5-level brightness adjustment, 3x optical zoom, and TFT LCD, Nikon Coolpix s203 fulfills all the demands of any photographer. The digital camera has an inbuilt memory of 44MB and an external memory slot made for all kinds of SD (Secure Digital) cards.http://di1.shopping.com/images/pi/c4/ef/1b/95397883-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-500x499-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=20139.00139.00http://www.shopping.com/Nikon-Coolpix-S203/prices~linkin_id-7000610http://www.shopping.com/Nikon-Coolpix-S203/info~linkin_id-7000610Nikon Coolpix S203 Digital Camera (Red)With 10.34 mega pixel, electronic VR vibration reduction, 5-level brightness adjustment, 3x optical zoom, and TFT LCD, Nikon Coolpix s203 fulfills all the demands of any photographer. The digital camera has an inbuilt memory of 44MB and an external memory slot made for all kinds of SD (Secure Digital) cards.7185Nikonhttp://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockFantastic prices with ease & comfort of Amazon.com!139.009.50139.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=566&BEFID=7185&aon=%5E1&MerchantID=301531&crawler_id=1903313&dealId=sBd2JnIEPM-A_lBAM1RZgQ%3D%3D&url=http%3A%2F%2Fwww.amazon.com%2Fdp%2FB002T964IM%2Fref%3Dasc_df_B002T964IM1751618%3Fsmid%3DA22UHVNXG98FAT%26tag%3Ddealtime-ce-mp01feed-20%26linkCode%3Dasn%26creative%3D395105%26creativeASIN%3DB002T964IM&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Coolpix+S203+Digital+Camera+%28Red%29&dlprc=139.0&crn=&istrsmrc=0&isathrsl=0&AR=63&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=95397883&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=63&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=518&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Amazon Marketplacehttp://img.shopping.com/cctool/merch_logos/301531.gif2132.73http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_amazon_marketplace_9689~MRD-301531~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSB002T964IMNikon S3100 Digital Camera14.5 Megapixel, Compact Camera, 2.7 in. LCD Screen, 5x Optical Zoom, With High Definition Video, Weight: 0.23 lb.This digital camera features a wide-angle optical Zoom-NIKKOR glass lens that allows you to capture anything from landscapes to portraits to action shots. The high-definition movie mode with one-touch recording makes it easy to capture video clips.http://di1.shopping.com/images/pi/66/2d/33/106834268-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-507x387-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=312.00http://img.shopping.com/sc/pr/sdc_stars_sm_2.gifhttp://www.shopping.com/nikon-s3100/reviews~linkin_id-700061099.95134.95http://www.shopping.com/nikon-s3100/prices~linkin_id-7000610http://www.shopping.com/nikon-s3100/info~linkin_id-7000610CoolPix S3100 14 Megapixel Compact Digital Camera- RedNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - red7185Nikonhttp://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=UUyGoqV8r0-xrkn-rnGNbg%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJ3Yx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmDAJeU1oyGG0GcBdhGwUGCAVqYF9SO0xSN1sZdmA7dmMdBQAJB24qX1NbQxI6AjA2ME5dVFULPDsGPFcQTTdaLTA6SR0OFlQvPAwMDxYcYlxIVkcoLTcCDA%3D%3D%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=CoolPix+S3100+14+Megapixel+Compact+Digital+Camera-+Red&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=28&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=28&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337013000COOLPIX S3100 PinkNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - pink7185Nikonhttp://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=X87AwXlW1dXoMXk4QQDToQ%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJxYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcUFxDEGsPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=COOLPIX+S3100+Pink&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=31&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=31&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337015000Nikon Coolpix S3100 14.0 MP Digital Camera - SilverNikon Coolpix S3100 14.0 MP Digital Camera - Silver7185Nikonhttp://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-270x270-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock109.970.00109.97http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=803&BEFID=7185&aon=%5E&MerchantID=475774&crawler_id=475774&dealId=nvFwnpfA4rlA1Dbksdsa0w%3D%3D&url=http%3A%2F%2Fwww.thewiz.com%2Fcatalog%2Fproduct.jsp%3FmodelNo%3DS3100SILVER%26gdftrk%3DgdfV2677_a_7c996_a_7c4049_a_7c26262&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Coolpix+S3100+14.0+MP+Digital+Camera+-+Silver&dlprc=109.97&crn=&istrsmrc=0&isathrsl=0&AR=33&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=33&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=797&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=TheWiz.comhttp://img.shopping.com/cctool/merch_logos/475774.gif877-542-69880http://img.shopping.com/sc/glb/flag/US.gifUS26262Nikon� COOLPIX� S3100 14MP Digital Camera (Silver)The Nikon COOLPIX S3100 is the easy way to share your life and stay connected.7185Nikonhttp://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock119.996.05119.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=5GtaN2NeryKwps-Se2l-4g%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D848064082%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C3%AF%C2%BF%C2%BD+COOLPIX%C3%AF%C2%BF%C2%BD+S3100+14MP+Digital+Camera+%28Silver%29&dlprc=119.99&crn=&istrsmrc=0&isathrsl=0&AR=37&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=37&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=509&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS10101095COOLPIX S3100 YellowNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - yellow7185Nikonhttp://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=a43m0RXulX38zCnQjU59jw%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJwYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcUFxDEGoPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=COOLPIX+S3100+Yellow&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=38&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=38&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337014000Nikon D90 Digital Camera12.3 Megapixel, Point and Shoot Camera, 3 in. LCD Screen, With Video Capability, Weight: 1.36 lb.Untitled Document Nikon D90 SLR Digital Camera With 28-80mm 75-300mm Lens Kit The Nikon D90 SLR Digital Camera, with its 12.3-megapixel DX-format CMOS, 3" High resolution LCD display, Scene Recognition System, Picture Control, Active D-Lighting, and one-button Live View, provides photo enthusiasts with the image quality and performance they need to pursue their own vision while still being intuitive enough for use as an everyday camera.http://di1.shopping.com/images/pi/52/fb/d3/99671132-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-499x255-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=475.00http://img.shopping.com/sc/pr/sdc_stars_sm_5.gifhttp://www.shopping.com/Nikon-D90-with-18-270mm-Lens/reviews~linkin_id-7000610689.002299.00http://www.shopping.com/Nikon-D90-with-18-270mm-Lens/prices~linkin_id-7000610http://www.shopping.com/Nikon-D90-with-18-270mm-Lens/info~linkin_id-7000610Nikon® D90 12.3MP Digital SLR Camera (Body Only)The Nikon D90 will make you rethink what a digital SLR camera can achieve.7185Nikonhttp://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stock1015.996.051015.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=GU5JJkpUAxe5HujB7fkwAA%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D851830266%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D90+12.3MP+Digital+SLR+Camera+%28Body+Only%29&dlprc=1015.99&crn=&istrsmrc=0&isathrsl=0&AR=14&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=14&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS10148659Nikon D90 SLR Digital Camera (Camera Body)The Nikon D90 SLR Digital Camera with its 12.3-megapixel DX-format CCD 3" High resolution LCD display Scene Recognition System Picture Control Active D-Lighting and one-button Live View provides photo enthusiasts with the image quality and performance they need to pursue their own vision while still being intuitive enough for use as an everyday camera. In addition the D90 introduces the D-Movie mode allowing for the first time an interchangeable lens SLR camera that is capable of recording 720p HD movie clips. Availabilty: In Stock7185Nikonhttp://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-350x350-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stockFree Shipping with Any Purchase!689.000.00900.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=647&BEFID=7185&aon=%5E1&MerchantID=475674&crawler_id=475674&dealId=XhURuSC-spBbTIDfo4qfzQ%3D%3D&url=http%3A%2F%2Fwww.fumfie.com%2Fproduct%2F169.5%2Fshopping-com%3F&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+Digital+Camera+%28Camera+Body%29&dlprc=689.0&crn=&istrsmrc=1&isathrsl=0&AR=16&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=16&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=658&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=FumFiehttp://img.shopping.com/cctool/merch_logos/475674.gif866 666 91985604.27http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_fumfie~MRD-475674~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSF169C5Nikon D90 SLR w/Nikon 18-105mm VR & 55-200mm VR Lenses12.3 MegapixelDX Format CMOS Sensor3" VGA LCD DisplayLive ViewSelf Cleaning SensorD-Movie ModeHigh Sensitivity (ISO 3200)4.5 fps BurstIn-Camera Image Editing7185Nikonhttp://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock1189.000.001189.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=o0Px_XLWDbrxAYRy3rCmyQ%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D30619%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+w%2FNikon+18-105mm+VR+%26+55-200mm+VR+Lenses&dlprc=1189.0&crn=&istrsmrc=0&isathrsl=0&AR=20&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=20&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS30619Nikon D90 12.3 Megapixel Digital SLR Camera (Body Only)Fusing 12.3 megapixel image quality and a cinematic 24fps D-Movie Mode, the Nikon D90 exceeds the demands of passionate photographers. Coupled with Nikon's EXPEED image processing technologies and NIKKOR optics, breathtaking image fidelity is assured. Combined with fast 0.15ms power-up and split-second 65ms shooting lag, dramatic action and decisive moments are captured easily. Effective 4-frequency, ultrasonic sensor cleaning frees image degrading dust particles from the sensor's optical low pass filter.7185Nikonhttp://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stockFREE FEDEX 2-3 DAY DELIVERY899.950.00899.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=269&BEFID=7185&aon=%5E&MerchantID=9296&crawler_id=811558&dealId=4HgbWJSJ8ssgIf8B0MXIwA%3D%3D&url=http%3A%2F%2Fwww.pcnation.com%2Foptics-gallery%2Fdetails.asp%3Faffid%3D305%26item%3D2N145P&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+12.3+Megapixel+Digital+SLR+Camera+%28Body+Only%29&dlprc=899.95&crn=&istrsmrc=1&isathrsl=0&AR=21&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=21&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=257&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=PCNationhttp://img.shopping.com/cctool/merch_logos/9296.gif800-470-707916224.43http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_pcnation_9689~MRD-9296~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS2N145PNikon D90 12.3MP Digital SLR Camera (Body Only)Fusing 12.3-megapixel image quality inherited from the award-winning D300 with groundbreaking features, the D90's breathtaking, low-noise image quality is further advanced with EXPEED image processing. Split-second shutter response and continuous shooting at up to 4.5 frames-per-second provide the power to capture fast action and precise moments perfectly, while Nikon's exclusive Scene Recognition System contributes to faster 11-area autofocus performance, finer white balance detection and more. The D90 delivers the control passionate photographers demand, utilizing comprehensive exposure functions and the intelligence of 3D Color Matrix Metering II. Stunning results come to life on a 3-inch 920,000-dot color LCD monitor, providing accurate image review, Live View composition and brilliant playback of the D90's cinematic-quality 24-fps HD D-Movie mode.7185Nikonhttp://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockFantastic prices with ease & comfort of Amazon.com!780.000.00780.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=566&BEFID=7185&aon=%5E1&MerchantID=301531&crawler_id=1903313&dealId=UNDa3uMDZXOnvD_7sTILYg%3D%3D&url=http%3A%2F%2Fwww.amazon.com%2Fdp%2FB001ET5U92%2Fref%3Dasc_df_B001ET5U921751618%3Fsmid%3DAHF4SYKP09WBH%26tag%3Ddealtime-ce-mp01feed-20%26linkCode%3Dasn%26creative%3D395105%26creativeASIN%3DB001ET5U92&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+12.3MP+Digital+SLR+Camera+%28Body+Only%29&dlprc=780.0&crn=&istrsmrc=0&isathrsl=0&AR=29&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=29&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=520&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Amazon Marketplacehttp://img.shopping.com/cctool/merch_logos/301531.gif2132.73http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_amazon_marketplace_9689~MRD-301531~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSB001ET5U92Nikon D90 Digital Camera with 18-105mm lens12.9 Megapixel, SLR Camera, 3 in. LCD Screen, 5.8x Optical Zoom, With Video Capability, Weight: 2.3 lb.Its 12.3 megapixel DX-format CMOS image sensor and EXPEED image processing system offer outstanding image quality across a wide ISO light sensitivity range. Live View mode lets you compose and shoot via the high-resolution 3-inch LCD monitor, and an advanced Scene Recognition System and autofocus performance help capture images with astounding accuracy. Movies can be shot in Motion JPEG format using the D-Movie function. The camera’s large image sensor ensures exceptional movie image quality and you can create dramatic effects by shooting with a wide range of interchangeable NIKKOR lenses, from wide-angle to macro to fisheye, or by adjusting the lens aperture and experimenting with depth-of-field. The D90 – designed to fuel your passion for photography.http://di1.shopping.com/images/pi/57/6a/4f/70621646-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-490x489-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5324.81http://img.shopping.com/sc/pr/sdc_stars_sm_5.gifhttp://www.shopping.com/Nikon-D90-with-18-105mm-lens/reviews~linkin_id-7000610849.951599.95http://www.shopping.com/Nikon-D90-with-18-105mm-lens/prices~linkin_id-7000610http://www.shopping.com/Nikon-D90-with-18-105mm-lens/info~linkin_id-7000610Nikon D90 18-105mm VR LensThe Nikon D90 SLR Digital Camera with its 12.3-megapixel DX-format CMOS 3" High resolution LCD display Scene Recognition System Picture Control Active D-Lighting and one-button Live View prov7185Nikonhttp://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-260x260-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stock849.950.00849.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=419&BEFID=7185&aon=%5E1&MerchantID=9390&crawler_id=1905054&dealId=3o5e1VghgJPfhLvT1JFKTA%3D%3D&url=http%3A%2F%2Fwww.ajrichard.com%2FNikon-D90-18-105mm-VR-Lens%2Fp-292%3Frefid%3DShopping%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+18-105mm+VR+Lens&dlprc=849.95&crn=&istrsmrc=0&isathrsl=0&AR=2&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=2&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=425&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=AJRichardhttp://img.shopping.com/cctool/merch_logos/9390.gif1-888-871-125631244.48http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_ajrichard~MRD-9390~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS292Nikon D90 SLR w/Nikon 18-105mm VR Lens12.3 MegapixelDX Format CMOS Sensor3" VGA LCD DisplayLive ViewSelf Cleaning SensorD-Movie ModeHigh Sensitivity (ISO 3200)4.5 fps BurstIn-Camera Image Editing7185Nikonhttp://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stock909.000.00909.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=_lYWj_jbwfsSkfcwUcDuww%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D30971%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+w%2FNikon+18-105mm+VR+Lens&dlprc=909.0&crn=&istrsmrc=0&isathrsl=0&AR=3&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=3&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS3097125448/D90 12.3 Megapixel Digital Camera 18-105mm Zoom Lens w/ 3" Screen - BlackNikon D90 - Digital camera - SLR - 12.3 Mpix - Nikon AF-S DX 18-105mm lens - optical zoom: 5.8 x - supported memory: SD, SDHC7185Nikonhttp://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stockGet 30 days FREE SHIPPING w/ ShipVantage1199.008.201199.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=1KCclCGuWvty2XKU9skadg%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBRtFXpzYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcVlhCGGkPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=25448%2FD90+12.3+Megapixel+Digital+Camera+18-105mm+Zoom+Lens+w%2F+3%22+Screen+-+Black&dlprc=1199.0&crn=&istrsmrc=1&isathrsl=0&AR=4&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=4&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=586&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00353197000Nikon® D90 12.3MP Digital SLR with 18-105mm LensThe Nikon D90 will make you rethink what a digital SLR camera can achieve.7185Nikonhttp://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock1350.996.051350.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=3-VOSfVV5Jo7HlA4kJtanA%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D982673361%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D90+12.3MP+Digital+SLR+with+18-105mm+Lens&dlprc=1350.99&crn=&istrsmrc=0&isathrsl=0&AR=5&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=5&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS11148905Nikon D90 Kit 12.3-megapixel Digital SLR with 18-105mm VR LensPhotographers, take your passion further!Now is the time for new creativity, and to rethink what a digital SLR camera can achieve. It's time for the D90, a camera with everything you would expect from Nikon's next-generation D-SLRs, and some unexpected surprises, as well. The stunning image quality is inherited from the D300, Nikon's DX-format flagship. The D90 also has Nikon's unmatched ergonomics and high performance, and now takes high-quality movies with beautifully cinematic results. The world of photography has changed, and with the D90 in your hands, it's time to make your own rules.AF-S DX NIKKOR 18-105mm f/3.5-5.6G ED VR LensWide-ratio 5.8x zoom Compact, versatile and ideal for a broad range of shooting situations, ranging from interiors and landscapes to beautiful portraits� a perfect everyday zoom. Nikon VR (Vibration Reduction) image stabilization Vibration Reduction is engineered specifically for each VR NIKKOR lens and enables handheld shooting at up to 3 shutter speeds slower than would7185Nikonhttp://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-300x232-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockShipping Included!1050.000.001199.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=135&BEFID=7185&aon=%5E1&MerchantID=313162&crawler_id=313162&dealId=kQnB6rS4AjN5dx5h2_631g%3D%3D&url=http%3A%2F%2Fonecall.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1pZSxNoWHFwLx8GTAICa2ZeH1sPXTZLNzRpAh1HR0BxPQEGCBJNMhFHUElsFCFCVkVTTHAcBggEHQ4aHXNpGERGH3RQODsbAgdechJtbBt8fx8JAwhtZFAzJj1oGgIWCxRlNyFOUV9UUGIxBgo0T0IyTSYqJ0RWHw4QPCIBAAQXRGMDICg6TllZVBhh%26nAID%3D13736960&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+Kit+12.3-megapixel+Digital+SLR+with+18-105mm+VR+Lens&dlprc=1050.0&crn=&istrsmrc=1&isathrsl=0&AR=6&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=6&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=1&code=&acode=143&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=OneCallhttp://img.shopping.com/cctool/merch_logos/313162.gif1.800.398.07661804.44http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_onecall_9689~MRD-313162~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS92826Price rangehttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610$24 - $4012http://www.shopping.com/digital-cameras/nikon/products?minPrice=24&maxPrice=4012&linkin_id=7000610$4012 - $7999http://www.shopping.com/digital-cameras/nikon/products?minPrice=4012&maxPrice=7999&linkin_id=7000610Brandhttp://www.shopping.com/digital-cameras/nikon/products~all-9688-brand~MS-1?oq=nikon&linkin_id=7000610Nikonhttp://www.shopping.com/digital-cameras/nikon+brand-nikon/products~linkin_id-7000610Cranehttp://www.shopping.com/digital-cameras/nikon+9688-brand-crane/products~linkin_id-7000610Ikelitehttp://www.shopping.com/digital-cameras/nikon+ikelite/products~linkin_id-7000610Bowerhttp://www.shopping.com/digital-cameras/nikon+bower/products~linkin_id-7000610FUJIFILMhttp://www.shopping.com/digital-cameras/nikon+brand-fuji/products~linkin_id-7000610Storehttp://www.shopping.com/digital-cameras/nikon/products~all-store~MS-1?oq=nikon&linkin_id=7000610Amazon Marketplacehttp://www.shopping.com/digital-cameras/nikon+store-amazon-marketplace-9689/products~linkin_id-7000610Amazonhttp://www.shopping.com/digital-cameras/nikon+store-amazon/products~linkin_id-7000610Adoramahttp://www.shopping.com/digital-cameras/nikon+store-adorama/products~linkin_id-7000610J&R Music and Computer Worldhttp://www.shopping.com/digital-cameras/nikon+store-j-r-music-and-computer-world/products~linkin_id-7000610RytherCamera.comhttp://www.shopping.com/digital-cameras/nikon+store-rythercamera-com/products~linkin_id-7000610Resolutionhttp://www.shopping.com/digital-cameras/nikon/products~all-21885-resolution~MS-1?oq=nikon&linkin_id=7000610Under 4 Megapixelhttp://www.shopping.com/digital-cameras/nikon+under-4-megapixel/products~linkin_id-7000610At least 5 Megapixelhttp://www.shopping.com/digital-cameras/nikon+5-megapixel-digital-cameras/products~linkin_id-7000610At least 6 Megapixelhttp://www.shopping.com/digital-cameras/nikon+6-megapixel-digital-cameras/products~linkin_id-7000610At least 7 Megapixelhttp://www.shopping.com/digital-cameras/nikon+7-megapixel-digital-cameras/products~linkin_id-7000610At least 8 Megapixelhttp://www.shopping.com/digital-cameras/nikon+8-megapixel-digital-cameras/products~linkin_id-7000610Featureshttp://www.shopping.com/digital-cameras/nikon/products~all-32804-features~MS-1?oq=nikon&linkin_id=7000610Shockproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-shockproof/products~linkin_id-7000610Waterproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-waterproof/products~linkin_id-7000610Freezeproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-freezeproof/products~linkin_id-7000610Dust proofhttp://www.shopping.com/digital-cameras/nikon+32804-features-dust-proof/products~linkin_id-7000610Image Stabilizationhttp://www.shopping.com/digital-cameras/nikon+32804-features-image-stabilization/products~linkin_id-7000610hybriddigital camerag1sonycameracanonnikonkodak digital camerakodaksony cybershotkodak easyshare digital cameranikon coolpixolympuspink digital cameracanon powershot \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/strict.dtd b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/strict.dtd new file mode 100644 index 0000000..b274559 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/strict.dtd @@ -0,0 +1,870 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/switch-bench.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/switch-bench.js new file mode 100644 index 0000000..4d3cf14 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/switch-bench.js @@ -0,0 +1,45 @@ +#!/usr/local/bin/node-bench + +var Promise = require("events").Promise; + +var xml = require("posix").cat("test.xml").wait(), + path = require("path"), + sax = require("../lib/sax"), + saxT = require("../lib/sax-trampoline"), + + parser = sax.parser(false, {trim:true}), + parserT = saxT.parser(false, {trim:true}), + + sys = require("sys"); + + +var count = exports.stepsPerLap = 500, + l = xml.length, + runs = 0; +exports.countPerLap = 1000; +exports.compare = { + "switch" : function () { + // sys.debug("switch runs: "+runs++); + // for (var x = 0; x < l; x += 1000) { + // parser.write(xml.substr(x, 1000)) + // } + // for (var i = 0; i < count; i ++) { + parser.write(xml); + parser.close(); + // } + // done(); + }, + trampoline : function () { + // sys.debug("trampoline runs: "+runs++); + // for (var x = 0; x < l; x += 1000) { + // parserT.write(xml.substr(x, 1000)) + // } + // for (var i = 0; i < count; i ++) { + parserT.write(xml); + parserT.close(); + // } + // done(); + }, +}; + +sys.debug("rock and roll..."); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.html b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.html new file mode 100644 index 0000000..61f8f1a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.html @@ -0,0 +1,15 @@ + + + + + testing the parser + + + +

hello + + + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.xml new file mode 100644 index 0000000..801292d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/examples/test.xml @@ -0,0 +1,1254 @@ + + +]> + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + + Some Text + + + + + + + are ok in here. ]]> + + Pre-Text & Inlined text Post-text. +  + + \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js new file mode 100644 index 0000000..17fb08e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/lib/sax.js @@ -0,0 +1,1006 @@ +// wrapper for non-node envs +;(function (sax) { + +sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } +sax.SAXParser = SAXParser +sax.SAXStream = SAXStream +sax.createStream = createStream + +// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. +// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), +// since that's the earliest that a buffer overrun could occur. This way, checks are +// as rare as required, but as often as necessary to ensure never crossing this bound. +// Furthermore, buffers are only tested at most once per write(), so passing a very +// large string into write() might have undesirable effects, but this is manageable by +// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme +// edge case, result in creating at most one complete copy of the string passed in. +// Set to Infinity to have unlimited buffers. +sax.MAX_BUFFER_LENGTH = 64 * 1024 + +var buffers = [ + "comment", "sgmlDecl", "textNode", "tagName", "doctype", + "procInstName", "procInstBody", "entity", "attribName", + "attribValue", "cdata", "script" +] + +sax.EVENTS = // for discoverability. + [ "text" + , "processinginstruction" + , "sgmldeclaration" + , "doctype" + , "comment" + , "attribute" + , "opentag" + , "closetag" + , "opencdata" + , "cdata" + , "closecdata" + , "error" + , "end" + , "ready" + , "script" + , "opennamespace" + , "closenamespace" + ] + +function SAXParser (strict, opt) { + if (!(this instanceof SAXParser)) return new SAXParser(strict, opt) + + var parser = this + clearBuffers(parser) + parser.q = parser.c = "" + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH + parser.opt = opt || {} + parser.tagCase = parser.opt.lowercasetags ? "toLowerCase" : "toUpperCase" + parser.tags = [] + parser.closed = parser.closedRoot = parser.sawRoot = false + parser.tag = parser.error = null + parser.strict = !!strict + parser.noscript = !!(strict || parser.opt.noscript) + parser.state = S.BEGIN + parser.ENTITIES = Object.create(sax.ENTITIES) + parser.attribList = [] + + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) parser.ns = Object.create(rootNS) + + // mostly just for error reporting + parser.position = parser.line = parser.column = 0 + emit(parser, "onready") +} + +if (!Object.create) Object.create = function (o) { + function f () { this.__proto__ = o } + f.prototype = o + return new f +} + +if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) { + return o.__proto__ +} + +if (!Object.keys) Object.keys = function (o) { + var a = [] + for (var i in o) if (o.hasOwnProperty(i)) a.push(i) + return a +} + +function checkBufferLength (parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) + , maxActual = 0 + for (var i = 0, l = buffers.length; i < l; i ++) { + var len = parser[buffers[i]].length + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case "textNode": + closeText(parser) + break + + case "cdata": + emitNode(parser, "oncdata", parser.cdata) + parser.cdata = "" + break + + case "script": + emitNode(parser, "onscript", parser.script) + parser.script = "" + break + + default: + error(parser, "Max buffer length exceeded: "+buffers[i]) + } + } + maxActual = Math.max(maxActual, len) + } + // schedule the next check for the earliest possible buffer overrun. + parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + + parser.position +} + +function clearBuffers (parser) { + for (var i = 0, l = buffers.length; i < l; i ++) { + parser[buffers[i]] = "" + } +} + +SAXParser.prototype = + { end: function () { end(this) } + , write: write + , resume: function () { this.error = null; return this } + , close: function () { return this.write(null) } + , end: function () { return this.write(null) } + } + +try { + var Stream = require("stream").Stream +} catch (ex) { + var Stream = function () {} +} + + +var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== "error" && ev !== "end" +}) + +function createStream (strict, opt) { + return new SAXStream(strict, opt) +} + +function SAXStream (strict, opt) { + if (!(this instanceof SAXStream)) return new SAXStream(strict, opt) + + Stream.apply(me) + + this._parser = new SAXParser(strict, opt) + this.writable = true + this.readable = true + + + var me = this + + this._parser.onend = function () { + me.emit("end") + } + + this._parser.onerror = function (er) { + me.emit("error", er) + + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null + } + + streamWraps.forEach(function (ev) { + Object.defineProperty(me, "on" + ev, { + get: function () { return me._parser["on" + ev] }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev) + return me._parser["on"+ev] = h + } + me.on(ev, h) + }, + enumerable: true, + configurable: false + }) + }) +} + +SAXStream.prototype = Object.create(Stream.prototype, + { constructor: { value: SAXStream } }) + +SAXStream.prototype.write = function (data) { + this._parser.write(data.toString()) + this.emit("data", data) + return true +} + +SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) this._parser.write(chunk.toString()) + this._parser.end() + return true +} + +SAXStream.prototype.on = function (ev, handler) { + var me = this + if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) { + me._parser["on"+ev] = function () { + var args = arguments.length === 1 ? [arguments[0]] + : Array.apply(null, arguments) + args.splice(0, 0, ev) + me.emit.apply(me, args) + } + } + + return Stream.prototype.on.call(me, ev, handler) +} + + + +// character classes and tokens +var whitespace = "\r\n\t " + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + , number = "0124356789" + , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + // (Letter | "_" | ":") + , nameStart = letter+"_:" + , nameBody = nameStart+number+"-." + , quote = "'\"" + , entity = number+letter+"#" + , attribEnd = whitespace + ">" + , CDATA = "[CDATA[" + , DOCTYPE = "DOCTYPE" + , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" + , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/" + , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } + +// turn all the string character sets into character class objects. +whitespace = charClass(whitespace) +number = charClass(number) +letter = charClass(letter) +nameStart = charClass(nameStart) +nameBody = charClass(nameBody) +quote = charClass(quote) +entity = charClass(entity) +attribEnd = charClass(attribEnd) + +function charClass (str) { + return str.split("").reduce(function (s, c) { + s[c] = true + return s + }, {}) +} + +function is (charclass, c) { + return charclass[c] +} + +function not (charclass, c) { + return !charclass[c] +} + +var S = 0 +sax.STATE = +{ BEGIN : S++ +, TEXT : S++ // general stuff +, TEXT_ENTITY : S++ // & and such. +, OPEN_WAKA : S++ // < +, SGML_DECL : S++ // +, SCRIPT : S++ // " + , expect : + [ [ "opentag", { name: "xml", attributes: {} } ] + , [ "opentag", { name: "script", attributes: {} } ] + , [ "text", "hello world" ] + , [ "closetag", "script" ] + , [ "closetag", "xml" ] + ] + , strict : false + , opt : { lowercasetags: true, noscript: true } + } + ) + +require(__dirname).test + ( { xml : "" + , expect : + [ [ "opentag", { name: "xml", attributes: {} } ] + , [ "opentag", { name: "script", attributes: {} } ] + , [ "opencdata", undefined ] + , [ "cdata", "hello world" ] + , [ "closecdata", undefined ] + , [ "closetag", "script" ] + , [ "closetag", "xml" ] + ] + , strict : false + , opt : { lowercasetags: true, noscript: true } + } + ) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/parser-position.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/parser-position.js new file mode 100644 index 0000000..e4a68b1 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/parser-position.js @@ -0,0 +1,28 @@ +var sax = require("../lib/sax"), + assert = require("assert") + +function testPosition(chunks, expectedEvents) { + var parser = sax.parser(); + expectedEvents.forEach(function(expectation) { + parser['on' + expectation[0]] = function() { + for (var prop in expectation[1]) { + assert.equal(parser[prop], expectation[1][prop]); + } + } + }); + chunks.forEach(function(chunk) { + parser.write(chunk); + }); +}; + +testPosition(['

abcdefgh
'], + [ ['opentag', { position: 5, startTagPosition: 1 }] + , ['text', { position: 19, startTagPosition: 14 }] + , ['closetag', { position: 19, startTagPosition: 14 }] + ]); + +testPosition(['
abcde','fgh
'], + [ ['opentag', { position: 5, startTagPosition: 1 }] + , ['text', { position: 19, startTagPosition: 14 }] + , ['closetag', { position: 19, startTagPosition: 14 }] + ]); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/script.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/script.js new file mode 100644 index 0000000..464c051 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/script.js @@ -0,0 +1,12 @@ +require(__dirname).test({ + xml : "", + expect : [ + ["opentag", {"name": "HTML","attributes": {}}], + ["opentag", {"name": "HEAD","attributes": {}}], + ["opentag", {"name": "SCRIPT","attributes": {}}], + ["script", "if (1 < 0) { console.log('elo there'); }"], + ["closetag", "SCRIPT"], + ["closetag", "HEAD"], + ["closetag", "HTML"] + ] +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child-strict.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child-strict.js new file mode 100644 index 0000000..ce9c045 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child-strict.js @@ -0,0 +1,40 @@ + +require(__dirname).test({ + xml : + ""+ + "" + + "" + + "" + + "" + + "=(|)" + + "" + + "", + expect : [ + ["opentag", { + "name": "root", + "attributes": {} + }], + ["opentag", { + "name": "child", + "attributes": {} + }], + ["opentag", { + "name": "haha", + "attributes": {} + }], + ["closetag", "haha"], + ["closetag", "child"], + ["opentag", { + "name": "monkey", + "attributes": {} + }], + ["text", "=(|)"], + ["closetag", "monkey"], + ["closetag", "root"], + ["end"], + ["ready"] + ], + strict : true, + opt : {} +}); + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child.js new file mode 100644 index 0000000..bc6b52b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-child.js @@ -0,0 +1,40 @@ + +require(__dirname).test({ + xml : + ""+ + "" + + "" + + "" + + "" + + "=(|)" + + "" + + "", + expect : [ + ["opentag", { + "name": "ROOT", + "attributes": {} + }], + ["opentag", { + "name": "CHILD", + "attributes": {} + }], + ["opentag", { + "name": "HAHA", + "attributes": {} + }], + ["closetag", "HAHA"], + ["closetag", "CHILD"], + ["opentag", { + "name": "MONKEY", + "attributes": {} + }], + ["text", "=(|)"], + ["closetag", "MONKEY"], + ["closetag", "ROOT"], + ["end"], + ["ready"] + ], + strict : false, + opt : {} +}); + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-tag.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-tag.js new file mode 100644 index 0000000..b2c5736 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/self-closing-tag.js @@ -0,0 +1,25 @@ + +require(__dirname).test({ + xml : + " "+ + " "+ + " "+ + " "+ + "=(|) "+ + ""+ + " ", + expect : [ + ["opentag", {name:"ROOT", attributes:{}}], + ["opentag", {name:"HAHA", attributes:{}}], + ["closetag", "HAHA"], + ["opentag", {name:"HAHA", attributes:{}}], + ["closetag", "HAHA"], + // ["opentag", {name:"HAHA", attributes:{}}], + // ["closetag", "HAHA"], + ["opentag", {name:"MONKEY", attributes:{}}], + ["text", "=(|)"], + ["closetag", "MONKEY"], + ["closetag", "ROOT"] + ], + opt : { trim : true } +}); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/stray-ending.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/stray-ending.js new file mode 100644 index 0000000..6b0aa7f --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/stray-ending.js @@ -0,0 +1,17 @@ +// stray ending tags should just be ignored in non-strict mode. +// https://github.com/isaacs/sax-js/issues/32 +require(__dirname).test + ( { xml : + "
" + , expect : + [ [ "opentag", { name: "A", attributes: {} } ] + , [ "opentag", { name: "B", attributes: {} } ] + , [ "text", "" ] + , [ "closetag", "B" ] + , [ "closetag", "A" ] + ] + , strict : false + , opt : {} + } + ) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/trailing-non-whitespace.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/trailing-non-whitespace.js new file mode 100644 index 0000000..3e1fb2e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/trailing-non-whitespace.js @@ -0,0 +1,17 @@ + +require(__dirname).test({ + xml : "Welcome, to monkey land", + expect : [ + ["opentag", { + "name": "SPAN", + "attributes": {} + }], + ["text", "Welcome,"], + ["closetag", "SPAN"], + ["text", " to monkey land"], + ["end"], + ["ready"] + ], + strict : false, + opt : {} +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/unquoted.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/unquoted.js new file mode 100644 index 0000000..79f1d0b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/unquoted.js @@ -0,0 +1,17 @@ +// unquoted attributes should be ok in non-strict mode +// https://github.com/isaacs/sax-js/issues/31 +require(__dirname).test + ( { xml : + "" + , expect : + [ [ "attribute", { name: "class", value: "test" } ] + , [ "attribute", { name: "hello", value: "world" } ] + , [ "opentag", { name: "SPAN", + attributes: { class: "test", hello: "world" } } ] + , [ "closetag", "SPAN" ] + ] + , strict : false + , opt : {} + } + ) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-issue-41.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-issue-41.js new file mode 100644 index 0000000..596d82b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-issue-41.js @@ -0,0 +1,67 @@ +var t = require(__dirname) + + , xmls = // should be the same both ways. + [ "" + , "" ] + + , ex1 = + [ [ "opennamespace" + , { prefix: "a" + , uri: "http://ATTRIBUTE" + } + ] + , [ "attribute" + , { name: "xmlns:a" + , value: "http://ATTRIBUTE" + , prefix: "xmlns" + , local: "a" + , uri: "http://www.w3.org/2000/xmlns/" + } + ] + , [ "attribute" + , { name: "a:attr" + , local: "attr" + , prefix: "a" + , uri: "http://ATTRIBUTE" + , value: "value" + } + ] + , [ "opentag" + , { name: "parent" + , uri: "" + , prefix: "" + , local: "parent" + , attributes: + { "a:attr": + { name: "a:attr" + , local: "attr" + , prefix: "a" + , uri: "http://ATTRIBUTE" + , value: "value" + } + , "xmlns:a": + { name: "xmlns:a" + , local: "a" + , prefix: "xmlns" + , uri: "http://www.w3.org/2000/xmlns/" + , value: "http://ATTRIBUTE" + } + } + , ns: {"a": "http://ATTRIBUTE"} + } + ] + , ["closetag", "parent"] + , ["closenamespace", { prefix: "a", uri: "http://ATTRIBUTE" }] + ] + + // swap the order of elements 2 and 1 + , ex2 = [ex1[0], ex1[2], ex1[1]].concat(ex1.slice(3)) + , expected = [ex1, ex2] + +xmls.forEach(function (x, i) { + t.test({ xml: x + , expect: expected[i] + , strict: true + , opt: { xmlns: true } + }) +}) diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-rebinding.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-rebinding.js new file mode 100644 index 0000000..f464876 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-rebinding.js @@ -0,0 +1,59 @@ + +require(__dirname).test + ( { xml : + ""+ + ""+ + ""+ + ""+ + ""+ + "" + + , expect : + [ [ "opennamespace", { prefix: "x", uri: "x1" } ] + , [ "opennamespace", { prefix: "y", uri: "y1" } ] + , [ "attribute", { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ] + , [ "attribute", { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" } ] + , [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ] + , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] + , [ "opentag", { name: "root", uri: "", prefix: "", local: "root", + attributes: { "xmlns:x": { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } + , "xmlns:y": { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" } + , "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } + , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, + ns: { x: 'x1', y: 'y1' } } ] + + , [ "opennamespace", { prefix: "x", uri: "x2" } ] + , [ "attribute", { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ] + , [ "opentag", { name: "rebind", uri: "", prefix: "", local: "rebind", + attributes: { "xmlns:x": { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } }, + ns: { x: 'x2' } } ] + + , [ "attribute", { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" } ] + , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] + , [ "opentag", { name: "check", uri: "", prefix: "", local: "check", + attributes: { "x:a": { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" } + , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, + ns: { x: 'x2' } } ] + + , [ "closetag", "check" ] + + , [ "closetag", "rebind" ] + , [ "closenamespace", { prefix: "x", uri: "x2" } ] + + , [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ] + , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] + , [ "opentag", { name: "check", uri: "", prefix: "", local: "check", + attributes: { "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } + , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, + ns: { x: 'x1', y: 'y1' } } ] + , [ "closetag", "check" ] + + , [ "closetag", "root" ] + , [ "closenamespace", { prefix: "x", uri: "x1" } ] + , [ "closenamespace", { prefix: "y", uri: "y1" } ] + ] + , strict : true + , opt : { xmlns: true } + } + ) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-strict.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-strict.js new file mode 100644 index 0000000..4ad615b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-strict.js @@ -0,0 +1,71 @@ + +require(__dirname).test + ( { xml : + ""+ + ""+ + ""+ + ""+ + ""+ + ""+ + ""+ + ""+ + ""+ + "" + + , expect : + [ [ "opentag", { name: "root", prefix: "", local: "root", uri: "", + attributes: {}, ns: {} } ] + + , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ] + , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "", + attributes: { "attr": { name: "attr", value: "normal", uri: "", prefix: "", local: "attr", uri: "" } }, + ns: {} } ] + , [ "closetag", "plain" ] + + , [ "opennamespace", { prefix: "", uri: "uri:default" } ] + + , [ "attribute", { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } ] + , [ "opentag", { name: "ns1", prefix: "", local: "ns1", uri: "uri:default", + attributes: { "xmlns": { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } }, + ns: { "": "uri:default" } } ] + + , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "uri:default" } ] + , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "uri:default", ns: { '': 'uri:default' }, + attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "uri:default" } } } ] + , [ "closetag", "plain" ] + + , [ "closetag", "ns1" ] + + , [ "closenamespace", { prefix: "", uri: "uri:default" } ] + + , [ "opennamespace", { prefix: "a", uri: "uri:nsa" } ] + + , [ "attribute", { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } ] + + , [ "opentag", { name: "ns2", prefix: "", local: "ns2", uri: "", + attributes: { "xmlns:a": { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } }, + ns: { a: "uri:nsa" } } ] + + , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ] + , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "", + attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } }, + ns: { a: 'uri:nsa' } } ] + , [ "closetag", "plain" ] + + , [ "attribute", { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } ] + , [ "opentag", { name: "a:ns", prefix: "a", local: "ns", uri: "uri:nsa", + attributes: { "a:attr": { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } }, + ns: { a: 'uri:nsa' } } ] + , [ "closetag", "a:ns" ] + + , [ "closetag", "ns2" ] + + , [ "closenamespace", { prefix: "a", uri: "uri:nsa" } ] + + , [ "closetag", "root" ] + ] + , strict : true + , opt : { xmlns: true } + } + ) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-unbound.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-unbound.js new file mode 100644 index 0000000..2944b87 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-unbound.js @@ -0,0 +1,15 @@ + +require(__dirname).test( + { strict : true + , opt : { xmlns: true } + , expect : + [ ["error", "Unbound namespace prefix: \"unbound\"\nLine: 0\nColumn: 28\nChar: >"] + + , [ "attribute", { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } ] + , [ "opentag", { name: "root", uri: "", prefix: "", local: "root", + attributes: { "unbound:attr": { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } }, + ns: {} } ] + , [ "closetag", "root" ] + ] + } +).write("") diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js new file mode 100644 index 0000000..16da771 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js @@ -0,0 +1,35 @@ +require(__dirname).test( + { xml : "" + , expect : + [ [ "attribute" + , { name: "xml:lang" + , local: "lang" + , prefix: "xml" + , uri: "http://www.w3.org/XML/1998/namespace" + , value: "en" + } + ] + , [ "opentag" + , { name: "root" + , uri: "" + , prefix: "" + , local: "root" + , attributes: + { "xml:lang": + { name: "xml:lang" + , local: "lang" + , prefix: "xml" + , uri: "http://www.w3.org/XML/1998/namespace" + , value: "en" + } + } + , ns: {} + } + ] + , ["closetag", "root"] + ] + , strict : true + , opt : { xmlns: true } + } +) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix.js new file mode 100644 index 0000000..9a1ce1b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-prefix.js @@ -0,0 +1,20 @@ +require(__dirname).test( + { xml : "" + , expect : + [ + [ "opentag" + , { name: "xml:root" + , uri: "http://www.w3.org/XML/1998/namespace" + , prefix: "xml" + , local: "root" + , attributes: {} + , ns: {} + } + ] + , ["closetag", "xml:root"] + ] + , strict : true + , opt : { xmlns: true } + } +) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-redefine.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-redefine.js new file mode 100644 index 0000000..1eba9c7 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/node_modules/sax/test/xmlns-xml-default-redefine.js @@ -0,0 +1,40 @@ +require(__dirname).test( + { xml : "" + , expect : + [ ["error" + , "xml: prefix must be bound to http://www.w3.org/XML/1998/namespace\n" + + "Actual: ERROR\n" + + "Line: 0\nColumn: 27\nChar: '" + ] + , [ "attribute" + , { name: "xmlns:xml" + , local: "xml" + , prefix: "xmlns" + , uri: "http://www.w3.org/2000/xmlns/" + , value: "ERROR" + } + ] + , [ "opentag" + , { name: "xml:root" + , uri: "http://www.w3.org/XML/1998/namespace" + , prefix: "xml" + , local: "root" + , attributes: + { "xmlns:xml": + { name: "xmlns:xml" + , local: "xml" + , prefix: "xmlns" + , uri: "http://www.w3.org/2000/xmlns/" + , value: "ERROR" + } + } + , ns: {} + } + ] + , ["closetag", "xml:root"] + ] + , strict : true + , opt : { xmlns: true } + } +) + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/package.json new file mode 100644 index 0000000..749a8d7 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/package.json @@ -0,0 +1,59 @@ +{ + "author": { + "name": "Rackspace US, Inc." + }, + "contributors": [ + { + "name": "Paul Querna", + "email": "paul.querna@rackspace.com" + }, + { + "name": "Tomaz Muraus", + "email": "tomaz.muraus@rackspace.com" + } + ], + "name": "elementtree", + "description": "XML Serialization and Parsing module based on Python's ElementTree.", + "version": "0.1.5", + "keywords": [ + "xml", + "sax", + "parser", + "seralization", + "elementtree" + ], + "homepage": "https://github.com/racker/node-elementtree", + "repository": { + "type": "git", + "url": "git://github.com/racker/node-elementtree.git" + }, + "main": "lib/elementtree.js", + "directories": { + "lib": "lib" + }, + "scripts": { + "test": "make test" + }, + "engines": { + "node": ">= 0.4.0" + }, + "dependencies": { + "sax": "0.3.5" + }, + "devDependencies": { + "whiskey": "0.6.8" + }, + "licenses": [ + { + "type": "Apache", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + ], + "readme": "node-elementtree\n====================\n\nnode-elementtree is a [Node.js](http://nodejs.org) XML parser and serializer based upon the [Python ElementTree v1.3](http://effbot.org/zone/element-index.htm) module.\n\nInstallation\n====================\n\n $ npm install elementtree\n \nUsing the library\n====================\n\nFor the usage refer to the Python ElementTree library documentation - [http://effbot.org/zone/element-index.htm#usage](http://effbot.org/zone/element-index.htm#usage).\n\nSupported XPath expressions in `find`, `findall` and `findtext` methods are listed on [http://effbot.org/zone/element-xpath.htm](http://effbot.org/zone/element-xpath.htm).\n\nBuild status\n====================\n\n[![Build Status](https://secure.travis-ci.org/racker/node-elementtree.png)](http://travis-ci.org/racker/node-elementtree)\n\n\nLicense\n====================\n\nnode-elementtree is distributed under the [Apache license](http://www.apache.org/licenses/LICENSE-2.0.html).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/racker/node-elementtree/issues" + }, + "_id": "elementtree@0.1.5", + "_from": "elementtree@0.1.5" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml1.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml1.xml new file mode 100644 index 0000000..72c33ae --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml1.xml @@ -0,0 +1,17 @@ + + + dd + test_object_1 + 4281c348eaf83e70ddce0e07221c3d28 + 14 + application/octetstream + 2009-02-03T05:26:32.612278 + + + test_object_2 + b039efe731ad111bc1b0ef221c3849d0 + 64 + application/octetstream + 2009-02-03T05:26:32.612278 + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml2.xml b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml2.xml new file mode 100644 index 0000000..5f94bbd --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/data/xml2.xml @@ -0,0 +1,14 @@ + + + + Hello World + + + + + + + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/test-simple.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/test-simple.js new file mode 100644 index 0000000..2ab0b7b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/elementtree/tests/test-simple.js @@ -0,0 +1,299 @@ +/** + * Copyright 2011 Rackspace + * + * Licensed 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 fs = require('fs'); +var path = require('path'); + +var sprintf = require('./../lib/sprintf').sprintf; +var et = require('elementtree'); +var XML = et.XML; +var ElementTree = et.ElementTree; +var Element = et.Element; +var SubElement = et.SubElement; +var SyntaxError = require('./../lib/errors').SyntaxError; + +function readFile(name) { + return fs.readFileSync(path.join(__dirname, '/data/', name), 'utf8'); +} + +exports['test_simplest'] = function(test, assert) { + /* Ported from */ + var Element = et.Element; + var root = Element('root'); + root.append(Element('one')); + root.append(Element('two')); + root.append(Element('three')); + assert.equal(3, root.len()); + assert.equal('one', root.getItem(0).tag); + assert.equal('two', root.getItem(1).tag); + assert.equal('three', root.getItem(2).tag); + test.finish(); +}; + + +exports['test_attribute_values'] = function(test, assert) { + var XML = et.XML; + var root = XML(''); + assert.equal('Alpha', root.attrib['alpha']); + assert.equal('Beta', root.attrib['beta']); + assert.equal('Gamma', root.attrib['gamma']); + test.finish(); +}; + + +exports['test_findall'] = function(test, assert) { + var XML = et.XML; + var root = XML(''); + + assert.equal(root.findall("c").length, 1); + assert.equal(root.findall(".//c").length, 2); + assert.equal(root.findall(".//b").length, 3); + assert.equal(root.findall(".//b")[0]._children.length, 1); + assert.equal(root.findall(".//b")[1]._children.length, 0); + assert.equal(root.findall(".//b")[2]._children.length, 0); + assert.deepEqual(root.findall('.//b')[0], root.getchildren()[0]); + + test.finish(); +}; + +exports['test_find'] = function(test, assert) { + var a = Element('a'); + var b = SubElement(a, 'b'); + var c = SubElement(a, 'c'); + + assert.deepEqual(a.find('./b/..'), a); + test.finish(); +}; + +exports['test_elementtree_find_qname'] = function(test, assert) { + var tree = new et.ElementTree(XML('')); + assert.deepEqual(tree.find(new et.QName('c')), tree.getroot()._children[2]); + test.finish(); +}; + +exports['test_attrib_ns_clear'] = function(test, assert) { + var attribNS = '{http://foo/bar}x'; + + var par = Element('par'); + par.set(attribNS, 'a'); + var child = SubElement(par, 'child'); + child.set(attribNS, 'b'); + + assert.equal('a', par.get(attribNS)); + assert.equal('b', child.get(attribNS)); + + par.clear(); + assert.equal(null, par.get(attribNS)); + assert.equal('b', child.get(attribNS)); + test.finish(); +}; + +exports['test_create_tree_and_parse_simple'] = function(test, assert) { + var i = 0; + var e = new Element('bar', {}); + var expected = "\n" + + 'ponies'; + + SubElement(e, "blah", {a: 11}); + SubElement(e, "blah", {a: 12}); + var se = et.SubElement(e, "gag", {a: '13', b: 'abc'}); + se.text = 'ponies'; + + se.itertext(function(text) { + assert.equal(text, 'ponies'); + i++; + }); + + assert.equal(i, 1); + var etree = new ElementTree(e); + var xml = etree.write(); + assert.equal(xml, expected); + test.finish(); +}; + +exports['test_write_with_options'] = function(test, assert) { + var i = 0; + var e = new Element('bar', {}); + var expected1 = "\n" + + '\n' + + ' \n' + + ' test\n' + + ' \n' + + ' \n' + + ' ponies\n' + + '\n'; + var expected2 = "\n" + + '\n' + + ' \n' + + ' test\n' + + ' \n' + + ' \n' + + ' ponies\n' + + '\n'; + + var expected3 = "\n" + + '\n' + + ' \n' + + ' Hello World\n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' Test & Test & Test\n' + + ' \n' + + '\n'; + + var se1 = SubElement(e, "blah", {a: 11}); + var se2 = SubElement(se1, "baz", {d: 11}); + se2.text = 'test'; + SubElement(e, "blah", {a: 12}); + var se = et.SubElement(e, "gag", {a: '13', b: 'abc'}); + se.text = 'ponies'; + + se.itertext(function(text) { + assert.equal(text, 'ponies'); + i++; + }); + + assert.equal(i, 1); + var etree = new ElementTree(e); + var xml1 = etree.write({'indent': 4}); + var xml2 = etree.write({'indent': 2}); + assert.equal(xml1, expected1); + assert.equal(xml2, expected2); + + var file = readFile('xml2.xml'); + var etree2 = et.parse(file); + var xml3 = etree2.write({'indent': 4}); + assert.equal(xml3, expected3); + test.finish(); +}; + +exports['test_parse_and_find_2'] = function(test, assert) { + var data = readFile('xml1.xml'); + var etree = et.parse(data); + + assert.equal(etree.findall('./object').length, 2); + assert.equal(etree.findall('[@name]').length, 1); + assert.equal(etree.findall('[@name="test_container_1"]').length, 1); + assert.equal(etree.findall('[@name=\'test_container_1\']').length, 1); + assert.equal(etree.findall('./object')[0].findtext('name'), 'test_object_1'); + assert.equal(etree.findtext('./object/name'), 'test_object_1'); + assert.equal(etree.findall('.//bytes').length, 2); + assert.equal(etree.findall('*/bytes').length, 2); + assert.equal(etree.findall('*/foobar').length, 0); + + test.finish(); +}; + +exports['test_namespaced_attribute'] = function(test, assert) { + var data = readFile('xml1.xml'); + var etree = et.parse(data); + + assert.equal(etree.findall('*/bytes[@android:type="cool"]').length, 1); + + test.finish(); +} + +exports['test_syntax_errors'] = function(test, assert) { + var expressions = [ './/@bar', '[@bar', '[@foo=bar]', '[@', '/bar' ]; + var errCount = 0; + var data = readFile('xml1.xml'); + var etree = et.parse(data); + + expressions.forEach(function(expression) { + try { + etree.findall(expression); + } + catch (err) { + errCount++; + } + }); + + assert.equal(errCount, expressions.length); + test.finish(); +}; + +exports['test_register_namespace'] = function(test, assert){ + var prefix = 'TESTPREFIX'; + var namespace = 'http://seriously.unknown/namespace/URI'; + var errCount = 0; + + var etree = Element(sprintf('{%s}test', namespace)); + assert.equal(et.tostring(etree, { 'xml_declaration': false}), + sprintf('', namespace)); + + et.register_namespace(prefix, namespace); + var etree = Element(sprintf('{%s}test', namespace)); + assert.equal(et.tostring(etree, { 'xml_declaration': false}), + sprintf('<%s:test xmlns:%s="%s" />', prefix, prefix, namespace)); + + try { + et.register_namespace('ns25', namespace); + } + catch (err) { + errCount++; + } + + assert.equal(errCount, 1, 'Reserved prefix used, but exception was not thrown'); + test.finish(); +}; + +exports['test_tostring'] = function(test, assert) { + var a = Element('a'); + var b = SubElement(a, 'b'); + var c = SubElement(a, 'c'); + c.text = 543; + + assert.equal(et.tostring(a, { 'xml_declaration': false }), '543'); + assert.equal(et.tostring(c, { 'xml_declaration': false }), '543'); + test.finish(); +}; + +exports['test_escape'] = function(test, assert) { + var a = Element('a'); + var b = SubElement(a, 'b'); + b.text = '&&&&<>"\n\r'; + + assert.equal(et.tostring(a, { 'xml_declaration': false }), '&&&&<>\"\n\r'); + test.finish(); +}; + +exports['test_find_null'] = function(test, assert) { + var root = Element('root'); + var node = SubElement(root, 'node'); + var leaf = SubElement(node, 'leaf'); + leaf.text = 'ipsum'; + + assert.equal(root.find('node/leaf'), leaf); + assert.equal(root.find('no-such-node/leaf'), null); + test.finish(); +}; + +exports['test_findtext_null'] = function(test, assert) { + var root = Element('root'); + var node = SubElement(root, 'node'); + var leaf = SubElement(node, 'leaf'); + leaf.text = 'ipsum'; + + assert.equal(root.findtext('node/leaf'), 'ipsum'); + assert.equal(root.findtext('no-such-node/leaf'), null); + test.finish(); +}; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.jshintrc b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.jshintrc new file mode 100644 index 0000000..2b7e39b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.jshintrc @@ -0,0 +1,14 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": "nofunc", + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "unused": true, + "boss": true, + "eqnull": true, + "node": true +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.travis.yml b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.travis.yml new file mode 100644 index 0000000..42d4302 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - 0.8 + - '0.10' +before_script: + - npm install -g grunt-cli diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/Gruntfile.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/Gruntfile.js new file mode 100644 index 0000000..ff37751 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/Gruntfile.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + nodeunit: { + files: ['test/**/*_test.js'], + }, + jshint: { + options: { + jshintrc: '.jshintrc' + }, + gruntfile: { + src: 'Gruntfile.js' + }, + lib: { + src: ['lib/**/*.js'] + }, + test: { + src: ['test/**/*.js'] + }, + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + lib: { + files: '<%= jshint.lib.src %>', + tasks: ['jshint:lib', 'nodeunit'] + }, + test: { + files: '<%= jshint.test.src %>', + tasks: ['jshint:test', 'nodeunit'] + }, + }, + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task. + grunt.registerTask('default', ['jshint', 'nodeunit']); + +}; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/LICENSE-MIT b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/LICENSE-MIT new file mode 100644 index 0000000..bb2aad6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 "Cowboy" Ben Alman + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/README.md new file mode 100644 index 0000000..a022301 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/README.md @@ -0,0 +1,74 @@ +# exit [![Build Status](https://secure.travis-ci.org/cowboy/node-exit.png?branch=master)](http://travis-ci.org/cowboy/node-exit) + +A replacement for process.exit that ensures stdio are fully drained before exiting. + +To make a long story short, if `process.exit` is called on Windows, script output is often truncated when pipe-redirecting `stdout` or `stderr`. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling `process.exit`. + +See [Node.js issue #3584](https://github.com/joyent/node/issues/3584) for further reference. + +Tested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18. + +Based on some code by [@vladikoff](https://github.com/vladikoff). + +## Getting Started +Install the module with: `npm install exit` + +```javascript +var exit = require('exit'); + +// These lines should appear in the output, EVEN ON WINDOWS. +console.log("omg"); +console.error("yay"); + +// process.exit(5); +exit(5); + +// These lines shouldn't appear in the output. +console.log("wtf"); +console.error("bro"); +``` + +## Don't believe me? Try it for yourself. + +In Windows, clone the repo and cd to the `test\fixtures` directory. The only difference between [log.js](test/fixtures/log.js) and [log-broken.js](test/fixtures/log-broken.js) is that the former uses `exit` while the latter calls `process.exit` directly. + +This test was done using cmd.exe, but you can see the same results using `| grep "std"` in either PowerShell or git-bash. + +``` +C:\node-exit\test\fixtures>node log.js 0 10 stdout stderr 2>&1 | find "std" +stdout 0 +stderr 0 +stdout 1 +stderr 1 +stdout 2 +stderr 2 +stdout 3 +stderr 3 +stdout 4 +stderr 4 +stdout 5 +stderr 5 +stdout 6 +stderr 6 +stdout 7 +stderr 7 +stdout 8 +stderr 8 +stdout 9 +stderr 9 + +C:\node-exit\test\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find "std" + +C:\node-exit\test\fixtures> +``` + +## Contributing +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). + +## Release History +2013-09-26 - v0.1.1 - Fixed some bugs. It seems to actually work now! +2013-09-20 - v0.1.0 - Initial release. + +## License +Copyright (c) 2013 "Cowboy" Ben Alman +Licensed under the MIT license. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/lib/exit.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/lib/exit.js new file mode 100644 index 0000000..3c411ed --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/lib/exit.js @@ -0,0 +1,41 @@ +/* + * exit + * https://github.com/cowboy/node-exit + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + */ + +'use strict'; + +module.exports = function exit(exitCode, streams) { + if (!streams) { streams = [process.stdout, process.stderr]; } + var drainCount = 0; + // Actually exit if all streams are drained. + function tryToExit() { + if (drainCount === streams.length) { + process.exit(exitCode); + } + } + streams.forEach(function(stream) { + // Prevent further writing. + stream.write = function() {}; + // Count drained streams now, but monitor non-drained streams. + if (stream.bufferSize === 0) { + drainCount++; + } else { + stream.once('drain', function() { + drainCount++; + tryToExit(); + }); + } + }); + // If all streams were already drained, exit now. + tryToExit(); + // In Windows, when run as a Node.js child process, a script utilizing + // this library might just exit with a 0 exit code, regardless. This code, + // despite the fact that it looks a bit crazy, appears to fix that. + process.on('exit', function() { + process.exit(exitCode); + }); +}; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/package.json new file mode 100644 index 0000000..0c6977a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/package.json @@ -0,0 +1,51 @@ +{ + "name": "exit", + "description": "A replacement for process.exit that ensures stdio are fully drained before exiting.", + "version": "0.1.1", + "homepage": "https://github.com/cowboy/node-exit", + "author": { + "name": "\"Cowboy\" Ben Alman", + "url": "http://benalman.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/cowboy/node-exit.git" + }, + "bugs": { + "url": "https://github.com/cowboy/node-exit/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/cowboy/node-exit/blob/master/LICENSE-MIT" + } + ], + "main": "lib/exit", + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "devDependencies": { + "grunt-contrib-jshint": "~0.6.4", + "grunt-contrib-nodeunit": "~0.2.0", + "grunt-contrib-watch": "~0.5.3", + "grunt": "~0.4.1", + "which": "~1.0.5" + }, + "keywords": [ + "exit", + "process", + "stdio", + "stdout", + "stderr", + "drain", + "flush", + "3584" + ], + "readme": "# exit [![Build Status](https://secure.travis-ci.org/cowboy/node-exit.png?branch=master)](http://travis-ci.org/cowboy/node-exit)\n\nA replacement for process.exit that ensures stdio are fully drained before exiting.\n\nTo make a long story short, if `process.exit` is called on Windows, script output is often truncated when pipe-redirecting `stdout` or `stderr`. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling `process.exit`.\n\nSee [Node.js issue #3584](https://github.com/joyent/node/issues/3584) for further reference.\n\nTested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18.\n\nBased on some code by [@vladikoff](https://github.com/vladikoff).\n\n## Getting Started\nInstall the module with: `npm install exit`\n\n```javascript\nvar exit = require('exit');\n\n// These lines should appear in the output, EVEN ON WINDOWS.\nconsole.log(\"omg\");\nconsole.error(\"yay\");\n\n// process.exit(5);\nexit(5);\n\n// These lines shouldn't appear in the output.\nconsole.log(\"wtf\");\nconsole.error(\"bro\");\n```\n\n## Don't believe me? Try it for yourself.\n\nIn Windows, clone the repo and cd to the `test\\fixtures` directory. The only difference between [log.js](test/fixtures/log.js) and [log-broken.js](test/fixtures/log-broken.js) is that the former uses `exit` while the latter calls `process.exit` directly.\n\nThis test was done using cmd.exe, but you can see the same results using `| grep \"std\"` in either PowerShell or git-bash.\n\n```\nC:\\node-exit\\test\\fixtures>node log.js 0 10 stdout stderr 2>&1 | find \"std\"\nstdout 0\nstderr 0\nstdout 1\nstderr 1\nstdout 2\nstderr 2\nstdout 3\nstderr 3\nstdout 4\nstderr 4\nstdout 5\nstderr 5\nstdout 6\nstderr 6\nstdout 7\nstderr 7\nstdout 8\nstderr 8\nstdout 9\nstderr 9\n\nC:\\node-exit\\test\\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find \"std\"\n\nC:\\node-exit\\test\\fixtures>\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-09-26 - v0.1.1 - Fixed some bugs. It seems to actually work now! \n2013-09-20 - v0.1.0 - Initial release.\n\n## License\nCopyright (c) 2013 \"Cowboy\" Ben Alman \nLicensed under the MIT license.\n", + "readmeFilename": "README.md", + "_id": "exit@0.1.1", + "_from": "exit@0.1.1" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/exit_test.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/exit_test.js new file mode 100644 index 0000000..a91afb9 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/exit_test.js @@ -0,0 +1,121 @@ +'use strict'; + +/* + ======== A Handy Little Nodeunit Reference ======== + https://github.com/caolan/nodeunit + + Test methods: + test.expect(numAssertions) + test.done() + Test assertions: + test.ok(value, [message]) + test.equal(actual, expected, [message]) + test.notEqual(actual, expected, [message]) + test.deepEqual(actual, expected, [message]) + test.notDeepEqual(actual, expected, [message]) + test.strictEqual(actual, expected, [message]) + test.notStrictEqual(actual, expected, [message]) + test.throws(block, [error], [message]) + test.doesNotThrow(block, [error], [message]) + test.ifError(value) +*/ + +var fs = require('fs'); +var exec = require('child_process').exec; + +var _which = require('which').sync; +function which(command) { + try { + _which(command); + return command; + } catch (err) { + return false; + } +} + +// Look for grep first (any OS). If not found (but on Windows) look for find, +// which is Windows' horribly crippled grep alternative. +var grep = which('grep') || process.platform === 'win32' && which('find'); + +exports['exit'] = { + setUp: function(done) { + this.origCwd = process.cwd(); + process.chdir('test/fixtures'); + done(); + }, + tearDown: function(done) { + process.chdir(this.origCwd); + done(); + }, + 'grep': function(test) { + test.expect(1); + // Many unit tests depend on this. + test.ok(grep, 'A suitable "grep" or "find" program was not found in the PATH.'); + test.done(); + }, + // The rest of the tests are built dynamically, to keep things sane. +}; + +// A few helper functions. +function normalizeLineEndings(s) { + return s.replace(/\r?\n/g, '\n'); +} + +// Capture command output, normalizing captured stdout to unix file endings. +function run(command, callback) { + exec(command, function(error, stdout) { + callback(error ? error.code : 0, normalizeLineEndings(stdout)); + }); +} + +// Read a fixture file, normalizing file contents to unix file endings. +function fixture(filename) { + return normalizeLineEndings(String(fs.readFileSync(filename))); +} + +function buildTests() { + // Build individual unit tests for command output. + var counts = [10, 100, 1000]; + var outputs = [' stdout stderr', ' stdout', ' stderr']; + var pipes = ['', ' | ' + grep + ' "std"']; + counts.forEach(function(count) { + outputs.forEach(function(output) { + pipes.forEach(function(pipe) { + var command = 'node log.js 0 ' + count + output + ' 2>&1' + pipe; + exports['exit']['output (' + command + ')'] = function(test) { + test.expect(2); + run(command, function(code, actual) { + var expected = fixture(count + output.replace(/ /g, '-') + '.txt'); + // Sometimes, the actual file lines are out of order on Windows. + // But since the point of this lib is to drain the buffer and not + // guarantee output order, we only test the length. + test.equal(actual.length, expected.length, 'should be the same length.'); + // The "fail" lines in log.js should NOT be output! + test.ok(actual.indexOf('fail') === -1, 'should not output after exit is called.'); + test.done(); + }); + }; + }); + }); + }); + + // Build individual unit tests for exit codes. + var codes = [0, 1, 123]; + codes.forEach(function(code) { + var command = 'node log.js ' + code + ' 10 stdout stderr'; + exports['exit']['exit code (' + command + ')'] = function(test) { + test.expect(1); + run(command, function(actual) { + // The specified exit code should be passed through. + test.equal(actual, code, 'should exit with ' + code + ' error code.'); + test.done(); + }); + }; + }); +} + +// Don't bother building tests if grep wasn't found, otherwise everything will +// fail and the error will get lost. +if (grep) { + buildTests(); +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stderr.txt new file mode 100644 index 0000000..2859200 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stderr.txt @@ -0,0 +1,10 @@ +stderr 0 +stderr 1 +stderr 2 +stderr 3 +stderr 4 +stderr 5 +stderr 6 +stderr 7 +stderr 8 +stderr 9 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout-stderr.txt new file mode 100644 index 0000000..9de8616 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout-stderr.txt @@ -0,0 +1,20 @@ +stdout 0 +stderr 0 +stdout 1 +stdout 2 +stderr 1 +stdout 3 +stderr 2 +stderr 3 +stdout 4 +stderr 4 +stdout 5 +stderr 5 +stdout 6 +stderr 6 +stdout 7 +stderr 7 +stdout 8 +stderr 8 +stdout 9 +stderr 9 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout.txt new file mode 100644 index 0000000..1ce90dc --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/10-stdout.txt @@ -0,0 +1,10 @@ +stdout 0 +stdout 1 +stdout 2 +stdout 3 +stdout 4 +stdout 5 +stdout 6 +stdout 7 +stdout 8 +stdout 9 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stderr.txt new file mode 100644 index 0000000..3a78c85 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stderr.txt @@ -0,0 +1,100 @@ +stderr 0 +stderr 1 +stderr 2 +stderr 3 +stderr 4 +stderr 5 +stderr 6 +stderr 7 +stderr 8 +stderr 9 +stderr 10 +stderr 11 +stderr 12 +stderr 13 +stderr 14 +stderr 15 +stderr 16 +stderr 17 +stderr 18 +stderr 19 +stderr 20 +stderr 21 +stderr 22 +stderr 23 +stderr 24 +stderr 25 +stderr 26 +stderr 27 +stderr 28 +stderr 29 +stderr 30 +stderr 31 +stderr 32 +stderr 33 +stderr 34 +stderr 35 +stderr 36 +stderr 37 +stderr 38 +stderr 39 +stderr 40 +stderr 41 +stderr 42 +stderr 43 +stderr 44 +stderr 45 +stderr 46 +stderr 47 +stderr 48 +stderr 49 +stderr 50 +stderr 51 +stderr 52 +stderr 53 +stderr 54 +stderr 55 +stderr 56 +stderr 57 +stderr 58 +stderr 59 +stderr 60 +stderr 61 +stderr 62 +stderr 63 +stderr 64 +stderr 65 +stderr 66 +stderr 67 +stderr 68 +stderr 69 +stderr 70 +stderr 71 +stderr 72 +stderr 73 +stderr 74 +stderr 75 +stderr 76 +stderr 77 +stderr 78 +stderr 79 +stderr 80 +stderr 81 +stderr 82 +stderr 83 +stderr 84 +stderr 85 +stderr 86 +stderr 87 +stderr 88 +stderr 89 +stderr 90 +stderr 91 +stderr 92 +stderr 93 +stderr 94 +stderr 95 +stderr 96 +stderr 97 +stderr 98 +stderr 99 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout-stderr.txt new file mode 100644 index 0000000..65f35f4 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout-stderr.txt @@ -0,0 +1,200 @@ +stdout 0 +stderr 0 +stdout 1 +stderr 1 +stdout 2 +stderr 2 +stdout 3 +stderr 3 +stdout 4 +stderr 4 +stdout 5 +stderr 5 +stdout 6 +stderr 6 +stdout 7 +stderr 7 +stdout 8 +stderr 8 +stdout 9 +stderr 9 +stdout 10 +stderr 10 +stdout 11 +stderr 11 +stdout 12 +stderr 12 +stdout 13 +stderr 13 +stdout 14 +stderr 14 +stdout 15 +stderr 15 +stdout 16 +stderr 16 +stdout 17 +stderr 17 +stdout 18 +stderr 18 +stdout 19 +stderr 19 +stdout 20 +stderr 20 +stdout 21 +stderr 21 +stdout 22 +stderr 22 +stdout 23 +stderr 23 +stdout 24 +stderr 24 +stdout 25 +stderr 25 +stdout 26 +stderr 26 +stdout 27 +stderr 27 +stdout 28 +stderr 28 +stdout 29 +stderr 29 +stdout 30 +stderr 30 +stdout 31 +stderr 31 +stdout 32 +stderr 32 +stdout 33 +stderr 33 +stdout 34 +stderr 34 +stdout 35 +stderr 35 +stdout 36 +stderr 36 +stdout 37 +stderr 37 +stdout 38 +stderr 38 +stdout 39 +stderr 39 +stdout 40 +stderr 40 +stdout 41 +stderr 41 +stdout 42 +stderr 42 +stdout 43 +stderr 43 +stdout 44 +stderr 44 +stdout 45 +stderr 45 +stdout 46 +stderr 46 +stdout 47 +stderr 47 +stdout 48 +stderr 48 +stdout 49 +stderr 49 +stdout 50 +stderr 50 +stdout 51 +stderr 51 +stdout 52 +stderr 52 +stdout 53 +stderr 53 +stdout 54 +stderr 54 +stdout 55 +stderr 55 +stdout 56 +stderr 56 +stdout 57 +stderr 57 +stdout 58 +stderr 58 +stdout 59 +stderr 59 +stdout 60 +stderr 60 +stdout 61 +stderr 61 +stdout 62 +stderr 62 +stdout 63 +stderr 63 +stdout 64 +stderr 64 +stdout 65 +stderr 65 +stdout 66 +stderr 66 +stdout 67 +stderr 67 +stdout 68 +stderr 68 +stdout 69 +stderr 69 +stdout 70 +stderr 70 +stdout 71 +stderr 71 +stdout 72 +stderr 72 +stdout 73 +stderr 73 +stdout 74 +stderr 74 +stdout 75 +stderr 75 +stdout 76 +stderr 76 +stdout 77 +stderr 77 +stdout 78 +stderr 78 +stdout 79 +stderr 79 +stdout 80 +stderr 80 +stdout 81 +stderr 81 +stdout 82 +stderr 82 +stdout 83 +stderr 83 +stdout 84 +stderr 84 +stdout 85 +stderr 85 +stdout 86 +stderr 86 +stdout 87 +stderr 87 +stdout 88 +stderr 88 +stdout 89 +stderr 89 +stdout 90 +stderr 90 +stdout 91 +stderr 91 +stdout 92 +stderr 92 +stdout 93 +stderr 93 +stdout 94 +stderr 94 +stdout 95 +stderr 95 +stdout 96 +stderr 96 +stdout 97 +stderr 97 +stdout 98 +stderr 98 +stdout 99 +stderr 99 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout.txt new file mode 100644 index 0000000..5d9cac2 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/100-stdout.txt @@ -0,0 +1,100 @@ +stdout 0 +stdout 1 +stdout 2 +stdout 3 +stdout 4 +stdout 5 +stdout 6 +stdout 7 +stdout 8 +stdout 9 +stdout 10 +stdout 11 +stdout 12 +stdout 13 +stdout 14 +stdout 15 +stdout 16 +stdout 17 +stdout 18 +stdout 19 +stdout 20 +stdout 21 +stdout 22 +stdout 23 +stdout 24 +stdout 25 +stdout 26 +stdout 27 +stdout 28 +stdout 29 +stdout 30 +stdout 31 +stdout 32 +stdout 33 +stdout 34 +stdout 35 +stdout 36 +stdout 37 +stdout 38 +stdout 39 +stdout 40 +stdout 41 +stdout 42 +stdout 43 +stdout 44 +stdout 45 +stdout 46 +stdout 47 +stdout 48 +stdout 49 +stdout 50 +stdout 51 +stdout 52 +stdout 53 +stdout 54 +stdout 55 +stdout 56 +stdout 57 +stdout 58 +stdout 59 +stdout 60 +stdout 61 +stdout 62 +stdout 63 +stdout 64 +stdout 65 +stdout 66 +stdout 67 +stdout 68 +stdout 69 +stdout 70 +stdout 71 +stdout 72 +stdout 73 +stdout 74 +stdout 75 +stdout 76 +stdout 77 +stdout 78 +stdout 79 +stdout 80 +stdout 81 +stdout 82 +stdout 83 +stdout 84 +stdout 85 +stdout 86 +stdout 87 +stdout 88 +stdout 89 +stdout 90 +stdout 91 +stdout 92 +stdout 93 +stdout 94 +stdout 95 +stdout 96 +stdout 97 +stdout 98 +stdout 99 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stderr.txt new file mode 100644 index 0000000..d637510 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stderr.txt @@ -0,0 +1,1000 @@ +stderr 0 +stderr 1 +stderr 2 +stderr 3 +stderr 4 +stderr 5 +stderr 6 +stderr 7 +stderr 8 +stderr 9 +stderr 10 +stderr 11 +stderr 12 +stderr 13 +stderr 14 +stderr 15 +stderr 16 +stderr 17 +stderr 18 +stderr 19 +stderr 20 +stderr 21 +stderr 22 +stderr 23 +stderr 24 +stderr 25 +stderr 26 +stderr 27 +stderr 28 +stderr 29 +stderr 30 +stderr 31 +stderr 32 +stderr 33 +stderr 34 +stderr 35 +stderr 36 +stderr 37 +stderr 38 +stderr 39 +stderr 40 +stderr 41 +stderr 42 +stderr 43 +stderr 44 +stderr 45 +stderr 46 +stderr 47 +stderr 48 +stderr 49 +stderr 50 +stderr 51 +stderr 52 +stderr 53 +stderr 54 +stderr 55 +stderr 56 +stderr 57 +stderr 58 +stderr 59 +stderr 60 +stderr 61 +stderr 62 +stderr 63 +stderr 64 +stderr 65 +stderr 66 +stderr 67 +stderr 68 +stderr 69 +stderr 70 +stderr 71 +stderr 72 +stderr 73 +stderr 74 +stderr 75 +stderr 76 +stderr 77 +stderr 78 +stderr 79 +stderr 80 +stderr 81 +stderr 82 +stderr 83 +stderr 84 +stderr 85 +stderr 86 +stderr 87 +stderr 88 +stderr 89 +stderr 90 +stderr 91 +stderr 92 +stderr 93 +stderr 94 +stderr 95 +stderr 96 +stderr 97 +stderr 98 +stderr 99 +stderr 100 +stderr 101 +stderr 102 +stderr 103 +stderr 104 +stderr 105 +stderr 106 +stderr 107 +stderr 108 +stderr 109 +stderr 110 +stderr 111 +stderr 112 +stderr 113 +stderr 114 +stderr 115 +stderr 116 +stderr 117 +stderr 118 +stderr 119 +stderr 120 +stderr 121 +stderr 122 +stderr 123 +stderr 124 +stderr 125 +stderr 126 +stderr 127 +stderr 128 +stderr 129 +stderr 130 +stderr 131 +stderr 132 +stderr 133 +stderr 134 +stderr 135 +stderr 136 +stderr 137 +stderr 138 +stderr 139 +stderr 140 +stderr 141 +stderr 142 +stderr 143 +stderr 144 +stderr 145 +stderr 146 +stderr 147 +stderr 148 +stderr 149 +stderr 150 +stderr 151 +stderr 152 +stderr 153 +stderr 154 +stderr 155 +stderr 156 +stderr 157 +stderr 158 +stderr 159 +stderr 160 +stderr 161 +stderr 162 +stderr 163 +stderr 164 +stderr 165 +stderr 166 +stderr 167 +stderr 168 +stderr 169 +stderr 170 +stderr 171 +stderr 172 +stderr 173 +stderr 174 +stderr 175 +stderr 176 +stderr 177 +stderr 178 +stderr 179 +stderr 180 +stderr 181 +stderr 182 +stderr 183 +stderr 184 +stderr 185 +stderr 186 +stderr 187 +stderr 188 +stderr 189 +stderr 190 +stderr 191 +stderr 192 +stderr 193 +stderr 194 +stderr 195 +stderr 196 +stderr 197 +stderr 198 +stderr 199 +stderr 200 +stderr 201 +stderr 202 +stderr 203 +stderr 204 +stderr 205 +stderr 206 +stderr 207 +stderr 208 +stderr 209 +stderr 210 +stderr 211 +stderr 212 +stderr 213 +stderr 214 +stderr 215 +stderr 216 +stderr 217 +stderr 218 +stderr 219 +stderr 220 +stderr 221 +stderr 222 +stderr 223 +stderr 224 +stderr 225 +stderr 226 +stderr 227 +stderr 228 +stderr 229 +stderr 230 +stderr 231 +stderr 232 +stderr 233 +stderr 234 +stderr 235 +stderr 236 +stderr 237 +stderr 238 +stderr 239 +stderr 240 +stderr 241 +stderr 242 +stderr 243 +stderr 244 +stderr 245 +stderr 246 +stderr 247 +stderr 248 +stderr 249 +stderr 250 +stderr 251 +stderr 252 +stderr 253 +stderr 254 +stderr 255 +stderr 256 +stderr 257 +stderr 258 +stderr 259 +stderr 260 +stderr 261 +stderr 262 +stderr 263 +stderr 264 +stderr 265 +stderr 266 +stderr 267 +stderr 268 +stderr 269 +stderr 270 +stderr 271 +stderr 272 +stderr 273 +stderr 274 +stderr 275 +stderr 276 +stderr 277 +stderr 278 +stderr 279 +stderr 280 +stderr 281 +stderr 282 +stderr 283 +stderr 284 +stderr 285 +stderr 286 +stderr 287 +stderr 288 +stderr 289 +stderr 290 +stderr 291 +stderr 292 +stderr 293 +stderr 294 +stderr 295 +stderr 296 +stderr 297 +stderr 298 +stderr 299 +stderr 300 +stderr 301 +stderr 302 +stderr 303 +stderr 304 +stderr 305 +stderr 306 +stderr 307 +stderr 308 +stderr 309 +stderr 310 +stderr 311 +stderr 312 +stderr 313 +stderr 314 +stderr 315 +stderr 316 +stderr 317 +stderr 318 +stderr 319 +stderr 320 +stderr 321 +stderr 322 +stderr 323 +stderr 324 +stderr 325 +stderr 326 +stderr 327 +stderr 328 +stderr 329 +stderr 330 +stderr 331 +stderr 332 +stderr 333 +stderr 334 +stderr 335 +stderr 336 +stderr 337 +stderr 338 +stderr 339 +stderr 340 +stderr 341 +stderr 342 +stderr 343 +stderr 344 +stderr 345 +stderr 346 +stderr 347 +stderr 348 +stderr 349 +stderr 350 +stderr 351 +stderr 352 +stderr 353 +stderr 354 +stderr 355 +stderr 356 +stderr 357 +stderr 358 +stderr 359 +stderr 360 +stderr 361 +stderr 362 +stderr 363 +stderr 364 +stderr 365 +stderr 366 +stderr 367 +stderr 368 +stderr 369 +stderr 370 +stderr 371 +stderr 372 +stderr 373 +stderr 374 +stderr 375 +stderr 376 +stderr 377 +stderr 378 +stderr 379 +stderr 380 +stderr 381 +stderr 382 +stderr 383 +stderr 384 +stderr 385 +stderr 386 +stderr 387 +stderr 388 +stderr 389 +stderr 390 +stderr 391 +stderr 392 +stderr 393 +stderr 394 +stderr 395 +stderr 396 +stderr 397 +stderr 398 +stderr 399 +stderr 400 +stderr 401 +stderr 402 +stderr 403 +stderr 404 +stderr 405 +stderr 406 +stderr 407 +stderr 408 +stderr 409 +stderr 410 +stderr 411 +stderr 412 +stderr 413 +stderr 414 +stderr 415 +stderr 416 +stderr 417 +stderr 418 +stderr 419 +stderr 420 +stderr 421 +stderr 422 +stderr 423 +stderr 424 +stderr 425 +stderr 426 +stderr 427 +stderr 428 +stderr 429 +stderr 430 +stderr 431 +stderr 432 +stderr 433 +stderr 434 +stderr 435 +stderr 436 +stderr 437 +stderr 438 +stderr 439 +stderr 440 +stderr 441 +stderr 442 +stderr 443 +stderr 444 +stderr 445 +stderr 446 +stderr 447 +stderr 448 +stderr 449 +stderr 450 +stderr 451 +stderr 452 +stderr 453 +stderr 454 +stderr 455 +stderr 456 +stderr 457 +stderr 458 +stderr 459 +stderr 460 +stderr 461 +stderr 462 +stderr 463 +stderr 464 +stderr 465 +stderr 466 +stderr 467 +stderr 468 +stderr 469 +stderr 470 +stderr 471 +stderr 472 +stderr 473 +stderr 474 +stderr 475 +stderr 476 +stderr 477 +stderr 478 +stderr 479 +stderr 480 +stderr 481 +stderr 482 +stderr 483 +stderr 484 +stderr 485 +stderr 486 +stderr 487 +stderr 488 +stderr 489 +stderr 490 +stderr 491 +stderr 492 +stderr 493 +stderr 494 +stderr 495 +stderr 496 +stderr 497 +stderr 498 +stderr 499 +stderr 500 +stderr 501 +stderr 502 +stderr 503 +stderr 504 +stderr 505 +stderr 506 +stderr 507 +stderr 508 +stderr 509 +stderr 510 +stderr 511 +stderr 512 +stderr 513 +stderr 514 +stderr 515 +stderr 516 +stderr 517 +stderr 518 +stderr 519 +stderr 520 +stderr 521 +stderr 522 +stderr 523 +stderr 524 +stderr 525 +stderr 526 +stderr 527 +stderr 528 +stderr 529 +stderr 530 +stderr 531 +stderr 532 +stderr 533 +stderr 534 +stderr 535 +stderr 536 +stderr 537 +stderr 538 +stderr 539 +stderr 540 +stderr 541 +stderr 542 +stderr 543 +stderr 544 +stderr 545 +stderr 546 +stderr 547 +stderr 548 +stderr 549 +stderr 550 +stderr 551 +stderr 552 +stderr 553 +stderr 554 +stderr 555 +stderr 556 +stderr 557 +stderr 558 +stderr 559 +stderr 560 +stderr 561 +stderr 562 +stderr 563 +stderr 564 +stderr 565 +stderr 566 +stderr 567 +stderr 568 +stderr 569 +stderr 570 +stderr 571 +stderr 572 +stderr 573 +stderr 574 +stderr 575 +stderr 576 +stderr 577 +stderr 578 +stderr 579 +stderr 580 +stderr 581 +stderr 582 +stderr 583 +stderr 584 +stderr 585 +stderr 586 +stderr 587 +stderr 588 +stderr 589 +stderr 590 +stderr 591 +stderr 592 +stderr 593 +stderr 594 +stderr 595 +stderr 596 +stderr 597 +stderr 598 +stderr 599 +stderr 600 +stderr 601 +stderr 602 +stderr 603 +stderr 604 +stderr 605 +stderr 606 +stderr 607 +stderr 608 +stderr 609 +stderr 610 +stderr 611 +stderr 612 +stderr 613 +stderr 614 +stderr 615 +stderr 616 +stderr 617 +stderr 618 +stderr 619 +stderr 620 +stderr 621 +stderr 622 +stderr 623 +stderr 624 +stderr 625 +stderr 626 +stderr 627 +stderr 628 +stderr 629 +stderr 630 +stderr 631 +stderr 632 +stderr 633 +stderr 634 +stderr 635 +stderr 636 +stderr 637 +stderr 638 +stderr 639 +stderr 640 +stderr 641 +stderr 642 +stderr 643 +stderr 644 +stderr 645 +stderr 646 +stderr 647 +stderr 648 +stderr 649 +stderr 650 +stderr 651 +stderr 652 +stderr 653 +stderr 654 +stderr 655 +stderr 656 +stderr 657 +stderr 658 +stderr 659 +stderr 660 +stderr 661 +stderr 662 +stderr 663 +stderr 664 +stderr 665 +stderr 666 +stderr 667 +stderr 668 +stderr 669 +stderr 670 +stderr 671 +stderr 672 +stderr 673 +stderr 674 +stderr 675 +stderr 676 +stderr 677 +stderr 678 +stderr 679 +stderr 680 +stderr 681 +stderr 682 +stderr 683 +stderr 684 +stderr 685 +stderr 686 +stderr 687 +stderr 688 +stderr 689 +stderr 690 +stderr 691 +stderr 692 +stderr 693 +stderr 694 +stderr 695 +stderr 696 +stderr 697 +stderr 698 +stderr 699 +stderr 700 +stderr 701 +stderr 702 +stderr 703 +stderr 704 +stderr 705 +stderr 706 +stderr 707 +stderr 708 +stderr 709 +stderr 710 +stderr 711 +stderr 712 +stderr 713 +stderr 714 +stderr 715 +stderr 716 +stderr 717 +stderr 718 +stderr 719 +stderr 720 +stderr 721 +stderr 722 +stderr 723 +stderr 724 +stderr 725 +stderr 726 +stderr 727 +stderr 728 +stderr 729 +stderr 730 +stderr 731 +stderr 732 +stderr 733 +stderr 734 +stderr 735 +stderr 736 +stderr 737 +stderr 738 +stderr 739 +stderr 740 +stderr 741 +stderr 742 +stderr 743 +stderr 744 +stderr 745 +stderr 746 +stderr 747 +stderr 748 +stderr 749 +stderr 750 +stderr 751 +stderr 752 +stderr 753 +stderr 754 +stderr 755 +stderr 756 +stderr 757 +stderr 758 +stderr 759 +stderr 760 +stderr 761 +stderr 762 +stderr 763 +stderr 764 +stderr 765 +stderr 766 +stderr 767 +stderr 768 +stderr 769 +stderr 770 +stderr 771 +stderr 772 +stderr 773 +stderr 774 +stderr 775 +stderr 776 +stderr 777 +stderr 778 +stderr 779 +stderr 780 +stderr 781 +stderr 782 +stderr 783 +stderr 784 +stderr 785 +stderr 786 +stderr 787 +stderr 788 +stderr 789 +stderr 790 +stderr 791 +stderr 792 +stderr 793 +stderr 794 +stderr 795 +stderr 796 +stderr 797 +stderr 798 +stderr 799 +stderr 800 +stderr 801 +stderr 802 +stderr 803 +stderr 804 +stderr 805 +stderr 806 +stderr 807 +stderr 808 +stderr 809 +stderr 810 +stderr 811 +stderr 812 +stderr 813 +stderr 814 +stderr 815 +stderr 816 +stderr 817 +stderr 818 +stderr 819 +stderr 820 +stderr 821 +stderr 822 +stderr 823 +stderr 824 +stderr 825 +stderr 826 +stderr 827 +stderr 828 +stderr 829 +stderr 830 +stderr 831 +stderr 832 +stderr 833 +stderr 834 +stderr 835 +stderr 836 +stderr 837 +stderr 838 +stderr 839 +stderr 840 +stderr 841 +stderr 842 +stderr 843 +stderr 844 +stderr 845 +stderr 846 +stderr 847 +stderr 848 +stderr 849 +stderr 850 +stderr 851 +stderr 852 +stderr 853 +stderr 854 +stderr 855 +stderr 856 +stderr 857 +stderr 858 +stderr 859 +stderr 860 +stderr 861 +stderr 862 +stderr 863 +stderr 864 +stderr 865 +stderr 866 +stderr 867 +stderr 868 +stderr 869 +stderr 870 +stderr 871 +stderr 872 +stderr 873 +stderr 874 +stderr 875 +stderr 876 +stderr 877 +stderr 878 +stderr 879 +stderr 880 +stderr 881 +stderr 882 +stderr 883 +stderr 884 +stderr 885 +stderr 886 +stderr 887 +stderr 888 +stderr 889 +stderr 890 +stderr 891 +stderr 892 +stderr 893 +stderr 894 +stderr 895 +stderr 896 +stderr 897 +stderr 898 +stderr 899 +stderr 900 +stderr 901 +stderr 902 +stderr 903 +stderr 904 +stderr 905 +stderr 906 +stderr 907 +stderr 908 +stderr 909 +stderr 910 +stderr 911 +stderr 912 +stderr 913 +stderr 914 +stderr 915 +stderr 916 +stderr 917 +stderr 918 +stderr 919 +stderr 920 +stderr 921 +stderr 922 +stderr 923 +stderr 924 +stderr 925 +stderr 926 +stderr 927 +stderr 928 +stderr 929 +stderr 930 +stderr 931 +stderr 932 +stderr 933 +stderr 934 +stderr 935 +stderr 936 +stderr 937 +stderr 938 +stderr 939 +stderr 940 +stderr 941 +stderr 942 +stderr 943 +stderr 944 +stderr 945 +stderr 946 +stderr 947 +stderr 948 +stderr 949 +stderr 950 +stderr 951 +stderr 952 +stderr 953 +stderr 954 +stderr 955 +stderr 956 +stderr 957 +stderr 958 +stderr 959 +stderr 960 +stderr 961 +stderr 962 +stderr 963 +stderr 964 +stderr 965 +stderr 966 +stderr 967 +stderr 968 +stderr 969 +stderr 970 +stderr 971 +stderr 972 +stderr 973 +stderr 974 +stderr 975 +stderr 976 +stderr 977 +stderr 978 +stderr 979 +stderr 980 +stderr 981 +stderr 982 +stderr 983 +stderr 984 +stderr 985 +stderr 986 +stderr 987 +stderr 988 +stderr 989 +stderr 990 +stderr 991 +stderr 992 +stderr 993 +stderr 994 +stderr 995 +stderr 996 +stderr 997 +stderr 998 +stderr 999 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout-stderr.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout-stderr.txt new file mode 100644 index 0000000..4fde2b4 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout-stderr.txt @@ -0,0 +1,2000 @@ +stdout 0 +stderr 0 +stdout 1 +stderr 1 +stdout 2 +stderr 2 +stdout 3 +stderr 3 +stdout 4 +stderr 4 +stdout 5 +stderr 5 +stdout 6 +stderr 6 +stdout 7 +stderr 7 +stdout 8 +stderr 8 +stdout 9 +stderr 9 +stdout 10 +stderr 10 +stdout 11 +stderr 11 +stdout 12 +stderr 12 +stdout 13 +stderr 13 +stdout 14 +stderr 14 +stdout 15 +stderr 15 +stdout 16 +stderr 16 +stdout 17 +stderr 17 +stdout 18 +stderr 18 +stdout 19 +stderr 19 +stdout 20 +stderr 20 +stdout 21 +stderr 21 +stdout 22 +stderr 22 +stdout 23 +stderr 23 +stdout 24 +stderr 24 +stdout 25 +stderr 25 +stdout 26 +stderr 26 +stdout 27 +stderr 27 +stdout 28 +stderr 28 +stdout 29 +stderr 29 +stdout 30 +stderr 30 +stdout 31 +stderr 31 +stdout 32 +stderr 32 +stdout 33 +stderr 33 +stdout 34 +stderr 34 +stdout 35 +stderr 35 +stdout 36 +stderr 36 +stdout 37 +stderr 37 +stdout 38 +stderr 38 +stdout 39 +stderr 39 +stdout 40 +stderr 40 +stdout 41 +stderr 41 +stdout 42 +stderr 42 +stdout 43 +stderr 43 +stdout 44 +stderr 44 +stdout 45 +stderr 45 +stdout 46 +stderr 46 +stdout 47 +stderr 47 +stdout 48 +stderr 48 +stdout 49 +stderr 49 +stdout 50 +stderr 50 +stdout 51 +stderr 51 +stdout 52 +stderr 52 +stdout 53 +stderr 53 +stdout 54 +stderr 54 +stdout 55 +stderr 55 +stdout 56 +stderr 56 +stdout 57 +stderr 57 +stdout 58 +stderr 58 +stdout 59 +stderr 59 +stdout 60 +stderr 60 +stdout 61 +stderr 61 +stdout 62 +stderr 62 +stdout 63 +stderr 63 +stdout 64 +stderr 64 +stdout 65 +stderr 65 +stdout 66 +stderr 66 +stdout 67 +stderr 67 +stdout 68 +stderr 68 +stdout 69 +stderr 69 +stdout 70 +stderr 70 +stdout 71 +stderr 71 +stdout 72 +stderr 72 +stdout 73 +stderr 73 +stdout 74 +stderr 74 +stdout 75 +stderr 75 +stdout 76 +stderr 76 +stdout 77 +stderr 77 +stdout 78 +stderr 78 +stdout 79 +stderr 79 +stdout 80 +stderr 80 +stdout 81 +stderr 81 +stdout 82 +stderr 82 +stdout 83 +stderr 83 +stdout 84 +stderr 84 +stdout 85 +stderr 85 +stdout 86 +stderr 86 +stdout 87 +stderr 87 +stdout 88 +stderr 88 +stdout 89 +stderr 89 +stdout 90 +stderr 90 +stdout 91 +stderr 91 +stdout 92 +stderr 92 +stdout 93 +stderr 93 +stdout 94 +stderr 94 +stdout 95 +stderr 95 +stdout 96 +stderr 96 +stdout 97 +stderr 97 +stdout 98 +stderr 98 +stdout 99 +stderr 99 +stdout 100 +stderr 100 +stdout 101 +stderr 101 +stdout 102 +stderr 102 +stdout 103 +stderr 103 +stdout 104 +stderr 104 +stdout 105 +stderr 105 +stdout 106 +stderr 106 +stdout 107 +stderr 107 +stdout 108 +stderr 108 +stdout 109 +stderr 109 +stdout 110 +stderr 110 +stdout 111 +stderr 111 +stdout 112 +stderr 112 +stdout 113 +stderr 113 +stdout 114 +stderr 114 +stdout 115 +stderr 115 +stdout 116 +stderr 116 +stdout 117 +stderr 117 +stdout 118 +stderr 118 +stdout 119 +stderr 119 +stdout 120 +stderr 120 +stdout 121 +stderr 121 +stdout 122 +stderr 122 +stdout 123 +stderr 123 +stdout 124 +stderr 124 +stdout 125 +stderr 125 +stdout 126 +stderr 126 +stdout 127 +stderr 127 +stdout 128 +stderr 128 +stdout 129 +stderr 129 +stdout 130 +stderr 130 +stdout 131 +stderr 131 +stdout 132 +stderr 132 +stdout 133 +stderr 133 +stdout 134 +stderr 134 +stdout 135 +stderr 135 +stdout 136 +stderr 136 +stdout 137 +stderr 137 +stdout 138 +stderr 138 +stdout 139 +stderr 139 +stdout 140 +stderr 140 +stdout 141 +stderr 141 +stdout 142 +stderr 142 +stdout 143 +stderr 143 +stdout 144 +stderr 144 +stdout 145 +stderr 145 +stdout 146 +stderr 146 +stdout 147 +stderr 147 +stdout 148 +stderr 148 +stdout 149 +stderr 149 +stdout 150 +stderr 150 +stdout 151 +stderr 151 +stdout 152 +stderr 152 +stdout 153 +stderr 153 +stdout 154 +stderr 154 +stdout 155 +stderr 155 +stdout 156 +stderr 156 +stdout 157 +stderr 157 +stdout 158 +stderr 158 +stdout 159 +stderr 159 +stdout 160 +stderr 160 +stdout 161 +stderr 161 +stdout 162 +stderr 162 +stdout 163 +stderr 163 +stdout 164 +stderr 164 +stdout 165 +stderr 165 +stdout 166 +stderr 166 +stdout 167 +stderr 167 +stdout 168 +stderr 168 +stdout 169 +stderr 169 +stdout 170 +stderr 170 +stdout 171 +stderr 171 +stdout 172 +stderr 172 +stdout 173 +stderr 173 +stdout 174 +stderr 174 +stdout 175 +stderr 175 +stdout 176 +stderr 176 +stdout 177 +stderr 177 +stdout 178 +stderr 178 +stdout 179 +stderr 179 +stdout 180 +stderr 180 +stdout 181 +stderr 181 +stdout 182 +stderr 182 +stdout 183 +stderr 183 +stdout 184 +stderr 184 +stdout 185 +stderr 185 +stdout 186 +stderr 186 +stdout 187 +stderr 187 +stdout 188 +stderr 188 +stdout 189 +stderr 189 +stdout 190 +stderr 190 +stdout 191 +stderr 191 +stdout 192 +stderr 192 +stdout 193 +stderr 193 +stdout 194 +stderr 194 +stdout 195 +stderr 195 +stdout 196 +stderr 196 +stdout 197 +stderr 197 +stdout 198 +stderr 198 +stdout 199 +stderr 199 +stdout 200 +stderr 200 +stdout 201 +stderr 201 +stdout 202 +stderr 202 +stdout 203 +stderr 203 +stdout 204 +stderr 204 +stdout 205 +stderr 205 +stdout 206 +stderr 206 +stdout 207 +stderr 207 +stdout 208 +stderr 208 +stdout 209 +stderr 209 +stdout 210 +stderr 210 +stdout 211 +stderr 211 +stdout 212 +stderr 212 +stdout 213 +stderr 213 +stdout 214 +stderr 214 +stdout 215 +stderr 215 +stdout 216 +stderr 216 +stdout 217 +stderr 217 +stdout 218 +stderr 218 +stdout 219 +stderr 219 +stdout 220 +stderr 220 +stdout 221 +stderr 221 +stdout 222 +stderr 222 +stdout 223 +stderr 223 +stdout 224 +stderr 224 +stdout 225 +stderr 225 +stdout 226 +stderr 226 +stdout 227 +stderr 227 +stdout 228 +stderr 228 +stdout 229 +stderr 229 +stdout 230 +stderr 230 +stdout 231 +stderr 231 +stdout 232 +stderr 232 +stdout 233 +stderr 233 +stdout 234 +stderr 234 +stdout 235 +stderr 235 +stdout 236 +stderr 236 +stdout 237 +stderr 237 +stdout 238 +stderr 238 +stdout 239 +stderr 239 +stdout 240 +stderr 240 +stdout 241 +stderr 241 +stdout 242 +stderr 242 +stdout 243 +stderr 243 +stdout 244 +stderr 244 +stdout 245 +stderr 245 +stdout 246 +stderr 246 +stdout 247 +stderr 247 +stdout 248 +stderr 248 +stdout 249 +stderr 249 +stdout 250 +stderr 250 +stdout 251 +stderr 251 +stdout 252 +stderr 252 +stdout 253 +stderr 253 +stdout 254 +stderr 254 +stdout 255 +stderr 255 +stdout 256 +stderr 256 +stdout 257 +stderr 257 +stdout 258 +stderr 258 +stdout 259 +stderr 259 +stdout 260 +stderr 260 +stdout 261 +stderr 261 +stdout 262 +stderr 262 +stdout 263 +stderr 263 +stdout 264 +stderr 264 +stdout 265 +stderr 265 +stdout 266 +stderr 266 +stdout 267 +stderr 267 +stdout 268 +stderr 268 +stdout 269 +stderr 269 +stdout 270 +stderr 270 +stdout 271 +stderr 271 +stdout 272 +stderr 272 +stdout 273 +stderr 273 +stdout 274 +stderr 274 +stdout 275 +stderr 275 +stdout 276 +stderr 276 +stdout 277 +stderr 277 +stdout 278 +stderr 278 +stdout 279 +stderr 279 +stdout 280 +stderr 280 +stdout 281 +stderr 281 +stdout 282 +stderr 282 +stdout 283 +stderr 283 +stdout 284 +stderr 284 +stdout 285 +stderr 285 +stdout 286 +stderr 286 +stdout 287 +stderr 287 +stdout 288 +stderr 288 +stdout 289 +stderr 289 +stdout 290 +stderr 290 +stdout 291 +stderr 291 +stdout 292 +stderr 292 +stdout 293 +stderr 293 +stdout 294 +stderr 294 +stdout 295 +stderr 295 +stdout 296 +stderr 296 +stdout 297 +stderr 297 +stdout 298 +stderr 298 +stdout 299 +stderr 299 +stdout 300 +stderr 300 +stdout 301 +stderr 301 +stdout 302 +stderr 302 +stdout 303 +stderr 303 +stdout 304 +stderr 304 +stdout 305 +stderr 305 +stdout 306 +stderr 306 +stdout 307 +stderr 307 +stdout 308 +stderr 308 +stdout 309 +stderr 309 +stdout 310 +stderr 310 +stdout 311 +stderr 311 +stdout 312 +stderr 312 +stdout 313 +stderr 313 +stdout 314 +stderr 314 +stdout 315 +stderr 315 +stdout 316 +stderr 316 +stdout 317 +stderr 317 +stdout 318 +stderr 318 +stdout 319 +stderr 319 +stdout 320 +stderr 320 +stdout 321 +stderr 321 +stdout 322 +stderr 322 +stdout 323 +stderr 323 +stdout 324 +stderr 324 +stdout 325 +stderr 325 +stdout 326 +stderr 326 +stdout 327 +stderr 327 +stdout 328 +stderr 328 +stdout 329 +stderr 329 +stdout 330 +stderr 330 +stdout 331 +stderr 331 +stdout 332 +stderr 332 +stdout 333 +stderr 333 +stdout 334 +stderr 334 +stdout 335 +stderr 335 +stdout 336 +stderr 336 +stdout 337 +stderr 337 +stdout 338 +stderr 338 +stdout 339 +stderr 339 +stdout 340 +stderr 340 +stdout 341 +stderr 341 +stdout 342 +stderr 342 +stdout 343 +stderr 343 +stdout 344 +stderr 344 +stdout 345 +stderr 345 +stdout 346 +stderr 346 +stdout 347 +stderr 347 +stdout 348 +stderr 348 +stdout 349 +stderr 349 +stdout 350 +stderr 350 +stdout 351 +stderr 351 +stdout 352 +stderr 352 +stdout 353 +stderr 353 +stdout 354 +stderr 354 +stdout 355 +stderr 355 +stdout 356 +stderr 356 +stdout 357 +stderr 357 +stdout 358 +stderr 358 +stdout 359 +stderr 359 +stdout 360 +stderr 360 +stdout 361 +stderr 361 +stdout 362 +stderr 362 +stdout 363 +stderr 363 +stdout 364 +stderr 364 +stdout 365 +stderr 365 +stdout 366 +stderr 366 +stdout 367 +stderr 367 +stdout 368 +stderr 368 +stdout 369 +stderr 369 +stdout 370 +stderr 370 +stdout 371 +stderr 371 +stdout 372 +stderr 372 +stdout 373 +stderr 373 +stdout 374 +stderr 374 +stdout 375 +stderr 375 +stdout 376 +stderr 376 +stdout 377 +stderr 377 +stdout 378 +stderr 378 +stdout 379 +stderr 379 +stdout 380 +stderr 380 +stdout 381 +stderr 381 +stdout 382 +stderr 382 +stdout 383 +stderr 383 +stdout 384 +stderr 384 +stdout 385 +stderr 385 +stdout 386 +stderr 386 +stdout 387 +stderr 387 +stdout 388 +stderr 388 +stdout 389 +stderr 389 +stdout 390 +stderr 390 +stdout 391 +stderr 391 +stdout 392 +stderr 392 +stdout 393 +stderr 393 +stdout 394 +stderr 394 +stdout 395 +stderr 395 +stdout 396 +stderr 396 +stdout 397 +stderr 397 +stdout 398 +stderr 398 +stdout 399 +stderr 399 +stdout 400 +stderr 400 +stdout 401 +stderr 401 +stdout 402 +stderr 402 +stdout 403 +stderr 403 +stdout 404 +stderr 404 +stdout 405 +stderr 405 +stdout 406 +stderr 406 +stdout 407 +stderr 407 +stdout 408 +stderr 408 +stdout 409 +stderr 409 +stdout 410 +stderr 410 +stdout 411 +stderr 411 +stdout 412 +stderr 412 +stdout 413 +stderr 413 +stdout 414 +stderr 414 +stdout 415 +stderr 415 +stdout 416 +stderr 416 +stdout 417 +stderr 417 +stdout 418 +stderr 418 +stdout 419 +stderr 419 +stdout 420 +stderr 420 +stdout 421 +stderr 421 +stdout 422 +stderr 422 +stdout 423 +stderr 423 +stdout 424 +stderr 424 +stdout 425 +stderr 425 +stdout 426 +stderr 426 +stdout 427 +stderr 427 +stdout 428 +stderr 428 +stdout 429 +stderr 429 +stdout 430 +stderr 430 +stdout 431 +stderr 431 +stdout 432 +stderr 432 +stdout 433 +stderr 433 +stdout 434 +stderr 434 +stdout 435 +stderr 435 +stdout 436 +stderr 436 +stdout 437 +stderr 437 +stdout 438 +stderr 438 +stdout 439 +stderr 439 +stdout 440 +stderr 440 +stdout 441 +stderr 441 +stdout 442 +stderr 442 +stdout 443 +stderr 443 +stdout 444 +stderr 444 +stdout 445 +stderr 445 +stdout 446 +stderr 446 +stdout 447 +stderr 447 +stdout 448 +stderr 448 +stdout 449 +stderr 449 +stdout 450 +stderr 450 +stdout 451 +stderr 451 +stdout 452 +stderr 452 +stdout 453 +stderr 453 +stdout 454 +stderr 454 +stdout 455 +stderr 455 +stdout 456 +stderr 456 +stdout 457 +stderr 457 +stdout 458 +stderr 458 +stdout 459 +stderr 459 +stdout 460 +stderr 460 +stdout 461 +stderr 461 +stdout 462 +stderr 462 +stdout 463 +stderr 463 +stdout 464 +stderr 464 +stdout 465 +stderr 465 +stdout 466 +stderr 466 +stdout 467 +stderr 467 +stdout 468 +stderr 468 +stdout 469 +stderr 469 +stdout 470 +stderr 470 +stdout 471 +stderr 471 +stdout 472 +stderr 472 +stdout 473 +stderr 473 +stdout 474 +stderr 474 +stdout 475 +stderr 475 +stdout 476 +stderr 476 +stdout 477 +stderr 477 +stdout 478 +stderr 478 +stdout 479 +stderr 479 +stdout 480 +stderr 480 +stdout 481 +stderr 481 +stdout 482 +stderr 482 +stdout 483 +stderr 483 +stdout 484 +stderr 484 +stdout 485 +stderr 485 +stdout 486 +stderr 486 +stdout 487 +stderr 487 +stdout 488 +stderr 488 +stdout 489 +stderr 489 +stdout 490 +stderr 490 +stdout 491 +stderr 491 +stdout 492 +stderr 492 +stdout 493 +stderr 493 +stdout 494 +stderr 494 +stdout 495 +stderr 495 +stdout 496 +stderr 496 +stdout 497 +stderr 497 +stdout 498 +stderr 498 +stdout 499 +stderr 499 +stdout 500 +stderr 500 +stdout 501 +stderr 501 +stdout 502 +stderr 502 +stdout 503 +stderr 503 +stdout 504 +stderr 504 +stdout 505 +stderr 505 +stdout 506 +stderr 506 +stdout 507 +stderr 507 +stdout 508 +stderr 508 +stdout 509 +stderr 509 +stdout 510 +stderr 510 +stdout 511 +stderr 511 +stdout 512 +stderr 512 +stdout 513 +stderr 513 +stdout 514 +stderr 514 +stdout 515 +stderr 515 +stdout 516 +stderr 516 +stdout 517 +stderr 517 +stdout 518 +stderr 518 +stdout 519 +stderr 519 +stdout 520 +stderr 520 +stdout 521 +stderr 521 +stdout 522 +stderr 522 +stdout 523 +stderr 523 +stdout 524 +stderr 524 +stdout 525 +stderr 525 +stdout 526 +stderr 526 +stdout 527 +stderr 527 +stdout 528 +stderr 528 +stdout 529 +stderr 529 +stdout 530 +stderr 530 +stdout 531 +stderr 531 +stdout 532 +stderr 532 +stdout 533 +stderr 533 +stdout 534 +stderr 534 +stdout 535 +stderr 535 +stdout 536 +stderr 536 +stdout 537 +stderr 537 +stdout 538 +stderr 538 +stdout 539 +stderr 539 +stdout 540 +stderr 540 +stdout 541 +stderr 541 +stdout 542 +stderr 542 +stdout 543 +stderr 543 +stdout 544 +stderr 544 +stdout 545 +stderr 545 +stdout 546 +stderr 546 +stdout 547 +stderr 547 +stdout 548 +stderr 548 +stdout 549 +stderr 549 +stdout 550 +stderr 550 +stdout 551 +stderr 551 +stdout 552 +stderr 552 +stdout 553 +stderr 553 +stdout 554 +stderr 554 +stdout 555 +stderr 555 +stdout 556 +stderr 556 +stdout 557 +stderr 557 +stdout 558 +stderr 558 +stdout 559 +stderr 559 +stdout 560 +stderr 560 +stdout 561 +stderr 561 +stdout 562 +stderr 562 +stdout 563 +stderr 563 +stdout 564 +stderr 564 +stdout 565 +stderr 565 +stdout 566 +stderr 566 +stdout 567 +stderr 567 +stdout 568 +stderr 568 +stdout 569 +stderr 569 +stdout 570 +stderr 570 +stdout 571 +stderr 571 +stdout 572 +stderr 572 +stdout 573 +stderr 573 +stdout 574 +stderr 574 +stdout 575 +stderr 575 +stdout 576 +stderr 576 +stdout 577 +stderr 577 +stdout 578 +stderr 578 +stdout 579 +stderr 579 +stdout 580 +stderr 580 +stdout 581 +stderr 581 +stdout 582 +stderr 582 +stdout 583 +stderr 583 +stdout 584 +stderr 584 +stdout 585 +stderr 585 +stdout 586 +stderr 586 +stdout 587 +stderr 587 +stdout 588 +stderr 588 +stdout 589 +stderr 589 +stdout 590 +stderr 590 +stdout 591 +stderr 591 +stdout 592 +stderr 592 +stdout 593 +stderr 593 +stdout 594 +stderr 594 +stdout 595 +stderr 595 +stdout 596 +stderr 596 +stdout 597 +stderr 597 +stdout 598 +stderr 598 +stdout 599 +stderr 599 +stdout 600 +stderr 600 +stdout 601 +stderr 601 +stdout 602 +stderr 602 +stdout 603 +stderr 603 +stdout 604 +stderr 604 +stdout 605 +stderr 605 +stdout 606 +stderr 606 +stdout 607 +stderr 607 +stdout 608 +stderr 608 +stdout 609 +stderr 609 +stdout 610 +stderr 610 +stdout 611 +stderr 611 +stdout 612 +stderr 612 +stdout 613 +stderr 613 +stdout 614 +stderr 614 +stdout 615 +stderr 615 +stdout 616 +stderr 616 +stdout 617 +stderr 617 +stdout 618 +stderr 618 +stdout 619 +stderr 619 +stdout 620 +stderr 620 +stdout 621 +stderr 621 +stdout 622 +stderr 622 +stdout 623 +stderr 623 +stdout 624 +stderr 624 +stdout 625 +stderr 625 +stdout 626 +stderr 626 +stdout 627 +stderr 627 +stdout 628 +stderr 628 +stdout 629 +stderr 629 +stdout 630 +stderr 630 +stdout 631 +stderr 631 +stdout 632 +stderr 632 +stdout 633 +stderr 633 +stdout 634 +stderr 634 +stdout 635 +stderr 635 +stdout 636 +stderr 636 +stdout 637 +stderr 637 +stdout 638 +stderr 638 +stdout 639 +stderr 639 +stdout 640 +stderr 640 +stdout 641 +stderr 641 +stdout 642 +stderr 642 +stdout 643 +stderr 643 +stdout 644 +stderr 644 +stdout 645 +stderr 645 +stdout 646 +stderr 646 +stdout 647 +stderr 647 +stdout 648 +stderr 648 +stdout 649 +stderr 649 +stdout 650 +stderr 650 +stdout 651 +stderr 651 +stdout 652 +stderr 652 +stdout 653 +stderr 653 +stdout 654 +stderr 654 +stdout 655 +stderr 655 +stdout 656 +stderr 656 +stdout 657 +stderr 657 +stdout 658 +stderr 658 +stdout 659 +stderr 659 +stdout 660 +stderr 660 +stdout 661 +stderr 661 +stdout 662 +stderr 662 +stdout 663 +stderr 663 +stdout 664 +stderr 664 +stdout 665 +stderr 665 +stdout 666 +stderr 666 +stdout 667 +stderr 667 +stdout 668 +stderr 668 +stdout 669 +stderr 669 +stdout 670 +stderr 670 +stdout 671 +stderr 671 +stdout 672 +stderr 672 +stdout 673 +stderr 673 +stdout 674 +stderr 674 +stdout 675 +stderr 675 +stdout 676 +stderr 676 +stdout 677 +stderr 677 +stdout 678 +stderr 678 +stdout 679 +stderr 679 +stdout 680 +stderr 680 +stdout 681 +stderr 681 +stdout 682 +stderr 682 +stdout 683 +stderr 683 +stdout 684 +stderr 684 +stdout 685 +stderr 685 +stdout 686 +stderr 686 +stdout 687 +stderr 687 +stdout 688 +stderr 688 +stdout 689 +stderr 689 +stdout 690 +stderr 690 +stdout 691 +stderr 691 +stdout 692 +stderr 692 +stdout 693 +stderr 693 +stdout 694 +stderr 694 +stdout 695 +stderr 695 +stdout 696 +stderr 696 +stdout 697 +stderr 697 +stdout 698 +stderr 698 +stdout 699 +stderr 699 +stdout 700 +stderr 700 +stdout 701 +stderr 701 +stdout 702 +stderr 702 +stdout 703 +stderr 703 +stdout 704 +stderr 704 +stdout 705 +stderr 705 +stdout 706 +stderr 706 +stdout 707 +stderr 707 +stdout 708 +stderr 708 +stdout 709 +stderr 709 +stdout 710 +stderr 710 +stdout 711 +stderr 711 +stdout 712 +stderr 712 +stdout 713 +stderr 713 +stdout 714 +stderr 714 +stdout 715 +stderr 715 +stdout 716 +stderr 716 +stdout 717 +stderr 717 +stdout 718 +stderr 718 +stdout 719 +stderr 719 +stdout 720 +stderr 720 +stdout 721 +stderr 721 +stdout 722 +stderr 722 +stdout 723 +stderr 723 +stdout 724 +stderr 724 +stdout 725 +stderr 725 +stdout 726 +stderr 726 +stdout 727 +stderr 727 +stdout 728 +stderr 728 +stdout 729 +stderr 729 +stdout 730 +stderr 730 +stdout 731 +stderr 731 +stdout 732 +stderr 732 +stdout 733 +stderr 733 +stdout 734 +stderr 734 +stdout 735 +stderr 735 +stdout 736 +stderr 736 +stdout 737 +stderr 737 +stdout 738 +stderr 738 +stdout 739 +stderr 739 +stdout 740 +stderr 740 +stdout 741 +stderr 741 +stdout 742 +stderr 742 +stdout 743 +stderr 743 +stdout 744 +stderr 744 +stdout 745 +stderr 745 +stdout 746 +stderr 746 +stdout 747 +stderr 747 +stdout 748 +stderr 748 +stdout 749 +stderr 749 +stdout 750 +stderr 750 +stdout 751 +stderr 751 +stdout 752 +stderr 752 +stdout 753 +stderr 753 +stdout 754 +stderr 754 +stdout 755 +stderr 755 +stdout 756 +stderr 756 +stdout 757 +stderr 757 +stdout 758 +stderr 758 +stdout 759 +stderr 759 +stdout 760 +stderr 760 +stdout 761 +stderr 761 +stdout 762 +stderr 762 +stdout 763 +stderr 763 +stdout 764 +stderr 764 +stdout 765 +stderr 765 +stdout 766 +stderr 766 +stdout 767 +stderr 767 +stdout 768 +stderr 768 +stdout 769 +stderr 769 +stdout 770 +stderr 770 +stdout 771 +stderr 771 +stdout 772 +stderr 772 +stdout 773 +stderr 773 +stdout 774 +stderr 774 +stdout 775 +stderr 775 +stdout 776 +stderr 776 +stdout 777 +stderr 777 +stdout 778 +stderr 778 +stdout 779 +stderr 779 +stdout 780 +stderr 780 +stdout 781 +stderr 781 +stdout 782 +stderr 782 +stdout 783 +stderr 783 +stdout 784 +stderr 784 +stdout 785 +stderr 785 +stdout 786 +stderr 786 +stdout 787 +stderr 787 +stdout 788 +stderr 788 +stdout 789 +stderr 789 +stdout 790 +stderr 790 +stdout 791 +stderr 791 +stdout 792 +stderr 792 +stdout 793 +stderr 793 +stdout 794 +stderr 794 +stdout 795 +stderr 795 +stdout 796 +stderr 796 +stdout 797 +stderr 797 +stdout 798 +stderr 798 +stdout 799 +stderr 799 +stdout 800 +stderr 800 +stdout 801 +stderr 801 +stdout 802 +stderr 802 +stdout 803 +stderr 803 +stdout 804 +stderr 804 +stdout 805 +stderr 805 +stdout 806 +stderr 806 +stdout 807 +stderr 807 +stdout 808 +stderr 808 +stdout 809 +stderr 809 +stdout 810 +stderr 810 +stdout 811 +stderr 811 +stdout 812 +stderr 812 +stdout 813 +stderr 813 +stdout 814 +stderr 814 +stdout 815 +stderr 815 +stdout 816 +stderr 816 +stdout 817 +stderr 817 +stdout 818 +stderr 818 +stdout 819 +stderr 819 +stdout 820 +stderr 820 +stdout 821 +stderr 821 +stdout 822 +stderr 822 +stdout 823 +stderr 823 +stdout 824 +stderr 824 +stdout 825 +stderr 825 +stdout 826 +stderr 826 +stdout 827 +stderr 827 +stdout 828 +stderr 828 +stdout 829 +stderr 829 +stdout 830 +stderr 830 +stdout 831 +stderr 831 +stdout 832 +stderr 832 +stdout 833 +stderr 833 +stdout 834 +stderr 834 +stdout 835 +stderr 835 +stdout 836 +stderr 836 +stdout 837 +stderr 837 +stdout 838 +stderr 838 +stdout 839 +stderr 839 +stdout 840 +stderr 840 +stdout 841 +stderr 841 +stdout 842 +stderr 842 +stdout 843 +stderr 843 +stdout 844 +stderr 844 +stdout 845 +stderr 845 +stdout 846 +stderr 846 +stdout 847 +stderr 847 +stdout 848 +stderr 848 +stdout 849 +stderr 849 +stdout 850 +stderr 850 +stdout 851 +stderr 851 +stdout 852 +stderr 852 +stdout 853 +stderr 853 +stdout 854 +stderr 854 +stdout 855 +stderr 855 +stdout 856 +stderr 856 +stdout 857 +stderr 857 +stdout 858 +stderr 858 +stdout 859 +stderr 859 +stdout 860 +stderr 860 +stdout 861 +stderr 861 +stdout 862 +stderr 862 +stdout 863 +stderr 863 +stdout 864 +stderr 864 +stdout 865 +stderr 865 +stdout 866 +stderr 866 +stdout 867 +stderr 867 +stdout 868 +stderr 868 +stdout 869 +stderr 869 +stdout 870 +stderr 870 +stdout 871 +stderr 871 +stdout 872 +stderr 872 +stdout 873 +stderr 873 +stdout 874 +stderr 874 +stdout 875 +stderr 875 +stdout 876 +stderr 876 +stdout 877 +stderr 877 +stdout 878 +stderr 878 +stdout 879 +stderr 879 +stdout 880 +stderr 880 +stdout 881 +stderr 881 +stdout 882 +stderr 882 +stdout 883 +stderr 883 +stdout 884 +stderr 884 +stdout 885 +stderr 885 +stdout 886 +stderr 886 +stdout 887 +stderr 887 +stdout 888 +stderr 888 +stdout 889 +stderr 889 +stdout 890 +stderr 890 +stdout 891 +stderr 891 +stdout 892 +stderr 892 +stdout 893 +stderr 893 +stdout 894 +stderr 894 +stdout 895 +stderr 895 +stdout 896 +stderr 896 +stdout 897 +stderr 897 +stdout 898 +stderr 898 +stdout 899 +stderr 899 +stdout 900 +stderr 900 +stdout 901 +stderr 901 +stdout 902 +stderr 902 +stdout 903 +stderr 903 +stdout 904 +stderr 904 +stdout 905 +stderr 905 +stdout 906 +stderr 906 +stdout 907 +stderr 907 +stdout 908 +stderr 908 +stdout 909 +stderr 909 +stdout 910 +stderr 910 +stdout 911 +stderr 911 +stdout 912 +stderr 912 +stdout 913 +stderr 913 +stdout 914 +stderr 914 +stdout 915 +stderr 915 +stdout 916 +stderr 916 +stdout 917 +stderr 917 +stdout 918 +stderr 918 +stdout 919 +stderr 919 +stdout 920 +stderr 920 +stdout 921 +stderr 921 +stdout 922 +stderr 922 +stdout 923 +stderr 923 +stdout 924 +stderr 924 +stdout 925 +stderr 925 +stdout 926 +stderr 926 +stdout 927 +stderr 927 +stdout 928 +stderr 928 +stdout 929 +stderr 929 +stdout 930 +stderr 930 +stdout 931 +stderr 931 +stdout 932 +stderr 932 +stdout 933 +stderr 933 +stdout 934 +stderr 934 +stdout 935 +stderr 935 +stdout 936 +stderr 936 +stdout 937 +stderr 937 +stdout 938 +stderr 938 +stdout 939 +stderr 939 +stdout 940 +stderr 940 +stdout 941 +stderr 941 +stdout 942 +stderr 942 +stdout 943 +stderr 943 +stdout 944 +stderr 944 +stdout 945 +stderr 945 +stdout 946 +stderr 946 +stdout 947 +stderr 947 +stdout 948 +stderr 948 +stdout 949 +stderr 949 +stdout 950 +stderr 950 +stdout 951 +stderr 951 +stdout 952 +stderr 952 +stdout 953 +stderr 953 +stdout 954 +stderr 954 +stdout 955 +stderr 955 +stdout 956 +stderr 956 +stdout 957 +stderr 957 +stdout 958 +stderr 958 +stdout 959 +stderr 959 +stdout 960 +stderr 960 +stdout 961 +stderr 961 +stdout 962 +stderr 962 +stdout 963 +stderr 963 +stdout 964 +stderr 964 +stdout 965 +stderr 965 +stdout 966 +stderr 966 +stdout 967 +stderr 967 +stdout 968 +stderr 968 +stdout 969 +stderr 969 +stdout 970 +stderr 970 +stdout 971 +stderr 971 +stdout 972 +stderr 972 +stdout 973 +stderr 973 +stdout 974 +stderr 974 +stdout 975 +stderr 975 +stdout 976 +stderr 976 +stdout 977 +stderr 977 +stdout 978 +stderr 978 +stdout 979 +stderr 979 +stdout 980 +stderr 980 +stdout 981 +stderr 981 +stdout 982 +stderr 982 +stdout 983 +stderr 983 +stdout 984 +stderr 984 +stdout 985 +stderr 985 +stdout 986 +stderr 986 +stdout 987 +stderr 987 +stdout 988 +stderr 988 +stdout 989 +stderr 989 +stdout 990 +stderr 990 +stdout 991 +stderr 991 +stdout 992 +stderr 992 +stdout 993 +stderr 993 +stdout 994 +stderr 994 +stdout 995 +stderr 995 +stdout 996 +stderr 996 +stdout 997 +stderr 997 +stdout 998 +stderr 998 +stdout 999 +stderr 999 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout.txt new file mode 100644 index 0000000..d3649d0 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/1000-stdout.txt @@ -0,0 +1,1000 @@ +stdout 0 +stdout 1 +stdout 2 +stdout 3 +stdout 4 +stdout 5 +stdout 6 +stdout 7 +stdout 8 +stdout 9 +stdout 10 +stdout 11 +stdout 12 +stdout 13 +stdout 14 +stdout 15 +stdout 16 +stdout 17 +stdout 18 +stdout 19 +stdout 20 +stdout 21 +stdout 22 +stdout 23 +stdout 24 +stdout 25 +stdout 26 +stdout 27 +stdout 28 +stdout 29 +stdout 30 +stdout 31 +stdout 32 +stdout 33 +stdout 34 +stdout 35 +stdout 36 +stdout 37 +stdout 38 +stdout 39 +stdout 40 +stdout 41 +stdout 42 +stdout 43 +stdout 44 +stdout 45 +stdout 46 +stdout 47 +stdout 48 +stdout 49 +stdout 50 +stdout 51 +stdout 52 +stdout 53 +stdout 54 +stdout 55 +stdout 56 +stdout 57 +stdout 58 +stdout 59 +stdout 60 +stdout 61 +stdout 62 +stdout 63 +stdout 64 +stdout 65 +stdout 66 +stdout 67 +stdout 68 +stdout 69 +stdout 70 +stdout 71 +stdout 72 +stdout 73 +stdout 74 +stdout 75 +stdout 76 +stdout 77 +stdout 78 +stdout 79 +stdout 80 +stdout 81 +stdout 82 +stdout 83 +stdout 84 +stdout 85 +stdout 86 +stdout 87 +stdout 88 +stdout 89 +stdout 90 +stdout 91 +stdout 92 +stdout 93 +stdout 94 +stdout 95 +stdout 96 +stdout 97 +stdout 98 +stdout 99 +stdout 100 +stdout 101 +stdout 102 +stdout 103 +stdout 104 +stdout 105 +stdout 106 +stdout 107 +stdout 108 +stdout 109 +stdout 110 +stdout 111 +stdout 112 +stdout 113 +stdout 114 +stdout 115 +stdout 116 +stdout 117 +stdout 118 +stdout 119 +stdout 120 +stdout 121 +stdout 122 +stdout 123 +stdout 124 +stdout 125 +stdout 126 +stdout 127 +stdout 128 +stdout 129 +stdout 130 +stdout 131 +stdout 132 +stdout 133 +stdout 134 +stdout 135 +stdout 136 +stdout 137 +stdout 138 +stdout 139 +stdout 140 +stdout 141 +stdout 142 +stdout 143 +stdout 144 +stdout 145 +stdout 146 +stdout 147 +stdout 148 +stdout 149 +stdout 150 +stdout 151 +stdout 152 +stdout 153 +stdout 154 +stdout 155 +stdout 156 +stdout 157 +stdout 158 +stdout 159 +stdout 160 +stdout 161 +stdout 162 +stdout 163 +stdout 164 +stdout 165 +stdout 166 +stdout 167 +stdout 168 +stdout 169 +stdout 170 +stdout 171 +stdout 172 +stdout 173 +stdout 174 +stdout 175 +stdout 176 +stdout 177 +stdout 178 +stdout 179 +stdout 180 +stdout 181 +stdout 182 +stdout 183 +stdout 184 +stdout 185 +stdout 186 +stdout 187 +stdout 188 +stdout 189 +stdout 190 +stdout 191 +stdout 192 +stdout 193 +stdout 194 +stdout 195 +stdout 196 +stdout 197 +stdout 198 +stdout 199 +stdout 200 +stdout 201 +stdout 202 +stdout 203 +stdout 204 +stdout 205 +stdout 206 +stdout 207 +stdout 208 +stdout 209 +stdout 210 +stdout 211 +stdout 212 +stdout 213 +stdout 214 +stdout 215 +stdout 216 +stdout 217 +stdout 218 +stdout 219 +stdout 220 +stdout 221 +stdout 222 +stdout 223 +stdout 224 +stdout 225 +stdout 226 +stdout 227 +stdout 228 +stdout 229 +stdout 230 +stdout 231 +stdout 232 +stdout 233 +stdout 234 +stdout 235 +stdout 236 +stdout 237 +stdout 238 +stdout 239 +stdout 240 +stdout 241 +stdout 242 +stdout 243 +stdout 244 +stdout 245 +stdout 246 +stdout 247 +stdout 248 +stdout 249 +stdout 250 +stdout 251 +stdout 252 +stdout 253 +stdout 254 +stdout 255 +stdout 256 +stdout 257 +stdout 258 +stdout 259 +stdout 260 +stdout 261 +stdout 262 +stdout 263 +stdout 264 +stdout 265 +stdout 266 +stdout 267 +stdout 268 +stdout 269 +stdout 270 +stdout 271 +stdout 272 +stdout 273 +stdout 274 +stdout 275 +stdout 276 +stdout 277 +stdout 278 +stdout 279 +stdout 280 +stdout 281 +stdout 282 +stdout 283 +stdout 284 +stdout 285 +stdout 286 +stdout 287 +stdout 288 +stdout 289 +stdout 290 +stdout 291 +stdout 292 +stdout 293 +stdout 294 +stdout 295 +stdout 296 +stdout 297 +stdout 298 +stdout 299 +stdout 300 +stdout 301 +stdout 302 +stdout 303 +stdout 304 +stdout 305 +stdout 306 +stdout 307 +stdout 308 +stdout 309 +stdout 310 +stdout 311 +stdout 312 +stdout 313 +stdout 314 +stdout 315 +stdout 316 +stdout 317 +stdout 318 +stdout 319 +stdout 320 +stdout 321 +stdout 322 +stdout 323 +stdout 324 +stdout 325 +stdout 326 +stdout 327 +stdout 328 +stdout 329 +stdout 330 +stdout 331 +stdout 332 +stdout 333 +stdout 334 +stdout 335 +stdout 336 +stdout 337 +stdout 338 +stdout 339 +stdout 340 +stdout 341 +stdout 342 +stdout 343 +stdout 344 +stdout 345 +stdout 346 +stdout 347 +stdout 348 +stdout 349 +stdout 350 +stdout 351 +stdout 352 +stdout 353 +stdout 354 +stdout 355 +stdout 356 +stdout 357 +stdout 358 +stdout 359 +stdout 360 +stdout 361 +stdout 362 +stdout 363 +stdout 364 +stdout 365 +stdout 366 +stdout 367 +stdout 368 +stdout 369 +stdout 370 +stdout 371 +stdout 372 +stdout 373 +stdout 374 +stdout 375 +stdout 376 +stdout 377 +stdout 378 +stdout 379 +stdout 380 +stdout 381 +stdout 382 +stdout 383 +stdout 384 +stdout 385 +stdout 386 +stdout 387 +stdout 388 +stdout 389 +stdout 390 +stdout 391 +stdout 392 +stdout 393 +stdout 394 +stdout 395 +stdout 396 +stdout 397 +stdout 398 +stdout 399 +stdout 400 +stdout 401 +stdout 402 +stdout 403 +stdout 404 +stdout 405 +stdout 406 +stdout 407 +stdout 408 +stdout 409 +stdout 410 +stdout 411 +stdout 412 +stdout 413 +stdout 414 +stdout 415 +stdout 416 +stdout 417 +stdout 418 +stdout 419 +stdout 420 +stdout 421 +stdout 422 +stdout 423 +stdout 424 +stdout 425 +stdout 426 +stdout 427 +stdout 428 +stdout 429 +stdout 430 +stdout 431 +stdout 432 +stdout 433 +stdout 434 +stdout 435 +stdout 436 +stdout 437 +stdout 438 +stdout 439 +stdout 440 +stdout 441 +stdout 442 +stdout 443 +stdout 444 +stdout 445 +stdout 446 +stdout 447 +stdout 448 +stdout 449 +stdout 450 +stdout 451 +stdout 452 +stdout 453 +stdout 454 +stdout 455 +stdout 456 +stdout 457 +stdout 458 +stdout 459 +stdout 460 +stdout 461 +stdout 462 +stdout 463 +stdout 464 +stdout 465 +stdout 466 +stdout 467 +stdout 468 +stdout 469 +stdout 470 +stdout 471 +stdout 472 +stdout 473 +stdout 474 +stdout 475 +stdout 476 +stdout 477 +stdout 478 +stdout 479 +stdout 480 +stdout 481 +stdout 482 +stdout 483 +stdout 484 +stdout 485 +stdout 486 +stdout 487 +stdout 488 +stdout 489 +stdout 490 +stdout 491 +stdout 492 +stdout 493 +stdout 494 +stdout 495 +stdout 496 +stdout 497 +stdout 498 +stdout 499 +stdout 500 +stdout 501 +stdout 502 +stdout 503 +stdout 504 +stdout 505 +stdout 506 +stdout 507 +stdout 508 +stdout 509 +stdout 510 +stdout 511 +stdout 512 +stdout 513 +stdout 514 +stdout 515 +stdout 516 +stdout 517 +stdout 518 +stdout 519 +stdout 520 +stdout 521 +stdout 522 +stdout 523 +stdout 524 +stdout 525 +stdout 526 +stdout 527 +stdout 528 +stdout 529 +stdout 530 +stdout 531 +stdout 532 +stdout 533 +stdout 534 +stdout 535 +stdout 536 +stdout 537 +stdout 538 +stdout 539 +stdout 540 +stdout 541 +stdout 542 +stdout 543 +stdout 544 +stdout 545 +stdout 546 +stdout 547 +stdout 548 +stdout 549 +stdout 550 +stdout 551 +stdout 552 +stdout 553 +stdout 554 +stdout 555 +stdout 556 +stdout 557 +stdout 558 +stdout 559 +stdout 560 +stdout 561 +stdout 562 +stdout 563 +stdout 564 +stdout 565 +stdout 566 +stdout 567 +stdout 568 +stdout 569 +stdout 570 +stdout 571 +stdout 572 +stdout 573 +stdout 574 +stdout 575 +stdout 576 +stdout 577 +stdout 578 +stdout 579 +stdout 580 +stdout 581 +stdout 582 +stdout 583 +stdout 584 +stdout 585 +stdout 586 +stdout 587 +stdout 588 +stdout 589 +stdout 590 +stdout 591 +stdout 592 +stdout 593 +stdout 594 +stdout 595 +stdout 596 +stdout 597 +stdout 598 +stdout 599 +stdout 600 +stdout 601 +stdout 602 +stdout 603 +stdout 604 +stdout 605 +stdout 606 +stdout 607 +stdout 608 +stdout 609 +stdout 610 +stdout 611 +stdout 612 +stdout 613 +stdout 614 +stdout 615 +stdout 616 +stdout 617 +stdout 618 +stdout 619 +stdout 620 +stdout 621 +stdout 622 +stdout 623 +stdout 624 +stdout 625 +stdout 626 +stdout 627 +stdout 628 +stdout 629 +stdout 630 +stdout 631 +stdout 632 +stdout 633 +stdout 634 +stdout 635 +stdout 636 +stdout 637 +stdout 638 +stdout 639 +stdout 640 +stdout 641 +stdout 642 +stdout 643 +stdout 644 +stdout 645 +stdout 646 +stdout 647 +stdout 648 +stdout 649 +stdout 650 +stdout 651 +stdout 652 +stdout 653 +stdout 654 +stdout 655 +stdout 656 +stdout 657 +stdout 658 +stdout 659 +stdout 660 +stdout 661 +stdout 662 +stdout 663 +stdout 664 +stdout 665 +stdout 666 +stdout 667 +stdout 668 +stdout 669 +stdout 670 +stdout 671 +stdout 672 +stdout 673 +stdout 674 +stdout 675 +stdout 676 +stdout 677 +stdout 678 +stdout 679 +stdout 680 +stdout 681 +stdout 682 +stdout 683 +stdout 684 +stdout 685 +stdout 686 +stdout 687 +stdout 688 +stdout 689 +stdout 690 +stdout 691 +stdout 692 +stdout 693 +stdout 694 +stdout 695 +stdout 696 +stdout 697 +stdout 698 +stdout 699 +stdout 700 +stdout 701 +stdout 702 +stdout 703 +stdout 704 +stdout 705 +stdout 706 +stdout 707 +stdout 708 +stdout 709 +stdout 710 +stdout 711 +stdout 712 +stdout 713 +stdout 714 +stdout 715 +stdout 716 +stdout 717 +stdout 718 +stdout 719 +stdout 720 +stdout 721 +stdout 722 +stdout 723 +stdout 724 +stdout 725 +stdout 726 +stdout 727 +stdout 728 +stdout 729 +stdout 730 +stdout 731 +stdout 732 +stdout 733 +stdout 734 +stdout 735 +stdout 736 +stdout 737 +stdout 738 +stdout 739 +stdout 740 +stdout 741 +stdout 742 +stdout 743 +stdout 744 +stdout 745 +stdout 746 +stdout 747 +stdout 748 +stdout 749 +stdout 750 +stdout 751 +stdout 752 +stdout 753 +stdout 754 +stdout 755 +stdout 756 +stdout 757 +stdout 758 +stdout 759 +stdout 760 +stdout 761 +stdout 762 +stdout 763 +stdout 764 +stdout 765 +stdout 766 +stdout 767 +stdout 768 +stdout 769 +stdout 770 +stdout 771 +stdout 772 +stdout 773 +stdout 774 +stdout 775 +stdout 776 +stdout 777 +stdout 778 +stdout 779 +stdout 780 +stdout 781 +stdout 782 +stdout 783 +stdout 784 +stdout 785 +stdout 786 +stdout 787 +stdout 788 +stdout 789 +stdout 790 +stdout 791 +stdout 792 +stdout 793 +stdout 794 +stdout 795 +stdout 796 +stdout 797 +stdout 798 +stdout 799 +stdout 800 +stdout 801 +stdout 802 +stdout 803 +stdout 804 +stdout 805 +stdout 806 +stdout 807 +stdout 808 +stdout 809 +stdout 810 +stdout 811 +stdout 812 +stdout 813 +stdout 814 +stdout 815 +stdout 816 +stdout 817 +stdout 818 +stdout 819 +stdout 820 +stdout 821 +stdout 822 +stdout 823 +stdout 824 +stdout 825 +stdout 826 +stdout 827 +stdout 828 +stdout 829 +stdout 830 +stdout 831 +stdout 832 +stdout 833 +stdout 834 +stdout 835 +stdout 836 +stdout 837 +stdout 838 +stdout 839 +stdout 840 +stdout 841 +stdout 842 +stdout 843 +stdout 844 +stdout 845 +stdout 846 +stdout 847 +stdout 848 +stdout 849 +stdout 850 +stdout 851 +stdout 852 +stdout 853 +stdout 854 +stdout 855 +stdout 856 +stdout 857 +stdout 858 +stdout 859 +stdout 860 +stdout 861 +stdout 862 +stdout 863 +stdout 864 +stdout 865 +stdout 866 +stdout 867 +stdout 868 +stdout 869 +stdout 870 +stdout 871 +stdout 872 +stdout 873 +stdout 874 +stdout 875 +stdout 876 +stdout 877 +stdout 878 +stdout 879 +stdout 880 +stdout 881 +stdout 882 +stdout 883 +stdout 884 +stdout 885 +stdout 886 +stdout 887 +stdout 888 +stdout 889 +stdout 890 +stdout 891 +stdout 892 +stdout 893 +stdout 894 +stdout 895 +stdout 896 +stdout 897 +stdout 898 +stdout 899 +stdout 900 +stdout 901 +stdout 902 +stdout 903 +stdout 904 +stdout 905 +stdout 906 +stdout 907 +stdout 908 +stdout 909 +stdout 910 +stdout 911 +stdout 912 +stdout 913 +stdout 914 +stdout 915 +stdout 916 +stdout 917 +stdout 918 +stdout 919 +stdout 920 +stdout 921 +stdout 922 +stdout 923 +stdout 924 +stdout 925 +stdout 926 +stdout 927 +stdout 928 +stdout 929 +stdout 930 +stdout 931 +stdout 932 +stdout 933 +stdout 934 +stdout 935 +stdout 936 +stdout 937 +stdout 938 +stdout 939 +stdout 940 +stdout 941 +stdout 942 +stdout 943 +stdout 944 +stdout 945 +stdout 946 +stdout 947 +stdout 948 +stdout 949 +stdout 950 +stdout 951 +stdout 952 +stdout 953 +stdout 954 +stdout 955 +stdout 956 +stdout 957 +stdout 958 +stdout 959 +stdout 960 +stdout 961 +stdout 962 +stdout 963 +stdout 964 +stdout 965 +stdout 966 +stdout 967 +stdout 968 +stdout 969 +stdout 970 +stdout 971 +stdout 972 +stdout 973 +stdout 974 +stdout 975 +stdout 976 +stdout 977 +stdout 978 +stdout 979 +stdout 980 +stdout 981 +stdout 982 +stdout 983 +stdout 984 +stdout 985 +stdout 986 +stdout 987 +stdout 988 +stdout 989 +stdout 990 +stdout 991 +stdout 992 +stdout 993 +stdout 994 +stdout 995 +stdout 996 +stdout 997 +stdout 998 +stdout 999 diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/create-files.sh b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/create-files.sh new file mode 100644 index 0000000..6a526de --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/create-files.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +rm 10*.txt +for n in 10 100 1000; do + node log.js 0 $n stdout stderr &> $n-stdout-stderr.txt + node log.js 0 $n stdout &> $n-stdout.txt + node log.js 0 $n stderr &> $n-stderr.txt +done diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log-broken.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log-broken.js new file mode 100644 index 0000000..74c8f12 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log-broken.js @@ -0,0 +1,23 @@ +var errorCode = process.argv[2]; +var max = process.argv[3]; +var modes = process.argv.slice(4); + +function stdout(message) { + if (modes.indexOf('stdout') === -1) { return; } + process.stdout.write('stdout ' + message + '\n'); +} + +function stderr(message) { + if (modes.indexOf('stderr') === -1) { return; } + process.stderr.write('stderr ' + message + '\n'); +} + +for (var i = 0; i < max; i++) { + stdout(i); + stderr(i); +} + +process.exit(errorCode); + +stdout('fail'); +stderr('fail'); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log.js new file mode 100644 index 0000000..8a9ed9a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/exit/test/fixtures/log.js @@ -0,0 +1,25 @@ +var exit = require('../../lib/exit'); + +var errorCode = process.argv[2]; +var max = process.argv[3]; +var modes = process.argv.slice(4); + +function stdout(message) { + if (modes.indexOf('stdout') === -1) { return; } + process.stdout.write('stdout ' + message + '\n'); +} + +function stderr(message) { + if (modes.indexOf('stderr') === -1) { return; } + process.stderr.write('stderr ' + message + '\n'); +} + +for (var i = 0; i < max; i++) { + stdout(i); + stderr(i); +} + +exit(errorCode); + +stdout('fail'); +stderr('fail'); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/.npmignore new file mode 100644 index 0000000..b4a9d1d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/.npmignore @@ -0,0 +1 @@ +.redcar diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/LICENSE b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/LICENSE new file mode 100644 index 0000000..b6cd384 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/LICENSE @@ -0,0 +1,9 @@ +** Licensed Under ** + +The MIT License +http://www.opensource.org/licenses/mit-license.php + +Copyright (c) 2010 all contributors: + +Gord Tanner +tinyHippos Inc. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/README.md new file mode 100644 index 0000000..8f420b1 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/README.md @@ -0,0 +1,170 @@ +# jWorkflow +Dude, where is my workflow? + +jWorkflow is a workflow engine for JavaScript that provides the ability to +create workflows to chain methods together in an easy to understand syntax: + + var fooodOrder = jWorkflow.order(garlicChicken) + .andThen(whiteRice) + .andThen(wontonSoup) + .andThen(cookiesFortune) + .andThen(noAndThen) + .andThen(noAndThen) + .andThen(noAndThen) + .andThen(noAndThen); + + fooodOrder.start(); + +# Install + +jWorkflow can be used in node or included in the browser. It can be installed with npm + + npm install jWorkflow + +and used + + var jWorkflow = require("jWorkflow"); + +or just include jWorkflow.js in your webpage and use window.jWorkflow. + +# Usage + +jWorkflow orders are started with a call to jWorkflow.order: + + function dude() { + // some of the best code in the world will live here + } + + var order = jWorkflow.order(dude); + + // orders can also be started with no initial function + var pizzacoli = jWorkflow.order(); + +jWorkflow tasks at the root are just functions that will be invoked in the order they are built. +Any number of tasks can be then appended to the order: + + order.andThen(sweet).andThen(dude).andThen(sweet); + +The functions passed into the order will not be invoked until you call: + + order.start(); + +The context to be used when invoking the functions can be passed in while creating the order: + + order.andThen(transfunctioner.photonAcceleratorAnnihilationBeam, transfunctioner); + +An initial value can be passed into the start method to seed the first function: + + order.start({ + initialValue: 10 + }); + +# Passing Values between tasks + +jWorkflow tasks can access the return value of the previous task with the previous parameter: + + function meaningOfLife() { + //find the meaning of life + return 42; + } + + function writeBook(previous) { + console.log("the meaning of life is " + previous); + } + + var guide = jWorkflow.order(meaningOfLife).andThen(writeBook); + guide.start(); + +# Handling Async calls + +Sometimes(probably all the time) you will need to do something async when working with +tasks, jWorkflow provides the ability to control the execution of the workflow via a +baton that is passed to the task + + function procrastinate(previous, baton) { + //take the baton, this means the next task will not run until you pass the baton + baton.take(); + + window.setTimeout(function() { + //do some stuff + + //please be nice and always remember to pass the baton! + baton.pass(); + }, 1000); + } + +If you want to pass a return value to the next task you can pass it along with the +baton. + +NOTE: if you did take the baton, the return value from your function will NOT be passed to +the next task: + + function awesometown(previous, baton) { + baton.take(); + + window.setTimeout(function() { + + //do stuff + + baton.pass(420); //This value will be passed to the next task + }, 100); + + return 50; // this will NOT be passed to the next function since you took the baton. + } + + +the start method provides a callback to execute when the workflow is finished. The final +return value is also passed to the callback: + + order.start({ + callback: function(review) { + console.log("dude!, your car is behind that mail truck!"); + expect(review).toBe("two thumbs up"); + } + }); + +you can also pass context to use for the callback: + + order.start({ + callback: function() { + //do stuff + }, + context: transfunctioner + }); + +# Waiting between tasks + +If you ever need to take a break and reflect on the moment you can add some time(in ms) to chill between tasks: + + jWorkflow.order(seeDoubleRainbow) + .chill(1000) + .andThen(omg) + .andThen(omg) + .andThen(omg) + .chill(1000) + .andThen(freakOut); + +# Handling Parallel tasks + +If you need to handle some tasks and don't care about when they are done you can pass in an array of functions and / or other workflows to execute +at the same time. + + jWorkflow.order([man, man, halfMan]) + .andThen([jWorkflow.order([guy, guy]).andThen(girl), pizzaPlace]); + +# Canceling Workflows + +To cancel the execution of the workflow you can call the drop method on the baton: + + function (previous, baton) { + //the value passed to drop will be passed onto the final callback if it exists + baton.drop("I dropped the soap"); + //this value will NOT be passed to the next workflow step + return 10; + } + +NOTE: This will force the workflow into async mode. + +# Contributers: + + Gord Tanner diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/Rakefile b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/Rakefile new file mode 100644 index 0000000..eb6b859 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/Rakefile @@ -0,0 +1,12 @@ +require 'rubygems' +require 'closure-compiler' + +task :default => [:build] + +desc "Use the Closure Compiler to compress jWorkflow.js" +task :build do + js = File.open('lib/jWorkflow.js', 'r') + min = Closure::Compiler.new.compile(js) + File.open('jworkflow-min-0.7.0.js', 'w') {|f| f.write(min) } +end + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/jworkflow-min-0.8.0.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/jworkflow-min-0.8.0.js new file mode 100644 index 0000000..a448d51 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/jworkflow-min-0.8.0.js @@ -0,0 +1,3 @@ +var jWorkflow=function(){return{order:function(j,k){var f=[],g,h=null,i=function(){var a=false;return{take:function(){a=true},pass:function(b){var c;a=false;g.length?(c=g.shift(),b=c.func.apply(c.context,[b,i]),a||i.pass(b)):h.func&&h.func.apply(h.context,[b])},drop:function(b){a=true;g=[];setTimeout(function(){i.pass(b)},1)}}}(),e={andThen:function(a,b){if(typeof a.andThen==="function"&&typeof a.start==="function"&&typeof a.chill==="function")f.push({func:function(c,d){d.take();a.start({callback:function(a){d.pass(a)}, +context:b,initialValue:c})},context:b});else if(a.map&&a.reduce)f.push({func:function(b,d){d.take();var f=a.length,g=function(){return--f||d.pass()};a.forEach(function(a){jWorkflow.order(a).start(g)})},context:b});else{if(typeof a!=="function")throw"expected function but was "+typeof a;f.push({func:a,context:b})}return e},chill:function(a){return e.andThen(function(b,c){c.take();setTimeout(function(){c.pass(b)},a)})},start:function(a,b){var c,d,e;a&&typeof a==="object"?(c=a.callback,d=a.context,e= +a.initialValue):(c=a,d=b);h={func:c,context:d};g=f.slice();i.pass(e)}};return j?e.andThen(j,k):e}}}();if(typeof module==="object"&&typeof require==="function")module.exports=jWorkflow; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/lib/jWorkflow.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/lib/jWorkflow.js new file mode 100644 index 0000000..36380d5 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/lib/jWorkflow.js @@ -0,0 +1,140 @@ +// jWorkflow.js +// (c) 2010 tinyHippos inc. +// jWorkflow is freely distributable under the terms of the MIT license. +// Portions of jWorkflow are inspired by Underscore.js +var jWorkflow = (function () { + function _valid(func) { + if (typeof(func) !== 'function') { + throw "expected function but was " + typeof(func); + } + } + + function _isWorkflow(func) { + return typeof func.andThen === 'function' && + typeof func.start === 'function' && + typeof func.chill === 'function'; + } + + function _isArray(func) { + return !!func.map && !!func.reduce; + } + + var transfunctioner = { + order: function (func, context) { + var _workflow = [], + _tasks, + _callback = null, + _baton = (function () { + var _taken = false; + return { + + take: function () { + _taken = true; + }, + + pass: function (result) { + var task; + _taken = false; + + if (_tasks.length) { + task = _tasks.shift(); + result = task.func.apply(task.context, [result, _baton]); + + if (!_taken) { + _baton.pass(result); + } + } + else { + if (_callback.func) { + _callback.func.apply(_callback.context, [result]); + } + } + }, + + drop: function (result) { + _taken = true; + _tasks = []; + setTimeout(function () { + _baton.pass(result); + }, 1); + } + }; + }()), + _self = { + + andThen: function (func, context) { + if (_isWorkflow(func)) { + var f = function (prev, baton) { + baton.take(); + func.start({ + callback: function (result) { + baton.pass(result); + }, + context: context, + initialValue: prev + }); + }; + _workflow.push({func: f, context: context}); + } + else if (_isArray(func)) { + var orch = function (prev, baton) { + baton.take(); + + var l = func.length, + join = function () { + return --l || baton.pass(); + }; + + func.forEach(function (f) { + jWorkflow.order(f).start(join); + }); + }; + _workflow.push({func: orch, context: context}); + } + else { + _valid(func); + _workflow.push({func: func, context: context}); + } + return _self; + }, + + chill: function (time) { + return _self.andThen(function (prev, baton) { + baton.take(); + setTimeout(function () { + baton.pass(prev); + }, time); + }); + }, + + start: function () { + var callback, + context, + initialValue; + + if (arguments[0] && typeof arguments[0] === 'object') { + callback = arguments[0].callback; + context = arguments[0].context; + initialValue = arguments[0].initialValue; + } + else { + callback = arguments[0]; + context = arguments[1]; + } + + _callback = {func: callback, context: context}; + _tasks = _workflow.slice(); + _baton.pass(initialValue); + } + }; + + return func ? _self.andThen(func, context) : _self; + } + }; + + return transfunctioner; +}()); + +if (typeof module === "object" && typeof require === "function") { + module.exports = jWorkflow; +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/package.json new file mode 100644 index 0000000..817ec46 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/package.json @@ -0,0 +1,27 @@ +{ + "name": "jWorkflow", + "version": "0.8.0", + "description": "dude, wheres my workflow?", + "homepage": "https://github.com/tinyhippos/jWorkflow", + "author": { + "name": "gtanner" + }, + "contributors": [ + { + "name": "Gord Tanner", + "email": "gtanner@gmail.com", + "url": "http://github.com/gtanner" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "" + } + ], + "main": "./lib/jWorkflow", + "readme": "# jWorkflow\nDude, where is my workflow?\n\njWorkflow is a workflow engine for JavaScript that provides the ability to\ncreate workflows to chain methods together in an easy to understand syntax:\n\n var fooodOrder = jWorkflow.order(garlicChicken)\n .andThen(whiteRice)\n .andThen(wontonSoup)\n .andThen(cookiesFortune)\n .andThen(noAndThen)\n .andThen(noAndThen)\n .andThen(noAndThen)\n .andThen(noAndThen);\n\n fooodOrder.start();\n\n# Install\n\njWorkflow can be used in node or included in the browser. It can be installed with npm\n\n npm install jWorkflow\n\nand used\n\n var jWorkflow = require(\"jWorkflow\");\n\nor just include jWorkflow.js in your webpage and use window.jWorkflow.\n\n# Usage\n\njWorkflow orders are started with a call to jWorkflow.order:\n\n function dude() {\n // some of the best code in the world will live here\n }\n\n var order = jWorkflow.order(dude);\n\n // orders can also be started with no initial function\n var pizzacoli = jWorkflow.order();\n\njWorkflow tasks at the root are just functions that will be invoked in the order they are built.\nAny number of tasks can be then appended to the order:\n\n order.andThen(sweet).andThen(dude).andThen(sweet);\n\nThe functions passed into the order will not be invoked until you call:\n\n order.start();\n\nThe context to be used when invoking the functions can be passed in while creating the order:\n\n order.andThen(transfunctioner.photonAcceleratorAnnihilationBeam, transfunctioner);\n\nAn initial value can be passed into the start method to seed the first function:\n\n order.start({\n initialValue: 10\n });\n\n# Passing Values between tasks\n\njWorkflow tasks can access the return value of the previous task with the previous parameter:\n\n function meaningOfLife() {\n //find the meaning of life\n return 42; \n }\n \n function writeBook(previous) {\n console.log(\"the meaning of life is \" + previous);\n }\n\n var guide = jWorkflow.order(meaningOfLife).andThen(writeBook);\n guide.start();\n\n# Handling Async calls\n\nSometimes(probably all the time) you will need to do something async when working with\ntasks, jWorkflow provides the ability to control the execution of the workflow via a\nbaton that is passed to the task\n\n function procrastinate(previous, baton) {\n //take the baton, this means the next task will not run until you pass the baton\n baton.take();\n\n window.setTimeout(function() {\n //do some stuff\n\n //please be nice and always remember to pass the baton!\n baton.pass();\n }, 1000);\n }\n\nIf you want to pass a return value to the next task you can pass it along with the\nbaton.\n\nNOTE: if you did take the baton, the return value from your function will NOT be passed to \nthe next task:\n\n function awesometown(previous, baton) {\n baton.take();\n\n window.setTimeout(function() {\n \n //do stuff\n \n baton.pass(420); //This value will be passed to the next task\n }, 100);\n\n return 50; // this will NOT be passed to the next function since you took the baton.\n }\n\n\nthe start method provides a callback to execute when the workflow is finished. The final\nreturn value is also passed to the callback:\n\n order.start({\n callback: function(review) {\n console.log(\"dude!, your car is behind that mail truck!\");\n expect(review).toBe(\"two thumbs up\");\n }\n });\n\nyou can also pass context to use for the callback:\n\n order.start({\n callback: function() {\n //do stuff\n }, \n context: transfunctioner\n });\n \n# Waiting between tasks\n\nIf you ever need to take a break and reflect on the moment you can add some time(in ms) to chill between tasks:\n\n jWorkflow.order(seeDoubleRainbow)\n .chill(1000)\n .andThen(omg)\n .andThen(omg)\n .andThen(omg)\n .chill(1000)\n .andThen(freakOut);\n\n# Handling Parallel tasks\n\nIf you need to handle some tasks and don't care about when they are done you can pass in an array of functions and / or other workflows to execute\nat the same time.\n\n jWorkflow.order([man, man, halfMan])\n .andThen([jWorkflow.order([guy, guy]).andThen(girl), pizzaPlace]);\n\n# Canceling Workflows\n\nTo cancel the execution of the workflow you can call the drop method on the baton:\n\n function (previous, baton) {\n //the value passed to drop will be passed onto the final callback if it exists\n baton.drop(\"I dropped the soap\");\n //this value will NOT be passed to the next workflow step\n return 10;\n }\n\nNOTE: This will force the workflow into async mode.\n\n# Contributers:\n\n Gord Tanner \n", + "readmeFilename": "README.md", + "_id": "jWorkflow@0.8.0", + "_from": "jWorkflow@0.8.0" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test.html b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test.html new file mode 100644 index 0000000..75e581b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test.html @@ -0,0 +1,17 @@ + + + + jWorkflow Test Suite + + + + + + + +

jWorkflow Test Suite

+

+

+
    + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test_jworkflow.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test_jworkflow.js new file mode 100644 index 0000000..afb13a2 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/test_jworkflow.js @@ -0,0 +1,521 @@ +$(document).ready(function () { + module("jWorkflow ordering and starting workflows"); + + test("jWorkflow: we can place an order", function () { + expect(1); + var order = jWorkflow.order(function () {}); + ok(order, "we should have an order"); + }); + + test("jWorkflow: order throws an error when not given a function", function () { + expect(1); + var errored = false; + try { + jWorkflow.order(42); + } + catch (ex) { + errored = true; + } + + ok(errored, "expected an error"); + + }); + + test("jWorkflow: we can call andThen on the return value of order", function () { + expect(2); + + var transfunctioner = function () { }, + order = jWorkflow.order(transfunctioner); + + ok(order.andThen, "expected to be asked: 'andThen'"); + equals(typeof(order.andThen), "function", "expected andThen to be a function"); + }); + + test("jWorkflow: andThen throws an error when not given a function", function () { + expect(1); + + var errored = false; + try { + jWorkflow.order(function () {}).andThen(42); + } + catch (ex) { + errored = true; + } + + ok(errored, "expected an error"); + + }); + + test("jWorkflow: we can call andThen on the return value of andThen", function () { + expect(2); + + var garlicChicken = function () {}, + whiteRice = function () {}, + wontonSoup = function () {}, + cookiesFortune = function () {}, + noAndThen = function () {}, + order = jWorkflow.order(garlicChicken) + .andThen(whiteRice) + .andThen(wontonSoup) + .andThen(cookiesFortune); + + order.andThen(noAndThen).andThen(noAndThen); + + ok(order.andThen, "expected to be asked: 'andThen'"); + equals(typeof(order.andThen), "function", "expected andThen to be a function"); + + }); + + test("jWorkflow: it doesnt invoke the order function when start isnt called", function () { + var dude = true, + sweet = function () { + dude = false; + }, + order = jWorkflow.order(sweet); + + ok(dude, "expected sweet to have not been invoked"); + + }); + + test("jWorkflow: it calls the order function when start is called", function () { + var dude = false, + sweet = function () { + dude = true; + }, + order = jWorkflow.order(sweet); + + order.start(); + + ok(dude, "expected sweet to have been invoked"); + }); + + asyncTest("jWorkflow: it can handle multiple orders without mixing them", function () { + expect(1); + var dude = false, + what = false, + sweet = function () { + dude = true; + }, + whatup = function () { + what = true; + }, + order = jWorkflow.order(sweet), + order2 = jWorkflow.order(whatup); + + + order.start(function () { + start(); + ok(what === false, "whatup shouldn't have been called"); + }); + }); + + test("jWorkflow: it calls the order in the order that it was built", function () { + expect(1); + + var result = [], + garlicChicken = function () { + result.push("garlicChicken"); + }, + whiteRice = function () { + result.push("whiteRice"); + }, + wontonSoup = function () { + result.push("wontonSoup"); + }, + cookiesFortune = function () { + result.push("cookiesFortune"); + }, + noAndThen = function () { + result.push("noAndThen"); + }, + order = jWorkflow.order(garlicChicken) + .andThen(whiteRice) + .andThen(wontonSoup) + .andThen(cookiesFortune); + + order.andThen(noAndThen).andThen(noAndThen); + + order.start(); + + same(["garlicChicken", "whiteRice", "wontonSoup", "cookiesFortune", "noAndThen", "noAndThen"], result, "expected functions to be called in order"); + }); + + test("jWorkflow: it get the return value of the previous func", function () { + + var dude = function () { + return 42; + }, + sweet = function (previous) { + equals(previous, 42, "expected previous to be return value"); + }, + order = jWorkflow.order(dude).andThen(sweet); + + order.start(); + + }); + + test("jWorkflow: we get a baton play with", function () { + var order = jWorkflow.order(function (previous, baton) { + ok(baton, "expected a baton"); + ok(baton.take, "expected to be able to take the baton"); + ok(baton.pass, "expected to be able to pass the baton"); + }); + + order.start(); + + }); + + test("jWorkflow: when I take the baton, the next methods are not called if I don't pass it", function () { + var transfunctioner = true, + dude = function () {}, + sweet = function () {}, + noAndThen = function (previous, baton) { + baton.take(); + }, + fortuneCookie = function () { + transfunctioner = false; + }, + order = jWorkflow.order(dude).andThen(sweet).andThen(noAndThen).andThen(fortuneCookie); + + order.start(); + + ok(transfunctioner, "fortune Cookie should not have been called because we took the baton and didn't pass it"); + }); + + asyncTest("jWorkflow: when I take the baton and pass it async, the next methods are called", function () { + expect(1); + var transfunctioner = false, + dude = function () {}, + sweet = function () {}, + noAndThen = function (previous, baton) { + baton.take(); + window.setTimeout(function () { + baton.pass(); + }, 10); + }, + fortuneCookie = function () { + transfunctioner = true; + }, + order = jWorkflow.order(dude).andThen(sweet).andThen(noAndThen).andThen(fortuneCookie); + + order.start(function () { + start(); + ok(transfunctioner, "fortune Cookie should have been called because we passed the baton"); + }); + + }); + + asyncTest("jWorkflow: it calls the order in the order that it was built, even with Async calls", function () { + expect(1); + + var result = [], + procrastinate = function (msg, baton) { + baton.take(); + window.setTimeout(function () { + result.push(msg); + baton.pass(); + }, 10); + }, + garlicChicken = function (previous, baton) { + procrastinate("garlicChicken", baton); + }, + whiteRice = function (previous, baton) { + result.push("whiteRice"); + }, + wontonSoup = function (previous, baton) { + procrastinate("wontonSoup", baton); + }, + cookiesFortune = function (previous, baton) { + result.push("cookiesFortune"); + }, + noAndThen = function (previous, baton) { + procrastinate("noAndThen", baton); + }, + order = jWorkflow.order(garlicChicken) + .andThen(whiteRice) + .andThen(wontonSoup) + .andThen(cookiesFortune); + + order.andThen(noAndThen).andThen(noAndThen); + + order.start(function () { + start(); + same(result, ["garlicChicken", "whiteRice", "wontonSoup", "cookiesFortune", "noAndThen", "noAndThen"], "expected functions to be called in order"); + }); + }); + + test("jWorkflow: we can give context for the function passed to andThen", function () { + expect(1); + + var zoltan = { + toMyParentsMinivan: function () { + ok(this.getCultMembers, "expected to be able to get the cult members"); + }, + + getCultMembers: function () { + return ["Zarnoff", "Zabu", "Zellnor", "Zelbor", "Zelmina", "Jeff"]; + } + }, + order = jWorkflow.order(zoltan.toMyParentsMinivan, zoltan); + + order.start(); + }); + + test("jWorkflow, we can pass in a different context for each function", function () { + expect(2); + + var jesse = { + smokeyMcPot: true, + test: function () { + ok(this.smokeyMcPot, "I should be SmokeyMcPot"); + } + }, + chester = { + johnnyPotsmoker: true, + test: function () { + ok(this.johnnyPotsmoker, "I should be Johnny Potsmoker"); + } + }, + order = jWorkflow.order(jesse.test, jesse) + .andThen(chester.test, chester); + + + order.start(); + + + }); + + test("jWorkflow: we can pass context into start", function () { + expect(1); + + var jesse = { + smokeyMcPot: true, + test: function () { + ok(this.smokeyMcPot, "I should be SmokeyMcPot"); + } + }, + order = jWorkflow.order(); + + order.start(jesse.test, jesse); + }); + + test("jWorkflow, we can pass null into order", function () { + expect(1); + + var order = jWorkflow.order(); + + ok(order, "expected to have an order when not passing in an initial function"); + }); + + test("jWorkflow, we can NOT pass null into andThen", function () { + expect(1); + var errored = false, + order = jWorkflow.order(); + + try { + order.andThen(); + } + catch (ex) { + errored = true; + } + + ok(errored, "expected an exception when calling andThen with no order"); + }); + + asyncTest("jWorkflow, we can pass a return value from an async function into a sync function via the baton", function () { + expect(1); + + var correct, + was, + order = jWorkflow.order(function (previous, baton) { + baton.take(); + setTimeout(function () { + baton.pass(420); + }, 10); + + return 11; + + }).andThen(function (answer) { + was = answer; + correct = answer === 420; + }); + + order.start(function () { + start(); + ok(correct, "expected it to be 420 but was " + was); + }); + }); + + asyncTest("jWorkflow, we can reuse an order", function () { + expect(1); + + var sheep_teleported = 0, + teleport = function () { + sheep_teleported += 1; + }, + order = jWorkflow.order(teleport).andThen(teleport); + + + order.start(function () { + order.start(function () { + start(); + equals(sheep_teleported, 4, "expected to teleport 4 sheep"); + }); + }); + }); + + asyncTest("jWorkflow, we can chill for a little bit between tasks", function () { + var time = [], + inhale = function () { + time.push(new Date()); + }, + exhale = inhale; + + jWorkflow.order(inhale).chill(100).andThen(exhale).start(function () { + start(); + var chilled = time[1] - time[0]; + ok(chilled > 50, "expected to chill a little bit between tasks: " + chilled); + }); + }); + + test("jWorkflow, it passes the final result to the callback passed to start", function () { + expect(1); + var plus1 = function (prev) { + return prev + 1; + }; + + jWorkflow.order(function () { + return 0; + }) + .andThen(plus1) + .andThen(plus1) + .start(function (result) { + equals(2, result); + }); + }); + + test("jWorkflow, we can pass the initial value into start", function () { + expect(1); + + jWorkflow.order().andThen(function (prev) { + equals(5, prev); + }).start({ + initialValue: 5 + }); + }); + + asyncTest("jWorkflow, we can pass another workflow into andThen", function () { + expect(1); + + var plus1 = function (prev) { + return prev + 1; + }, + plus4 = function (prev, baton) { + baton.take(); + setTimeout(function () { + baton.pass(prev + 4); + }, 10); + }, + addTen = jWorkflow.order(plus4).andThen(plus1).andThen(plus4).andThen(plus1), + addFive = jWorkflow.order(plus4).andThen(plus1); + + jWorkflow.order() + .andThen(addTen) + .andThen(addTen) + .andThen(addFive) + .start({ + callback: function (result) { + start(); + equals(result, 25); + }, + initialValue: 0 + }); + }); + + asyncTest("jWorkflow, we can pass an array of functions into andThen", function () { + expect(1); + + var x = "", + w = function (letter, delay) { + return function (prev, baton) { + if (delay) { + baton.take(); + window.setTimeout(function () { + x += letter; + baton.pass(); + }, delay); + } + else { + x += letter; + } + }; + }; + + jWorkflow.order(w("d")) + .andThen([w("U", 100), w("u", 10), w("u")]) + .andThen(w("de")) + .start(function () { + start(); + equals(x, "duuUde"); + }); + + }); + + asyncTest("jWorkflow, we can pass an array of workflows into andThen", function () { + expect(1); + + var x = "", + w = function (letter, delay) { + return function (prev, baton) { + if (delay) { + baton.take(); + window.setTimeout(function () { + x += letter; + baton.pass(); + }, delay); + } + else { + x += letter; + } + }; + }; + + jWorkflow.order(jWorkflow.order(w("s"))) + .andThen([jWorkflow.order(w("w", 1)).andThen(w("e")), jWorkflow.order(w("e", 30))]) + .andThen(w("et")) + .start(function () { + start(); + equals(x, "sweeet"); + }); + }); + + asyncTest("jWorkflow, we can stop execution of a workflow with baton.drop", function () { + expect(2); + + var inc = function (prev, baton) { + if (prev >= 3) { + baton.drop(prev); + } + return ++prev; + }, + protected = false; + + jWorkflow.order(inc) + .andThen(inc) + .andThen(inc) + .andThen(inc) + .andThen(inc) + .andThen(inc) + .andThen(function (prev) { + protected = true; + return prev; + }).start({ + initialValue: 0, + callback: function (result) { + start(); + equals(protected, false); + equals(result, 3); + } + }); + }); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/jquery.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/jquery.js new file mode 100644 index 0000000..a0fb883 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/jquery.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.css b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.css new file mode 100644 index 0000000..1d3b97e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.css @@ -0,0 +1,17 @@ +h1#qunit-header, h1.qunit-header { padding: 15px; font-size: large; background-color: #06b; color: white; font-family: 'trebuchet ms', verdana, arial; margin: 0; } +h1#qunit-header a { color: white; } + +h2#qunit-banner { height: 2em; border-bottom: 1px solid white; background-color: #eee; margin: 0; font-family: 'trebuchet ms', verdana, arial; } +h2#qunit-banner.pass { background-color: green; } +h2#qunit-banner.fail { background-color: red; } + +h2#qunit-userAgent, h2.qunit-userAgent { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal; font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; } + +div#qunit-testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; font-family: 'trebuchet ms', verdana, arial; margin: 0; font-size: 10pt; } + +ol#qunit-tests { font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; } +ol#qunit-tests li strong { cursor:pointer; } +ol#qunit-tests .pass { color: green; } +ol#qunit-tests .fail { color: red; } + +p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; } diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.js new file mode 100644 index 0000000..385f1e6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/jWorkflow/test/vendor/qunit.js @@ -0,0 +1,997 @@ +/* + * QUnit - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2009 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + */ + +(function(window) { + +var QUnit = { + + // Initialize the configuration options + init: function init() { + config = { + stats: { all: 0, bad: 0 }, + moduleStats: { all: 0, bad: 0 }, + started: +new Date, + blocking: false, + autorun: false, + assertions: [], + filters: [], + queue: [] + }; + + var tests = id("qunit-tests"), + banner = id("qunit-banner"), + result = id("qunit-testresult"); + + if ( tests ) { + tests.innerHTML = ""; + } + + if ( banner ) { + banner.className = ""; + } + + if ( result ) { + result.parentNode.removeChild( result ); + } + }, + + // call on start of module test to prepend name to all tests + module: function module(name, testEnvironment) { + + synchronize(function() { + if ( config.currentModule ) { + QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); + } + + config.currentModule = name; + config.moduleTestEnvironment = testEnvironment; + config.moduleStats = { all: 0, bad: 0 }; + + QUnit.moduleStart( name, testEnvironment ); + }); + }, + + asyncTest: function asyncTest(testName, expected, callback) { + if ( arguments.length === 2 ) { + callback = expected; + expected = 0; + } + + QUnit.test(testName, expected, callback, true); + }, + + test: function test(testName, expected, callback, async) { + var name = testName, testEnvironment = {}; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + if ( config.currentModule ) { + name = config.currentModule + " module: " + name; + } + + if ( !validTest(name) ) { + return; + } + + synchronize(function() { + QUnit.testStart( testName ); + + testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, config.moduleTestEnvironment); + + config.assertions = []; + config.expected = null; + + if ( arguments.length >= 3 ) { + config.expected = callback; + callback = arguments[2]; + } + + try { + if ( !config.pollution ) { + saveGlobal(); + } + + testEnvironment.setup.call(testEnvironment); + } catch(e) { + QUnit.ok( false, "Setup failed on " + name + ": " + e.message ); + } + + if ( async ) { + QUnit.stop(); + } + + try { + callback.call(testEnvironment); + } catch(e) { + fail("Test " + name + " died, exception and test follows", e, callback); + QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message ); + // else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if ( config.blocking ) { + start(); + } + } + }); + + synchronize(function() { + try { + checkPollution(); + testEnvironment.teardown.call(testEnvironment); + } catch(e) { + QUnit.ok( false, "Teardown failed on " + name + ": " + e.message ); + } + + try { + QUnit.reset(); + } catch(e) { + fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset); + } + + if ( config.expected && config.expected != config.assertions.length ) { + QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" ); + } + + var good = 0, bad = 0, + tests = id("qunit-tests"); + + config.stats.all += config.assertions.length; + config.moduleStats.all += config.assertions.length; + + if ( tests ) { + var ol = document.createElement("ol"); + ol.style.display = "none"; + + for ( var i = 0; i < config.assertions.length; i++ ) { + var assertion = config.assertions[i]; + + var li = document.createElement("li"); + li.className = assertion.result ? "pass" : "fail"; + li.innerHTML = assertion.message || "(no message)"; + ol.appendChild( li ); + + if ( assertion.result ) { + good++; + } else { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + + var b = document.createElement("strong"); + b.innerHTML = name + " (" + bad + ", " + good + ", " + config.assertions.length + ")"; + + addEvent(b, "click", function() { + var next = b.nextSibling, display = next.style.display; + next.style.display = display === "none" ? "block" : "none"; + }); + + addEvent(b, "dblclick", function(e) { + var target = (e || window.event).target; + if ( target.nodeName.toLowerCase() === "strong" ) { + var text = "", node = target.firstChild; + + while ( node.nodeType === 3 ) { + text += node.nodeValue; + node = node.nextSibling; + } + + text = text.replace(/(^\s*|\s*$)/g, ""); + + if ( window.location ) { + window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text); + } + } + }); + + var li = document.createElement("li"); + li.className = bad ? "fail" : "pass"; + li.appendChild( b ); + li.appendChild( ol ); + tests.appendChild( li ); + + if ( bad ) { + var toolbar = id("qunit-testrunner-toolbar"); + if ( toolbar ) { + toolbar.style.display = "block"; + id("qunit-filter-pass").disabled = null; + id("qunit-filter-missing").disabled = null; + } + } + + } else { + for ( var i = 0; i < config.assertions.length; i++ ) { + if ( !config.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + QUnit.testDone( testName, bad, config.assertions.length ); + + if ( !window.setTimeout && !config.queue.length ) { + done(); + } + }); + + if ( window.setTimeout && !config.doneTimer ) { + config.doneTimer = window.setTimeout(function(){ + if ( !config.queue.length ) { + done(); + } else { + synchronize( done ); + } + }, 13); + } + }, + + /** + * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + */ + expect: function expect(asserts) { + config.expected = asserts; + }, + + /** + * Asserts true. + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function ok(a, msg) { + QUnit.log(a, msg); + + config.assertions.push({ + result: !!a, + message: msg + }); + }, + + /** + * Checks that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * + * Prefered to ok( actual == expected, message ) + * + * @example equals( format("Received {0} bytes.", 2), "Received 2 bytes." ); + * + * @param Object actual + * @param Object expected + * @param String message (optional) + */ + equals: function equals(actual, expected, message) { + push(expected == actual, actual, expected, message); + }, + + same: function(a, b, message) { + push(QUnit.equiv(a, b), a, b, message); + }, + + start: function start() { + // A slight delay, to avoid any current callbacks + if ( window.setTimeout ) { + window.setTimeout(function() { + if ( config.timeout ) { + clearTimeout(config.timeout); + } + + config.blocking = false; + process(); + }, 13); + } else { + config.blocking = false; + process(); + } + }, + + stop: function stop(timeout) { + config.blocking = true; + + if ( timeout && window.setTimeout ) { + config.timeout = window.setTimeout(function() { + QUnit.ok( false, "Test timed out" ); + QUnit.start(); + }, timeout); + } + }, + + /** + * Resets the test setup. Useful for tests that modify the DOM. + */ + reset: function reset() { + if ( window.jQuery ) { + jQuery("#main").html( config.fixture ); + jQuery.event.global = {}; + jQuery.ajaxSettings = extend({}, config.ajaxSettings); + } + }, + + /** + * Trigger an event on an element. + * + * @example triggerEvent( document.body, "click" ); + * + * @param DOMElement elem + * @param String type + */ + triggerEvent: function triggerEvent( elem, type, event ) { + if ( document.createEvent ) { + event = document.createEvent("MouseEvents"); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent( event ); + + } else if ( elem.fireEvent ) { + elem.fireEvent("on"+type); + } + }, + + // Logging callbacks + done: function done(failures, total) {}, + log: function log(result, message) {}, + testStart: function testStart(name) {}, + testDone: function testDone(name, failures, total) {}, + moduleStart: function moduleStart(name, testEnvironment) {}, + moduleDone: function moduleDone(name, failures, total) {} +}; + +// Maintain internal state +var config = { + // The queue of tests to run + queue: [], + + // block until document ready + blocking: true +}; + +// Load paramaters +(function() { + var location = window.location || { search: "", protocol: "file:" }, + GETParams = location.search.slice(1).split('&'); + + for ( var i = 0; i < GETParams.length; i++ ) { + GETParams[i] = decodeURIComponent( GETParams[i] ); + if ( GETParams[i] === "noglobals" ) { + GETParams.splice( i, 1 ); + i--; + config.noglobals = true; + } + } + + // restrict modules/tests by get parameters + config.filters = GETParams; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = !!(location.protocol === 'file:'); +})(); + +// Expose the API as global variables, unless an 'exports' +// object exists, in that case we assume we're in CommonJS +if ( typeof exports === "undefined" || typeof require === "undefined" ) { + extend(window, QUnit); + window.QUnit = QUnit; +} else { + extend(exports, QUnit); + exports.QUnit = QUnit; +} + +if ( typeof document === "undefined" || document.readyState === "complete" ) { + config.autorun = true; +} + +addEvent(window, "load", function() { + // Initialize the config, saving the execution queue + var oldconfig = extend({}, config); + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + var userAgent = id("qunit-userAgent"); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + + var toolbar = id("qunit-testrunner-toolbar"); + if ( toolbar ) { + toolbar.style.display = "none"; + + var filter = document.createElement("input"); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + filter.disabled = true; + addEvent( filter, "click", function() { + var li = document.getElementsByTagName("li"); + for ( var i = 0; i < li.length; i++ ) { + if ( li[i].className.indexOf("pass") > -1 ) { + li[i].style.display = filter.checked ? "none" : "block"; + } + } + }); + toolbar.appendChild( filter ); + + var label = document.createElement("label"); + label.setAttribute("for", "filter-pass"); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + + var missing = document.createElement("input"); + missing.type = "checkbox"; + missing.id = "qunit-filter-missing"; + missing.disabled = true; + addEvent( missing, "click", function() { + var li = document.getElementsByTagName("li"); + for ( var i = 0; i < li.length; i++ ) { + if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) { + li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block"; + } + } + }); + toolbar.appendChild( missing ); + + label = document.createElement("label"); + label.setAttribute("for", "filter-missing"); + label.innerHTML = "Hide missing tests (untested code is broken code)"; + toolbar.appendChild( label ); + } + + var main = id('main'); + if ( main ) { + config.fixture = main.innerHTML; + } + + if ( window.jQuery ) { + config.ajaxSettings = window.jQuery.ajaxSettings; + } + + QUnit.start(); +}); + +function done() { + if ( config.doneTimer && window.clearTimeout ) { + window.clearTimeout( config.doneTimer ); + config.doneTimer = null; + } + + if ( config.queue.length ) { + config.doneTimer = window.setTimeout(function(){ + if ( !config.queue.length ) { + done(); + } else { + synchronize( done ); + } + }, 13); + + return; + } + + config.autorun = true; + + // Log the last module results + if ( config.currentModule ) { + QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); + } + + var banner = id("qunit-banner"), + tests = id("qunit-tests"), + html = ['Tests completed in ', + +new Date - config.started, ' milliseconds.
    ', + '', config.stats.all - config.stats.bad, ' tests of ', config.stats.all, ' passed, ', config.stats.bad,' failed.'].join(''); + + if ( banner ) { + banner.className += " " + (config.stats.bad ? "fail" : "pass"); + } + + if ( tests ) { + var result = id("qunit-testresult"); + + if ( !result ) { + result = document.createElement("p"); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore( result, tests.nextSibling ); + } + + result.innerHTML = html; + } + + QUnit.done( config.stats.bad, config.stats.all ); +} + +function validTest( name ) { + var i = config.filters.length, + run = false; + + if ( !i ) { + return true; + } + + while ( i-- ) { + var filter = config.filters[i], + not = filter.charAt(0) == '!'; + + if ( not ) { + filter = filter.slice(1); + } + + if ( name.indexOf(filter) !== -1 ) { + return !not; + } + + if ( not ) { + run = true; + } + } + + return run; +} + +function push(result, actual, expected, message) { + message = message || (result ? "okay" : "failed"); + QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) ); +} + +function synchronize( callback ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process(); + } +} + +function process() { + while ( config.queue.length && !config.blocking ) { + config.queue.shift()(); + } +} + +function saveGlobal() { + config.pollution = []; + + if ( config.noglobals ) { + for ( var key in window ) { + config.pollution.push( key ); + } + } +} + +function checkPollution( name ) { + var old = config.pollution; + saveGlobal(); + + var newGlobals = diff( old, config.pollution ); + if ( newGlobals.length > 0 ) { + ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); + config.expected++; + } + + var deletedGlobals = diff( config.pollution, old ); + if ( deletedGlobals.length > 0 ) { + ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") ); + config.expected++; + } +} + +// returns a new Array with the elements that are in a but not in b +function diff( a, b ) { + var result = a.slice(); + for ( var i = 0; i < result.length; i++ ) { + for ( var j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice(i, 1); + i--; + break; + } + } + } + return result; +} + +function fail(message, exception, callback) { + if ( typeof console !== "undefined" && console.error && console.warn ) { + console.error(message); + console.error(exception); + console.warn(callback.toString()); + + } else if ( window.opera && opera.postError ) { + opera.postError(message, exception, callback.toString); + } +} + +function extend(a, b) { + for ( var prop in b ) { + a[prop] = b[prop]; + } + + return a; +} + +function addEvent(elem, type, fn) { + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, fn ); + } else { + fn(); + } +} + +function id(name) { + return !!(typeof document !== "undefined" && document && document.getElementById) && + document.getElementById( name ); +} + +// Test for equality any JavaScript type. +// Discussions and reference: http://philrathe.com/articles/equiv +// Test suites: http://philrathe.com/tests/equiv +// Author: Philippe Rathé +QUnit.equiv = function () { + + var innerEquiv; // the real equiv function + var callers = []; // stack to decide between skip/abort functions + + + // Determine what is o. + function hoozit(o) { + if (o.constructor === String) { + return "string"; + + } else if (o.constructor === Boolean) { + return "boolean"; + + } else if (o.constructor === Number) { + + if (isNaN(o)) { + return "nan"; + } else { + return "number"; + } + + } else if (typeof o === "undefined") { + return "undefined"; + + // consider: typeof null === object + } else if (o === null) { + return "null"; + + // consider: typeof [] === object + } else if (o instanceof Array) { + return "array"; + + // consider: typeof new Date() === object + } else if (o instanceof Date) { + return "date"; + + // consider: /./ instanceof Object; + // /./ instanceof RegExp; + // typeof /./ === "function"; // => false in IE and Opera, + // true in FF and Safari + } else if (o instanceof RegExp) { + return "regexp"; + + } else if (typeof o === "object") { + return "object"; + + } else if (o instanceof Function) { + return "function"; + } else { + return undefined; + } + } + + // Call the o related callback with the given arguments. + function bindCallbacks(o, callbacks, args) { + var prop = hoozit(o); + if (prop) { + if (hoozit(callbacks[prop]) === "function") { + return callbacks[prop].apply(callbacks, args); + } else { + return callbacks[prop]; // or undefined + } + } + } + + var callbacks = function () { + + // for string, boolean, number and null + function useStrictEquality(b, a) { + if (b instanceof a.constructor || a instanceof b.constructor) { + // to catch short annotaion VS 'new' annotation of a declaration + // e.g. var i = 1; + // var j = new Number(1); + return a == b; + } else { + return a === b; + } + } + + return { + "string": useStrictEquality, + "boolean": useStrictEquality, + "number": useStrictEquality, + "null": useStrictEquality, + "undefined": useStrictEquality, + + "nan": function (b) { + return isNaN(b); + }, + + "date": function (b, a) { + return hoozit(b) === "date" && a.valueOf() === b.valueOf(); + }, + + "regexp": function (b, a) { + return hoozit(b) === "regexp" && + a.source === b.source && // the regex itself + a.global === b.global && // and its modifers (gmi) ... + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline; + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function": function () { + var caller = callers[callers.length - 1]; + return caller !== Object && + typeof caller !== "undefined"; + }, + + "array": function (b, a) { + var i; + var len; + + // b could be an object literal here + if ( ! (hoozit(b) === "array")) { + return false; + } + + len = a.length; + if (len !== b.length) { // safe and faster + return false; + } + for (i = 0; i < len; i++) { + if ( ! innerEquiv(a[i], b[i])) { + return false; + } + } + return true; + }, + + "object": function (b, a) { + var i; + var eq = true; // unless we can proove it + var aProperties = [], bProperties = []; // collection of strings + + // comparing constructors is more strict than using instanceof + if ( a.constructor !== b.constructor) { + return false; + } + + // stack constructor before traversing properties + callers.push(a.constructor); + + for (i in a) { // be strict: don't ensures hasOwnProperty and go deep + + aProperties.push(i); // collect a's properties + + if ( ! innerEquiv(a[i], b[i])) { + eq = false; + } + } + + callers.pop(); // unstack, we are done + + for (i in b) { + bProperties.push(i); // collect b's properties + } + + // Ensures identical properties name + return eq && innerEquiv(aProperties.sort(), bProperties.sort()); + } + }; + }(); + + innerEquiv = function () { // can take multiple arguments + var args = Array.prototype.slice.apply(arguments); + if (args.length < 2) { + return true; // end transition + } + + return (function (a, b) { + if (a === b) { + return true; // catch the most you can + } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) { + return false; // don't lose time with error prone cases + } else { + return bindCallbacks(a, callbacks, [b, a]); + } + + // apply transition with (1..n) arguments + })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1)); + }; + + return innerEquiv; + +}(); + +/** + * jsDump + * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php) + * Date: 5/15/2008 + * @projectDescription Advanced and extensible data dumping for Javascript. + * @version 1.0.0 + * @author Ariel Flesler + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} + */ +QUnit.jsDump = (function() { + function quote( str ) { + return '"' + str.toString().replace(/"/g, '\\"') + '"'; + }; + function literal( o ) { + return o + ''; + }; + function join( pre, arr, post ) { + var s = jsDump.separator(), + base = jsDump.indent(), + inner = jsDump.indent(1); + if ( arr.join ) + arr = arr.join( ',' + s + inner ); + if ( !arr ) + return pre + post; + return [ pre, inner + arr, base + post ].join(s); + }; + function array( arr ) { + var i = arr.length, ret = Array(i); + this.up(); + while ( i-- ) + ret[i] = this.parse( arr[i] ); + this.down(); + return join( '[', ret, ']' ); + }; + + var reName = /^function (\w+)/; + + var jsDump = { + parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance + var parser = this.parsers[ type || this.typeOf(obj) ]; + type = typeof parser; + + return type == 'function' ? parser.call( this, obj ) : + type == 'string' ? parser : + this.parsers.error; + }, + typeOf:function( obj ) { + var type = typeof obj, + f = 'function';//we'll use it 3 times, save it + return type != 'object' && type != f ? type : + !obj ? 'null' : + obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions + obj.getHours ? 'date' : + obj.scrollBy ? 'window' : + obj.nodeName == '#document' ? 'document' : + obj.nodeName ? 'node' : + obj.item ? 'nodelist' : // Safari reports nodelists as functions + obj.callee ? 'arguments' : + obj.call || obj.constructor != Array && //an array would also fall on this hack + (obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects + 'length' in obj ? 'array' : + type; + }, + separator:function() { + return this.multiline ? this.HTML ? '
    ' : '\n' : this.HTML ? ' ' : ' '; + }, + indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing + if ( !this.multiline ) + return ''; + var chr = this.indentChar; + if ( this.HTML ) + chr = chr.replace(/\t/g,' ').replace(/ /g,' '); + return Array( this._depth_ + (extra||0) ).join(chr); + }, + up:function( a ) { + this._depth_ += a || 1; + }, + down:function( a ) { + this._depth_ -= a || 1; + }, + setParser:function( name, parser ) { + this.parsers[name] = parser; + }, + // The next 3 are exposed so you can use them + quote:quote, + literal:literal, + join:join, + // + _depth_: 1, + // This is the list of parsers, to modify them, use jsDump.setParser + parsers:{ + window: '[Window]', + document: '[Document]', + error:'[ERROR]', //when no parser is found, shouldn't happen + unknown: '[Unknown]', + 'null':'null', + undefined:'undefined', + 'function':function( fn ) { + var ret = 'function', + name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE + if ( name ) + ret += ' ' + name; + ret += '('; + + ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join(''); + return join( ret, this.parse(fn,'functionCode'), '}' ); + }, + array: array, + nodelist: array, + arguments: array, + object:function( map ) { + var ret = [ ]; + this.up(); + for ( var key in map ) + ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) ); + this.down(); + return join( '{', ret, '}' ); + }, + node:function( node ) { + var open = this.HTML ? '<' : '<', + close = this.HTML ? '>' : '>'; + + var tag = node.nodeName.toLowerCase(), + ret = open + tag; + + for ( var a in this.DOMAttrs ) { + var val = node[this.DOMAttrs[a]]; + if ( val ) + ret += ' ' + a + '=' + this.parse( val, 'attribute' ); + } + return ret + close + open + '/' + tag + close; + }, + functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function + var l = fn.length; + if ( !l ) return ''; + + var args = Array(l); + while ( l-- ) + args[l] = String.fromCharCode(97+l);//97 is 'a' + return ' ' + args.join(', ') + ' '; + }, + key:quote, //object calls it internally, the key part of an item in a map + functionCode:'[code]', //function calls it internally, it's the content of the function + attribute:quote, //node calls it internally, it's an html attribute value + string:quote, + date:quote, + regexp:literal, //regex + number:literal, + 'boolean':literal + }, + DOMAttrs:{//attributes to dump from nodes, name=>realName + id:'id', + name:'name', + 'class':'className' + }, + HTML:true,//if true, entities are escaped ( <, >, \t, space and \n ) + indentChar:' ',//indentation unit + multiline:true //if true, items in a collection, are separated by a \n, else just a space. + }; + + return jsDump; +})(); + +})(this); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/README.md new file mode 100644 index 0000000..54f52ba --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/README.md @@ -0,0 +1,267 @@ +# The *node-localize* library +provides a [GNU gettext](http://www.gnu.org/s/gettext/)-inspired (but not conformant) translation utility for [Node.js](http://nodejs.org) that tries to avoid some of the limitations of the ``sprintf``-bound ``gettext`` (such as translation string parameters being in a fixed order in all translation results) and "fit in" better than a straight port. + +## Installation + +If you have [npm](http://npmjs.org), just type: + +```sh +npm install localize +``` + +## Usage + +``node-localize`` returns an object constructor so multiple simultaneous localization objects may be in use at once (though most cases will probably be a singleton instantiation). The only required parameter on initialization is a ``translations`` object, using the following structure: + +```js +var Localize = require('localize'); + +var myLocalize = new Localize({ + "Testing...": { + "es": "Pruebas...", + "sr": "тестирање..." + }, + "Substitution: $[1]": { + "es": "Sustitución: $[1]", + "sr": "замена: $[1]" + } +}); + +console.log(myLocalize.translate("Testing...")); // Testing... +console.log(myLocalize.translate("Substitution: $[1]", 5)); // Substitution: 5 + +myLocalize.setLocale("es"); +console.log(myLocalize.translate("Testing...")); // Pruebas... + +myLocalize.setLocale("sr"); +console.log(myLocalize.translate("Substitution: $[1]", 5)); // замена: 5 +``` + +``node-localize`` objects can also be passed a string indicating the directory a ``translations.json`` file can be found. This directory is searched recursively for all ``translations.json`` files in all subdirectories, and their contents combined together, so you can organize your translations as you wish. + +The directory is also searched recursively for directories named ``translations``. These directories are checked for special text files of the form ``varname.txt``, ``varname.es.txt``, ``varname.sr.txt``, etc. The text in ``varname.txt`` is treated as the default language of the application and the ``varname.xx.txt`` are treated as translations of the text. A special ``strings`` object is created where the ``varname`` becomes a property of that object and the default language text is the value of the property. So you can also do the following: + +```js +var Localize = require('localize'); + +var myLocalize = new Localize('./path/to/text/files/'); + +console.log(myLocalize.translate(myLocalize.strings.reallyLongText); // The contents of ./path/to/text/files/translations/reallyLongText.txt, if it exists + +myLocalize.setLocale("es"); +console.log(myLocalize.translate(myLocalize.strings.reallyLongText); // The contents of ./path/to/text/files/translations/reallyLongText.es.txt, if it exists +``` + +## Dates + +Because date formats differ so wildly in different languages and these differences cannot be solved via simple substitution, there is also a ``localDate`` method for translating these values. + +```js +var theDate = new Date("4-Jul-1776"); +var dateLocalize = new Localize("./translations"); +dateLocalize.loadDateFormats({ + "es": { + dayNames: [ + 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', + 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' + ], + monthNames: [ + 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic', + 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' + ], + masks: { + "default": "dddd, d 'de' mmmm yyyy" + } + } +}); + +console.log(dateLocalize.localDate(theDate)); // Thu Jul 04 1776 00:00:00 +console.log(dateLocalize.localDate(theDate, "fullDate")); // Thursday, July 4, 1776 +console.log(dateLocalize.localDate(theDate, "mm/dd/yyyy")); // 07/04/1776 + +dateLocalize.setLocale("es"); +console.log(dateLocalize.localDate(theDate)); // Jueves, 4 de Julio 1776 +``` + +The date formatting rules and configuration have been taken from [node-dateformat](https://github.com/felixge/node-dateformat), which has been extended to support multiple simultaneous locales and subsumed into ``node-localize``. + +## Complete API + +```js +var myLocalize = new Localize(translationsObjOrStr, dateFormatObj, defaultLocaleStr); +// translationsObjOrStr: a conformant translations object or a string indicating +// the directory where one or more conformant translations.json files are stored +// dateFormatObj: a conformant date format object, containing one or more locales +// if not specified, will auto-generate an 'en' locale; if initially specified, +// will *overwrite* this auto-generated locale object +// defaultLocale: the locale of all keys in the translations object. Defaults to 'en' +``` + +```js +myLocalize.setLocale(localeStr); +// localeStr: a locale string to switch to +``` + +```js +myLocalize.loadTranslations(translationsObjOrStr); +// translationsObjOrStr: a conformant translations object or a string indicating +// the directory where one or more conformant translations.json files are stored +// Multiple calls to loadTranslations *appends* the keys to the translations +// object in memory (overwriting duplicate keys). +``` + +```js +myLocalize.clearTranslations(); +// Wipes out the translations object entirely (if a clean reload is desired) +``` + +```js +myLocalize.throwOnMissingTranslation(throwBool); +// throwBool: Boolean indicating whether or not missing translations should +// throw an error or be silently ignored and the text stay in the default +// locale. Useful for development to turn off. +``` + +```js +myLocalize.translate(translateStr, arg1, arg2, ...); +// translateStr: The string to be translated and optionally perform a +// substitution of specified args into. Arguments are specified in a RegExp +// style by number starting with 1 (it is the first argument that can be +// used and also is the arguments[1] value...), while using a jQuery-style +// demarcation of $[x], where x is the argument number. +``` + +```js +myLocalize.loadDateFormats(dateFormatObj); +// dateFormatObj: a conformant date format object, containing one or more locales +// Specified locales are appended to the internal object just like +// loadTranslations. +``` + +```js +myLocalize.clearDateFormats(); +// Resets the date formats object to just the 'en' locale. +``` + +```js +myLocalize.localDate(dateObjOrStr, maskStr, utcBool) +// dateObjOrStr: the date object or string to format as desired in the current +// locale. +// maskStr: the predefined mask to use, or a custom mask. +// utcBool: a boolean indicating whether the timezone should be local or UTC +``` + +```js +myLocalize.strings +// Object of key-value pairs defined by files in ``translations`` directories +// Key is the filename (sans extension) and value is the default language +// text. Useful for translating very large blocks of text that shouldn't really +// exist in code. +``` + +## _xlocalize_ CLI Utility + +Starting at version 0.2.0, ``node-localize``, when installed via NPM, adds an ``xlocalize`` utility command to the _PATH_, which allows for automatic construction of ``translations.json`` files (and can be re-run in the future to update existing files without clobbering any current translations present). It's command switches are as follows: + +``` +xlocalize USAGE: + +-l Set the default language for the translations.json file(s) (default: en) +-r Set xlocalize to generate translations.json files recursively (default) +-R Set xlocalize to only generate a translations.json file for the current directory +-e Set the file extensions to include for translation (default: html,js) +-t Set the languages to translate to (comma separated) +-h Show this help message. +``` + +For example, to create a ``translations.json`` file in the current directory only that will translate from English to Spanish, Portuguese, Italian, and French for HTML and JS files: + +```sh +xlocalize -R -t es,pt,it,fr +``` + +And if a new language, such as Serbian, is to be translated at a later time, you can use the command: +```sh +xlocalize -R -t es,pt,it,fr,sr +``` + +## [Express](http://expressjs.com) Integration Tips + +If your website supports multiple languages (probably why you're using this library!), you'll want to translate the page content for each supported language. The following snippets of code should make it easy to use within Express. + +### Middleware to switch locale on request + +```js +app.configure(function() { + ... + app.use(function(request, response, next) { + var lang = request.session.lang || "en"; + localize.setLocale(lang); + next(); + }); + ... +}); +``` + +I'm assuming you're storing their language preference inside of a session, but the logic can be easily tweaked for however you detect which language to show. + +### Export *translate*, *localDate*, and *strings* as static helpers + +```js +app.helpers({ + ... + translate: localize.translate, + localDate: localize.localDate, + strings: localize.strings +}); +``` + +Your controllers shouldn't really even be aware of any localization issues; the views should be doing that, so this ought to be enough configuration within your ``app.js`` file. + +### Using *translate*, *localDate*, and *strings* in your views + +```html +

    ${translate("My Awesome Webpage")}

    + +

    ${translate("By: $[1]", webpageAuthor)}

    + +

    ${translate("Published: $[1]", localDate(publicationDate))}

    + +{{if translate(strings.reallyLongPost) == strings.reallyLongPost}} +${translate("Warning: The following content is in English.")} +{{/if}} + +{{html translate(strings.reallyLongPost)}} +``` + +I'm using [jQuery Templates for Express](https://github.com/kof/node-jqtpl) here, but it should be easy to translate to whatever templating language you prefer. + +## Planned Features + +* Browser compatibility (use same functions for client-side jQuery Templates, for instance) +* Optional Country Code support (that falls back to baseline language translation if a specific country code is missing) for regional language differences +* Numeric localization (1,234,567.89 versus 1.234.567,89 versus 1 234 567,89 versus [Japanese Numerals](http://en.wikipedia.org/wiki/Japanese_numerals) [no idea how to handle that one at the moment]) +* Currency localization; not just representing $100.00 versus 100,00$, but perhaps hooking into currency conversion, as well. +* Pluralization; one area gettext still beats node-localize is the ability to pluralize words correctly when given the number to pluralize against. + +## License (MIT) + +Copyright (C) 2011 by Agrosica, Inc, David Ellis, Felix Geisendörfer, Steven Levithan, Scott Trenda, Kris Kowal, Jerry Jalava, Clint Andrew Hall. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/translations.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/translations.json new file mode 100644 index 0000000..a4d2575 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/translations.json @@ -0,0 +1,6 @@ +{ + "MISSING TRANSLATION": { + }, + "FOUND VARIABLE INPUT $[1]": { + } +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/xlocalize.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/xlocalize.js new file mode 100644 index 0000000..d34df65 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/bin/xlocalize.js @@ -0,0 +1,139 @@ +#!/usr/bin/node + +// Load required modules +var fs = require('fs'); +var path = require('path'); + +// Use localize for internal localizations +var localize = new require('localize')(__dirname); +localize.throwOnMissingTranslation(false); +var translate = localize.translate; + +// Defaults for ``xlocalize`` +var defaultLang = "en"; +var recurse = true; +var extensions = ['html', 'js']; +var outLangs = []; + +// Load arguments +for(var i = 0; i < process.argv.length; i++) { + switch(process.argv[i]) { + case "-l": + defaultLang = process.argv[i+1]; + break; + case "-r": + recurse = true; + break; + case "-R": + recurse = false; + break; + case "-e": + extensions = process.argv[i+1].split(","); + break; + case "-t": + outLangs = process.argv[i+1].split(","); + break; + case "-h": + case "--help": + console.log("xlocalize USAGE:\n"); + console.log("-l\tSet the default language for the translations.json file(s) (default: en)"); + console.log("-r\tSet xlocalize to generate translations.json files recursively (default)"); + console.log("-R\tSet xlocalize to only generate a translations.json file for the current directory"); + console.log("-e\tSet the file extensions to include for translation (default: html,js)"); + console.log("-t\tSet the languages to translate to (comma separated)"); + console.log("-h\tShow this help message."); + process.exit(); + default: + break; + } +} + +// Set internal localize object to use the user's default language +localize.setLocale(defaultLang); + +// ## The *mergeObjs* function +// is a helper function that clones the value of various object into a new one. +// This simplistic one is fast, but assumes no recursive objects to merge. +function mergeObjs() { + var outObj = {}; + for(var i in arguments) { + if(arguments[i] instanceof Object) { + for(var j in arguments[i]) { + // Does not check for collisions, newer object + // definitions clobber old definitions + outObj[j] = arguments[i][j]; + } + } + } + return outObj; +} + +// ## The *processDir* function +// generates a ``translations.json`` file for the current directory, but does +// not override the previous file -- only augments it +function processDir(dir) { + // JSON object for the current directory + var dirJSON = {}; + // Path where translations will go + var translations = path.join(dir, "translations.json"); + // Check for pre-existing ``translations.json`` file + if(path.existsSync(translations)) { + var currJSON = JSON.parse(fs.readFileSync(translations, "utf8")); + dirJSON = mergeObjs(dirJSON, currJSON); + } + + // Build pattern matching for searchable files + var extRegExpStr = "("; + for(var i = 0; i < extensions.length; i++) { + extRegExpStr += extensions[i]; + if(i < extensions.length-1) { extRegExpStr += "|"; } + else { extRegExpStr += ")$"; } + } + var extRegExp = new RegExp(extRegExpStr); + + // Process files in the current directory + var files = fs.readdirSync(dir); + files.forEach(function(file) { + if(extRegExp.test(file)) { + processFile(path.join(dir, file), dirJSON); + } + if(recurse && fs.statSync(path.join(dir, file)).isDirectory()) { + processDir(path.join(dir, file)); + } + }); + + // Output dirJSON to file + fs.writeFileSync(translations, JSON.stringify(dirJSON, null, " "), "utf8"); +} + +// ## The *processFile* function +// extracts all translatable pieces of a source file into the dirJSON object, +// unless already there. +function processFile(filename, dirJSON) { + // Hacky, hacky RegExp parsing right now; replace with something better + var fileContents = fs.readFileSync(filename, "utf8"); + var translatables = fileContents.match(/translate\s*\([^\),]*/); + if(translatables) { + for(var i = 0; i < translatables.length; i++) { + if(/^translate\s*\(\s*['"](.*)['"]$/.test(translatables[i])) { // A string-looking thing + if(!dirJSON[RegExp.$1]) { // Does not yet exist + dirJSON[RegExp.$1] = {}; + } + outLangs.forEach(function(lang) { + if(!dirJSON[RegExp.$1][lang]) { // No translation, yet + dirJSON[RegExp.$1][lang] = translate("MISSING TRANSLATION"); + } + }); + } else { + var translateMessage = translate("FOUND VARIABLE INPUT: $[1]", translatables[i]); + dirJSON[translateMessage] = {}; + outLangs.forEach(function(lang) { + dirJSON[translateMessage][lang] = translate("MISSING TRANSLATION"); + }); + } + } + } +} + +// Get the ball rollin' +processDir(process.cwd()); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/lib/localize.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/lib/localize.js new file mode 100644 index 0000000..648325e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/lib/localize.js @@ -0,0 +1,405 @@ +// # Localize +// is a GNU gettext-inspired (but not conformant) localization library for +// Node.js + +// Libraries, if in a CommonJS environment +if(typeof(require) != 'undefined') { + var path = require('path'); + var fs = require('fs'); +} + +function Localize(translations, dateFormats, defaultLocale) { + + // Make sure the defaultLocale is something sane, and set the locale to + // its value. Also configure ``Localize`` to throw an error if missing + // a translation. + defaultLocale = typeof(defaultLocale) == "string" ? defaultLocale : "en"; + var locale = defaultLocale; + var missingTranslationThrow = true; + + // ## The *mergeObjs* function + // is a simple helper function to create a new object based on input objects. + function mergeObjs() { + var outObj = {}; + for(var i in arguments) { + if(arguments[i] instanceof Object) { + for(var j in arguments[i]) { + // Does not check for collisions, newer object + // definitions clobber old definitions + outObj[j] = arguments[i][j]; + } + } + } + return outObj; + } + + // ## The *setLocale* function + // simply sets the locale to whatever is specified at the moment, as long as it + // is a string. + this.setLocale = function(newLocale) { + if(typeof(newLocale) == "string") { + locale = newLocale; + } else { + throw new Error("Locale must be a string"); + } + }; + + // ## The *strings* object + // contains a series of key-val pairs to be used for translating very large strings + // that aren't desirable to have duplicated in several locations + this.strings = {}; + + // ## The *getTranslations* function + // is a recursive function that checks the specified directory, and all child + // directories, for ``translations.json`` files, combines them into one JSON + // object, and returns them. + function getTranslations(currDir, translations, strings) { + if(path.existsSync(currDir)) { + // Load translations.json file in current directory, if any + if(path.existsSync(path.join(currDir, "translations.json"))) { + translations = mergeObjs(translations, + JSON.parse(fs.readFileSync(path.join(path.resolve(currDir), "translations.json"))) + ); + } + // Load large text translations in translations subdirectory, if it exists + var translationPath = path.join(currDir, "translations"); + if(path.existsSync(translationPath) && fs.statSync(translationPath).isDirectory()) { + // Get all children in the translations directory + var pathChildren = fs.readdirSync(translationPath); + // Filter out all non-default translations (the ones without a lang type) + pathChildren.filter(function(child) { + return !/^.*\..*\..*/.test(child); + // And map these default translations into an object containing the variable name to use, + // the default text, and an array of translations for this text + }).map(function(child) { + return { + name: child.replace(/\..*$/, ""), + defaultText: fs.readFileSync(path.join(translationPath, child), 'utf8'), + // To make the array of translations for this default translation, filter out + // all files that do not start with the primary translation filename (minus extension), with a special + // case to filter out the primary translation, as well + translations: pathChildren.filter(function(secondChild) { + return (new RegExp("^" + child.replace(/\..*$/, ""))).test(secondChild) && child != secondChild; + // Then map this array of files into an object containing the language specified + // and the translation text for this language + }).map(function(secondChild) { + return { + lang: secondChild.replace(/\.[^\.]*$/, "").replace(/^[^\.]*\./, ""), + text: fs.readFileSync(path.join(translationPath, secondChild), 'utf8') + } + }) + } + // For each of these long-form translation objects, add the default text to the strings object using the + // desired variable name, and create a translation object for all defined languages for this text. + }).forEach(function(translation) { + strings[translation.name] = translation.defaultText; + translations[translation.defaultText] = {}; + translation.translations.forEach(function(lang) { + translations[translation.defaultText][lang.lang] = lang.text; + }); + }); + } + // Recurse down each directory and get the translations for that directory + var pathChildren = fs.readdirSync(currDir); + for(var child in pathChildren) { + var childPath = path.resolve(path.join(currDir, pathChildren[child])); + if(fs.statSync(childPath).isDirectory()) { + var tempArray = getTranslations(childPath, translations, strings); + translations = tempArray[0], strings = tempArray[1]; + } + } + } else { + throw new Error("Translation Path Invalid"); + } + return [translations, strings]; + } + + // ## The *validateTranslations* function + // determines whether or not the provided JSON object is in a valid + // format for ``localize``. + function validateTranslations(newTranslations) { + if(typeof(newTranslations) != "object") { return false; } + for(var translation in newTranslations) { + if(typeof(translation) != "string") { return false; } + if(typeof(newTranslations[translation]) != "object" ) { return false; } + for(var lang in newTranslations[translation]) { + if(typeof(lang) != "string") { return false; } + if(typeof(newTranslations[translation][lang]) != "string") { return false; } + } + } + return true; + } + + // ## The *loadTranslations* function + // takes a string or object, and attempts to append the specified translation + // to its store of translations, either by loading all translations from the + // specified directory (string), or appending the object directly. + this.loadTranslations = function(newTranslations) { + if(typeof(newTranslations) == "string") { + var tempArray = getTranslations(newTranslations, {}, this.strings); + newTranslations = tempArray[0]; + this.strings = tempArray[1]; + } + if(validateTranslations(newTranslations)) { + translations = mergeObjs(translations, newTranslations); + } else { + throw new Error("Must provide a valid set of translations."); + } + }; + + // Now that we have the infrastructure in place, let's verify that the + // provided translations are valid. + this.loadTranslations(translations); + + // ## The *clearTranslations* function + // simply resets the translations variable to a clean slate. + this.clearTranslations = function() { + translations = {}; + }; + + // ## The *getTranslations* function + // simply returns the entire translations object, or returns that portion + // of translations matched by the elements of a provided array of text to + // translate + this.getTranslations = function(textArr) { + if(textArr instanceof Array) { + var outObj = {}; + textArr.forEach(function(text) { + outObj[text] = translations[text]; + }); + return outObj; + } else { + return translations; + } + }; + + // ## The *throwOnMissingTranslation* function + // lets the user decide if a missing translation should cause an Error + // to be thrown. Turning it off for development and on for testing is + // recommended. The function coerces whatever it receives into a bool. + this.throwOnMissingTranslation = function(shouldThrow) { + missingTranslationThrow = !!shouldThrow; + }; + + // ## The *buildString* function + // is a string-building function inspired by both ``sprintf`` and + // [jQuery Templates](http://api.jquery.com/category/plugins/templates/) + // and a small helping of RegExp. The first argument to buildString is + // the source string, which has special ``$[x]`` blocks, where ``x`` is + // a number from 1 to Infinity, matching the nth argument provided. + // Because of ``.toString()``, string formatting _a la_ ``sprintf`` is + // avoided, and the numeric identification allows the same parameter to + // be used multiple times, and the parameter order need not match the + // string referencing order (important for translations) + function buildString() { + var outString = arguments[0]; + for(var i = 1; i < arguments.length; i++) { + outString = outString.replace(new RegExp("\\$\\[" + i + "\\]", "g"), arguments[i]); + } + return outString; + } + + // ## The *translate* function + // is a thin automatic substitution wrapper around ``buildString``. In + // fact, it short-circuits to ``buildString`` when ``locale`` equals + // ``defaultLocale``. Otherwise, it looks up the required translated + // string and executes ``buildString`` on that, instead + this.translate = function() { + if(locale == defaultLocale) { + return buildString.apply(this, arguments); + } + var newText = translations[arguments[0]] && translations[arguments[0]][locale] ? + translations[arguments[0]][locale] : null; + if(missingTranslationThrow && typeof(newText) != "string") { + throw new Error("Could not find translation for '" + + arguments[0] + "' in the " + locale + " locale"); + } else if(typeof(newText) != "string") { + newText = arguments[0]; + } + var newArr = Array.prototype.splice.call(arguments, 1, arguments.length - 1); + newArr.unshift(newText); + return buildString.apply(this, newArr); + }; + + // ## The *validateDateFormats* function + // determines whether or not the provided dateFormat object conforms to + // the necessary structure + function validateDateFormats(dateFormats) { + if(typeof(dateFormats) != "object") { return false; } + for(var lang in dateFormats) { + if(typeof(lang) != "string") { return false; } + if(typeof(dateFormats[lang]) != "object") { return false; } + if(!(dateFormats[lang].dayNames instanceof Array)) { return false; } + if(!(dateFormats[lang].monthNames instanceof Array)) { return false; } + if(typeof(dateFormats[lang].masks) != "object") { return false; } + if(typeof(dateFormats[lang].masks["default"]) != "string") { return false; } + if(dateFormats[lang].dayNames.length != 14) { return false; } + if(dateFormats[lang].monthNames.length != 24) { return false; } + for(var i = 0; i < 24; i++) { + if(i < 14 && typeof(dateFormats[lang].dayNames[i]) != "string") { return false; } + if(typeof(dateFormats[lang].monthNames[i]) != "string") { return false; } + } + } + return true; + } + + // ## The *loadDateFormats* function + // appends the provided ``dateFormats`` object, if valid, to the current + // ``dateFormats`` object. Otherwise, it throws an error. + this.loadDateFormats = function(newDateFormats) { + if(validateDateFormats(newDateFormats)) { + dateFormats = mergeObjs(dateFormats, newDateFormats); + } else { + throw new Error("Invalid Date Format provided"); + } + }; + + // ## The *clearDateFormats* function + // resets the ``dateFormats`` object to English dates. + this.clearDateFormats = function() { + dateFormats = { + "en": { + dayNames: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" + ], + monthNames: [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + masks: { + "default": "ddd mmm dd yyyy HH:MM:ss", + shortDate: "m/d/yy", + mediumDate: "mmm d, yyyy", + longDate: "mmmm d, yyyy", + fullDate: "dddd, mmmm d, yyyy", + shortTime: "h:MM TT", + mediumTime: "h:MM:ss TT", + longTime: "h:MM:ss TT Z", + isoDate: "yyyy-mm-dd", + isoTime: "HH:MM:ss", + isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", + isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" + } + } + }; + }; + + // ## The *getDateFormats* function + // returns the currently-defined ``dateFormats`` object + this.getDateFormats = function() { + return dateFormats; + }; + + // Now that we have the infrastructure in place, let's validate the + // optional ``dateFormats`` object if provided, or initialize it. + if(validateDateFormats(dateFormats)) { + this.loadDateFormats(dateFormats); + } else { + this.clearDateFormats(); + } + + // The *localDate* function + // provides easy-to-use date localization support. Based heavily on + // [node-dateFormat](https://github.com/felixge/node-dateformat) by + // Steven Levithan + // Scott Trenda + // Kris Kowal + // Felix Geisendörfer + // MIT Licensed, as with this library. The resultant API is one where + // a date string or object is the first argument, a mask string (being + // either a key in the ``masks`` object or an arbitrary mask is the + // second argument, and a third is a bool flag on whether local or UTC + // time should be used. + this.localDate = function() { + var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, + timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, + timezoneClip = /[^-+\dA-Z]/g, + pad = function (val, len) { + val = String(val); + len = len || 2; + while (val.length < len) val = "0" + val; + return val; + }; + + // Regexes and supporting functions are cached through closure + return function (date, mask, utc) { + // You can't provide utc if you skip other args (use the "UTC:" mask prefix) + if (arguments.length == 1 && + Object.prototype.toString.call(date) == "[object String]" && + !/\d/.test(date)) { + mask = date; + date = undefined; + } + + date = date || new Date; + + if(!(date instanceof Date)) { + date = new Date(date); + } + + if(isNaN(date)) { + throw TypeError("Invalid date"); + } + + mask = String(dateFormats[locale].masks[mask] || mask || dateFormats[locale].masks["default"]); + + // Allow setting the utc argument via the mask + if (mask.slice(0, 4) == "UTC:") { + mask = mask.slice(4); + utc = true; + } + + var _ = utc ? "getUTC" : "get", + d = date[_ + "Date"](), + D = date[_ + "Day"](), + m = date[_ + "Month"](), + y = date[_ + "FullYear"](), + H = date[_ + "Hours"](), + M = date[_ + "Minutes"](), + s = date[_ + "Seconds"](), + L = date[_ + "Milliseconds"](), + o = utc ? 0 : date.getTimezoneOffset(), + flags = { + d: d, + dd: pad(d), + ddd: dateFormats[locale].dayNames[D], + dddd: dateFormats[locale].dayNames[D + 7], + m: m + 1, + mm: pad(m + 1), + mmm: dateFormats[locale].monthNames[m], + mmmm: dateFormats[locale].monthNames[m + 12], + yy: String(y).slice(2), + yyyy: y, + h: H % 12 || 12, + hh: pad(H % 12 || 12), + H: H, + HH: pad(H), + M: M, + MM: pad(M), + s: s, + ss: pad(s), + l: pad(L, 3), + L: pad(L > 99 ? Math.round(L / 10) : L), + t: H < 12 ? "a" : "p", + tt: H < 12 ? "am" : "pm", + T: H < 12 ? "A" : "P", + TT: H < 12 ? "AM" : "PM", + Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), + o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), + S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] + }; + + return mask.replace(token, function ($0) { + return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); + }); + }; + }(); + + return this; +} + +// Publish as a module, if in a CommonJS environment +if(typeof(module) != 'undefined') { + module.exports = Localize; +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/package.json new file mode 100644 index 0000000..d709584 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/package.json @@ -0,0 +1,38 @@ +{ + "name": "localize", + "description": "A GNU gettext-inspired (but not conformant) localization library for Node.js", + "homepage": "https://github.com/AGROSICA/node-localize", + "author": { + "name": "David Ellis" + }, + "contributors": [ + { + "name": "Steven Levithan" + }, + { + "name": "Felix Geisendörfer" + }, + { + "name": "Clint Andrew Hall" + }, + { + "name": "Jerry Jalava" + } + ], + "version": "0.4.2", + "main": "./lib/localize", + "dependencies": {}, + "devDependencies": { + "expresso": ">=0.8.1" + }, + "engines": { + "node": "*" + }, + "bin": { + "xlocalize": "./bin/xlocalize.js" + }, + "readme": "# The *node-localize* library\nprovides a [GNU gettext](http://www.gnu.org/s/gettext/)-inspired (but not conformant) translation utility for [Node.js](http://nodejs.org) that tries to avoid some of the limitations of the ``sprintf``-bound ``gettext`` (such as translation string parameters being in a fixed order in all translation results) and \"fit in\" better than a straight port.\n\n## Installation\n\nIf you have [npm](http://npmjs.org), just type:\n\n```sh\nnpm install localize\n```\n\n## Usage\n\n``node-localize`` returns an object constructor so multiple simultaneous localization objects may be in use at once (though most cases will probably be a singleton instantiation). The only required parameter on initialization is a ``translations`` object, using the following structure:\n\n```js\nvar Localize = require('localize');\n\nvar myLocalize = new Localize({\n \"Testing...\": {\n \"es\": \"Pruebas...\",\n \"sr\": \"тестирање...\"\n },\n \"Substitution: $[1]\": {\n \"es\": \"Sustitución: $[1]\",\n \"sr\": \"замена: $[1]\"\n }\n});\n\nconsole.log(myLocalize.translate(\"Testing...\")); // Testing...\nconsole.log(myLocalize.translate(\"Substitution: $[1]\", 5)); // Substitution: 5\n\nmyLocalize.setLocale(\"es\");\nconsole.log(myLocalize.translate(\"Testing...\")); // Pruebas...\n\nmyLocalize.setLocale(\"sr\");\nconsole.log(myLocalize.translate(\"Substitution: $[1]\", 5)); // замена: 5\n```\n\n``node-localize`` objects can also be passed a string indicating the directory a ``translations.json`` file can be found. This directory is searched recursively for all ``translations.json`` files in all subdirectories, and their contents combined together, so you can organize your translations as you wish.\n\nThe directory is also searched recursively for directories named ``translations``. These directories are checked for special text files of the form ``varname.txt``, ``varname.es.txt``, ``varname.sr.txt``, etc. The text in ``varname.txt`` is treated as the default language of the application and the ``varname.xx.txt`` are treated as translations of the text. A special ``strings`` object is created where the ``varname`` becomes a property of that object and the default language text is the value of the property. So you can also do the following:\n\n```js\nvar Localize = require('localize');\n\nvar myLocalize = new Localize('./path/to/text/files/');\n\nconsole.log(myLocalize.translate(myLocalize.strings.reallyLongText); // The contents of ./path/to/text/files/translations/reallyLongText.txt, if it exists\n\nmyLocalize.setLocale(\"es\");\nconsole.log(myLocalize.translate(myLocalize.strings.reallyLongText); // The contents of ./path/to/text/files/translations/reallyLongText.es.txt, if it exists\n```\n\n## Dates\n\nBecause date formats differ so wildly in different languages and these differences cannot be solved via simple substitution, there is also a ``localDate`` method for translating these values.\n\n```js\nvar theDate = new Date(\"4-Jul-1776\");\nvar dateLocalize = new Localize(\"./translations\");\ndateLocalize.loadDateFormats({\n\t\"es\": {\n\t\tdayNames: [\n\t\t\t'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb',\n\t\t\t'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'\n\t\t],\n\t\tmonthNames: [\n\t\t\t'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic',\n\t\t\t'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'\n\t\t],\n\t\tmasks: {\n\t\t\t\"default\": \"dddd, d 'de' mmmm yyyy\"\n\t\t}\n\t}\n});\n\nconsole.log(dateLocalize.localDate(theDate)); // Thu Jul 04 1776 00:00:00\nconsole.log(dateLocalize.localDate(theDate, \"fullDate\")); // Thursday, July 4, 1776\nconsole.log(dateLocalize.localDate(theDate, \"mm/dd/yyyy\")); // 07/04/1776\n\ndateLocalize.setLocale(\"es\");\nconsole.log(dateLocalize.localDate(theDate)); // Jueves, 4 de Julio 1776\n```\n\nThe date formatting rules and configuration have been taken from [node-dateformat](https://github.com/felixge/node-dateformat), which has been extended to support multiple simultaneous locales and subsumed into ``node-localize``.\n\n## Complete API\n\n```js\nvar myLocalize = new Localize(translationsObjOrStr, dateFormatObj, defaultLocaleStr);\n// translationsObjOrStr: a conformant translations object or a string indicating\n// the directory where one or more conformant translations.json files are stored\n// dateFormatObj: a conformant date format object, containing one or more locales\n// if not specified, will auto-generate an 'en' locale; if initially specified,\n// will *overwrite* this auto-generated locale object\n// defaultLocale: the locale of all keys in the translations object. Defaults to 'en'\n```\n\n```js\nmyLocalize.setLocale(localeStr);\n// localeStr: a locale string to switch to\n```\n\n```js\nmyLocalize.loadTranslations(translationsObjOrStr);\n// translationsObjOrStr: a conformant translations object or a string indicating\n// the directory where one or more conformant translations.json files are stored\n// Multiple calls to loadTranslations *appends* the keys to the translations\n// object in memory (overwriting duplicate keys).\n```\n\n```js\nmyLocalize.clearTranslations();\n// Wipes out the translations object entirely (if a clean reload is desired)\n```\n\n```js\nmyLocalize.throwOnMissingTranslation(throwBool);\n// throwBool: Boolean indicating whether or not missing translations should\n// throw an error or be silently ignored and the text stay in the default\n// locale. Useful for development to turn off.\n```\n\n```js\nmyLocalize.translate(translateStr, arg1, arg2, ...);\n// translateStr: The string to be translated and optionally perform a\n// substitution of specified args into. Arguments are specified in a RegExp\n// style by number starting with 1 (it is the first argument that can be\n// used and also is the arguments[1] value...), while using a jQuery-style\n// demarcation of $[x], where x is the argument number.\n```\n\n```js\nmyLocalize.loadDateFormats(dateFormatObj);\n// dateFormatObj: a conformant date format object, containing one or more locales\n// Specified locales are appended to the internal object just like\n// loadTranslations.\n```\n\n```js\nmyLocalize.clearDateFormats();\n// Resets the date formats object to just the 'en' locale.\n```\n\n```js\nmyLocalize.localDate(dateObjOrStr, maskStr, utcBool)\n// dateObjOrStr: the date object or string to format as desired in the current\n// locale.\n// maskStr: the predefined mask to use, or a custom mask.\n// utcBool: a boolean indicating whether the timezone should be local or UTC\n```\n\n```js\nmyLocalize.strings\n// Object of key-value pairs defined by files in ``translations`` directories\n// Key is the filename (sans extension) and value is the default language\n// text. Useful for translating very large blocks of text that shouldn't really\n// exist in code.\n```\n\n## _xlocalize_ CLI Utility\n\nStarting at version 0.2.0, ``node-localize``, when installed via NPM, adds an ``xlocalize`` utility command to the _PATH_, which allows for automatic construction of ``translations.json`` files (and can be re-run in the future to update existing files without clobbering any current translations present). It's command switches are as follows:\n\n```\nxlocalize USAGE:\n\n-l\tSet the default language for the translations.json file(s) (default: en)\n-r\tSet xlocalize to generate translations.json files recursively (default)\n-R\tSet xlocalize to only generate a translations.json file for the current directory\n-e\tSet the file extensions to include for translation (default: html,js)\n-t\tSet the languages to translate to (comma separated)\n-h\tShow this help message.\n```\n\nFor example, to create a ``translations.json`` file in the current directory only that will translate from English to Spanish, Portuguese, Italian, and French for HTML and JS files:\n\n```sh\nxlocalize -R -t es,pt,it,fr\n```\n\nAnd if a new language, such as Serbian, is to be translated at a later time, you can use the command:\n```sh\nxlocalize -R -t es,pt,it,fr,sr\n```\n\n## [Express](http://expressjs.com) Integration Tips\n\nIf your website supports multiple languages (probably why you're using this library!), you'll want to translate the page content for each supported language. The following snippets of code should make it easy to use within Express.\n\n### Middleware to switch locale on request\n\n```js\napp.configure(function() {\n ...\n app.use(function(request, response, next) {\n var lang = request.session.lang || \"en\";\n localize.setLocale(lang);\n next();\n });\n ...\n});\n```\n\nI'm assuming you're storing their language preference inside of a session, but the logic can be easily tweaked for however you detect which language to show.\n\n### Export *translate*, *localDate*, and *strings* as static helpers\n\n```js\napp.helpers({\n ...\n translate: localize.translate,\n localDate: localize.localDate,\n strings: localize.strings\n});\n```\n\nYour controllers shouldn't really even be aware of any localization issues; the views should be doing that, so this ought to be enough configuration within your ``app.js`` file.\n\n### Using *translate*, *localDate*, and *strings* in your views\n\n```html\n

    ${translate(\"My Awesome Webpage\")}

    \n\n

    ${translate(\"By: $[1]\", webpageAuthor)}

    \n\n

    ${translate(\"Published: $[1]\", localDate(publicationDate))}

    \n\n{{if translate(strings.reallyLongPost) == strings.reallyLongPost}}\n${translate(\"Warning: The following content is in English.\")}\n{{/if}}\n\n{{html translate(strings.reallyLongPost)}}\n```\n\nI'm using [jQuery Templates for Express](https://github.com/kof/node-jqtpl) here, but it should be easy to translate to whatever templating language you prefer.\n\n## Planned Features\n\n* Browser compatibility (use same functions for client-side jQuery Templates, for instance)\n* Optional Country Code support (that falls back to baseline language translation if a specific country code is missing) for regional language differences\n* Numeric localization (1,234,567.89 versus 1.234.567,89 versus 1 234 567,89 versus [Japanese Numerals](http://en.wikipedia.org/wiki/Japanese_numerals) [no idea how to handle that one at the moment])\n* Currency localization; not just representing $100.00 versus 100,00$, but perhaps hooking into currency conversion, as well.\n* Pluralization; one area gettext still beats node-localize is the ability to pluralize words correctly when given the number to pluralize against.\n\n## License (MIT)\n\nCopyright (C) 2011 by Agrosica, Inc, David Ellis, Felix Geisendörfer, Steven Levithan, Scott Trenda, Kris Kowal, Jerry Jalava, Clint Andrew Hall.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "localize@0.4.2", + "_from": "localize@*0.4.2" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/localize.test.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/localize.test.js new file mode 100644 index 0000000..49dd92b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/localize.test.js @@ -0,0 +1,179 @@ +var assert = require('assert'); +var Localize = require('../lib/localize'); + +module.exports = { + 'test empty initialization error': function() { + assert.throws(function() { + var badLocalize = new Localize(); + }, function(err) { + if(err instanceof Error && + err.message == "Must provide a valid set of translations.") { + return true; + } + return false; + }); + }, + 'test bad translations var error': function() { + assert.throws(function() { + var badLocalize = new Localize([1,2,3]); + }, function(err) { + if(err instanceof Error && + err.message == "Must provide a valid set of translations.") { + return true; + } + return false; + }); + }, + 'test bad translations path error': function() { + assert.throws(function() { + var badLocalize = new Localize("/nowheresville"); + }, function(err) { + if(err instanceof Error && + err.message == "Translation Path Invalid") { + return true; + } + return false; + }); + }, + 'test good translations var': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize({ + "Testing...": { + "es": "Pruebas..." + } + }); + }); + }, + 'test good translations path': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize("./translations"); + }); + }, + 'test bad setLocale var': function() { + assert.throws(function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.setLocale(23); + }, function(err) { + if(err instanceof Error && + err.message == "Locale must be a string") { + return true; + } + return false; + }); + }, + 'test good setLocale var': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.setLocale("es"); + }); + }, + 'test bad translate string': function() { + assert.throws(function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.setLocale("es"); + goodLocalize.translate("Test2"); + }, function(err) { + if(err instanceof Error && + err.message == "Could not find translation for 'Test2' in the es locale") { + return true; + } + return false; + }); + }, + 'test good translate string': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.translate("Testing..."), "Pruebas..."); + }); + }, + 'test good translate nop': function() { + var goodLocalize = new Localize("./translations"); + assert.strictEqual(goodLocalize.translate("Testing..."), "Testing..."); + }, + 'test good translate substitution': function() { + var goodLocalize = new Localize("./translations"); + assert.strictEqual(goodLocalize.translate("Substitution: $[1]", 5), "Substitution: 5"); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.translate("Substitution: $[1]", 5), "Sustitución: 5"); + }, + 'test good translate multiple substitution': function() { + var goodLocalize = new Localize("./translations"); + assert.strictEqual(goodLocalize.translate("Multiple substitution: $[1], $[2]", 5, 25), "Multiple substitution: 5, 25"); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.translate("Multiple substitution: $[1], $[2]", 5, 25), "Sustitución múltiple: 5, 25"); + }, + 'test bad dateFormat var initialization': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize("./translations", 25); + }); + }, + 'test bad dateFormat var post-initialization': function() { + assert.throws(function() { + var badLocalize = new Localize("./translations", 25); + badLocalize.loadDateFormats(25); + }, function(err) { + if(err instanceof Error && + err.message == "Invalid Date Format provided") { + return true; + } + return false; + }); + }, + 'test good dateFormat var post-initialization': function() { + assert.doesNotThrow(function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.loadDateFormats({ + "es": { + dayNames: [ + 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', + 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' + ], + monthNames: [ + 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic', + 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' + ], + masks: { + "default": "dddd, d 'de' mmmm yyyy" + } + } + }); + }); + }, + 'test good localDate': function() { + var theDate = new Date("4-Jul-1776"); + var goodLocalize = new Localize("./translations"); + goodLocalize.loadDateFormats({ + "es": { + dayNames: [ + 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb', + 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' + ], + monthNames: [ + 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic', + 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' + ], + masks: { + "default": "dddd, d 'de' mmmm yyyy" + } + } + }); + assert.strictEqual(goodLocalize.localDate(theDate), "Thu Jul 04 1776 00:00:00"); + assert.strictEqual(goodLocalize.localDate(theDate, "fullDate"), "Thursday, July 4, 1776"); + assert.strictEqual(goodLocalize.localDate(theDate, "mm/dd/yyyy"), "07/04/1776"); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.localDate(theDate), "Jueves, 4 de Julio 1776"); + }, + 'test good missing translation ignore': function() { + var goodLocalize = new Localize("./translations"); + goodLocalize.throwOnMissingTranslation(false); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.translate("Not found"), "Not found"); + }, + 'test translations dir': function() { + var goodLocalize = new Localize('./translations'); + assert.strictEqual(goodLocalize.translate(goodLocalize.strings.helloWorld), "Hello, World!\n"); + goodLocalize.setLocale("es"); + assert.strictEqual(goodLocalize.translate(goodLocalize.strings.helloWorld), "¡Hola, mundo!\n"); + } +}; diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/subsitution/translations.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/subsitution/translations.json new file mode 100644 index 0000000..1a68bb3 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/subsitution/translations.json @@ -0,0 +1,8 @@ +{ + "Substitution: $[1]": { + "es": "Sustitución: $[1]" + }, + "Multiple substitution: $[1], $[2]": { + "es": "Sustitución múltiple: $[1], $[2]" + } +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations.json new file mode 100644 index 0000000..e83ace0 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations.json @@ -0,0 +1,5 @@ +{ + "Testing...": { + "es": "Pruebas..." + } +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.es.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.es.txt new file mode 100644 index 0000000..59b3e13 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.es.txt @@ -0,0 +1 @@ +¡Hola, mundo! diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.txt b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.txt new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/translations/translations/helloWorld.txt @@ -0,0 +1 @@ +Hello, World! diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.test.sh b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.test.sh new file mode 100644 index 0000000..700cb5b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.test.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +testdir=`pwd` +cd xlocalize +../../bin/xlocalize.js -t es,pt,it,fr +test1=`diff translations.json ../xlocalize.testfile1.json` +if [ "$test1" = "" ] +then + cd subdir + test2=`diff translations.json ../../xlocalize.testfile2.json` + if [ "$test2" = "" ] + then + cd .. + ../../bin/xlocalize.js -t es,pt,it,fr,sr + test3=`diff translations.json ../xlocalize.testfile3.json` + if [ "$test3" = "" ] + then + cd subdir + test4=`diff translations.json ../../xlocalize.testfile4.json` + if [ "$test4" = "" ] + then + echo "Success" + else + echo "testfile4 Failed"; + fi + else + echo "testfile3 Failed"; + fi + else + echo "testfile2 Failed"; + fi +else + echo "testfile1 Failed"; +fi +cd $testdir +rm xlocalize/translations.json +rm xlocalize/subdir/translations.json diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile1.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile1.json new file mode 100644 index 0000000..3ff0677 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile1.json @@ -0,0 +1,8 @@ +{ + "This page is in English.": { + "es": "MISSING TRANSLATION", + "pt": "MISSING TRANSLATION", + "it": "MISSING TRANSLATION", + "fr": "MISSING TRANSLATION" + } +} \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile2.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile2.json new file mode 100644 index 0000000..8e9ccdf --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile2.json @@ -0,0 +1,8 @@ +{ + "You called foo!": { + "es": "MISSING TRANSLATION", + "pt": "MISSING TRANSLATION", + "it": "MISSING TRANSLATION", + "fr": "MISSING TRANSLATION" + } +} \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile3.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile3.json new file mode 100644 index 0000000..18d86f7 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile3.json @@ -0,0 +1,9 @@ +{ + "This page is in English.": { + "es": "MISSING TRANSLATION", + "pt": "MISSING TRANSLATION", + "it": "MISSING TRANSLATION", + "fr": "MISSING TRANSLATION", + "sr": "MISSING TRANSLATION" + } +} \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile4.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile4.json new file mode 100644 index 0000000..7ee91e9 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize.testfile4.json @@ -0,0 +1,9 @@ +{ + "You called foo!": { + "es": "MISSING TRANSLATION", + "pt": "MISSING TRANSLATION", + "it": "MISSING TRANSLATION", + "fr": "MISSING TRANSLATION", + "sr": "MISSING TRANSLATION" + } +} \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/subdir/test2.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/subdir/test2.js new file mode 100644 index 0000000..f05ca6a --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/subdir/test2.js @@ -0,0 +1,3 @@ +function foo() { + alert(translate("You called foo!")); +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/test.html b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/test.html new file mode 100644 index 0000000..ce37ee7 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/localize/test/xlocalize/test.html @@ -0,0 +1,13 @@ + + + + + Test Doc! + + + {{if session.lang != "en"}} +

    ${translate("This page is in English.")}

    + {{/if}} + Foo. Foobar. Tada. + + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.jshintrc b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.jshintrc new file mode 100644 index 0000000..0d97986 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.jshintrc @@ -0,0 +1,54 @@ +{ + "passfail": false, + "maxerr": 100, + + "browser": false, + "node": true, + "rhino": false, + "couch": true, + "wsh": true, + "jquery": true, + "prototypejs": false, + "mootools": false, + "dojo": false, + + "devel": false, + + "es5": true, + "strict": false, + "globalstrict": false, + + "asi": false, + "lastsemic": true, + "laxbreak": true, + "laxcomma": false, + "bitwise": false, + "boss": false, + "curly": true, + "eqeqeq": true, + "eqnull": false, + "evil": false, + "expr": false, + "forin": false, + "immed": false, + "latedef": false, + "loopfunc": true, + "noarg": true, + "regexp": true, + "regexdash": false, + "scripturl": true, + "shadow": true, + "supernew": true, + "undef": true, + + "newcap": true, + "noempty": true, + "nonew": true, + "nomen": false, + "onevar": true, + "plusplus": false, + "sub": true, + "trailing": true, + "white": false, + "indent": 2 +} \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.npmignore new file mode 100644 index 0000000..e3bc275 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +node_modules/* +npm-debug.log \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.travis.yml b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.travis.yml new file mode 100644 index 0000000..d2f42d5 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - 0.8 + +notifications: + email: + - travis@nodejitsu.com + irc: "irc.freenode.org#nodejitsu" + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/CHANGELOG.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/CHANGELOG.md new file mode 100644 index 0000000..b094c48 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/CHANGELOG.md @@ -0,0 +1,13 @@ + +0.2.7 / 2012-08-30 +================== + + * Fixed handling of numeric inputs with parseFloat + * Fixed overwriting of non-string inputs + * Added support for boolean types + +0.2.6 / 2012-08-12 +================== + + * Added allowance of empty default values + diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/LICENSE b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/LICENSE new file mode 100644 index 0000000..56217ca --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Nodejitsu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/README.md new file mode 100644 index 0000000..6fdb684 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/README.md @@ -0,0 +1,293 @@ +# prompt [![Build Status](https://secure.travis-ci.org/flatiron/prompt.png)](http://travis-ci.org/flatiron/prompt) + +A beautiful command-line prompt for node.js + +## Features + +* prompts the user for input +* supports validation and defaults +* hides passwords + +## Usage +Using prompt is relatively straight forward. There are two core methods you should be aware of: `prompt.get()` and `prompt.addProperties()`. There methods take strings representing property names in addition to objects for complex property validation (and more). There are a number of [examples][0] that you should examine for detailed usage. + +### Getting Basic Prompt Information +Getting started with `prompt` is easy. Lets take a look at `examples/simple-prompt.js`: + +``` js + var prompt = require('prompt'); + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and email + // + prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + }); +``` + +This will result in the following command-line output: + +``` + $ node examples/simple-prompt.js + prompt: username: some-user + prompt: email: some-user@some-place.org + Command-line input received: + username: some-user + email: some-user@some-place.org +``` + +### Prompting with Validation, Default Values, and More (Complex Properties) +In addition to prompting the user with simple string prompts, there is a robust API for getting and validating complex information from a command-line prompt. Here's a quick sample: + +``` js + var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s\-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + password: { + hidden: true + } + } + }; + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: email, password + // + prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' password: ' + result.password); + }); +``` + +Pretty easy right? The output from the above script is: + +``` + $ node examples/property-prompt.js + prompt: name: nodejitsu000 + error: Invalid input for name + error: Name must be only letters, spaces, or dashes + prompt: name: Nodejitsu Inc + prompt: password: + Command-line input received: + name: Nodejitsu Inc + password: some-password +``` + +## Valid Property Settings +`prompt` understands JSON-schema with a few extra parameters and uses [revalidator](https://github.com/flatiron/revalidator) for validation. + +Here's an overview of the properties that may be used for validation and prompting controls: + +``` js + { + description: 'Enter your password', // Prompt displayed to the user. If not supplied name will be used. + type: 'string', // Specify the type of input to expect. + pattern: /^\w+$/, // Regular expression that input must be valid against. + message: 'Password must be letters', // Warning message to display if validation fails. + hidden: true, // If true, characters entered will not be output to console. + default: 'lamepassword', // Default value to use if no value is entered. + required: true // If true, value entered must be non-empty. + before: function(value) { return 'v' + value; } // Runs before node-prompt callbacks. It modifies user's input + } +``` + +Alternatives to `pattern` include `format` and `conform`, as documented in [revalidator](https://github.com/flatiron/revalidator). + +Using `type: 'array'` has some special cases. + +- `description` will not work in the schema if `type: 'array'` is defined. +- `maxItems` takes precedence over `minItems`. +- Arrays that do not have `maxItems` defined will require users to `SIGINT` (`^C`) before the array is ended. +- If `SIGINT` (`^C`) is triggered before `minItems` is met, a validation error will appear. This will require users to `SIGEOF` (`^D`) to end the input. + +For more information on things such as `maxItems` and `minItems`, refer to the [revalidator](https://github.com/flatiron/revalidator) repository. + +### Alternate Validation API: + +Prompt, in addition to iterating over JSON-Schema properties, will also happily iterate over an array of validation objects given an extra 'name' property: + +```js + var prompt = require('../lib/prompt'); + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and password + // + prompt.get([{ + name: 'username', + required: true + }, { + name: 'password', + hidden: true, + conform: function (value) { + return true; + } + }], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' password: ' + result.password); + }); +``` + +### Backward Compatibility + +Note that, while this structure is similar to that used by prompt 0.1.x, that the object properties use the same names as in JSON-Schema. prompt 0.2.x is backward compatible with prompt 0.1.x except for asynchronous validation. + +### Skipping Prompts + +Sometimes power users may wish to skip promts and specify all data as command line options. +if a value is set as a property of `prompt.override` prompt will use that instead of +prompting the user. + +``` js + //prompt-override.js + + var prompt = require('prompt'), + optimist = require('optimist') + + // + // set the overrides + // + prompt.override = optimist.argv + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and email + // + prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + }) + + //: node prompt-override.js --username USER --email EMAIL +``` + + +### Adding Properties to an Object +A common use-case for prompting users for data from the command-line is to extend or create a configuration object that is passed onto the entry-point method for your CLI tool. `prompt` exposes a convenience method for doing just this: + +``` js + var obj = { + password: 'lamepassword', + mindset: 'NY' + } + + // + // Log the initial object. + // + console.log('Initial object to be extended:'); + console.dir(obj); + + // + // Add two properties to the empty object: username and email + // + prompt.addProperties(obj, ['username', 'email'], function (err) { + // + // Log the results. + // + console.log('Updated object received:'); + console.dir(obj); + }); +``` + +## Customizing your prompt +Aside from changing `property.message`, you can also change `prompt.message` +and `prompt.delimiter` to change the appearance of your prompt. + +The basic structure of a prompt is this: + +``` js +prompt.message + prompt.delimiter + property.message + prompt.delimiter; +``` + +The default `prompt.message` is "prompt," the default `prompt.delimiter` is +": ", and the default `property.message` is `property.name`. +Changing these allows you to customize the appearance of your prompts! In +addition, prompt supports ANSI color codes via the +[colors module](https://github.com/Marak/colors.js) for custom colors. For a +very colorful example: + +``` js + var prompt = require("prompt"); + + // + // Setting these properties customizes the prompt. + // + prompt.message = "Question!".rainbow; + prompt.delimiter = "><".green; + + prompt.start(); + + prompt.get({ + properties: { + name: { + description: "What is your name?".magenta + } + } + }, function (err, result) { + console.log("You said your name is: ".cyan + result.name.cyan); + }); +``` + +If you don't want colors, you can set + +```js +var prompt = require('prompt'); + +prompt.colors = false; +``` + +## Installation + +``` bash + $ [sudo] npm install prompt +``` + +## Running tests + +``` bash + $ npm test +``` + +#### License: MIT +#### Author: [Charlie Robbins](http://github.com/indexzero) +#### Contributors: [Josh Holbrook](http://github.com/jesusabdullah), [Pavan Kumar Sunkara](http://github.com/pksunkara) + +[0]: https://github.com/flatiron/prompt/tree/master/examples diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/docco.css b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/docco.css new file mode 100644 index 0000000..bd54134 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/docco.css @@ -0,0 +1,194 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h4, h5, h6 { + color: #333; + margin: 6px 0 6px 0; + font-size: 13px; +} + h2, h3 { + margin-bottom: 0; + color: #000; + } + h1 { + margin-top: 40px; + margin-bottom: 15px; + color: #000; + } +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +#jump_to, #jump_page { + background: white; + -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; + -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; + font: 10px Arial; + text-transform: uppercase; + cursor: pointer; + text-align: right; +} +#jump_to, #jump_wrapper { + position: fixed; + right: 0; top: 0; + padding: 5px 10px; +} + #jump_wrapper { + padding: 0; + display: none; + } + #jump_to:hover #jump_wrapper { + display: block; + } + #jump_page { + padding: 5px 0 3px; + margin: 0 0 25px 25px; + } + #jump_page .source { + display: block; + padding: 5px 10px; + text-decoration: none; + border-top: 1px solid #eee; + } + #jump_page .source:hover { + background: #f5f5ff; + } + #jump_page .source:first-child { + } +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/prompt.html b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/prompt.html new file mode 100644 index 0000000..7776f5b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/docs/prompt.html @@ -0,0 +1,296 @@ + prompt.js

    prompt.js

    /*
    + * prompt.js: Simple prompt for prompting information from the command line 
    + *
    + * (C) 2010, Nodejitsu Inc.
    + *
    + */
    +
    +var events = require('events'),
    +    async = require('async'),
    +    colors = require('colors'),
    +    winston = require('winston'),
    +    stdio = process.binding('stdio');

    @private function capitalize (str)

    + +

    str {string} String to capitalize

    + +

    Capitalizes the string supplied.

    function capitalize(str) {
    +  return str.charAt(0).toUpperCase() + str.slice(1);
    +}
    +
    +var prompt = module.exports = Object.create(events.EventEmitter.prototype);
    +
    +var logger = prompt.logger = new winston.Logger({
    +  transports: [
    +    new (winston.transports.Console)()
    +  ]
    +});
    +    
    +prompt.started    = false;
    +prompt.paused     = false;
    +prompt.allowEmpty = false; 
    +
    +var stdin, stdout;

    Create an empty object for the properties +known to prompt

    prompt.properties = {};

    Setup the default winston logger to use +the cli levels and colors.

    logger.cli();

    function start (options)

    + +

    @options {Object} Optional Options to consume by prompt

    + +

    Starts the prompt by listening to the appropriate events on options.stdin +and options.stdout. If no streams are supplied, then process.stdin +and process.stdout are used, respectively.

    prompt.start = function (options) {
    +  if (prompt.started) {
    +    return;
    +  }
    +  
    +  options = options        || {};
    +  stdin   = options.stdin  || process.openStdin();
    +  stdout  = options.stdout || process.stdout;
    +  
    +  prompt.allowEmpty = options.allowEmpty || false;
    +  
    +  process.on('SIGINT', function () {
    +    stdout.write('\n');
    +    process.exit(1);
    +  })
    +  
    +  prompt.emit('start');
    +  prompt.started = true;
    +  return prompt;
    +};

    function pause ()

    + +

    Pauses input coming in from stdin

    prompt.pause = function () {
    +  if (!prompt.started || prompt.paused) {
    +    return;
    +  }
    +  
    +  stdin.pause();
    +  prompt.emit('pause');
    +  prompt.paused = true;
    +  return prompt;
    +};

    function resume ()

    + +

    Resumes input coming in from stdin

    prompt.resume = function () {
    +  if (!prompt.started || !prompt.paused) {
    +    return;
    +  }
    +  
    +  stdin.resume();
    +  prompt.emit('resume');
    +  prompt.paused = false;
    +  return prompt;
    +};

    function get (msg, [validator,] callback)

    + +

    @msg {Array|Object|string} Set of variables to get input for.

    + +

    @callback {function} Continuation to pass control to when complete.

    + +

    Gets input from the user via stdin for the specified message(s) msg.

    prompt.get = function (msg, callback) {
    +  var vars = !Array.isArray(msg) ? [msg] : msg,
    +      result = {};
    +  
    +  vars = vars.map(function (v) {
    +    if (typeof v === 'string') {
    +      v = v.toLowerCase();
    +    }
    +    
    +    return prompt.properties[v] || v;
    +  });
    +  
    +  function get(target, next) {
    +    prompt.getInput(target, function (err, line) {
    +      if (err) {
    +        return next(err);
    +      }
    +      
    +      var name = target.name || target;
    +      result[name] = line;
    +      next();
    +    });
    +  }
    +  
    +  async.forEachSeries(vars, get, function (err) {
    +    return err ? callback(err) : callback(null, result);
    +  });
    +  
    +  return prompt;
    +};

    function getInput (msg, validator, callback)

    + +

    @msg {Object|string} Variable to get input for.

    + +

    @callback {function} Continuation to pass control to when complete.

    + +

    Gets input from the user via stdin for the specified message msg.

    prompt.getInput = function (prop, callback) {
    +  var name   = prop.message || prop.name || prop,
    +      raw    = ['prompt', ': ' + name.grey, ': '.grey],
    +      read   = prop.hidden ? prompt.readLineHidden : prompt.readLine,
    +      length, msg;
    +  
    +  if (prop.default) {
    +    raw.splice(2, -1, ' (' + prop.default + ')');
    +  }
    +  

    Calculate the raw length and colorize the prompt

      length = raw.join('').length;
    +  raw[0] = raw[0];
    +  msg = raw.join('');
    +  
    +  if (prop.help) {
    +    prop.help.forEach(function (line) {
    +      logger.help(line);
    +    });
    +  }
    +  
    +  stdout.write(msg); 
    +  prompt.emit('prompt', prop);
    +  
    +  read.call(null, function (err, line) {
    +    if (err) {
    +      return callback(err);
    +    }
    +  
    +    if (!line || line === '') {
    +      line = prop.default || line;
    +    }
    +    
    +    if (prop.validator || prop.empty === false) {
    +      var valid;
    +      
    +      if (prop.validator) {
    +        valid = prop.validator.test 
    +         ? prop.validator.test(line)
    +         : prop.validator(line);
    +      }
    +      
    +      if (prop.empty === false && valid) {
    +        valid = line.length > 0;
    +        prop.warning = prop.warning || 'You must supply a value.';
    +      }
    +      
    +      if (!valid) {
    +        logger.error('Invalid input for ' + name.grey);
    +        if (prop.warning) {
    +          logger.error(prop.warning);
    +        }
    +        
    +        prompt.emit('invalid', prop, line);
    +        return prompt.getInput(prop, callback);
    +      }
    +    }
    +        
    +    logger.input(line.yellow);
    +    callback(null, line);
    +  });
    +
    +  return prompt;
    +};

    function addProperties (obj, properties, callback)

    + +

    @obj {Object} Object to add properties to

    + +

    @properties {Array} List of properties to get values for

    + +

    @callback {function} Continuation to pass control to when complete.

    + +

    Prompts the user for values each of the properties if obj does not already +have a value for the property. Responds with the modified object.

    prompt.addProperties = function (obj, properties, callback) {
    +  properties = properties.filter(function (prop) {
    +    return typeof obj[prop] === 'undefined';
    +  });
    +  
    +  if (properties.length === 0) {
    +    return callback(obj);
    +  }
    +  
    +  prompt.get(properties, function (err, results) {
    +    if (err) {
    +      return callback(err);
    +    }
    +    else if (!results) {
    +      return callback(null, obj);
    +    }
    +    
    +    function putNested (obj, path, value) {
    +      var last = obj, key; 
    +      
    +      while (path.length > 1) {
    +        key = path.shift();
    +        if (!last[key]) {
    +          last[key] = {};
    +        }
    +        
    +        last = last[key];
    +      }
    +      
    +      last[path.shift()] = value;
    +    }
    +    
    +    Object.keys(results).forEach(function (key) {
    +      putNested(obj, key.split('.'), results[key]);
    +    });
    +    
    +    callback(null, obj);
    +  });
    +  
    +  return prompt;
    +};

    function readLine (callback)

    + +

    @callback {function} Continuation to respond to when complete

    + +

    Gets a single line of input from the user.

    prompt.readLine = function (callback) {
    +  var value = '', buffer = '';
    +  prompt.resume();
    +  stdin.setEncoding('utf8');
    +  stdin.on('error', callback);
    +  stdin.on('data', function data (chunk) {
    +    value += buffer + chunk;
    +    buffer = '';
    +    value = value.replace(/\r/g, '');
    +    if (value.indexOf('\n') !== -1) {
    +      if (value !== '\n') {
    +        value = value.replace(/^\n+/, '');
    +      }
    +      
    +      buffer = value.substr(value.indexOf('\n'));
    +      val = value.substr(0, value.indexOf('\n'));
    +      prompt.pause();
    +      stdin.removeListener('data', data);
    +      stdin.removeListener('error', callback);
    +      value = value.trim();
    +      callback(null, value);
    +    }
    +  });
    +  
    +  return prompt;
    +};

    function readLineHidden (callback)

    + +

    @callback {function} Continuation to respond to when complete

    + +

    Gets a single line of hidden input (i.e. rawMode = true) from the user.

    prompt.readLineHidden = function (callback) {
    +  var value = '', buffer = '';
    +  stdio.setRawMode(true);
    +  prompt.resume();
    +  stdin.on('error', callback);
    +  stdin.on('data', function data (c) {
    +    c = '' + c;
    +    switch (c) {
    +      case '\n': case '\r': case '\r\n': case '\u0004':
    +        stdio.setRawMode(false);
    +        stdin.removeListener('data', data);
    +        stdin.removeListener('error', callback);
    +        value = value.trim();
    +        stdout.write('\n');
    +        stdout.flush();
    +        prompt.pause();
    +        return callback(null, value)
    +      case '\u0003': case '\0':
    +        stdout.write('\n');
    +        process.exit(1);
    +        break;
    +      default:
    +        value += buffer + c
    +        buffer = '';
    +        break;
    +    }
    +  });
    +  
    +  return prompt;
    +};
    +
    +
    diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/add-properties.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/add-properties.js new file mode 100644 index 0000000..1a56176 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/add-properties.js @@ -0,0 +1,35 @@ +/* + * add-properties.js: Example of how to add properties to an object using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var obj = { + password: 'lamepassword', + mindset: 'NY' +} + +// +// Log the initial object. +// +console.log('Initial object to be extended:'); +console.dir(obj); + +// +// Add two properties to the empty object: username and email +// +prompt.addProperties(obj, ['username', 'email'], function (err) { + // + // Log the results. + // + console.log('Updated object received:'); + console.dir(obj); +}); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/existing-properties.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/existing-properties.js new file mode 100644 index 0000000..d87503b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/existing-properties.js @@ -0,0 +1,35 @@ +/* + * existing-properties.js: Example of using prompt with predefined properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +prompt.properties = { + email: { + format: 'email', + message: 'Must be a valid email address' + }, + password: { + hidden: true + } +}; + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(['email', 'password'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' email: ' + result.email); + console.log(' password: ' + result.password); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/history.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/history.js new file mode 100644 index 0000000..fd4369d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/history.js @@ -0,0 +1,44 @@ +/* + * history.js: Example of using the prompt history capabilities. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var properties = { + properties: { + animal: { + description: 'Enter an animal', + default: 'dog', + pattern: /dog|cat/ + }, + sound: { + description: 'What sound does this animal make?', + conform: function (value) { + var animal = prompt.history(0).value; + + return animal === 'dog' && value === 'woof' + || animal === 'cat' && value === 'meow'; + } + } + } +} + +// +// Get two properties from the user +// +prompt.get(properties, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' animal: ' + result.animal); + console.log(' sound: ' + result.sound); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/nested-properties-prompt.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/nested-properties-prompt.js new file mode 100644 index 0000000..25106a2 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/nested-properties-prompt.js @@ -0,0 +1,37 @@ +/* + * property-prompt.js: Example of using prompt with complex properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +var schema = { + properties: { + url: { + required: true, + format: 'url' + }, + auth: { + properties: { + username: { + required: true + }, + password: { + required: true, + hidden: true + } + } + } + } +}; + +prompt.start(); + +prompt.get(schema, function (err, result) { + console.log('Command-line input received:'); + console.log(' url: ' + result.url); + console.log(' auth:username: ' + result.auth.username); + console.log(' auth:password: ' + result.auth.password); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/old-schema.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/old-schema.js new file mode 100644 index 0000000..631b7b5 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/old-schema.js @@ -0,0 +1,36 @@ +/* + * simple-prompt.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get([ + { + name: 'username', + validator: /^[a-z]+$/, + warning: 'Username should consist only lowercase alphabets', + empty: false + }, + { + name: 'email', + message: 'Email Address' + } +], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/override-validation.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/override-validation.js new file mode 100644 index 0000000..8b02373 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/override-validation.js @@ -0,0 +1,52 @@ +/* + * override-validation.js: Example of using prompt with complex properties and command-line input. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'), + optimist = require('optimist'); + +var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + email: { + name: 'email', + format: 'email', + message: 'Must be a valid email address' + } + } +}; + +// +// Set the overrides +// +prompt.override = optimist.argv + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' email: ' + result.email); +}); + +// try running +// $ node ./override-validation.js --name USER --email EMAIL +// You will only be asked for email becasue it's invalid +// $ node ./override-validation.js --name h$acker --email me@example.com +// You will only be asked for email becasue it's invalid \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/password.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/password.js new file mode 100644 index 0000000..72fc02d --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/password.js @@ -0,0 +1,34 @@ +/* + * password.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and password +// +prompt.get([{ + name: 'username', + required: true + }, { + name: 'password', + hidden: true, + conform: function (value) { + return true; + } + }], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' password: ' + result.password); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/prompt-override.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/prompt-override.js new file mode 100644 index 0000000..7f2848b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/prompt-override.js @@ -0,0 +1,36 @@ +var prompt = require('../lib/prompt'), + optimist; + +try { + optimist = require('optimist'); +} catch (err) { + throw new Error([ + 'You need to install optimist before this example will work!', + 'Try: `npm install optimist`.' + ].join('\n')); +} + +// +// Set the overrides +// +prompt.override = optimist.argv + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + prompt.pause(); +}) + +// $ node ./prompt-override.js --username USER --email EMAIL diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/property-prompt.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/property-prompt.js new file mode 100644 index 0000000..c8b343b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/property-prompt.js @@ -0,0 +1,45 @@ +/* + * property-prompt.js: Example of using prompt with complex properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + email: { + name: 'email', + format: 'email', + message: 'Must be a valid email address' + }, + password: { + required: true, + hidden: true + } + } +}; + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' email: ' + result.email); + console.log(' password: ' + result.password); +}); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/simple-prompt.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/simple-prompt.js new file mode 100644 index 0000000..062e529 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/simple-prompt.js @@ -0,0 +1,25 @@ +/* + * simple-prompt.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); +}); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/yes-or-no-prompt.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/yes-or-no-prompt.js new file mode 100644 index 0000000..512b556 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/examples/yes-or-no-prompt.js @@ -0,0 +1,32 @@ +/* + * yes-or-no-prompt.js: Simple example of using prompt. + * + * (C) 2012, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var property = { + name: 'yesno', + message: 'are you sure?', + validator: /y[es]*|n[o]?/, + warning: 'Must respond yes or no', + default: 'no' +}; + +// +// Get the simple yes or no property +// +prompt.get(property, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' result: ' + result.yesno); +}); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/lib/prompt.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/lib/prompt.js new file mode 100644 index 0000000..250b047 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/lib/prompt.js @@ -0,0 +1,756 @@ +/* + * prompt.js: Simple prompt for prompting information from the command line + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var events = require('events'), + readline = require('readline'), + utile = require('utile'), + async = utile.async, + read = require('read'), + validate = require('revalidator').validate, + winston = require('winston'); + +// +// Monkey-punch readline.Interface to work-around +// https://github.com/joyent/node/issues/3860 +// +readline.Interface.prototype.setPrompt = function(prompt, length) { + this._prompt = prompt; + if (length) { + this._promptLength = length; + } else { + var lines = prompt.split(/[\r\n]/); + var lastLine = lines[lines.length - 1]; + this._promptLength = lastLine.replace(/\u001b\[(\d+(;\d+)*)?m/g, '').length; + } +}; + +// +// Expose version using `pkginfo` +// +require('pkginfo')(module, 'version'); + +var stdin, stdout, history = []; +var prompt = module.exports = Object.create(events.EventEmitter.prototype); +var logger = prompt.logger = new winston.Logger({ + transports: [new (winston.transports.Console)()] +}); + +prompt.started = false; +prompt.paused = false; +prompt.allowEmpty = false; +prompt.message = 'prompt'; +prompt.delimiter = ': '; +prompt.colors = true; + +// +// Create an empty object for the properties +// known to `prompt` +// +prompt.properties = {}; + +// +// Setup the default winston logger to use +// the `cli` levels and colors. +// +logger.cli(); + +// +// ### function start (options) +// #### @options {Object} **Optional** Options to consume by prompt +// Starts the prompt by listening to the appropriate events on `options.stdin` +// and `options.stdout`. If no streams are supplied, then `process.stdin` +// and `process.stdout` are used, respectively. +// +prompt.start = function (options) { + if (prompt.started) { + return; + } + + options = options || {}; + stdin = options.stdin || process.stdin; + stdout = options.stdout || process.stdout; + + // + // By default: Remember the last `10` prompt property / + // answer pairs and don't allow empty responses globally. + // + prompt.memory = options.memory || 10; + prompt.allowEmpty = options.allowEmpty || false; + prompt.message = options.message || prompt.message; + prompt.delimiter = options.delimiter || prompt.delimiter; + prompt.colors = options.colors || prompt.colors; + + if (process.platform !== 'win32') { + // windows falls apart trying to deal with SIGINT + process.on('SIGINT', function () { + stdout.write('\n'); + process.exit(1); + }); + } + + prompt.emit('start'); + prompt.started = true; + return prompt; +}; + +// +// ### function pause () +// Pauses input coming in from stdin +// +prompt.pause = function () { + if (!prompt.started || prompt.paused) { + return; + } + + stdin.pause(); + prompt.emit('pause'); + prompt.paused = true; + return prompt; +}; + +// +// ### function resume () +// Resumes input coming in from stdin +// +prompt.resume = function () { + if (!prompt.started || !prompt.paused) { + return; + } + + stdin.resume(); + prompt.emit('resume'); + prompt.paused = false; + return prompt; +}; + +// +// ### function history (search) +// #### @search {Number|string} Index or property name to find. +// Returns the `property:value` pair from within the prompts +// `history` array. +// +prompt.history = function (search) { + if (typeof search === 'number') { + return history[search] || {}; + } + + var names = history.map(function (pair) { + return typeof pair.property === 'string' + ? pair.property + : pair.property.name; + }); + + if (~names.indexOf(search)) { + return null; + } + + return history.filter(function (pair) { + return typeof pair.property === 'string' + ? pair.property === search + : pair.property.name === search; + })[0]; +}; + +// +// ### function get (schema, callback) +// #### @schema {Array|Object|string} Set of variables to get input for. +// #### @callback {function} Continuation to pass control to when complete. +// Gets input from the user via stdin for the specified message(s) `msg`. +// +prompt.get = function (schema, callback) { + // + // Transforms a full JSON-schema into an array describing path and sub-schemas. + // Used for iteration purposes. + // + function untangle(schema, path) { + var results = []; + path = path || []; + + if (schema.properties) { + // + // Iterate over the properties in the schema and use recursion + // to process sub-properties. + // + Object.keys(schema.properties).forEach(function (key) { + var obj = {}; + obj[key] = schema.properties[key]; + + // + // Concat a sub-untangling to the results. + // + results = results.concat(untangle(obj[key], path.concat(key))); + }); + + // Return the results. + return results; + } + + // + // This is a schema "leaf". + // + return { + path: path, + schema: schema + }; + } + + // + // Iterate over the values in the schema, represented as + // a legit single-property object subschemas. Accepts `schema` + // of the forms: + // + // 'prop-name' + // + // ['string-name', { path: ['or-well-formed-subschema'], properties: ... }] + // + // { path: ['or-well-formed-subschema'], properties: ... ] } + // + // { properties: { 'schema-with-no-path' } } + // + // And transforms them all into + // + // { path: ['path', 'to', 'property'], properties: { path: { to: ...} } } + // + function iterate(schema, get, done) { + var iterator = [], + result = {}; + + if (typeof schema === 'string') { + // + // We can iterate over a single string. + // + iterator.push({ + path: [schema], + schema: prompt.properties[schema.toLowerCase()] || {} + }); + } + else if (Array.isArray(schema)) { + // + // An array of strings and/or single-prop schema and/or no-prop schema. + // + iterator = schema.map(function (element) { + if (typeof element === 'string') { + return { + path: [element], + schema: prompt.properties[element.toLowerCase()] || {} + }; + } + else if (element.properties) { + return { + path: [Object.keys(element.properties)[0]], + schema: element.properties[Object.keys(element.properties)[0]] + }; + } + else if (element.path && element.schema) { + return element; + } + else { + return { + path: [element.name || 'question'], + schema: element + }; + } + }); + } + else if (schema.properties) { + // + // Or a complete schema `untangle` it for use. + // + iterator = untangle(schema); + } + else { + // + // Or a partial schema and path. + // TODO: Evaluate need for this option. + // + iterator = [{ + schema: schema.schema ? schema.schema : schema, + path: schema.path || [schema.name || 'question'] + }]; + } + + // + // Now, iterate and assemble the result. + // + async.forEachSeries(iterator, function (branch, next) { + get(branch, function assembler(err, line) { + if (err) { + return next(err); + } + + function build(path, line) { + var obj = {}; + if (path.length) { + obj[path[0]] = build(path.slice(1), line); + return obj; + } + + return line; + } + + function attach(obj, attr) { + var keys; + if (typeof attr !== 'object' || attr instanceof Array) { + return attr; + } + + keys = Object.keys(attr); + if (keys.length) { + if (!obj[keys[0]]) { + obj[keys[0]] = {}; + } + obj[keys[0]] = attach(obj[keys[0]], attr[keys[0]]); + } + + return obj; + } + + result = attach(result, build(branch.path, line)); + next(); + }); + }, function (err) { + return err ? done(err) : done(null, result); + }); + } + + iterate(schema, function get(target, next) { + prompt.getInput(target, function (err, line) { + return err ? next(err) : next(null, line); + }); + }, callback); + + return prompt; +}; + +// +// ### function confirm (msg, callback) +// #### @msg {Array|Object|string} set of message to confirm +// #### @callback {function} Continuation to pass control to when complete. +// Confirms a single or series of messages by prompting the user for a Y/N response. +// Returns `true` if ALL messages are answered in the affirmative, otherwise `false` +// +// `msg` can be a string, or object (or array of strings/objects). +// An object may have the following properties: +// +// { +// description: 'yes/no' // message to prompt user +// pattern: /^[yntf]{1}/i // optional - regex defining acceptable responses +// yes: /^[yt]{1}/i // optional - regex defining `affirmative` responses +// message: 'yes/no' // optional - message to display for invalid responses +// } +// +prompt.confirm = function (/* msg, options, callback */) { + var args = Array.prototype.slice.call(arguments), + msg = args.shift(), + callback = args.pop(), + opts = args.shift(), + vars = !Array.isArray(msg) ? [msg] : msg, + RX_Y = /^[yt]{1}/i, + RX_YN = /^[yntf]{1}/i; + + function confirm(target, next) { + var yes = target.yes || RX_Y, + options = utile.mixin({ + description: typeof target === 'string' ? target : target.description||'yes/no', + pattern: target.pattern || RX_YN, + name: 'confirm', + message: target.message || 'yes/no' + }, opts || {}); + + + prompt.get([options], function (err, result) { + next(err ? false : yes.test(result[options.name])); + }); + } + + async.rejectSeries(vars, confirm, function(result) { + callback(null, result.length===0); + }); +}; + + +// Variables needed outside of getInput for multiline arrays. +var tmp = []; + + +// ### function getInput (prop, callback) +// #### @prop {Object|string} Variable to get input for. +// #### @callback {function} Continuation to pass control to when complete. +// Gets input from the user via stdin for the specified message `msg`. +// +prompt.getInput = function (prop, callback) { + var schema = prop.schema || prop, + propName = prop.path && prop.path.join(':') || prop, + storedSchema = prompt.properties[propName.toLowerCase()], + delim = prompt.delimiter, + defaultLine, + against, + hidden, + length, + valid, + name, + raw, + msg; + + // + // If there is a stored schema for `propName` in `propmpt.properties` + // then use it. + // + if (schema instanceof Object && !Object.keys(schema).length && + typeof storedSchema !== 'undefined') { + schema = storedSchema; + } + + // + // Build a proper validation schema if we just have a string + // and no `storedSchema`. + // + if (typeof prop === 'string' && !storedSchema) { + schema = {}; + } + + schema = convert(schema); + defaultLine = schema.default; + name = prop.description || schema.description || propName; + raw = prompt.colors + ? [prompt.message, delim + name.grey, delim.grey] + : [prompt.message, delim + name, delim]; + + prop = { + schema: schema, + path: propName.split(':') + }; + + // + // If the schema has no `properties` value then set + // it to an object containing the current schema + // for `propName`. + // + if (!schema.properties) { + schema = (function () { + var obj = { properties: {} }; + obj.properties[propName] = schema; + return obj; + })(); + } + + // + // Handle overrides here. + // TODO: Make overrides nestable + // + if (prompt.override && prompt.override[propName]) { + if (prompt._performValidation(name, prop, prompt.override, schema, -1, callback)) { + return callback(null, prompt.override[propName]); + } + + delete prompt.override[propName]; + } + + var type = (schema.properties && schema.properties[name] && + schema.properties[name].type || '').toLowerCase().trim(), + wait = type === 'array'; + + if (type === 'array') { + length = prop.schema.maxItems; + if (length) { + msg = (tmp.length + 1).toString() + '/' + length.toString(); + } + else { + msg = (tmp.length + 1).toString(); + } + msg += delim; + raw.push(prompt.colors ? msg.grey : msg); + } + + // + // Calculate the raw length and colorize the prompt + // + length = raw.join('').length; + raw[0] = raw[0]; + msg = raw.join(''); + + if (schema.help) { + schema.help.forEach(function (line) { + logger.help(line); + }); + } + + // + // Emit a "prompting" event + // + prompt.emit('prompt', prop); + + // + // If there is no default line, set it to an empty string + // + if(typeof defaultLine === 'undefined') { + defaultLine = ''; + } + + // + // set to string for readline ( will not accept Numbers ) + // + defaultLine = defaultLine.toString(); + + // + // Make the actual read + // + read({ + prompt: msg, + silent: prop.schema && prop.schema.hidden, + default: defaultLine, + input: stdin, + output: stdout + }, function (err, line) { + if (err && wait === false) { + return callback(err); + } + + var against = {}, + numericInput, + isValid; + + if (line !== '') { + + if (schema.properties[name]) { + var type = (schema.properties[name].type || '').toLowerCase().trim() || undefined; + + // + // Attempt to parse input as a float if the schema expects a number. + // + if (type == 'number') { + numericInput = parseFloat(line, 10); + if (!isNaN(numericInput)) { + line = numericInput; + } + } + + // + // Attempt to parse input as a boolean if the schema expects a boolean + // + if (type == 'boolean') { + if(line === "true") { + line = true; + } + if(line === "false") { + line = false; + } + } + + // + // If the type is an array, wait for the end. Fixes #54 + // + if (type == 'array') { + var length = prop.schema.maxItems; + if (err) { + if (err.message == 'canceled') { + wait = false; + stdout.write('\n'); + } + } + else { + if (length) { + if (tmp.length + 1 < length) { + isValid = false; + wait = true; + } + else { + isValid = true; + wait = false; + } + } + else { + isValid = false; + wait = true; + } + tmp.push(line); + } + line = tmp; + } + } + + against[propName] = line; + } + + if (prop && prop.schema.before) { + line = prop.schema.before(line); + } + + // Validate + if (isValid === undefined) isValid = prompt._performValidation(name, prop, against, schema, line, callback); + + if (!isValid) { + return prompt.getInput(prop, callback); + } + + // + // Log the resulting line, append this `property:value` + // pair to the history for `prompt` and respond to + // the callback. + // + logger.input(line.yellow); + prompt._remember(propName, line); + callback(null, line); + + // Make sure `tmp` is emptied + tmp = []; + }); +}; + +// +// ### function performValidation (name, prop, against, schema, line, callback) +// #### @name {Object} Variable name +// #### @prop {Object|string} Variable to get input for. +// #### @against {Object} Input +// #### @schema {Object} Validation schema +// #### @line {String|Boolean} Input line +// #### @callback {function} Continuation to pass control to when complete. +// Perfoms user input validation, print errors if needed and returns value according to validation +// +prompt._performValidation = function (name, prop, against, schema, line, callback) { + var numericInput, valid, msg; + + try { + valid = validate(against, schema); + } + catch (err) { + return (line !== -1) ? callback(err) : false; + } + + if (!valid.valid) { + msg = line !== -1 ? 'Invalid input for ' : 'Invalid command-line input for '; + + if (prompt.colors) { + logger.error(msg + name.grey); + } + else { + logger.error(msg + name); + } + + if (prop.schema.message) { + logger.error(prop.schema.message); + } + + prompt.emit('invalid', prop, line); + } + + return valid.valid; +}; + +// +// ### function addProperties (obj, properties, callback) +// #### @obj {Object} Object to add properties to +// #### @properties {Array} List of properties to get values for +// #### @callback {function} Continuation to pass control to when complete. +// Prompts the user for values each of the `properties` if `obj` does not already +// have a value for the property. Responds with the modified object. +// +prompt.addProperties = function (obj, properties, callback) { + properties = properties.filter(function (prop) { + return typeof obj[prop] === 'undefined'; + }); + + if (properties.length === 0) { + return callback(obj); + } + + prompt.get(properties, function (err, results) { + if (err) { + return callback(err); + } + else if (!results) { + return callback(null, obj); + } + + function putNested (obj, path, value) { + var last = obj, key; + + while (path.length > 1) { + key = path.shift(); + if (!last[key]) { + last[key] = {}; + } + + last = last[key]; + } + + last[path.shift()] = value; + } + + Object.keys(results).forEach(function (key) { + putNested(obj, key.split('.'), results[key]); + }); + + callback(null, obj); + }); + + return prompt; +}; + +// +// ### @private function _remember (property, value) +// #### @property {Object|string} Property that the value is in response to. +// #### @value {string} User input captured by `prompt`. +// Prepends the `property:value` pair into the private `history` Array +// for `prompt` so that it can be accessed later. +// +prompt._remember = function (property, value) { + history.unshift({ + property: property, + value: value + }); + + // + // If the length of the `history` Array + // has exceeded the specified length to remember, + // `prompt.memory`, truncate it. + // + if (history.length > prompt.memory) { + history.splice(prompt.memory, history.length - prompt.memory); + } +}; + +// +// ### @private function convert (schema) +// #### @schema {Object} Schema for a property +// Converts the schema into new format if it is in old format +// +function convert(schema) { + var newProps = Object.keys(validate.messages), + newSchema = false, + key; + + newProps = newProps.concat(['description', 'dependencies']); + + for (key in schema) { + if (newProps.indexOf(key) > 0) { + newSchema = true; + break; + } + } + + if (!newSchema || schema.validator || schema.warning || typeof schema.empty !== 'undefined') { + schema.description = schema.message; + schema.message = schema.warning; + + if (typeof schema.validator === 'function') { + schema.conform = schema.validator; + } else { + schema.pattern = schema.validator; + } + + if (typeof schema.empty !== 'undefined') { + schema.required = !(schema.empty); + } + + delete schema.warning; + delete schema.validator; + delete schema.empty; + } + + return schema; +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/.npmignore new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/LICENSE b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/LICENSE new file mode 100644 index 0000000..ed4a4e7 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Charlie Robbins. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/README.md new file mode 100644 index 0000000..332704e --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/README.md @@ -0,0 +1,86 @@ +# node-pkginfo + +An easy way to expose properties on a module from a package.json + +## Installation + +### Installing npm (node package manager) +``` + curl http://npmjs.org/install.sh | sh +``` + +### Installing pkginfo +``` + [sudo] npm install pkginfo +``` + +## Motivation +How often when writing node.js modules have you written the following line(s) of code? + +* Hard code your version string into your code + +``` js + exports.version = '0.1.0'; +``` + +* Programmatically expose the version from the package.json + +``` js + exports.version = JSON.parse(fs.readFileSync('/path/to/package.json', 'utf8')).version; +``` + +In other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!** + +## Usage + +Using `pkginfo` is idiot-proof, just require and invoke it. + +``` js + var pkginfo = require('pkginfo')(module); + + console.dir(module.exports); +``` + +By invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). + +Here's a sample of the output: + +``` + { name: 'simple-app', + description: 'A test fixture for pkginfo', + version: '0.1.0', + author: 'Charlie Robbins ', + keywords: [ 'test', 'fixture' ], + main: './index.js', + scripts: { test: 'vows test/*-test.js --spec' }, + engines: { node: '>= 0.4.0' } } +``` + +### Expose specific properties +If you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function: + +``` js + var pkginfo = require('pkginfo')(module, 'version', 'author'); + + console.dir(module.exports); +``` + +``` + { version: '0.1.0', + author: 'Charlie Robbins ' } +``` + +If you're looking for further usage see the [examples][0] included in this repository. + +## Run Tests +Tests are written in [vows][1] and give complete coverage of all APIs. + +``` + vows test/*-test.js --spec +``` + +[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples +[1]: http://vowsjs.org + +#### Author: [Charlie Robbins](http://nodejitsu.com) +#### License: MIT \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/docco.css b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/docco.css new file mode 100644 index 0000000..bd54134 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/docco.css @@ -0,0 +1,194 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h4, h5, h6 { + color: #333; + margin: 6px 0 6px 0; + font-size: 13px; +} + h2, h3 { + margin-bottom: 0; + color: #000; + } + h1 { + margin-top: 40px; + margin-bottom: 15px; + color: #000; + } +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +#jump_to, #jump_page { + background: white; + -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; + -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; + font: 10px Arial; + text-transform: uppercase; + cursor: pointer; + text-align: right; +} +#jump_to, #jump_wrapper { + position: fixed; + right: 0; top: 0; + padding: 5px 10px; +} + #jump_wrapper { + padding: 0; + display: none; + } + #jump_to:hover #jump_wrapper { + display: block; + } + #jump_page { + padding: 5px 0 3px; + margin: 0 0 25px 25px; + } + #jump_page .source { + display: block; + padding: 5px 10px; + text-decoration: none; + border-top: 1px solid #eee; + } + #jump_page .source:hover { + background: #f5f5ff; + } + #jump_page .source:first-child { + } +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/pkginfo.html b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/pkginfo.html new file mode 100644 index 0000000..bf615fa --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/docs/pkginfo.html @@ -0,0 +1,101 @@ + pkginfo.js

    pkginfo.js

    /*
    + * pkginfo.js: Top-level include for the pkginfo module
    + *
    + * (C) 2011, Charlie Robbins
    + *
    + */
    + 
    +var fs = require('fs'),
    +    path = require('path');

    function pkginfo ([options, 'property', 'property' ..])

    + +

    @pmodule {Module} Parent module to read from.

    + +

    @options {Object|Array|string} Optional Options used when exposing properties.

    + +

    @arguments {string...} Optional Specified properties to expose.

    + +

    Exposes properties from the package.json file for the parent module on +it's exports. Valid usage:

    + +

    require('pkginfo')()

    + +

    require('pkginfo')('version', 'author');

    + +

    require('pkginfo')(['version', 'author']);

    + +

    require('pkginfo')({ include: ['version', 'author'] });

    var pkginfo = module.exports = function (pmodule, options) {
    +  var args = [].slice.call(arguments, 2).filter(function (arg) {
    +    return typeof arg === 'string';
    +  });
    +  

    Parse variable arguments

      if (Array.isArray(options)) {

    If the options passed in is an Array assume that +it is the Array of properties to expose from the +on the package.json file on the parent module.

        options = { include: options };
    +  }
    +  else if (typeof options === 'string') {

    Otherwise if the first argument is a string, then +assume that it is the first property to expose from +the package.json file on the parent module.

        options = { include: [options] };
    +  }
    +  

    Setup default options

      options = options || { include: [] };
    +  
    +  if (args.length > 0) {

    If additional string arguments have been passed in +then add them to the properties to expose on the +parent module.

        options.include = options.include.concat(args);
    +  }
    +  
    +  var pkg = pkginfo.read(pmodule, options.dir).package;
    +  Object.keys(pkg).forEach(function (key) {
    +    if (options.include.length > 0 && !~options.include.indexOf(key)) {
    +      return;
    +    }
    +    
    +    if (!pmodule.exports[key]) {
    +      pmodule.exports[key] = pkg[key];
    +    }
    +  });
    +  
    +  return pkginfo;
    +};

    function find (dir)

    + +

    @pmodule {Module} Parent module to read from.

    + +

    @dir {string} Optional Directory to start search from.

    + +

    Searches up the directory tree from dir until it finds a directory +which contains a package.json file.

    pkginfo.find = function (pmodule, dir) {
    +  dir = dir || pmodule.filename;
    +  dir = path.dirname(dir); 
    +  
    +  var files = fs.readdirSync(dir);
    +  
    +  if (~files.indexOf('package.json')) {
    +    return path.join(dir, 'package.json');
    +  }
    +  
    +  if (dir === '/') {
    +    throw new Error('Could not find package.json up from: ' + dir);
    +  }
    +  
    +  return pkginfo.find(dir);
    +};

    function read (pmodule, dir)

    + +

    @pmodule {Module} Parent module to read from.

    + +

    @dir {string} Optional Directory to start search from.

    + +

    Searches up the directory tree from dir until it finds a directory +which contains a package.json file and returns the package information.

    pkginfo.read = function (pmodule, dir) { 
    +  dir = pkginfo.find(pmodule, dir);
    +  
    +  var data = fs.readFileSync(dir).toString();
    +      
    +  return {
    +    dir: dir, 
    +    package: JSON.parse(data)
    +  };
    +};

    Call pkginfo on this module and expose version.

    pkginfo(module, {
    +  dir: __dirname,
    +  include: ['version'],
    +  target: pkginfo
    +});
    +
    +
    \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js new file mode 100644 index 0000000..fd1d831 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js @@ -0,0 +1,19 @@ +/* + * all-properties.js: Sample of including all properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js new file mode 100644 index 0000000..b1b6848 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js @@ -0,0 +1,20 @@ +/* + * array-argument.js: Sample of including specific properties from a package.json file + * using Array argument syntax. + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, ['version', 'author']); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js new file mode 100644 index 0000000..b4b5fd6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js @@ -0,0 +1,19 @@ +/* + * multiple-properties.js: Sample of including multiple properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, 'version', 'author'); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js new file mode 100644 index 0000000..28420c8 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js @@ -0,0 +1,22 @@ +/* + * object-argument.js: Sample of including specific properties from a package.json file + * using Object argument syntax. + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, { + include: ['version', 'author'] + }); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/package.json new file mode 100644 index 0000000..1f2f01c --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/package.json @@ -0,0 +1,10 @@ +{ + "name": "simple-app", + "description": "A test fixture for pkginfo", + "version": "0.1.0", + "author": "Charlie Robbins ", + "keywords": ["test", "fixture"], + "main": "./index.js", + "scripts": { "test": "vows test/*-test.js --spec" }, + "engines": { "node": ">= 0.4.0" } +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/single-property.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/single-property.js new file mode 100644 index 0000000..4f44561 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/single-property.js @@ -0,0 +1,19 @@ +/* + * single-property.js: Sample of including a single specific properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, 'version'); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json new file mode 100644 index 0000000..aa85410 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json @@ -0,0 +1,11 @@ +{ + "name": "simple-app-subdir", + "description": "A test fixture for pkginfo", + "version": "0.1.0", + "author": "Charlie Robbins ", + "keywords": ["test", "fixture"], + "main": "./index.js", + "scripts": { "test": "vows test/*-test.js --spec" }, + "engines": { "node": ">= 0.4.0" }, + "subdironly": "true" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js new file mode 100644 index 0000000..88770e6 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js @@ -0,0 +1,20 @@ +/* + * multiple-properties.js: Sample of including multiple properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + path = require('path'), + pkginfo = require('../lib/pkginfo')(module, { dir: path.resolve(__dirname, 'subdir' )}); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js new file mode 100644 index 0000000..c5dc020 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js @@ -0,0 +1,136 @@ +/* + * pkginfo.js: Top-level include for the pkginfo module + * + * (C) 2011, Charlie Robbins + * + */ + +var fs = require('fs'), + path = require('path'); + +// +// ### function pkginfo ([options, 'property', 'property' ..]) +// #### @pmodule {Module} Parent module to read from. +// #### @options {Object|Array|string} **Optional** Options used when exposing properties. +// #### @arguments {string...} **Optional** Specified properties to expose. +// Exposes properties from the package.json file for the parent module on +// it's exports. Valid usage: +// +// `require('pkginfo')()` +// +// `require('pkginfo')('version', 'author');` +// +// `require('pkginfo')(['version', 'author']);` +// +// `require('pkginfo')({ include: ['version', 'author'] });` +// +var pkginfo = module.exports = function (pmodule, options) { + var args = [].slice.call(arguments, 2).filter(function (arg) { + return typeof arg === 'string'; + }); + + // + // **Parse variable arguments** + // + if (Array.isArray(options)) { + // + // If the options passed in is an Array assume that + // it is the Array of properties to expose from the + // on the package.json file on the parent module. + // + options = { include: options }; + } + else if (typeof options === 'string') { + // + // Otherwise if the first argument is a string, then + // assume that it is the first property to expose from + // the package.json file on the parent module. + // + options = { include: [options] }; + } + + // + // **Setup default options** + // + options = options || {}; + + // ensure that includes have been defined + options.include = options.include || []; + + if (args.length > 0) { + // + // If additional string arguments have been passed in + // then add them to the properties to expose on the + // parent module. + // + options.include = options.include.concat(args); + } + + var pkg = pkginfo.read(pmodule, options.dir).package; + Object.keys(pkg).forEach(function (key) { + if (options.include.length > 0 && !~options.include.indexOf(key)) { + return; + } + + if (!pmodule.exports[key]) { + pmodule.exports[key] = pkg[key]; + } + }); + + return pkginfo; +}; + +// +// ### function find (dir) +// #### @pmodule {Module} Parent module to read from. +// #### @dir {string} **Optional** Directory to start search from. +// Searches up the directory tree from `dir` until it finds a directory +// which contains a `package.json` file. +// +pkginfo.find = function (pmodule, dir) { + if (! dir) { + dir = path.dirname(pmodule.filename); + } + + var files = fs.readdirSync(dir); + + if (~files.indexOf('package.json')) { + return path.join(dir, 'package.json'); + } + + if (dir === '/') { + throw new Error('Could not find package.json up from: ' + dir); + } + else if (!dir || dir === '.') { + throw new Error('Cannot find package.json from unspecified directory'); + } + + return pkginfo.find(pmodule, path.dirname(dir)); +}; + +// +// ### function read (pmodule, dir) +// #### @pmodule {Module} Parent module to read from. +// #### @dir {string} **Optional** Directory to start search from. +// Searches up the directory tree from `dir` until it finds a directory +// which contains a `package.json` file and returns the package information. +// +pkginfo.read = function (pmodule, dir) { + dir = pkginfo.find(pmodule, dir); + + var data = fs.readFileSync(dir).toString(); + + return { + dir: dir, + package: JSON.parse(data) + }; +}; + +// +// Call `pkginfo` on this module and expose version. +// +pkginfo(module, { + dir: __dirname, + include: ['version'], + target: pkginfo +}); \ No newline at end of file diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/package.json b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/package.json new file mode 100644 index 0000000..173f799 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/package.json @@ -0,0 +1,35 @@ +{ + "name": "pkginfo", + "version": "0.3.0", + "description": "An easy way to expose properties on a module from a package.json", + "author": { + "name": "Charlie Robbins", + "email": "charlie.robbins@gmail.com" + }, + "repository": { + "type": "git", + "url": "http://github.com/indexzero/node-pkginfo.git" + }, + "keywords": [ + "info", + "tools", + "package.json" + ], + "devDependencies": { + "vows": "0.7.x" + }, + "main": "./lib/pkginfo", + "scripts": { + "test": "vows test/*-test.js --spec" + }, + "engines": { + "node": ">= 0.4.0" + }, + "readme": "# node-pkginfo\n\nAn easy way to expose properties on a module from a package.json\n\n## Installation\n\n### Installing npm (node package manager)\n```\n curl http://npmjs.org/install.sh | sh\n```\n\n### Installing pkginfo\n```\n [sudo] npm install pkginfo\n```\n\n## Motivation\nHow often when writing node.js modules have you written the following line(s) of code? \n\n* Hard code your version string into your code\n\n``` js\n exports.version = '0.1.0';\n```\n\n* Programmatically expose the version from the package.json\n\n``` js\n exports.version = JSON.parse(fs.readFileSync('/path/to/package.json', 'utf8')).version;\n```\n\nIn other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!**\n\n## Usage\n\nUsing `pkginfo` is idiot-proof, just require and invoke it. \n\n``` js\n var pkginfo = require('pkginfo')(module);\n \n console.dir(module.exports);\n```\n\nBy invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). \n\nHere's a sample of the output:\n\n```\n { name: 'simple-app',\n description: 'A test fixture for pkginfo',\n version: '0.1.0',\n author: 'Charlie Robbins ',\n keywords: [ 'test', 'fixture' ],\n main: './index.js',\n scripts: { test: 'vows test/*-test.js --spec' },\n engines: { node: '>= 0.4.0' } }\n```\n\n### Expose specific properties\nIf you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function:\n\n``` js\n var pkginfo = require('pkginfo')(module, 'version', 'author');\n \n console.dir(module.exports);\n```\n\n```\n { version: '0.1.0',\n author: 'Charlie Robbins ' }\n```\n\nIf you're looking for further usage see the [examples][0] included in this repository. \n\n## Run Tests\nTests are written in [vows][1] and give complete coverage of all APIs.\n\n```\n vows test/*-test.js --spec\n```\n\n[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples\n[1]: http://vowsjs.org\n\n#### Author: [Charlie Robbins](http://nodejitsu.com)\n#### License: MIT", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/indexzero/node-pkginfo/issues" + }, + "_id": "pkginfo@0.3.0", + "_from": "pkginfo@0.x.x" +} diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js new file mode 100644 index 0000000..a59f077 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js @@ -0,0 +1,83 @@ +/* + * pkginfo-test.js: Tests for the pkginfo module. + * + * (C) 2011, Charlie Robbins + * + */ + +var assert = require('assert'), + exec = require('child_process').exec, + fs = require('fs'), + path = require('path'), + vows = require('vows'), + pkginfo = require('../lib/pkginfo'); + +function assertProperties (source, target) { + assert.lengthOf(source, target.length + 1); + target.forEach(function (prop) { + assert.isTrue(!!~source.indexOf(prop)); + }); +} + +function compareWithExample(targetPath) { + var examplePaths = ['package.json']; + + if (targetPath) { + examplePaths.unshift(targetPath); + } + + return function(exposed) { + var pkg = fs.readFileSync(path.join.apply(null, [__dirname, '..', 'examples'].concat(examplePaths))).toString(), + keys = Object.keys(JSON.parse(pkg)); + + assertProperties(exposed, keys); + }; +} + +function testExposes (options) { + return { + topic: function () { + exec('node ' + path.join(__dirname, '..', 'examples', options.script), this.callback); + }, + "should expose that property correctly": function (err, stdout, stderr) { + assert.isNull(err); + + var exposed = stderr.match(/'(\w+)'/ig).map(function (p) { + return p.substring(1, p.length - 1); + }); + + return !options.assert + ? assertProperties(exposed, options.properties) + : options.assert(exposed); + } + } +} + +vows.describe('pkginfo').addBatch({ + "When using the pkginfo module": { + "and passed a single `string` argument": testExposes({ + script: 'single-property.js', + properties: ['version'] + }), + "and passed multiple `string` arguments": testExposes({ + script: 'multiple-properties.js', + properties: ['version', 'author'] + }), + "and passed an `object` argument": testExposes({ + script: 'object-argument.js', + properties: ['version', 'author'] + }), + "and passed an `array` argument": testExposes({ + script: 'array-argument.js', + properties: ['version', 'author'] + }), + "and read from a specified directory": testExposes({ + script: 'target-dir.js', + assert: compareWithExample('subdir') + }), + "and passed no arguments": testExposes({ + script: 'all-properties.js', + assert: compareWithExample() + }) + } +}).export(module); diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/.npmignore b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/.npmignore new file mode 100644 index 0000000..0db216b --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/.npmignore @@ -0,0 +1,2 @@ +npm-debug.log +node_modules diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/LICENCE b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/LICENCE new file mode 100644 index 0000000..74489e2 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/LICENCE @@ -0,0 +1,25 @@ +Copyright (c) Isaac Z. Schlueter +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/README.md b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/README.md new file mode 100644 index 0000000..5967fad --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/README.md @@ -0,0 +1,53 @@ +## read + +For reading user input from stdin. + +Similar to the `readline` builtin's `question()` method, but with a +few more features. + +## USAGE + +```javascript +var read = require("read") +read(options, callback) +``` + +The callback gets called with either the user input, or the default +specified, or an error, as `callback(error, result, isDefault)` +node style. + +## OPTIONS + +Every option is optional. + +* `prompt` What to write to stdout before reading input. +* `silent` Don't echo the output as the user types it. +* `replace` Replace silenced characters with the supplied character value. +* `timeout` Number of ms to wait for user input before giving up. +* `default` The default value if the user enters nothing. +* `edit` Allow the user to edit the default value. +* `terminal` Treat the output as a TTY, whether it is or not. +* `input` Readable stream to get input data from. (default `process.stdin`) +* `output` Writeable stream to write prompts to. (default: `process.stdout`) + +If silent is true, and the input is a TTY, then read will set raw +mode, and read character by character. + +## COMPATIBILITY + +This module works sort of with node 0.6. It does not work with node +versions less than 0.6. It is best on node 0.8. + +On node version 0.6, it will remove all listeners on the input +stream's `data` and `keypress` events, because the readline module did +not fully clean up after itself in that version of node, and did not +make it possible to clean up after it in a way that has no potential +for side effects. + +Additionally, some of the readline options (like `terminal`) will not +function in versions of node before 0.8, because they were not +implemented in the builtin readline module. + +## CONTRIBUTING + +Patches welcome. diff --git a/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/lib/read.js b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/lib/read.js new file mode 100644 index 0000000..a93d1b3 --- /dev/null +++ b/3.0/one3/platforms/blackberry10/cordova/node_modules/prompt/node_modules/read/lib/read.js @@ -0,0 +1,113 @@ + +module.exports = read + +var readline = require('readline') +var Mute = require('mute-stream') + +function read (opts, cb) { + if (opts.num) { + throw new Error('read() no longer accepts a char number limit') + } + + if (typeof opts.default !== 'undefined' && + typeof opts.default !== 'string' && + typeof opts.default !== 'number') { + throw new Error('default value must be string or number') + } + + var input = opts.input || process.stdin + var output = opts.output || process.stdout + var prompt = (opts.prompt || '').trim() + ' ' + var silent = opts.silent + var editDef = false + var timeout = opts.timeout + + var def = opts.default || '' + if (def) { + if (silent) { + prompt += '(