You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2012/08/25 01:54:56 UTC

[2/3] updating 2.1.0rc1

http://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen/blob/aeb33add/framework/cordova.tizen-debug.js
----------------------------------------------------------------------
diff --git a/framework/cordova.tizen-debug.js b/framework/cordova.tizen-debug.js
index d16ed8e..cf927cf 100644
--- a/framework/cordova.tizen-debug.js
+++ b/framework/cordova.tizen-debug.js
@@ -1,6 +1,6 @@
-// commit 7dd17b00544742d14ecdeff2148a66480680f12b
+// commit a290eef8cb6740922a865cdd5d7aa50cc5135ec4
 
-// File generated at :: Fri Jul 27 2012 11:40:36 GMT+0200 (CEST)
+// File generated at :: Fri Aug 24 2012 16:52:04 GMT-0700 (PDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -23,12 +23,12 @@
 
 ;(function() {
 
-try {eval("var require,\n    define;\n\n(function () {\n    var modules = {};\n\n    function build(module) {\n        var factory = module.factory;\n        module.exports = {};\n        delete module.factory;\n        factory(require, module.exports, module);\n        return module.exports;\n    }\n\n    require = function (id) {\n        if (!modules[id]) {\n            throw \"module \" + id + \" not found\";\n        }\n        return modules[id].factory ? build(modules[id]) : modules[id].exports;\n    };\n\n    define = function (id, factory) {\n        if (modules[id]) {\n            throw \"module \" + id + \" already defined\";\n        }\n\n        modules[id] = {\n            id: id,\n            factory: factory\n        };\n    };\n\n    define.remove = function (id) {\n        delete modules[id];\n    };\n\n})();\n\n//Export for use in node\nif (typeof module === \"object\" && typeof require === \"function\") {\n    module.exports.require = require;\n    module.exports
 .define = define;\n}\n//@ sourceURL=lib/scripts/require.js")} catch(e) {console.log("exception: in lib/scripts/require.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova\", function(require, exports, module) {\nvar channel = require('cordova/channel');\n\n/**\n * Listen for DOMContentLoaded and notify our channel subscribers.\n */\ndocument.addEventListener('DOMContentLoaded', function() {\n    channel.onDOMContentLoaded.fire();\n}, false);\nif (document.readyState == 'complete' || document.readyState == 'interactive') {\n    channel.onDOMContentLoaded.fire();\n}\n\n/**\n * Intercept calls to addEventListener + removeEventListener and handle deviceready,\n * resume, and pause events.\n */\nvar m_document_addEventListener = document.addEventListener;\nvar m_document_removeEventListener = document.removeEventListener;\nvar m_window_addEventListener = window.addEventListener;\nvar m_window_removeEventListener = window.removeEventListener;\n\n/**\n * Houses custom event handlers to intercept on document + window event listeners.\n */\nvar documentEventHandlers = {},\n    windowEventHandlers = {};\n\ndocument.addEventListener 
 = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (typeof documentEventHandlers[e] != 'undefined') {\n        if (evt === 'deviceready') {\n            documentEventHandlers[e].subscribeOnce(handler);\n        } else {\n            documentEventHandlers[e].subscribe(handler);\n        }\n    } else {\n        m_document_addEventListener.call(document, evt, handler, capture);\n    }\n};\n\nwindow.addEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (typeof windowEventHandlers[e] != 'undefined') {\n        windowEventHandlers[e].subscribe(handler);\n    } else {\n        m_window_addEventListener.call(window, evt, handler, capture);\n    }\n};\n\ndocument.removeEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    // If unsubcribing from an event that is handled by a plugin\n    if (typeof documentEventHandlers[e] != \"undefined\") {\n        documentEventHandlers[e].unsubscribe(handler)
 ;\n    } else {\n        m_document_removeEventListener.call(document, evt, handler, capture);\n    }\n};\n\nwindow.removeEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    // If unsubcribing from an event that is handled by a plugin\n    if (typeof windowEventHandlers[e] != \"undefined\") {\n        windowEventHandlers[e].unsubscribe(handler);\n    } else {\n        m_window_removeEventListener.call(window, evt, handler, capture);\n    }\n};\n\nfunction createEvent(type, data) {\n    var event = document.createEvent('Events');\n    event.initEvent(type, false, false);\n    if (data) {\n        for (var i in data) {\n            if (data.hasOwnProperty(i)) {\n                event[i] = data[i];\n            }\n        }\n    }\n    return event;\n}\n\nif(typeof window.console === \"undefined\") {\n    window.console = {\n        log:function(){}\n    };\n}\n\nvar cordova = {\n    define:define,\n    require:require,\n    /**\n     * Methods to add
 /remove your own addEventListener hijacking on document + window.\n     */\n    addWindowEventHandler:function(event, opts) {\n        return (windowEventHandlers[event] = channel.create(event, opts));\n    },\n    addDocumentEventHandler:function(event, opts) {\n        return (documentEventHandlers[event] = channel.create(event, opts));\n    },\n    removeWindowEventHandler:function(event) {\n        delete windowEventHandlers[event];\n    },\n    removeDocumentEventHandler:function(event) {\n        delete documentEventHandlers[event];\n    },\n    /**\n     * Retreive original event handlers that were replaced by Cordova\n     *\n     * @return object\n     */\n    getOriginalHandlers: function() {\n        return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},\n        'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};\n    },\n    /**\n     * Met
 hod to fire event from native code\n     */\n    fireDocumentEvent: function(type, data) {\n        var evt = createEvent(type, data);\n        if (typeof documentEventHandlers[type] != 'undefined') {\n            setTimeout(function() {\n                documentEventHandlers[type].fire(evt);\n            }, 0);\n        } else {\n            document.dispatchEvent(evt);\n        }\n    },\n    fireWindowEvent: function(type, data) {\n        var evt = createEvent(type,data);\n        if (typeof windowEventHandlers[type] != 'undefined') {\n            setTimeout(function() {\n                windowEventHandlers[type].fire(evt);\n            }, 0);\n        } else {\n            window.dispatchEvent(evt);\n        }\n    },\n    // TODO: this is Android only; think about how to do this better\n    shuttingDown:false,\n    UsePolling:false,\n    // END TODO\n\n    // TODO: iOS only\n    // This queue holds the currently executing command and all pending\n    // commands executed with 
 cordova.exec().\n    commandQueue:[],\n    // Indicates if we're currently in the middle of flushing the command\n    // queue on the native side.\n    commandQueueFlushing:false,\n    // END TODO\n    /**\n     * Plugin callback mechanism.\n     */\n    callbackId: 0,\n    callbacks:  {},\n    callbackStatus: {\n        NO_RESULT: 0,\n        OK: 1,\n        CLASS_NOT_FOUND_EXCEPTION: 2,\n        ILLEGAL_ACCESS_EXCEPTION: 3,\n        INSTANTIATION_EXCEPTION: 4,\n        MALFORMED_URL_EXCEPTION: 5,\n        IO_EXCEPTION: 6,\n        INVALID_ACTION: 7,\n        JSON_EXCEPTION: 8,\n        ERROR: 9\n    },\n\n    /**\n     * Called by native code when returning successful result from an action.\n     *\n     * @param callbackId\n     * @param args\n     */\n    callbackSuccess: function(callbackId, args) {\n        if (cordova.callbacks[callbackId]) {\n\n            // If result is to be sent to callback\n            if (args.status == cordova.callbackStatus.OK) {\n                try
  {\n                    if (cordova.callbacks[callbackId].success) {\n                        cordova.callbacks[callbackId].success(args.message);\n                    }\n                }\n                catch (e) {\n                    console.log(\"Error in success callback: \"+callbackId+\" = \"+e);\n                }\n            }\n\n            // Clear callback if not expecting any more results\n            if (!args.keepCallback) {\n                delete cordova.callbacks[callbackId];\n            }\n        }\n    },\n\n    /**\n     * Called by native code when returning error result from an action.\n     *\n     * @param callbackId\n     * @param args\n     */\n    callbackError: function(callbackId, args) {\n        if (cordova.callbacks[callbackId]) {\n            try {\n                if (cordova.callbacks[callbackId].fail) {\n                    cordova.callbacks[callbackId].fail(args.message);\n                }\n            }\n            catch (e) {\n          
       console.log(\"Error in error callback: \"+callbackId+\" = \"+e);\n            }\n\n            // Clear callback if not expecting any more results\n            if (!args.keepCallback) {\n                delete cordova.callbacks[callbackId];\n            }\n        }\n    },\n    addConstructor: function(func) {\n        channel.onCordovaReady.subscribeOnce(function() {\n            try {\n                func();\n            } catch(e) {\n                console.log(\"Failed to run constructor: \" + e);\n            }\n        });\n    }\n};\n\n// Register pause, resume and deviceready channels as events on document.\nchannel.onPause = cordova.addDocumentEventHandler('pause');\nchannel.onResume = cordova.addDocumentEventHandler('resume');\nchannel.onDeviceReady = cordova.addDocumentEventHandler('deviceready');\n\nmodule.exports = cordova;\n\n});\n\n//@ sourceURL=lib/cordova.js")} catch(e) {console.log("exception: in lib/cordova.js: " + e);console.log(e.stack);}
+try {eval("var require,\n    define;\n\n(function () {\n    var modules = {};\n    // Stack of moduleIds currently being built.\n    var requireStack = [];\n    // Map of module ID -> index into requireStack of modules currently being built.\n    var inProgressModules = {};\n\n    function build(module) {\n        var factory = module.factory;\n        module.exports = {};\n        delete module.factory;\n        factory(require, module.exports, module);\n        return module.exports;\n    }\n\n    require = function (id) {\n        if (!modules[id]) {\n            throw \"module \" + id + \" not found\";\n        } else if (id in inProgressModules) {\n            var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;\n            throw \"Cycle in require graph: \" + cycle;\n        }\n        if (modules[id].factory) {\n            try {\n                inProgressModules[id] = requireStack.length;\n                requireStack.push(id);\n                ret
 urn build(modules[id]);\n            } finally {\n                delete inProgressModules[id];\n                requireStack.pop();\n            }\n        }\n        return modules[id].exports;\n    };\n\n    define = function (id, factory) {\n        if (modules[id]) {\n            throw \"module \" + id + \" already defined\";\n        }\n\n        modules[id] = {\n            id: id,\n            factory: factory\n        };\n    };\n\n    define.remove = function (id) {\n        delete modules[id];\n    };\n\n})();\n\n//Export for use in node\nif (typeof module === \"object\" && typeof require === \"function\") {\n    module.exports.require = require;\n    module.exports.define = define;\n}\n\n//@ sourceURL=lib/scripts/require.js")} catch(e) {console.log("exception: in lib/scripts/require.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova\", function(require, exports, module) {\nvar channel = require('cordova/channel');\n\n/**\n * Listen for DOMContentLoaded and notify our channel subscribers.\n */\ndocument.addEventListener('DOMContentLoaded', function() {\n    channel.onDOMContentLoaded.fire();\n}, false);\nif (document.readyState == 'complete' || document.readyState == 'interactive') {\n    channel.onDOMContentLoaded.fire();\n}\n\n/**\n * Intercept calls to addEventListener + removeEventListener and handle deviceready,\n * resume, and pause events.\n */\nvar m_document_addEventListener = document.addEventListener;\nvar m_document_removeEventListener = document.removeEventListener;\nvar m_window_addEventListener = window.addEventListener;\nvar m_window_removeEventListener = window.removeEventListener;\n\n/**\n * Houses custom event handlers to intercept on document + window event listeners.\n */\nvar documentEventHandlers = {},\n    windowEventHandlers = {};\n\ndocument.addEventListener 
 = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (typeof documentEventHandlers[e] != 'undefined') {\n        if (evt === 'deviceready') {\n            documentEventHandlers[e].subscribeOnce(handler);\n        } else {\n            documentEventHandlers[e].subscribe(handler);\n        }\n    } else {\n        m_document_addEventListener.call(document, evt, handler, capture);\n    }\n};\n\nwindow.addEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    if (typeof windowEventHandlers[e] != 'undefined') {\n        windowEventHandlers[e].subscribe(handler);\n    } else {\n        m_window_addEventListener.call(window, evt, handler, capture);\n    }\n};\n\ndocument.removeEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    // If unsubcribing from an event that is handled by a plugin\n    if (typeof documentEventHandlers[e] != \"undefined\") {\n        documentEventHandlers[e].unsubscribe(handler)
 ;\n    } else {\n        m_document_removeEventListener.call(document, evt, handler, capture);\n    }\n};\n\nwindow.removeEventListener = function(evt, handler, capture) {\n    var e = evt.toLowerCase();\n    // If unsubcribing from an event that is handled by a plugin\n    if (typeof windowEventHandlers[e] != \"undefined\") {\n        windowEventHandlers[e].unsubscribe(handler);\n    } else {\n        m_window_removeEventListener.call(window, evt, handler, capture);\n    }\n};\n\nfunction createEvent(type, data) {\n    var event = document.createEvent('Events');\n    event.initEvent(type, false, false);\n    if (data) {\n        for (var i in data) {\n            if (data.hasOwnProperty(i)) {\n                event[i] = data[i];\n            }\n        }\n    }\n    return event;\n}\n\nif(typeof window.console === \"undefined\") {\n    window.console = {\n        log:function(){}\n    };\n}\n\nvar cordova = {\n    define:define,\n    require:require,\n    /**\n     * Methods to add
 /remove your own addEventListener hijacking on document + window.\n     */\n    addWindowEventHandler:function(event, opts) {\n        return (windowEventHandlers[event] = channel.create(event, opts));\n    },\n    addDocumentEventHandler:function(event, opts) {\n        return (documentEventHandlers[event] = channel.create(event, opts));\n    },\n    removeWindowEventHandler:function(event) {\n        delete windowEventHandlers[event];\n    },\n    removeDocumentEventHandler:function(event) {\n        delete documentEventHandlers[event];\n    },\n    /**\n     * Retreive original event handlers that were replaced by Cordova\n     *\n     * @return object\n     */\n    getOriginalHandlers: function() {\n        return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},\n        'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};\n    },\n    /**\n     * Met
 hod to fire event from native code\n     */\n    fireDocumentEvent: function(type, data) {\n        var evt = createEvent(type, data);\n        if (typeof documentEventHandlers[type] != 'undefined') {\n            setTimeout(function() {\n                documentEventHandlers[type].fire(evt);\n            }, 0);\n        } else {\n            document.dispatchEvent(evt);\n        }\n    },\n    fireWindowEvent: function(type, data) {\n        var evt = createEvent(type,data);\n        if (typeof windowEventHandlers[type] != 'undefined') {\n            setTimeout(function() {\n                windowEventHandlers[type].fire(evt);\n            }, 0);\n        } else {\n            window.dispatchEvent(evt);\n        }\n    },\n\n    // TODO: iOS only\n    // This queue holds the currently executing command and all pending\n    // commands executed with cordova.exec().\n    commandQueue:[],\n    // Indicates if we're currently in the middle of flushing the command\n    // queue on the n
 ative side.\n    commandQueueFlushing:false,\n    // END TODO\n    /**\n     * Plugin callback mechanism.\n     */\n    callbackId: 0,\n    callbacks:  {},\n    callbackStatus: {\n        NO_RESULT: 0,\n        OK: 1,\n        CLASS_NOT_FOUND_EXCEPTION: 2,\n        ILLEGAL_ACCESS_EXCEPTION: 3,\n        INSTANTIATION_EXCEPTION: 4,\n        MALFORMED_URL_EXCEPTION: 5,\n        IO_EXCEPTION: 6,\n        INVALID_ACTION: 7,\n        JSON_EXCEPTION: 8,\n        ERROR: 9\n    },\n\n    /**\n     * Called by native code when returning successful result from an action.\n     *\n     * @param callbackId\n     * @param args\n     */\n    callbackSuccess: function(callbackId, args) {\n        if (cordova.callbacks[callbackId]) {\n\n            // If result is to be sent to callback\n            if (args.status == cordova.callbackStatus.OK) {\n                try {\n                    if (cordova.callbacks[callbackId].success) {\n                        cordova.callbacks[callbackId].success(arg
 s.message);\n                    }\n                }\n                catch (e) {\n                    console.log(\"Error in success callback: \"+callbackId+\" = \"+e);\n                }\n            }\n\n            // Clear callback if not expecting any more results\n            if (!args.keepCallback) {\n                delete cordova.callbacks[callbackId];\n            }\n        }\n    },\n\n    /**\n     * Called by native code when returning error result from an action.\n     *\n     * @param callbackId\n     * @param args\n     */\n    callbackError: function(callbackId, args) {\n        if (cordova.callbacks[callbackId]) {\n            try {\n                if (cordova.callbacks[callbackId].fail) {\n                    cordova.callbacks[callbackId].fail(args.message);\n                }\n            }\n            catch (e) {\n                console.log(\"Error in error callback: \"+callbackId+\" = \"+e);\n            }\n\n            // Clear callback if not expecting
  any more results\n            if (!args.keepCallback) {\n                delete cordova.callbacks[callbackId];\n            }\n        }\n    },\n    addConstructor: function(func) {\n        channel.onCordovaReady.subscribeOnce(function() {\n            try {\n                func();\n            } catch(e) {\n                console.log(\"Failed to run constructor: \" + e);\n            }\n        });\n    }\n};\n\n// Register pause, resume and deviceready channels as events on document.\nchannel.onPause = cordova.addDocumentEventHandler('pause');\nchannel.onResume = cordova.addDocumentEventHandler('resume');\nchannel.onDeviceReady = cordova.addDocumentEventHandler('deviceready');\n\nmodule.exports = cordova;\n\n});\n\n//@ sourceURL=lib/cordova.js")} catch(e) {console.log("exception: in lib/cordova.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/builder\", function(require, exports, module) {\nvar utils = require('cordova/utils');\n\nfunction each(objects, func, context) {\n    for (var prop in objects) {\n        if (objects.hasOwnProperty(prop)) {\n            func.apply(context, [objects[prop], prop]);\n        }\n    }\n}\n\nfunction include(parent, objects, clobber, merge) {\n    each(objects, function (obj, key) {\n        try {\n          var result = obj.path ? require(obj.path) : {};\n\n          if (clobber) {\n              // Clobber if it doesn't exist.\n              if (typeof parent[key] === 'undefined') {\n                  parent[key] = result;\n              } else if (typeof obj.path !== 'undefined') {\n                  // If merging, merge properties onto parent, otherwise, clobber.\n                  if (merge) {\n                      recursiveMerge(parent[key], result);\n                  } else {\n                      parent[key] = result;\n                  }\n        
       }\n              result = parent[key];\n          } else {\n            // Overwrite if not currently defined.\n            if (typeof parent[key] == 'undefined') {\n              parent[key] = result;\n            } else if (merge && typeof obj.path !== 'undefined') {\n              // If merging, merge parent onto result\n              recursiveMerge(result, parent[key]);\n              parent[key] = result;\n            } else {\n              // Set result to what already exists, so we can build children into it if they exist.\n              result = parent[key];\n            }\n          }\n\n          if (obj.children) {\n            include(result, obj.children, clobber, merge);\n          }\n        } catch(e) {\n          utils.alert('Exception building cordova JS globals: ' + e + ' for key \"' + key + '\"');\n        }\n    });\n}\n\n/**\n * Merge properties from one object onto another recursively.  Properties from\n * the src object will overwrite existing target p
 roperty.\n *\n * @param target Object to merge properties into.\n * @param src Object to merge properties from.\n */\nfunction recursiveMerge(target, src) {\n    for (var prop in src) {\n        if (src.hasOwnProperty(prop)) {\n            if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {\n                // If the target object is a constructor override off prototype.\n                target.prototype[prop] = src[prop];\n            } else {\n                target[prop] = typeof src[prop] === 'object' ? recursiveMerge(\n                        target[prop], src[prop]) : src[prop];\n            }\n        }\n    }\n    return target;\n}\n\nmodule.exports = {\n    build: function (objects) {\n        return {\n            intoButDontClobber: function (target) {\n                include(target, objects, false, false);\n            },\n            intoAndClobber: function(target) {\n                include(target, objects, true, false);\n       
      },\n            intoAndMerge: function(target) {\n                include(target, objects, true, true);\n            }\n        };\n    }\n};\n\n});\n\n//@ sourceURL=lib/common/builder.js")} catch(e) {console.log("exception: in lib/common/builder.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/channel\", function(require, exports, module) {\nvar utils = require('cordova/utils');\n\n/**\n * Custom pub-sub \"channel\" that can have functions subscribed to it\n * This object is used to define and control firing of events for\n * cordova initialization.\n *\n * The order of events during page load and Cordova startup is as follows:\n *\n * onDOMContentLoaded         Internal event that is received when the web page is loaded and parsed.\n * onNativeReady              Internal event that indicates the Cordova native side is ready.\n * onCordovaReady             Internal event fired when all Cordova JavaScript objects have been created.\n * onCordovaInfoReady         Internal event fired when device properties are available.\n * onCordovaConnectionReady   Internal event fired when the connection property has been set.\n * onDeviceReady              User event fired to indicate that Cordova is ready\n * onResume                   User event fired to i
 ndicate a start/resume lifecycle event\n * onPause                    User event fired to indicate a pause lifecycle event\n * onDestroy                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).\n *\n * The only Cordova events that user code should register for are:\n *      deviceready           Cordova native code is initialized and Cordova APIs can be called from JavaScript\n *      pause                 App has moved to background\n *      resume                App has returned to foreground\n *\n * Listeners can be registered as:\n *      document.addEventListener(\"deviceready\", myDeviceReadyListener, false);\n *      document.addEventListener(\"resume\", myResumeListener, false);\n *      document.addEventListener(\"pause\", myPauseListener, false);\n *\n * The DOM lifecycle events should be used for saving and restoring state\n *      window.onload\n *      window.onunload\n *\n */\n\n/**\n * Channel\n * @constr
 uctor\n * @param type  String the channel name\n * @param opts  Object options to pass into the channel, currently\n *                     supports:\n *                     onSubscribe: callback that fires when\n *                       something subscribes to the Channel. Sets\n *                       context to the Channel.\n *                     onUnsubscribe: callback that fires when\n *                       something unsubscribes to the Channel. Sets\n *                       context to the Channel.\n */\nvar Channel = function(type, opts) {\n    this.type = type;\n    this.handlers = {};\n    this.numHandlers = 0;\n    this.guid = 1;\n    this.fired = false;\n    this.enabled = true;\n    this.events = {\n        onSubscribe:null,\n        onUnsubscribe:null\n    };\n    if (opts) {\n        if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe;\n        if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe;\n    }\n},\n    channel = {\n        /
 **\n         * Calls the provided function only after all of the channels specified\n         * have been fired.\n         */\n        join: function (h, c) {\n            var i = c.length;\n            var len = i;\n            var f = function() {\n                if (!(--i)) h();\n            };\n            for (var j=0; j<len; j++) {\n                !c[j].fired?c[j].subscribeOnce(f):i--;\n            }\n            if (!i) h();\n        },\n        create: function (type, opts) {\n            channel[type] = new Channel(type, opts);\n            return channel[type];\n        },\n\n        /**\n         * cordova Channels that must fire before \"deviceready\" is fired.\n         */\n        deviceReadyChannelsArray: [],\n        deviceReadyChannelsMap: {},\n\n        /**\n         * Indicate that a feature needs to be initialized before it is ready to be used.\n         * This holds up Cordova's \"deviceready\" event until the feature has been initialized\n         * and Cordo
 va.initComplete(feature) is called.\n         *\n         * @param feature {String}     The unique feature name\n         */\n        waitForInitialization: function(feature) {\n            if (feature) {\n                var c = null;\n                if (this[feature]) {\n                    c = this[feature];\n                }\n                else {\n                    c = this.create(feature);\n                }\n                this.deviceReadyChannelsMap[feature] = c;\n                this.deviceReadyChannelsArray.push(c);\n            }\n        },\n\n        /**\n         * Indicate that initialization code has completed and the feature is ready to be used.\n         *\n         * @param feature {String}     The unique feature name\n         */\n        initializationComplete: function(feature) {\n            var c = this.deviceReadyChannelsMap[feature];\n            if (c) {\n                c.fire();\n            }\n        }\n    };\n\nfunction forceFunction(f) {\n    
 if (f === null || f === undefined || typeof f != 'function') throw \"Function required as first argument!\";\n}\n\n/**\n * Subscribes the given function to the channel. Any time that\n * Channel.fire is called so too will the function.\n * Optionally specify an execution context for the function\n * and a guid that can be used to stop subscribing to the channel.\n * Returns the guid.\n */\nChannel.prototype.subscribe = function(f, c, g) {\n    // need a function to call\n    forceFunction(f);\n\n    var func = f;\n    if (typeof c == \"object\") { func = utils.close(c, f); }\n\n    g = g || func.observer_guid || f.observer_guid;\n    if (!g) {\n        // first time we've seen this subscriber\n        g = this.guid++;\n    }\n    else {\n        // subscriber already handled; dont set it twice\n        return g;\n    }\n    func.observer_guid = g;\n    f.observer_guid = g;\n    this.handlers[g] = func;\n    this.numHandlers++;\n    if (this.events.onSubscribe) this.events.onSubscrib
 e.call(this);\n    if (this.fired) func.call(this);\n    return g;\n};\n\n/**\n * Like subscribe but the function is only called once and then it\n * auto-unsubscribes itself.\n */\nChannel.prototype.subscribeOnce = function(f, c) {\n    // need a function to call\n    forceFunction(f);\n\n    var g = null;\n    var _this = this;\n    var m = function() {\n        f.apply(c || null, arguments);\n        _this.unsubscribe(g);\n    };\n    if (this.fired) {\n        if (typeof c == \"object\") { f = utils.close(c, f); }\n        f.apply(this, this.fireArgs);\n    } else {\n        g = this.subscribe(m);\n    }\n    return g;\n};\n\n/**\n * Unsubscribes the function with the given guid from the channel.\n */\nChannel.prototype.unsubscribe = function(g) {\n    // need a function to unsubscribe\n    if (g === null || g === undefined) { throw \"You must pass _something_ into Channel.unsubscribe\"; }\n\n    if (typeof g == 'function') { g = g.observer_guid; }\n    var handler = this.handle
 rs[g];\n    if (handler) {\n        if (handler.observer_guid) handler.observer_guid=null;\n        this.handlers[g] = null;\n        delete this.handlers[g];\n        this.numHandlers--;\n        if (this.events.onUnsubscribe) this.events.onUnsubscribe.call(this);\n    }\n};\n\n/**\n * Calls all functions subscribed to this channel.\n */\nChannel.prototype.fire = function(e) {\n    if (this.enabled) {\n        var fail = false;\n        this.fired = true;\n        for (var item in this.handlers) {\n            var handler = this.handlers[item];\n            if (typeof handler == 'function') {\n                var rv = (handler.apply(this, arguments)===false);\n                fail = fail || rv;\n            }\n        }\n        this.fireArgs = arguments;\n        return !fail;\n    }\n    return true;\n};\n\n// defining them here so they are ready super fast!\n// DOM event that is received when the web page is loaded and parsed.\nchannel.create('onDOMContentLoaded');\n\n// Event t
 o indicate the Cordova native side is ready.\nchannel.create('onNativeReady');\n\n// Event to indicate that all Cordova JavaScript objects have been created\n// and it's time to run plugin constructors.\nchannel.create('onCordovaReady');\n\n// Event to indicate that device properties are available\nchannel.create('onCordovaInfoReady');\n\n// Event to indicate that the connection property has been set.\nchannel.create('onCordovaConnectionReady');\n\n// Event to indicate that Cordova is ready\nchannel.create('onDeviceReady');\n\n// Event to indicate a resume lifecycle event\nchannel.create('onResume');\n\n// Event to indicate a pause lifecycle event\nchannel.create('onPause');\n\n// Event to indicate a destroy lifecycle event\nchannel.create('onDestroy');\n\n// Channels that must fire before \"deviceready\" is fired.\nchannel.waitForInitialization('onCordovaReady');\nchannel.waitForInitialization('onCordovaConnectionReady');\n\nmodule.exports = channel;\n\n});\n\n//@ sourceURL=lib/com
 mon/channel.js")} catch(e) {console.log("exception: in lib/common/channel.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/channel\", function(require, exports, module) {\nvar utils = require('cordova/utils'),\n    nextGuid = 1;\n\n/**\n * Custom pub-sub \"channel\" that can have functions subscribed to it\n * This object is used to define and control firing of events for\n * cordova initialization.\n *\n * The order of events during page load and Cordova startup is as follows:\n *\n * onDOMContentLoaded         Internal event that is received when the web page is loaded and parsed.\n * onNativeReady              Internal event that indicates the Cordova native side is ready.\n * onCordovaReady             Internal event fired when all Cordova JavaScript objects have been created.\n * onCordovaInfoReady         Internal event fired when device properties are available.\n * onCordovaConnectionReady   Internal event fired when the connection property has been set.\n * onDeviceReady              User event fired to indicate that Cordova is ready\n * onResume                   Us
 er event fired to indicate a start/resume lifecycle event\n * onPause                    User event fired to indicate a pause lifecycle event\n * onDestroy                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).\n *\n * The only Cordova events that user code should register for are:\n *      deviceready           Cordova native code is initialized and Cordova APIs can be called from JavaScript\n *      pause                 App has moved to background\n *      resume                App has returned to foreground\n *\n * Listeners can be registered as:\n *      document.addEventListener(\"deviceready\", myDeviceReadyListener, false);\n *      document.addEventListener(\"resume\", myResumeListener, false);\n *      document.addEventListener(\"pause\", myPauseListener, false);\n *\n * The DOM lifecycle events should be used for saving and restoring state\n *      window.onload\n *      window.onunload\n *\n */\n\n/**\n * 
 Channel\n * @constructor\n * @param type  String the channel name\n * @param opts  Object options to pass into the channel, currently\n *                     supports:\n *                     onSubscribe: callback that fires when\n *                       something subscribes to the Channel. Sets\n *                       context to the Channel.\n *                     onUnsubscribe: callback that fires when\n *                       something unsubscribes to the Channel. Sets\n *                       context to the Channel.\n */\nvar Channel = function(type, opts) {\n    this.type = type;\n    this.handlers = {};\n    this.numHandlers = 0;\n    this.fired = false;\n    this.enabled = true;\n    this.events = {\n        onSubscribe:null,\n        onUnsubscribe:null\n    };\n    if (opts) {\n        if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe;\n        if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe;\n    }\n},\n    channel = {\n        /*
 *\n         * Calls the provided function only after all of the channels specified\n         * have been fired.\n         */\n        join: function (h, c) {\n            var i = c.length;\n            var len = i;\n            var f = function() {\n                if (!(--i)) h();\n            };\n            for (var j=0; j<len; j++) {\n                !c[j].fired?c[j].subscribeOnce(f):i--;\n            }\n            if (!i) h();\n        },\n        create: function (type, opts) {\n            channel[type] = new Channel(type, opts);\n            return channel[type];\n        },\n\n        /**\n         * cordova Channels that must fire before \"deviceready\" is fired.\n         */\n        deviceReadyChannelsArray: [],\n        deviceReadyChannelsMap: {},\n\n        /**\n         * Indicate that a feature needs to be initialized before it is ready to be used.\n         * This holds up Cordova's \"deviceready\" event until the feature has been initialized\n         * and Cordov
 a.initComplete(feature) is called.\n         *\n         * @param feature {String}     The unique feature name\n         */\n        waitForInitialization: function(feature) {\n            if (feature) {\n                var c = null;\n                if (this[feature]) {\n                    c = this[feature];\n                }\n                else {\n                    c = this.create(feature);\n                }\n                this.deviceReadyChannelsMap[feature] = c;\n                this.deviceReadyChannelsArray.push(c);\n            }\n        },\n\n        /**\n         * Indicate that initialization code has completed and the feature is ready to be used.\n         *\n         * @param feature {String}     The unique feature name\n         */\n        initializationComplete: function(feature) {\n            var c = this.deviceReadyChannelsMap[feature];\n            if (c) {\n                c.fire();\n            }\n        }\n    };\n\nfunction forceFunction(f) {\n    i
 f (f === null || f === undefined || typeof f != 'function') throw \"Function required as first argument!\";\n}\n\n/**\n * Subscribes the given function to the channel. Any time that\n * Channel.fire is called so too will the function.\n * Optionally specify an execution context for the function\n * and a guid that can be used to stop subscribing to the channel.\n * Returns the guid.\n */\nChannel.prototype.subscribe = function(f, c, g) {\n    // need a function to call\n    forceFunction(f);\n\n    var func = f;\n    if (typeof c == \"object\") { func = utils.close(c, f); }\n\n    g = g || func.observer_guid || f.observer_guid;\n    if (!g) {\n        // first time any channel has seen this subscriber\n        g = nextGuid++;\n    }\n    func.observer_guid = g;\n    f.observer_guid = g;\n\n    // Don't add the same handler more than once.\n    if (!this.handlers[g]) {\n        this.handlers[g] = func;\n        this.numHandlers++;\n        if (this.events.onSubscribe) this.events.onS
 ubscribe.call(this);\n        if (this.fired) func.apply(this, this.fireArgs);\n    }\n    return g;\n};\n\n/**\n * Like subscribe but the function is only called once and then it\n * auto-unsubscribes itself.\n */\nChannel.prototype.subscribeOnce = function(f, c) {\n    // need a function to call\n    forceFunction(f);\n\n    var g = null;\n    var _this = this;\n    if (this.fired) {\n        f.apply(c || null, this.fireArgs);\n    } else {\n        g = this.subscribe(function() {\n            _this.unsubscribe(g);\n            f.apply(c || null, arguments);\n        });\n        f.observer_guid = g;\n    }\n    return g;\n};\n\n/**\n * Unsubscribes the function with the given guid from the channel.\n */\nChannel.prototype.unsubscribe = function(g) {\n    // need a function to unsubscribe\n    if (g === null || g === undefined) { throw \"You must pass _something_ into Channel.unsubscribe\"; }\n\n    if (typeof g == 'function') { g = g.observer_guid; }\n    var handler = this.handl
 ers[g];\n    if (handler) {\n        if (handler.observer_guid) handler.observer_guid=null;\n        delete this.handlers[g];\n        this.numHandlers--;\n        if (this.events.onUnsubscribe) this.events.onUnsubscribe.call(this);\n    }\n};\n\n/**\n * Calls all functions subscribed to this channel.\n */\nChannel.prototype.fire = function(e) {\n    if (this.enabled) {\n        var fail = false;\n        this.fired = true;\n        this.fireArgs = arguments;\n        // Copy the values first so that it is safe to modify it from within\n        // callbacks.\n        var toCall = [];\n        for (var item in this.handlers) {\n            toCall.push(this.handlers[item]);\n        }\n        for (var i = 0; i < toCall.length; ++i) {\n            var rv = (toCall[i].apply(this, arguments)===false);\n            fail = fail || rv;\n        }\n        return !fail;\n    }\n    return true;\n};\n\n// defining them here so they are ready super fast!\n// DOM event that is received when th
 e web page is loaded and parsed.\nchannel.create('onDOMContentLoaded');\n\n// Event to indicate the Cordova native side is ready.\nchannel.create('onNativeReady');\n\n// Event to indicate that all Cordova JavaScript objects have been created\n// and it's time to run plugin constructors.\nchannel.create('onCordovaReady');\n\n// Event to indicate that device properties are available\nchannel.create('onCordovaInfoReady');\n\n// Event to indicate that the connection property has been set.\nchannel.create('onCordovaConnectionReady');\n\n// Event to indicate that Cordova is ready\nchannel.create('onDeviceReady');\n\n// Event to indicate a resume lifecycle event\nchannel.create('onResume');\n\n// Event to indicate a pause lifecycle event\nchannel.create('onPause');\n\n// Event to indicate a destroy lifecycle event\nchannel.create('onDestroy');\n\n// Channels that must fire before \"deviceready\" is fired.\nchannel.waitForInitialization('onCordovaReady');\nchannel.waitForInitialization('onC
 ordovaConnectionReady');\n\nmodule.exports = channel;\n\n});\n\n//@ sourceURL=lib/common/channel.js")} catch(e) {console.log("exception: in lib/common/channel.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/common\", function(require, exports, module) {\nmodule.exports = {\n    objects: {\n        cordova: {\n            path: 'cordova',\n            children: {\n                exec: {\n                    path: 'cordova/exec'\n                },\n                logger: {\n                    path: 'cordova/plugin/logger'\n                }\n            }\n        },\n        Cordova: {\n            children: {\n                exec: {\n                    path: 'cordova/exec'\n                }\n            }\n        },\n        PhoneGap:{\n            children: {\n                exec: {\n                    path: 'cordova/exec'\n                }\n            }\n        },\n        navigator: {\n            children: {\n                notification: {\n                    path: 'cordova/plugin/notification'\n                },\n                accelerometer: {\n                    path: 'cordova/plugin/accelerometer'\n                },\n              
   battery: {\n                    path: 'cordova/plugin/battery'\n                },\n                camera:{\n                    path: 'cordova/plugin/Camera'\n                },\n                compass:{\n                    path: 'cordova/plugin/compass'\n                },\n                contacts: {\n                    path: 'cordova/plugin/contacts'\n                },\n                device:{\n                    children:{\n                        capture: {\n                            path: 'cordova/plugin/capture'\n                        }\n                    }\n                },\n                geolocation: {\n                    path: 'cordova/plugin/geolocation'\n                },\n                network: {\n                    children: {\n                        connection: {\n                            path: 'cordova/plugin/network'\n                        }\n                    }\n                },\n                splashscreen: {\n                  
   path: 'cordova/plugin/splashscreen'\n                }\n            }\n        },\n        Acceleration: {\n            path: 'cordova/plugin/Acceleration'\n        },\n        Camera:{\n            path: 'cordova/plugin/CameraConstants'\n        },\n        CameraPopoverOptions: {\n            path: 'cordova/plugin/CameraPopoverOptions'\n        },\n        CaptureError: {\n            path: 'cordova/plugin/CaptureError'\n        },\n        CaptureAudioOptions:{\n            path: 'cordova/plugin/CaptureAudioOptions'\n        },\n        CaptureImageOptions: {\n            path: 'cordova/plugin/CaptureImageOptions'\n        },\n        CaptureVideoOptions: {\n            path: 'cordova/plugin/CaptureVideoOptions'\n        },\n        CompassHeading:{\n            path: 'cordova/plugin/CompassHeading'\n        },\n        CompassError:{\n            path: 'cordova/plugin/CompassError'\n        },\n        ConfigurationData: {\n            path: 'cordova/plugin/ConfigurationData'\
 n        },\n        Connection: {\n            path: 'cordova/plugin/Connection'\n        },\n        Contact: {\n            path: 'cordova/plugin/Contact'\n        },\n        ContactAddress: {\n            path: 'cordova/plugin/ContactAddress'\n        },\n        ContactError: {\n            path: 'cordova/plugin/ContactError'\n        },\n        ContactField: {\n            path: 'cordova/plugin/ContactField'\n        },\n        ContactFindOptions: {\n            path: 'cordova/plugin/ContactFindOptions'\n        },\n        ContactName: {\n            path: 'cordova/plugin/ContactName'\n        },\n        ContactOrganization: {\n            path: 'cordova/plugin/ContactOrganization'\n        },\n        Coordinates: {\n            path: 'cordova/plugin/Coordinates'\n        },\n        device: {\n            path: 'cordova/plugin/device'\n        },\n        DirectoryEntry: {\n            path: 'cordova/plugin/DirectoryEntry'\n        },\n        DirectoryReader: {\n      
       path: 'cordova/plugin/DirectoryReader'\n        },\n        Entry: {\n            path: 'cordova/plugin/Entry'\n        },\n        File: {\n            path: 'cordova/plugin/File'\n        },\n        FileEntry: {\n            path: 'cordova/plugin/FileEntry'\n        },\n        FileError: {\n            path: 'cordova/plugin/FileError'\n        },\n        FileReader: {\n            path: 'cordova/plugin/FileReader'\n        },\n        FileSystem: {\n            path: 'cordova/plugin/FileSystem'\n        },\n        FileTransfer: {\n            path: 'cordova/plugin/FileTransfer'\n        },\n        FileTransferError: {\n            path: 'cordova/plugin/FileTransferError'\n        },\n        FileUploadOptions: {\n            path: 'cordova/plugin/FileUploadOptions'\n        },\n        FileUploadResult: {\n            path: 'cordova/plugin/FileUploadResult'\n        },\n        FileWriter: {\n            path: 'cordova/plugin/FileWriter'\n        },\n        Flags: {\n 
            path: 'cordova/plugin/Flags'\n        },\n        LocalFileSystem: {\n            path: 'cordova/plugin/LocalFileSystem'\n        },\n        Media: {\n            path: 'cordova/plugin/Media'\n        },\n        MediaError: {\n            path: 'cordova/plugin/MediaError'\n        },\n        MediaFile: {\n            path: 'cordova/plugin/MediaFile'\n        },\n        MediaFileData:{\n            path: 'cordova/plugin/MediaFileData'\n        },\n        Metadata:{\n            path: 'cordova/plugin/Metadata'\n        },\n        Position: {\n            path: 'cordova/plugin/Position'\n        },\n        PositionError: {\n            path: 'cordova/plugin/PositionError'\n        },\n        ProgressEvent: {\n            path: 'cordova/plugin/ProgressEvent'\n        },\n        requestFileSystem:{\n            path: 'cordova/plugin/requestFileSystem'\n        },\n        resolveLocalFileSystemURI:{\n            path: 'cordova/plugin/resolveLocalFileSystemURI'\n      
   }\n    }\n};\n\n});\n\n//@ sourceURL=lib/common/common.js")} catch(e) {console.log("exception: in lib/common/common.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/exec\", function(require, exports, module) {\n/**\n * Execute a cordova command.  It is up to the native side whether this action\n * is synchronous or asynchronous.  The native side can return:\n *      Synchronous: PluginResult object as a JSON string\n *      Asynchrounous: Empty string \"\"\n * If async, the native side will cordova.callbackSuccess or cordova.callbackError,\n * depending upon the result of the action.\n *\n * @param {Function} successCB  The success callback\n * @param {Function} failCB     The fail callback\n * @param {String} service      The name of the service to use\n * @param {String} action       Action to be run in cordova\n * @param {String[]} [args]     Zero or more arguments to pass to the method\n */\n\nvar tizen = require('cordova/plugin/tizen/manager'),\n    cordova = require('cordova'),\n    utils = require('cordova/utils');\n\nmodule.exports = function(successCB, failCB, service, action, args) {\n\n    try {\n        v
 ar v = tizen.exec(successCB, failCB, service, action, args);\n\n        // If status is OK, then return value back to caller\n        if (v.status == cordova.callbackStatus.OK) {\n\n            // If there is a success callback, then call it now with returned value\n            if (successCB) {\n                try {\n                    successCB(v.message);\n                }\n                catch (e) {\n                    console.log(\"Error in success callback: \"+ service + \".\" + action + \" = \" + e);\n                }\n\n            }\n            return v.message;\n        } else if (v.status == cordova.callbackStatus.NO_RESULT) {\n            // Nothing to do here\n        } else {\n            // If error, then display error\n            console.log(\"Error: \" + service + \".\" + action + \" Status=\" + v.status + \" Message=\" + v.message);\n\n            // If there is a fail callback, then call it now with returned value\n            if (failCB) {\n               
  try {\n                    failCB(v.message);\n                }\n                catch (e) {\n                    console.log(\"Error in error callback: \" + service + \".\" + action + \" = \"+e);\n                }\n            }\n            return null;\n        }\n    } catch (e) {\n        utils.alert(\"Error: \" + e);\n    }\n};\n\n});\n\n//@ sourceURL=lib/tizen/exec.js")} catch(e) {console.log("exception: in lib/tizen/exec.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/exec\", function(require, exports, module) {\n/**\n * Execute a cordova command.  It is up to the native side whether this action\n * is synchronous or asynchronous.  The native side can return:\n *      Synchronous: PluginResult object as a JSON string\n *      Asynchronous: Empty string \"\"\n * If async, the native side will cordova.callbackSuccess or cordova.callbackError,\n * depending upon the result of the action.\n *\n * @param {Function} successCB  The success callback\n * @param {Function} failCB     The fail callback\n * @param {String} service      The name of the service to use\n * @param {String} action       Action to be run in cordova\n * @param {String[]} [args]     Zero or more arguments to pass to the method\n */\n\nvar tizen = require('cordova/plugin/tizen/manager'),\n    cordova = require('cordova'),\n    utils = require('cordova/utils');\n\nmodule.exports = function(successCB, failCB, service, action, args) {\n\n    try {\n        va
 r v = tizen.exec(successCB, failCB, service, action, args);\n\n        // If status is OK, then return value back to caller\n        if (v.status == cordova.callbackStatus.OK) {\n\n            // If there is a success callback, then call it now with returned value\n            if (successCB) {\n                try {\n                    successCB(v.message);\n                }\n                catch (e) {\n                    console.log(\"Error in success callback: \"+ service + \".\" + action + \" = \" + e);\n                }\n\n            }\n            return v.message;\n        } else if (v.status == cordova.callbackStatus.NO_RESULT) {\n            // Nothing to do here\n        } else {\n            // If error, then display error\n            console.log(\"Error: \" + service + \".\" + action + \" Status=\" + v.status + \" Message=\" + v.message);\n\n            // If there is a fail callback, then call it now with returned value\n            if (failCB) {\n                
 try {\n                    failCB(v.message);\n                }\n                catch (e) {\n                    console.log(\"Error in error callback: \" + service + \".\" + action + \" = \"+e);\n                }\n            }\n            return null;\n        }\n    } catch (e) {\n        utils.alert(\"Error: \" + e);\n    }\n};\n\n});\n\n//@ sourceURL=lib/tizen/exec.js")} catch(e) {console.log("exception: in lib/tizen/exec.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/platform\", function(require, exports, module) {\nmodule.exports = {\n    id: \"tizen\",\n    initialize: function() {},\n    objects: {\n        device: {\n            path: \"cordova/plugin/tizen/Device\"\n        },\n        File: { // exists natively, override\n            path: \"cordova/plugin/File\"\n        },\n        FileReader: { // exists natively, override\n            path: \"cordova/plugin/FileReader\"\n        },\n        FileError: { //exists natively, override\n            path: \"cordova/plugin/FileError\"\n        }\n    },\n    merges: {\n        MediaError: { // exists natively\n            path: \"cordova/plugin/tizen/MediaError\"\n        },\n        navigator: {\n            children: {\n                device: {\n                    path: \"cordova/plugin/tizen/Device\"\n                },\n                contacts: {\n                    path: \"cordova/plugin/tizen/contacts\"\n                },\n               notification: {\
 n                   path: \"cordova/plugin/tizen/Notification\"\n               }\n            }\n        },\n        Contact: {\n            path: \"cordova/plugin/tizen/Contact\"\n        }\n    }\n};\n\n});\n\n//@ sourceURL=lib/tizen/platform.js")} catch(e) {console.log("exception: in lib/tizen/platform.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/Acceleration\", function(require, exports, module) {\nvar Acceleration = function(x, y, z, timestamp) {\n    this.x = x;\n    this.y = y;\n    this.z = z;\n    this.timestamp = timestamp || (new Date()).getTime();\n};\n\nmodule.exports = Acceleration;\n\n});\n\n//@ sourceURL=lib/common/plugin/Acceleration.js")} catch(e) {console.log("exception: in lib/common/plugin/Acceleration.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/Camera\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    Camera = require('cordova/plugin/CameraConstants');\n\nvar cameraExport = {};\n\n// Tack on the Camera Constants to the base camera plugin.\nfor (var key in Camera) {\n    cameraExport[key] = Camera[key];\n}\n\n/**\n * Gets a picture from source defined by \"options.sourceType\", and returns the\n * image as defined by the \"options.destinationType\" option.\n\n * The defaults are sourceType=CAMERA and destinationType=FILE_URI.\n *\n * @param {Function} successCallback\n * @param {Function} errorCallback\n * @param {Object} options\n */\ncameraExport.getPicture = function(successCallback, errorCallback, options) {\n    // successCallback required\n    if (typeof successCallback != \"function\") {\n        console.log(\"Camera Error: successCallback is not a function\");\n        return;\n    }\n\n    // errorCallback optional\n    if (errorCallback && (typeof e
 rrorCallback != \"function\")) {\n        console.log(\"Camera Error: errorCallback is not a function\");\n        return;\n    }\n\n    var quality = 50;\n    if (options && typeof options.quality == \"number\") {\n        quality = options.quality;\n    } else if (options && typeof options.quality == \"string\") {\n        var qlity = parseInt(options.quality, 10);\n        if (isNaN(qlity) === false) {\n            quality = qlity.valueOf();\n        }\n    }\n\n    var destinationType = Camera.DestinationType.FILE_URI;\n    if (typeof options.destinationType == \"number\") {\n        destinationType = options.destinationType;\n    }\n\n    var sourceType = Camera.PictureSourceType.CAMERA;\n    if (typeof options.sourceType == \"number\") {\n        sourceType = options.sourceType;\n    }\n\n    var targetWidth = -1;\n    if (typeof options.targetWidth == \"number\") {\n        targetWidth = options.targetWidth;\n    } else if (typeof options.targetWidth == \"string\") {\n       
  var width = parseInt(options.targetWidth, 10);\n        if (isNaN(width) === false) {\n            targetWidth = width.valueOf();\n        }\n    }\n\n    var targetHeight = -1;\n    if (typeof options.targetHeight == \"number\") {\n        targetHeight = options.targetHeight;\n    } else if (typeof options.targetHeight == \"string\") {\n        var height = parseInt(options.targetHeight, 10);\n        if (isNaN(height) === false) {\n            targetHeight = height.valueOf();\n        }\n    }\n\n    var encodingType = Camera.EncodingType.JPEG;\n    if (typeof options.encodingType == \"number\") {\n        encodingType = options.encodingType;\n    }\n\n    var mediaType = Camera.MediaType.PICTURE;\n    if (typeof options.mediaType == \"number\") {\n        mediaType = options.mediaType;\n    }\n    var allowEdit = false;\n    if (typeof options.allowEdit == \"boolean\") {\n        allowEdit = options.allowEdit;\n    } else if (typeof options.allowEdit == \"number\") {\n        al
 lowEdit = options.allowEdit <= 0 ? false : true;\n    }\n    var correctOrientation = false;\n    if (typeof options.correctOrientation == \"boolean\") {\n        correctOrientation = options.correctOrientation;\n    } else if (typeof options.correctOrientation == \"number\") {\n        correctOrientation = options.correctOrientation <=0 ? false : true;\n    }\n    var saveToPhotoAlbum = false;\n    if (typeof options.saveToPhotoAlbum == \"boolean\") {\n        saveToPhotoAlbum = options.saveToPhotoAlbum;\n    } else if (typeof options.saveToPhotoAlbum == \"number\") {\n        saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true;\n    }\n    var popoverOptions = null;\n    if (typeof options.popoverOptions == \"object\") {\n        popoverOptions = options.popoverOptions;\n    }\n\n    var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,\n                mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions];\n\n 
    exec(successCallback, errorCallback, \"Camera\", \"takePicture\", args);\n};\n\ncameraExport.cleanup = function(successCallback, errorCallback) {\n    exec(successCallback, errorCallback, \"Camera\", \"cleanup\", []);\n};\n\nmodule.exports = cameraExport;\n});\n\n//@ sourceURL=lib/common/plugin/Camera.js")} catch(e) {console.log("exception: in lib/common/plugin/Camera.js: " + e);console.log(e.stack);}
@@ -58,30 +58,31 @@ try {eval("define(\"cordova/plugin/FileEntry\", function(require, exports, modul
 try {eval("define(\"cordova/plugin/FileError\", function(require, exports, module) {\n/**\n * FileError\n */\nfunction FileError(error) {\n  this.code = error || null;\n}\n\n// File error codes\n// Found in DOMException\nFileError.NOT_FOUND_ERR = 1;\nFileError.SECURITY_ERR = 2;\nFileError.ABORT_ERR = 3;\n\n// Added by File API specification\nFileError.NOT_READABLE_ERR = 4;\nFileError.ENCODING_ERR = 5;\nFileError.NO_MODIFICATION_ALLOWED_ERR = 6;\nFileError.INVALID_STATE_ERR = 7;\nFileError.SYNTAX_ERR = 8;\nFileError.INVALID_MODIFICATION_ERR = 9;\nFileError.QUOTA_EXCEEDED_ERR = 10;\nFileError.TYPE_MISMATCH_ERR = 11;\nFileError.PATH_EXISTS_ERR = 12;\n\nmodule.exports = FileError;\n});\n\n//@ sourceURL=lib/common/plugin/FileError.js")} catch(e) {console.log("exception: in lib/common/plugin/FileError.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/FileReader\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    FileError = require('cordova/plugin/FileError'),\n    ProgressEvent = require('cordova/plugin/ProgressEvent');\n\n/**\n * This class reads the mobile device file system.\n *\n * For Android:\n *      The root directory is the root of the file system.\n *      To read from the SD card, the file name is \"sdcard/my_file.txt\"\n * @constructor\n */\nvar FileReader = function() {\n    this.fileName = \"\";\n\n    this.readyState = 0; // FileReader.EMPTY\n\n    // File data\n    this.result = null;\n\n    // Error\n    this.error = null;\n\n    // Event handlers\n    this.onloadstart = null;    // When the read starts.\n    this.onprogress = null;     // While reading (and decoding) file or fileBlob data, and reporting partial file data (progess.loaded/progress.total)\n    this.onload = null;         // When the read has successfully completed.\n    this.onerror
  = null;        // When the read has failed (see errors).\n    this.onloadend = null;      // When the request has completed (either in success or failure).\n    this.onabort = null;        // When the read has been aborted. For instance, by invoking the abort() method.\n};\n\n// States\nFileReader.EMPTY = 0;\nFileReader.LOADING = 1;\nFileReader.DONE = 2;\n\n/**\n * Abort reading file.\n */\nFileReader.prototype.abort = function() {\n    this.result = null;\n\n    if (this.readyState == FileReader.DONE || this.readyState == FileReader.EMPTY) {\n      return;\n    }\n\n    this.readyState = FileReader.DONE;\n\n    // If abort callback\n    if (typeof this.onabort === 'function') {\n        this.onabort(new ProgressEvent('abort', {target:this}));\n    }\n    // If load end callback\n    if (typeof this.onloadend === 'function') {\n        this.onloadend(new ProgressEvent('loadend', {target:this}));\n    }\n};\n\n/**\n * Read text file.\n *\n * @param file          {File} File object c
 ontaining file properties\n * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)\n */\nFileReader.prototype.readAsText = function(file, encoding) {\n    // Figure out pathing\n    this.fileName = '';\n    if (typeof file.fullPath === 'undefined') {\n        this.fileName = file;\n    } else {\n        this.fileName = file.fullPath;\n    }\n\n    // Already loading something\n    if (this.readyState == FileReader.LOADING) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === \"function\") {\n        this.onloadstart(new ProgressEvent(\"loadstart\", {target:this}));\n    }\n\n    // Default encoding is UTF-8\n    var enc = encoding ? encoding : \"UTF-8\";\n\n    var me = this;\n\n    // Read file\n    exec(\n        // Success callback\n        function(r) {\n            // If DONE (cancelled), then don'
 t do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // Save result\n            me.result = r;\n\n            // If onload callback\n            if (typeof me.onload === \"function\") {\n                me.onload(new ProgressEvent(\"load\", {target:me}));\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // If onloadend callback\n            if (typeof me.onloadend === \"function\") {\n                me.onloadend(new ProgressEvent(\"loadend\", {target:me}));\n            }\n        },\n        // Error callback\n        function(e) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // null result\n            me.result = null;\n\n            // Save error\n          
   me.error = new FileError(e);\n\n            // If onerror callback\n            if (typeof me.onerror === \"function\") {\n                me.onerror(new ProgressEvent(\"error\", {target:me}));\n            }\n\n            // If onloadend callback\n            if (typeof me.onloadend === \"function\") {\n                me.onloadend(new ProgressEvent(\"loadend\", {target:me}));\n            }\n        }, \"File\", \"readAsText\", [this.fileName, enc]);\n};\n\n\n/**\n * Read file and return data as a base64 encoded data url.\n * A data url is of the form:\n *      data:[<mediatype>][;base64],<data>\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsDataURL = function(file) {\n    this.fileName = \"\";\n    if (typeof file.fullPath === \"undefined\") {\n        this.fileName = file;\n    } else {\n        this.fileName = file.fullPath;\n    }\n\n    // Already loading something\n    if (this.readyState == FileReader.LOADING) 
 {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // LOADING state\n    this.readyState = FileReader.LOADING;\n\n    // If loadstart callback\n    if (typeof this.onloadstart === \"function\") {\n        this.onloadstart(new ProgressEvent(\"loadstart\", {target:this}));\n    }\n\n    var me = this;\n\n    // Read file\n    exec(\n        // Success callback\n        function(r) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            // Save result\n            me.result = r;\n\n            // If onload callback\n            if (typeof me.onload === \"function\") {\n                me.onload(new ProgressEvent(\"load\", {target:me}));\n            }\n\n            // If onloadend callback\n            if (typeof me.onloadend === \"function\") {\n                me.onloadend
 (new ProgressEvent(\"loadend\", {target:me}));\n            }\n        },\n        // Error callback\n        function(e) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileReader.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileReader.DONE;\n\n            me.result = null;\n\n            // Save error\n            me.error = new FileError(e);\n\n            // If onerror callback\n            if (typeof me.onerror === \"function\") {\n                me.onerror(new ProgressEvent(\"error\", {target:me}));\n            }\n\n            // If onloadend callback\n            if (typeof me.onloadend === \"function\") {\n                me.onloadend(new ProgressEvent(\"loadend\", {target:me}));\n            }\n        }, \"File\", \"readAsDataURL\", [this.fileName]);\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          {File} File object contai
 ning file properties\n */\nFileReader.prototype.readAsBinaryString = function(file) {\n    // TODO - Can't return binary data to browser.\n    console.log('method \"readAsBinaryString\" is not supported at this time.');\n};\n\n/**\n * Read file and return data as a binary data.\n *\n * @param file          {File} File object containing file properties\n */\nFileReader.prototype.readAsArrayBuffer = function(file) {\n    // TODO - Can't return binary data to browser.\n    console.log('This method is not supported at this time.');\n};\n\nmodule.exports = FileReader;\n});\n\n//@ sourceURL=lib/common/plugin/FileReader.js")} catch(e) {console.log("exception: in lib/common/plugin/FileReader.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/FileSystem\", function(require, exports, module) {\nvar DirectoryEntry = require('cordova/plugin/DirectoryEntry');\n\n/**\n * An interface representing a file system\n *\n * @constructor\n * {DOMString} name the unique name of the file system (readonly)\n * {DirectoryEntry} root directory of the file system (readonly)\n */\nvar FileSystem = function(name, root) {\n    this.name = name || null;\n    if (root) {\n        this.root = new DirectoryEntry(root.name, root.fullPath);\n    }\n};\n\nmodule.exports = FileSystem;\n\n});\n\n//@ sourceURL=lib/common/plugin/FileSystem.js")} catch(e) {console.log("exception: in lib/common/plugin/FileSystem.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/plugin/FileTransfer\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    FileTransferError = require('cordova/plugin/FileTransferError');\n\n/**\n * FileTransfer uploads a file to a remote server.\n * @constructor\n */\nvar FileTransfer = function() {};\n\n/**\n* Given an absolute file path, uploads a file on the device to a remote server\n* using a multipart HTTP request.\n* @param filePath {String}           Full path of the file on the device\n* @param server {String}             URL of the server to receive the file\n* @param successCallback (Function}  Callback to be invoked when upload has completed\n* @param errorCallback {Function}    Callback to be invoked upon error\n* @param options {FileUploadOptions} Optional parameters such as file name and mimetype\n* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false\n*/\nFileTransfer.prototype.upload = function(filePath, ser
 ver, successCallback, errorCallback, options, trustAllHosts) {\n    // sanity parameter checking\n    if (!filePath || !server) throw new Error(\"FileTransfer.upload requires filePath and server URL parameters at the minimum.\");\n    // check for options\n    var fileKey = null;\n    var fileName = null;\n    var mimeType = null;\n    var params = null;\n    var chunkedMode = true;\n    if (options) {\n        fileKey = options.fileKey;\n        fileName = options.fileName;\n        mimeType = options.mimeType;\n        if (options.chunkedMode !== null || typeof options.chunkedMode != \"undefined\") {\n            chunkedMode = options.chunkedMode;\n        }\n        if (options.params) {\n            params = options.params;\n        }\n        else {\n            params = {};\n        }\n    }\n\n    var fail = function(e) {\n        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);\n        errorCallback(error);\n    };\n\n    exec(successCallback, f
 ail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]);\n};\n\n/**\n * Downloads a file form a given URL and saves it to the specified directory.\n * @param source {String}          URL of the server to receive the file\n * @param target {String}         Full path of the file on the device\n * @param successCallback (Function}  Callback to be invoked when upload has completed\n * @param errorCallback {Function}    Callback to be invoked upon error\n */\nFileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {\n    // sanity parameter checking\n    if (!source || !target) throw new Error(\"FileTransfer.download requires source URI and target URI parameters at the minimum.\");\n    var win = function(result) {\n        var entry = null;\n        if (result.isDirectory) {\n            entry = new (require('cordova/plugin/DirectoryEntry'))();\n        }\n        else if (result.isFile) {\n  
           entry = new (require('cordova/plugin/FileEntry'))();\n        }\n        entry.isDirectory = result.isDirectory;\n        entry.isFile = result.isFile;\n        entry.name = result.name;\n        entry.fullPath = result.fullPath;\n        successCallback(entry);\n    };\n\n    var fail = function(e) {\n        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);\n        errorCallback(error);\n    };\n\n    exec(win, errorCallback, 'FileTransfer', 'download', [source, target]);\n};\n\nmodule.exports = FileTransfer;\n\n});\n\n//@ sourceURL=lib/common/plugin/FileTransfer.js")} catch(e) {console.log("exception: in lib/common/plugin/FileTransfer.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/plugin/FileTransfer\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    FileTransferError = require('cordova/plugin/FileTransferError');\n\n/**\n * FileTransfer uploads a file to a remote server.\n * @constructor\n */\nvar FileTransfer = function() {};\n\n/**\n* Given an absolute file path, uploads a file on the device to a remote server\n* using a multipart HTTP request.\n* @param filePath {String}           Full path of the file on the device\n* @param server {String}             URL of the server to receive the file\n* @param successCallback (Function}  Callback to be invoked when upload has completed\n* @param errorCallback {Function}    Callback to be invoked upon error\n* @param options {FileUploadOptions} Optional parameters such as file name and mimetype\n* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false\n*/\nFileTransfer.prototype.upload = function(filePath, ser
 ver, successCallback, errorCallback, options, trustAllHosts) {\n    // sanity parameter checking\n    if (!filePath || !server) throw new Error(\"FileTransfer.upload requires filePath and server URL parameters at the minimum.\");\n    // check for options\n    var fileKey = null;\n    var fileName = null;\n    var mimeType = null;\n    var params = null;\n    var chunkedMode = true;\n    var headers = null;\n    if (options) {\n        fileKey = options.fileKey;\n        fileName = options.fileName;\n        mimeType = options.mimeType;\n        headers = options.headers;\n        if (options.chunkedMode !== null || typeof options.chunkedMode != \"undefined\") {\n            chunkedMode = options.chunkedMode;\n        }\n        if (options.params) {\n            params = options.params;\n        }\n        else {\n            params = {};\n        }\n    }\n\n    var fail = function(e) {\n        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);\n       
  errorCallback(error);\n    };\n\n    exec(successCallback, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers]);\n};\n\n/**\n * Downloads a file form a given URL and saves it to the specified directory.\n * @param source {String}          URL of the server to receive the file\n * @param target {String}         Full path of the file on the device\n * @param successCallback (Function}  Callback to be invoked when upload has completed\n * @param errorCallback {Function}    Callback to be invoked upon error\n */\nFileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {\n    // sanity parameter checking\n    if (!source || !target) throw new Error(\"FileTransfer.download requires source URI and target URI parameters at the minimum.\");\n    var win = function(result) {\n        var entry = null;\n        if (result.isDirectory) {\n            entry = new (require('cordova/plugin/
 DirectoryEntry'))();\n        }\n        else if (result.isFile) {\n            entry = new (require('cordova/plugin/FileEntry'))();\n        }\n        entry.isDirectory = result.isDirectory;\n        entry.isFile = result.isFile;\n        entry.name = result.name;\n        entry.fullPath = result.fullPath;\n        successCallback(entry);\n    };\n\n    var fail = function(e) {\n        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);\n        errorCallback(error);\n    };\n\n    exec(win, errorCallback, 'FileTransfer', 'download', [source, target]);\n};\n\nmodule.exports = FileTransfer;\n\n});\n\n//@ sourceURL=lib/common/plugin/FileTransfer.js")} catch(e) {console.log("exception: in lib/common/plugin/FileTransfer.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/FileTransferError\", function(require, exports, module) {\n/**\n * FileTransferError\n * @constructor\n */\nvar FileTransferError = function(code, source, target, status) {\n    this.code = code || null;\n    this.source = source || null;\n    this.target = target || null;\n    this.http_status = status || null;\n};\n\nFileTransferError.FILE_NOT_FOUND_ERR = 1;\nFileTransferError.INVALID_URL_ERR = 2;\nFileTransferError.CONNECTION_ERR = 3;\n\nmodule.exports = FileTransferError;\n\n});\n\n//@ sourceURL=lib/common/plugin/FileTransferError.js")} catch(e) {console.log("exception: in lib/common/plugin/FileTransferError.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/plugin/FileUploadOptions\", function(require, exports, module) {\n/**\n * Options to customize the HTTP request used to upload files.\n * @constructor\n * @param fileKey {String}   Name of file request parameter.\n * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.\n * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.\n * @param params {Object}    Object with key: value params to send to the server.\n */\nvar FileUploadOptions = function(fileKey, fileName, mimeType, params) {\n    this.fileKey = fileKey || null;\n    this.fileName = fileName || null;\n    this.mimeType = mimeType || null;\n    this.params = params || null;\n};\n\nmodule.exports = FileUploadOptions;\n});\n\n//@ sourceURL=lib/common/plugin/FileUploadOptions.js")} catch(e) {console.log("exception: in lib/common/plugin/FileUploadOptions.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/plugin/FileUploadOptions\", function(require, exports, module) {\n/**\n * Options to customize the HTTP request used to upload files.\n * @constructor\n * @param fileKey {String}   Name of file request parameter.\n * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.\n * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.\n * @param params {Object}    Object with key: value params to send to the server.\n * @param headers {Object}   Keys are header names, values are header values. Multiple\n *                           headers of the same name are not supported.\n */\nvar FileUploadOptions = function(fileKey, fileName, mimeType, params, headers) {\n    this.fileKey = fileKey || null;\n    this.fileName = fileName || null;\n    this.mimeType = mimeType || null;\n    this.params = params || null;\n    this.headers = headers || null;\n};\n\nmodule.exports = FileUploadOptions;\n\n});\n\n//@ sourceU
 RL=lib/common/plugin/FileUploadOptions.js")} catch(e) {console.log("exception: in lib/common/plugin/FileUploadOptions.js: " + e);console.log(e.stack);}
 try {eval("define(\"cordova/plugin/FileUploadResult\", function(require, exports, module) {\n/**\n * FileUploadResult\n * @constructor\n */\nvar FileUploadResult = function() {\n    this.bytesSent = 0;\n    this.responseCode = null;\n    this.response = null;\n};\n\nmodule.exports = FileUploadResult;\n});\n\n//@ sourceURL=lib/common/plugin/FileUploadResult.js")} catch(e) {console.log("exception: in lib/common/plugin/FileUploadResult.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/plugin/FileWriter\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    FileError = require('cordova/plugin/FileError'),\n    ProgressEvent = require('cordova/plugin/ProgressEvent');\n\n/**\n * This class writes to the mobile device file system.\n *\n * For Android:\n *      The root directory is the root of the file system.\n *      To write to the SD card, the file name is \"sdcard/my_file.txt\"\n *\n * @constructor\n * @param file {File} File object containing file properties\n * @param append if true write to the end of the file, otherwise overwrite the file\n */\nvar FileWriter = function(file) {\n    this.fileName = \"\";\n    this.length = 0;\n    if (file) {\n        this.fileName = file.fullPath || file;\n        this.length = file.size || 0;\n    }\n    // default is to write at the beginning of the file\n    this.position = 0;\n\n    this.readyState = 0; // EMPTY\n\n    this.result = null;\n\n    // Error\n    this.e
 rror = null;\n\n    // Event handlers\n    this.onwritestart = null;   // When writing starts\n    this.onprogress = null;     // While writing the file, and reporting partial file data\n    this.onwrite = null;        // When the write has successfully completed.\n    this.onwriteend = null;     // When the request has completed (either in success or failure).\n    this.onabort = null;        // When the write has been aborted. For instance, by invoking the abort() method.\n    this.onerror = null;        // When the write has failed (see errors).\n};\n\n// States\nFileWriter.INIT = 0;\nFileWriter.WRITING = 1;\nFileWriter.DONE = 2;\n\n/**\n * Abort writing file.\n */\nFileWriter.prototype.abort = function() {\n    // check for invalid state\n    if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // set error\n    this.error = new FileError(FileError.ABORT_ERR);\n\n    this.readyS
 tate = FileWriter.DONE;\n\n    // If abort callback\n    if (typeof this.onabort === \"function\") {\n        this.onabort(new ProgressEvent(\"abort\", {\"target\":this}));\n    }\n\n    // If write end callback\n    if (typeof this.onwriteend === \"function\") {\n        this.onwriteend(new ProgressEvent(\"writeend\", {\"target\":this}));\n    }\n};\n\n/**\n * Writes data to the file\n *\n * @param text to be written\n */\nFileWriter.prototype.write = function(text) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === \"function\") {\n        me.onwritestart(new ProgressEvent(\"writestart\", {\"target\":me}));\n    }\n\n    // Write file\n    exec(\n        // Success callback\n        function(r) {\n
             // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // position always increases by bytes written because file would be extended\n            me.position += r;\n            // The length of the file is now where we are done writing.\n\n            me.length = me.position;\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // If onwrite callback\n            if (typeof me.onwrite === \"function\") {\n                me.onwrite(new ProgressEvent(\"write\", {\"target\":me}));\n            }\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === \"function\") {\n                me.onwriteend(new ProgressEvent(\"writeend\", {\"target\":me}));\n            }\n        },\n        // Error callback\n        function(e) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState 
 === FileWriter.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // Save error\n            me.error = new FileError(e);\n\n            // If onerror callback\n            if (typeof me.onerror === \"function\") {\n                me.onerror(new ProgressEvent(\"error\", {\"target\":me}));\n            }\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === \"function\") {\n                me.onwriteend(new ProgressEvent(\"writeend\", {\"target\":me}));\n            }\n        }, \"File\", \"write\", [this.fileName, text, this.position]);\n};\n\n/**\n * Moves the file pointer to the location specified.\n *\n * If the offset is a negative number the position of the file\n * pointer is rewound.  If the offset is greater than the file\n * size the position is set to the end of the file.\n *\n * @param offset is the location to move the file pointer to.\n */\nFileWriter.pr
 ototype.seek = function(offset) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    if (!offset && offset !== 0) {\n        return;\n    }\n\n    // See back from end of file.\n    if (offset < 0) {\n        this.position = Math.max(offset + this.length, 0);\n    }\n    // Offset is bigger then file size so set position\n    // to the end of the file.\n    else if (offset > this.length) {\n        this.position = this.length;\n    }\n    // Offset is between 0 and file size so set the position\n    // to start writing.\n    else {\n        this.position = offset;\n    }\n};\n\n/**\n * Truncates the file to the size specified.\n *\n * @param size to chop the file at.\n */\nFileWriter.prototype.truncate = function(size) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw new Fil
 eError(FileError.INVALID_STATE_ERR);\n    }\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === \"function\") {\n        me.onwritestart(new ProgressEvent(\"writestart\", {\"target\":this}));\n    }\n\n    // Write file\n    exec(\n        // Success callback\n        function(r) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // Update the length of the file\n            me.length = r;\n            me.position = Math.min(me.position, r);\n\n            // If onwrite callback\n            if (typeof me.onwrite === \"function\") {\n                me.onwrite(new ProgressEvent(\"write\", {\"target\":me}));\n            }\n\n            // If onwriteend callback\n            if (typeof
  me.onwriteend === \"function\") {\n                me.onwriteend(new ProgressEvent(\"writeend\", {\"target\":me}));\n            }\n        },\n        // Error callback\n        function(e) {\n            // If DONE (cancelled), then don't do anything\n            if (me.readyState === FileWriter.DONE) {\n                return;\n            }\n\n            // DONE state\n            me.readyState = FileWriter.DONE;\n\n            // Save error\n            me.error = new FileError(e);\n\n            // If onerror callback\n            if (typeof me.onerror === \"function\") {\n                me.onerror(new ProgressEvent(\"error\", {\"target\":me}));\n            }\n\n            // If onwriteend callback\n            if (typeof me.onwriteend === \"function\") {\n                me.onwriteend(new ProgressEvent(\"writeend\", {\"target\":me}));\n            }\n        }, \"File\", \"truncate\", [this.fileName, size]);\n};\n\nmodule.exports = FileWriter;\n\n});\n\n//@ sourceURL=lib
 /common/plugin/FileWriter.js")} catch(e) {console.log("exception: in lib/common/plugin/FileWriter.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/plugin/FileWriter\", function(require, exports, module) {\nvar exec = require('cordova/exec'),\n    FileError = require('cordova/plugin/FileError'),\n    ProgressEvent = require('cordova/plugin/ProgressEvent');\n\n/**\n * This class writes to the mobile device file system.\n *\n * For Android:\n *      The root directory is the root of the file system.\n *      To write to the SD card, the file name is \"sdcard/my_file.txt\"\n *\n * @constructor\n * @param file {File} File object containing file properties\n * @param append if true write to the end of the file, otherwise overwrite the file\n */\nvar FileWriter = function(file) {\n    this.fileName = \"\";\n    this.length = 0;\n    if (file) {\n        this.fileName = file.fullPath || file;\n        this.length = file.size || 0;\n    }\n    // default is to write at the beginning of the file\n    this.position = 0;\n\n    this.readyState = 0; // EMPTY\n\n    this.result = null;\n\n    // Error\n    this.e
 rror = null;\n\n    // Event handlers\n    this.onwritestart = null;   // When writing starts\n    this.onprogress = null;     // While writing the file, and reporting partial file data\n    this.onwrite = null;        // When the write has successfully completed.\n    this.onwriteend = null;     // When the request has completed (either in success or failure).\n    this.onabort = null;        // When the write has been aborted. For instance, by invoking the abort() method.\n    this.onerror = null;        // When the write has failed (see errors).\n};\n\n// States\nFileWriter.INIT = 0;\nFileWriter.WRITING = 1;\nFileWriter.DONE = 2;\n\n/**\n * Abort writing file.\n */\nFileWriter.prototype.abort = function() {\n    // check for invalid state\n    if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // set error\n    this.error = new FileError(FileError.ABORT_ERR);\n\n    this.readyS
 tate = FileWriter.DONE;\n\n    // If abort callback\n    if (typeof this.onabort === \"function\") {\n        this.onabort(new ProgressEvent(\"abort\", {\"target\":this}));\n    }\n\n    // If write end callback\n    if (typeof this.onwriteend === \"function\") {\n        this.onwriteend(new ProgressEvent(\"writeend\", {\"target\":this}));\n    }\n};\n\n/**\n * Writes data to the file\n *\n * @param text to be written\n */\nFileWriter.prototype.write = function(text) {\n    // Throw an exception if we are already writing a file\n    if (this.readyState === FileWriter.WRITING) {\n        throw new FileError(FileError.INVALID_STATE_ERR);\n    }\n\n    // WRITING state\n    this.readyState = FileWriter.WRITING;\n\n    var me = this;\n\n    // If onwritestart callback\n    if (typeof me.onwritestart === \"function\") {\n        me.onwritestart(new ProgressEvent(\"writestart\", {\"target\":me}));\n    }\n\n    // Write file\n    exec(\n        // Success callback\n        fu

<TRUNCATED>