updating to 2.2.0
diff --git a/VERSION b/VERSION
index bdc2ab6..ccbccc3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.0rc1
+2.2.0
diff --git a/js/cordova.tizen-debug.js b/js/cordova.tizen-debug.js
index 40a0558..29c60ac 100644
--- a/js/cordova.tizen-debug.js
+++ b/js/cordova.tizen-debug.js
@@ -1,6 +1,6 @@
-// commit 884cb0e8f4809b6182b41101c092eee1139f82da
+// commit 02b91c5313ff37d74a58f71775170afd360f4a1f
-// File generated at :: Wed Oct 24 2012 12:54:26 GMT-0700 (PDT)
+// File generated at :: Thu Nov 01 2012 09:47:22 GMT-0700 (PDT)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -59,7 +59,7 @@
try {eval("define(\"cordova/plugin/FileError\", function(require, exports, module) {\n\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\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) {\n\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 (progress.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 containing 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 containing 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\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) {\n\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) {\n\nvar exec = require('cordova/exec'),\n FileTransferError = require('cordova/plugin/FileTransferError'),\n ProgressEvent = require('cordova/plugin/ProgressEvent');\n\nfunction newProgressEvent(result) {\n var pe = new ProgressEvent();\n pe.lengthComputable = result.lengthComputable;\n pe.loaded = result.loaded;\n pe.total = result.total;\n return pe;\n}\n\nvar idCounter = 0;\n\n/**\n * FileTransfer uploads a file to a remote server.\n * @constructor\n */\nvar FileTransfer = function() {\n this._id = ++idCounter;\n this.onprogress = null; // optional callback\n};\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, server, 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 var self = this;\n var win = function(result) {\n if (typeof result.lengthComputable != \"undefined\") {\n if (self.onprogress) {\n return self.onprogress(newProgressEvent(result));\n }\n } else {\n return successCallback(result);\n }\n };\n exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id]);\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 * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false\n */\nFileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts) {\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 self = this;\n var win = function(result) {\n if (typeof result.lengthComputable != \"undefined\") {\n if (self.onprogress) {\n return self.onprogress(newProgressEvent(result));\n }\n } else {\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\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, trustAllHosts, this._id]);\n};\n\n/**\n * Aborts the ongoing file transfer on this object\n * @param successCallback {Function} Callback to be invoked upon success\n * @param errorCallback {Function} Callback to be invoked upon error\n */\nFileTransfer.prototype.abort = function(successCallback, errorCallback) {\n exec(successCallback, errorCallback, 'FileTransfer', 'abort', [this._id]);\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) {\n\nvar exec = require('cordova/exec'),\n FileTransferError = require('cordova/plugin/FileTransferError'),\n ProgressEvent = require('cordova/plugin/ProgressEvent');\n\nfunction newProgressEvent(result) {\n var pe = new ProgressEvent();\n pe.lengthComputable = result.lengthComputable;\n pe.loaded = result.loaded;\n pe.total = result.total;\n return pe;\n}\n\nvar idCounter = 0;\n\n/**\n * FileTransfer uploads a file to a remote server.\n * @constructor\n */\nvar FileTransfer = function() {\n this._id = ++idCounter;\n this.onprogress = null; // optional callback\n};\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, server, 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 var self = this;\n var win = function(result) {\n if (typeof result.lengthComputable != \"undefined\") {\n if (self.onprogress) {\n return self.onprogress(newProgressEvent(result));\n }\n } else {\n return successCallback(result);\n }\n };\n exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id]);\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 * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false\n */\nFileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts) {\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 self = this;\n var win = function(result) {\n if (typeof result.lengthComputable != \"undefined\") {\n if (self.onprogress) {\n return self.onprogress(newProgressEvent(result));\n }\n } else {\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\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, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id]);\n};\n\n/**\n * Aborts the ongoing file transfer on this object\n * @param successCallback {Function} Callback to be invoked upon success\n * @param errorCallback {Function} Callback to be invoked upon error\n */\nFileTransfer.prototype.abort = function(successCallback, errorCallback) {\n exec(successCallback, errorCallback, 'FileTransfer', 'abort', [this._id]);\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/**\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;\nFileTransferError.ABORT_ERR = 4;\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/**\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//@ 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/FileUploadResult\", function(require, exports, module) {\n\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\n//@ sourceURL=lib/common/plugin/FileUploadResult.js")} catch(e) {console.log("exception: in lib/common/plugin/FileUploadResult.js: " + e);console.log(e.stack);}
@@ -98,7 +98,7 @@
try {eval("define(\"cordova/plugin/tizen/Compass\", function(require, exports, module) {\n\nvar CompassError = require('cordova/plugin/CompassError'),\n callback = null, ready = false;\n\nmodule.exports = {\n getHeading: function(successCallback, errorCallback) {\n if (window.DeviceOrientationEvent !== undefined) {\n callback = function (orientation) {\n var heading = 360 - orientation.alpha;\n if (ready) {\n successCallback({\n magneticHeading: heading,\n trueHeading: heading,\n headingAccuracy: 0,\n timestamp: orientation.timeStamp\n });\n window.removeEventListener(\"deviceorientation\", callback);\n }\n ready = true;\n };\n ready = false; // workaround invalid first event value returned by WRT\n window.addEventListener(\"deviceorientation\", callback);\n }\n else {\n errorCallback(CompassError.COMPASS_NOT_SUPPORTED);\n }\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/Compass.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/Compass.js: " + e);console.log(e.stack);}
try {eval("define(\"cordova/plugin/tizen/Contact\", function(require, exports, module) {\n\n/*global tizen:false */\nvar ContactError = require('cordova/plugin/ContactError'),\n ContactUtils = require('cordova/plugin/tizen/ContactUtils'),\n utils = require('cordova/utils'),\n exec = require('cordova/exec');\n\n// ------------------\n// Utility functions\n// ------------------\n\n\n/**\n * Retrieves a Tizen Contact object from the device by its unique id.\n *\n * @param uid\n * Unique id of the contact on the device\n * @return {tizen.Contact} Tizen Contact object or null if contact with\n * specified id is not found\n */\nvar findByUniqueId = function(id) {\n\n if (!id) {\n return null;\n }\n\n var tizenContact = null;\n\n tizen.contact.getDefaultAddressBook().find(\n function _successCallback(contacts){\n tizenContact = contacts[0];\n },\n function _errorCallback(error){\n console.log(\"tizen find error \" + error);\n },\n new tizen.AttributeFilter('id', 'CONTAINS', id),\n new tizen.SortMode('id', 'ASC'));\n\n return tizenContact || null;\n};\n\n\nvar traceTizenContact = function (tizenContact) {\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.id \" + tizenContact.id);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.lastUpdated \" + tizenContact.lastUpdated);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.name \" + tizenContact.name);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.account \" + tizenContact.account);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.addresses \" + tizenContact.addresses);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.photoURI \" + tizenContact.photoURI);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.phoneNumbers \" + tizenContact.phoneNumbers);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.emails \" + tizenContact.emails);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.birthday \" + tizenContact.birthday);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.organization \" + tizenContact.organization);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.notes \" + tizenContact.notes);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.urls \" + tizenContact.isFavorite);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.isFavorite \" + tizenContact.isFavorite);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.ringtonesURI \" + tizenContact.ringtonesURI);\n console.log(\"cordova/plugin/tizen/Contact/ tizenContact.categories \" + tizenContact.categories);\n};\n\n\n/**\n * Creates a Tizen contact object from the W3C Contact object and persists\n * it to device storage.\n *\n * @param {Contact}\n * contact The contact to save\n * @return a new contact object with all properties set\n */\nvar saveToDevice = function(contact) {\n\n if (!contact) {\n return;\n }\n\n var tizenContact = null;\n var update = false;\n var i = 0;\n\n // if the underlying Tizen Contact object already exists, retrieve it for\n // update\n if (contact.id) {\n // we must attempt to retrieve the BlackBerry contact from the device\n // because this may be an update operation\n tizenContact = findByUniqueId(contact.id);\n }\n\n // contact not found on device, create a new one\n if (!tizenContact) {\n tizenContact = new tizen.Contact();\n }\n // update the existing contact\n else {\n update = true;\n }\n\n // NOTE: The user may be working with a partial Contact object, because only\n // user-specified Contact fields are returned from a find operation (blame\n // the W3C spec). If this is an update to an existing Contact, we don't\n // want to clear an attribute from the contact database simply because the\n // Contact object that the user passed in contains a null value for that\n // attribute. So we only copy the non-null Contact attributes to the\n // Tizen Contact object before saving.\n //\n // This means that a user must explicitly set a Contact attribute to a\n // non-null value in order to update it in the contact database.\n //\n traceTizenContact (tizenContact);\n\n // display name\n if (contact.displayName !== null) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n tizenContact.name.displayName = contact.displayName;\n }\n }\n\n // name\n if (contact.name !== null) {\n if (contact.name.givenName) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n tizenContact.name.firstName = contact.name.givenName;\n }\n }\n\n if (contact.name.middleName) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n tizenContact.name.middleName = contact.name.middleName;\n }\n }\n\n if (contact.name.familyName) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n tizenContact.name.lastName = contact.name.familyName;\n }\n }\n\n if (contact.name.honorificPrefix) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n tizenContact.name.prefix = contact.name.honorificPrefix;\n }\n }\n }\n\n // nickname\n if (contact.nickname !== null) {\n if (tizenContact.name === null) {\n tizenContact.name = new tizen.ContactName();\n }\n if (tizenContact.name !== null) {\n if (!utils.isArray(tizenContact.name.nicknames))\n {\n tizenContact.name.nicknames = [];\n }\n tizenContact.name.nicknames[0] = contact.nickname;\n }\n }\n else {\n tizenContact.name.nicknames = [];\n }\n\n // note\n if (contact.note !== null) {\n if (tizenContact.note === null) {\n tizenContact.note = [];\n }\n if (tizenContact.note !== null) {\n tizenContact.note[0] = contact.note;\n }\n }\n\n // photos\n if (contact.photos && utils.isArray(contact.emails) && contact.emails.length > 0) {\n tizenContact.photoURI = contact.photos[0];\n }\n\n if (utils.isDate(contact.birthday)) {\n if (!utils.isDate(tizenContact.birthday)) {\n tizenContact.birthday = new Date();\n }\n if (utils.isDate(tizenContact.birthday)) {\n tizenContact.birthday.setDate(contact.birthday.getDate());\n }\n }\n\n // Tizen supports many addresses\n if (utils.isArray(contact.emails)) {\n\n // if this is an update, re initialize email addresses\n if (update) {\n // doit on effacer sur un update??????\n }\n\n // copy the first three email addresses found\n var emails = [];\n for (i = 0; i < contact.emails.length; i += 1) {\n var emailTypes = [];\n\n emailTypes.push (contact.emails[i].type);\n\n if (contact.emails[i].pref) {\n emailTypes.push (\"PREF\");\n }\n\n emails.push(\n new tizen.ContactEmailAddress(\n contact.emails[i].value,\n emailTypes)\n );\n }\n tizenContact.emails = emails.length > 0 ? emails : [];\n }\n else {\n tizenContact.emails = [];\n }\n\n // Tizen supports many phone numbers\n // copy into appropriate fields based on type\n if (utils.isArray(contact.phoneNumbers)) {\n // if this is an update, re-initialize phone numbers\n if (update) {\n }\n\n var phoneNumbers = [];\n\n for (i = 0; i < contact.phoneNumbers.length; i += 1) {\n\n if (!contact.phoneNumbers[i] || !contact.phoneNumbers[i].value) {\n continue;\n }\n\n var phoneTypes = [];\n phoneTypes.push (contact.phoneNumbers[i].type);\n\n if (contact.phoneNumbers[i].pref) {\n phoneTypes.push (\"PREF\");\n }\n\n phoneNumbers.push(\n new tizen.ContactPhoneNumber(\n contact.phoneNumbers[i].value,\n phoneTypes)\n );\n }\n\n tizenContact.phoneNumbers = phoneNumbers.length > 0 ? phoneNumbers : [];\n } else {\n tizenContact.phoneNumbers = [];\n }\n\n if (utils.isArray(contact.addresses)) {\n // if this is an update, re-initialize addresses\n if (update) {\n }\n\n var addresses = [],\n address = null;\n\n for ( i = 0; i < contact.addresses.length; i += 1) {\n address = contact.addresses[i];\n\n if (!address || address.id === undefined || address.pref === undefined || address.type === undefined || address.formatted === undefined) {\n continue;\n }\n\n var addressTypes = [];\n addressTypes.push (address.type);\n\n if (address.pref) {\n addressTypes.push (\"PREF\");\n }\n\n addresses.push(\n new tizen.ContactAddress({\n country: address.country,\n region : address.region,\n city: address.locality,\n streetAddress: address.streetAddress,\n additionalInformation: \"\",\n postalCode: address.postalCode,\n types : addressTypes\n }));\n\n }\n tizenContact.addresses = addresses.length > 0 ? addresses : [];\n\n } else{\n tizenContact.addresses = [];\n }\n\n // copy first url found to BlackBerry 'webpage' field\n if (utils.isArray(contact.urls)) {\n // if this is an update, re-initialize web page\n if (update) {\n }\n\n var url = null,\n urls = [];\n\n for ( i = 0; i< contact.urls.length; i+= 1) {\n url = contact.urls[i];\n\n if (!url || !url.value) {\n continue;\n }\n\n urls.push( new tizen.ContactWebSite(url.value, url.type));\n }\n tizenContact.urls = urls.length > 0 ? urls : [];\n } else{\n tizenContact.urls = [];\n }\n\n if (utils.isArray(contact.organizations && contact.organizations.length > 0) ) {\n // if this is an update, re-initialize org attributes\n var organization = contact.organizations[0];\n\n tizenContact.organization = new tizen.ContacOrganization({\n name: organization.name,\n department: organization.department,\n office: \"\",\n title: organization.title,\n role: \"\",\n logoURI: \"\"\n });\n }\n\n // categories\n if (utils.isArray(contact.categories)) {\n tizenContact.categories = [];\n\n var category = null;\n\n for (i = 0; i < contact.categories.length; i += 1) {\n category = contact.categories[i];\n\n if (typeof category === \"string\") {\n tizenContact.categories.push(category);\n }\n }\n }\n else {\n tizenContact.categories = [];\n }\n\n // save to device\n // in tizen contact mean update or add\n // later we might use addBatch and updateBatch\n if (update){\n tizen.contact.getDefaultAddressBook().update(tizenContact);\n }\n else {\n tizen.contact.getDefaultAddressBook().add(tizenContact);\n }\n\n // Use the fully populated Tizen contact object to create a\n // corresponding W3C contact object.\n return ContactUtils.createContact(tizenContact, [ \"*\" ]);\n};\n\n\n/**\n * Creates a Tizen ContactAddress object from a W3C ContactAddress.\n *\n * @return {tizen.ContactAddress} a Tizen ContactAddress object\n */\nvar createTizenAddress = function(address) {\n\n var type = null,\n pref = null,\n typesAr = [];\n\n if (address === null) {\n return null;\n }\n\n\n var tizenAddress = new tizen.ContactAddress();\n\n if (tizenAddress === null) {\n return null;\n }\n\n typesAr.push(address.type);\n\n if (address.pref) {\n typesAr.push(\"PREF\");\n }\n\n tizenAddress.country = address.country || \"\";\n tizenAddress.region = address.region || \"\";\n tizenAddress.city = address.locality || \"\";\n tizenAddress.streetAddress = address.streetAddress || \"\";\n tizenAddress.postalCode = address.postalCode || \"\";\n tizenAddress.types = typesAr || \"\";\n\n return tizenAddress;\n};\n\nmodule.exports = {\n /**\n * Persists contact to device storage.\n */\n\n save : function(successCB, failCB) {\n\n try {\n // save the contact and store it's unique id\n var fullContact = saveToDevice(this);\n\n this.id = fullContact.id;\n\n // This contact object may only have a subset of properties\n // if the save was an update of an existing contact. This is\n // because the existing contact was likely retrieved using a\n // subset of properties, so only those properties were set in the\n // object. For this reason, invoke success with the contact object\n // returned by saveToDevice since it is fully populated.\n\n if (typeof successCB === 'function') {\n successCB(fullContact);\n }\n }\n catch (error) {\n console.log('Error saving contact: ' + error);\n\n if (typeof failCB === 'function') {\n failCB (new ContactError(ContactError.UNKNOWN_ERROR));\n }\n }\n },\n\n /**\n * Removes contact from device storage.\n *\n * @param successCB\n * successCB callback\n * @param failCB\n * error callback\n */\n remove : function (successCB, failCB) {\n\n try {\n // retrieve contact from device by id\n var tizenContact = null;\n\n if (this.id) {\n tizenContact = findByUniqueId(this.id);\n }\n\n\n // if contact was found, remove it\n if (tizenContact) {\n\n tizen.contact.getDefaultAddressBook().remove(tizenContact.id);\n\n if (typeof success === 'function') {\n successCB(this);\n }\n }\n // attempting to remove a contact that hasn't been saved\n else if (typeof failCB === 'function') {\n failCB(new ContactError(ContactError.UNKNOWN_ERROR));\n }\n }\n catch (error) {\n console.log('Error removing contact ' + this.id + \": \" + error);\n if (typeof failCB === 'function') {\n failCB(new ContactError(ContactError.UNKNOWN_ERROR));\n }\n }\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/Contact.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/Contact.js: " + e);console.log(e.stack);}
try {eval("define(\"cordova/plugin/tizen/ContactUtils\", function(require, exports, module) {\n\n/*global tizen:false */\nvar ContactAddress = require('cordova/plugin/ContactAddress'),\n ContactName = require('cordova/plugin/ContactName'),\n ContactField = require('cordova/plugin/ContactField'),\n ContactOrganization = require('cordova/plugin/ContactOrganization'),\n utils = require('cordova/utils'),\n Contact = require('cordova/plugin/Contact');\n\n/**\n * Mappings for each Contact field that may be used in a find operation. Maps\n * W3C Contact fields to one or more fields in a Tizen contact object.\n *\n * Example: user searches with a filter on the Contact 'name' field:\n *\n * <code>Contacts.find(['name'], onSuccess, onFail, {filter:'Bob'});</code>\n *\n * The 'name' field does not exist in a Tizen contact. Instead, a filter\n * expression will be built to search the Tizen contacts using the\n * Tizen 'title', 'firstName' and 'lastName' fields.\n */\nvar fieldMappings = {\n \"id\" : [\"id\"],\n \"displayName\" : [\"name.displayName\"],\n \"nickname\": [\"name.nicknames\"],\n \"name\" : [ \"name.prefix\", \"name.firstName\", \"name.lastName\" ],\n \"phoneNumbers\" : [\"phoneNumbers.number\",\"phoneNumbers.types\"],\n \"emails\" : [\"emails.types\", \"emails.email\"],\n \"addresses\" : [\"addresses.country\",\"addresses.region\",\"addresses.city\",\"addresses.streetAddress\",\"addresses.postalCode\",\"addresses.country\",\"addresses.types\"],\n \"organizations\" : [\"organization.name\",\"organization.department\",\"organization.office\", \"organization.title\"],\n \"birthday\" : [\"birthday\"],\n \"note\" : [\"notes\"],\n \"photos\" : [\"photoURI\"],\n \"categories\" : [\"categories\"],\n \"urls\" : [\"urls.url\", \"urls.type\"]\n};\n\n/*\n * Build an array of all of the valid W3C Contact fields. This is used to\n * substitute all the fields when [\"*\"] is specified.\n */\nvar allFields = [];\n\n(function initializeAllFieldsMapping() {\n\n for ( var key in fieldMappings) {\n allFields.push(key);\n }\n // as we want it to be executed once\n function initializeAllFieldsMapping() {\n }\n\n})();\n\n/**\n * Create a W3C ContactAddress object from a Tizen Address object\n *\n * @param {String}\n * type the type of address (e.g. work, home)\n * @param {tizen.ContactAddress}\n * tizenAddress a Tizen Address object\n * @return {ContactAddress} a contact address object or null if the specified\n * address is null\n */\nvar createContactAddress = function(type, tizenAddress) {\n if (!tizenAddress) {\n return null;\n }\n\n var streetAddress = tizenAddress.streetAddress;\n var locality = tizenAddress.city || \"\";\n var region = tizenAddress.region || \"\";\n var postalCode = tizenAddress.postalCode || \"\";\n var country = tizenAddress.country || \"\";\n var formatted = streetAddress + \", \" + locality + \", \" + region + \", \" + postalCode + \", \" + country;\n\n var contact = new ContactAddress(null, type, formatted, streetAddress, locality, region, postalCode, country);\n\n return contact;\n};\n\nmodule.exports = {\n /**\n * Builds Tizen filter expressions for contact search using the\n * contact fields and search filter provided.\n *\n * @param {String[]}\n * fields Array of Contact fields to search\n * @param {String}\n * filter Filter, or search string\n * @param {Boolean}\n * multiple, one contacts or more wanted as result\n * @return filter expression or null if fields is empty or filter is null or\n * empty\n */\n\n buildFilterExpression: function(fields, filter) {\n // ensure filter exists\n if (!filter || filter === \"\") {\n return null;\n }\n\n if ((fields.length === 1) && (fields[0] === \"*\")) {\n // Cordova enhancement to allow fields value of [\"*\"] to indicate\n // all supported fields.\n fields = allFields;\n }\n\n // build a filter expression using all Contact fields provided\n var compositeFilter = null,\n attributeFilter = null,\n filterExpression = null,\n matchFlag = \"CONTAINS\",\n matchValue = filter,\n attributesArray = [];\n\n if (fields && utils.isArray(fields)) {\n\n for ( var field in fields) {\n\n if (!fields[field]) {\n continue;\n }\n\n // retrieve Tizen contact fields that map Cordova fields specified\n // (tizenFields is a string or an array of strings)\n var tizenFields = fieldMappings[fields[field]];\n\n if (!tizenFields) {\n // does something maps\n continue;\n }\n\n // construct the filter expression using the Tizen fields\n for ( var index in tizenFields) {\n attributeFilter = new tizen.AttributeFilter(tizenFields[index], matchFlag, matchValue);\n if (attributeFilter !== null) {\n attributesArray.push(attributeFilter);\n }\n }\n }\n }\n\n // fulfill Tizen find attribute as a single or a composite attribute\n if (attributesArray.length == 1 ) {\n filterExpression = attributeFilter[0];\n } else if (attributesArray.length > 1) {\n // combine the filters as a Union\n filterExpression = new tizen.CompositeFilter(\"UNION\", attributesArray);\n } else {\n filterExpression = null;\n }\n\n return filterExpression;\n },\n\n\n\n /**\n * Creates a Contact object from a Tizen Contact object, copying only\n * the fields specified.\n *\n * This is intended as a privately used function but it is made globally\n * available so that a Contact.save can convert a BlackBerry contact object\n * into its W3C equivalent.\n *\n * @param {tizen.Contact}\n * tizenContact Tizen Contact object\n * @param {String[]}\n * fields array of contact fields that should be copied\n * @return {Contact} a contact object containing the specified fields or\n * null if the specified contact is null\n */\n createContact: function(tizenContact, fields) {\n\n if (!tizenContact) {\n return null;\n }\n\n // construct a new contact object\n // always copy the contact id and displayName fields\n var contact = new Contact(tizenContact.id, tizenContact.name.displayName);\n\n\n // nothing to do\n if (!fields || !(utils.isArray(fields)) || fields.length === 0) {\n return contact;\n } else if (fields.length === 1 && fields[0] === \"*\") {\n // Cordova enhancement to allow fields value of [\"*\"] to indicate\n // all supported fields.\n fields = allFields;\n }\n\n // add the fields specified\n for ( var key in fields) {\n\n var field = fields[key],\n index = 0;\n\n if (!field) {\n continue;\n }\n\n // name\n if (field.indexOf('name') === 0) {\n\n var formattedName = (tizenContact.name.prefix || \"\");\n\n if (tizenContact.name.firstName) {\n formattedName += ' ';\n formattedName += (tizenContact.name.firstName || \"\");\n }\n\n if (tizenContact.name.middleName) {\n formattedName += ' ';\n formattedName += (tizenContact.name.middleName || \"\");\n }\n\n if (tizenContact.name.lastName) {\n formattedName += ' ';\n formattedName += (tizenContact.name.lastName || \"\");\n }\n\n contact.name = new ContactName(\n formattedName,\n tizenContact.name.lastName,\n tizenContact.name.firstName,\n tizenContact.name.middleName,\n tizenContact.name.prefix,\n null);\n }\n\n // phoneNumbers\n else if (field.indexOf('phoneNumbers') === 0) {\n\n var phoneNumbers = [];\n\n for (index = 0 ; index < tizenContact.phoneNumbers.length ; ++index) {\n\n phoneNumbers.push(\n new ContactField(\n 'PHONE',\n tizenContact.phoneNumbers[index].number,\n ((tizenContact.phoneNumbers[index].types[1]) && (tizenContact.emails[index].types[1] === \"PREF\") ) ? true : false));\n }\n\n\n contact.phoneNumbers = phoneNumbers.length > 0 ? phoneNumbers : null;\n }\n\n // emails\n else if (field.indexOf('emails') === 0) {\n\n var emails = [];\n\n for (index = 0 ; index < tizenContact.emails.length ; ++index) {\n\n emails.push(\n new ContactField(\n 'EMAILS',\n tizenContact.emails[index].email,\n ((tizenContact.emails[index].types[1]) && (tizenContact.emails[index].types[1] === \"PREF\") ) ? true : false));\n }\n contact.emails = emails.length > 0 ? emails : null;\n }\n\n // addresses\n else if (field.indexOf('addresses') === 0) {\n\n var addresses = [];\n for (index = 0 ; index < tizenContact.addresses.length ; ++index) {\n\n addresses.push(\n new ContactAddress(\n ((tizenContact.addresses[index].types[1] && tizenContact.addresses[index].types[1] === \"PREF\") ? true : false),\n tizenContact.addresses[index].types[0] ? tizenContact.addresses[index].types[0] : \"HOME\",\n null,\n tizenContact.addresses[index].streetAddress,\n tizenContact.addresses[index].city,\n tizenContact.addresses[index].region,\n tizenContact.addresses[index].postalCode,\n tizenContact.addresses[index].country ));\n }\n\n contact.addresses = addresses.length > 0 ? addresses : null;\n }\n\n // birthday\n else if (field.indexOf('birthday') === 0) {\n if (utils.isDate(tizenContact.birthday)) {\n contact.birthday = tizenContact.birthday;\n }\n }\n\n // note only one in Tizen Contact\n else if (field.indexOf('note') === 0) {\n if (tizenContact.note) {\n contact.note = tizenContact.note[0];\n }\n }\n\n // organizations\n else if (field.indexOf('organizations') === 0) {\n\n var organizations = [];\n\n // there's only one organization in a Tizen Address\n\n if (tizenContact.organization) {\n organizations.push(\n new ContactOrganization(\n true,\n 'WORK',\n tizenContact.organization.name,\n tizenContact.organization.department,\n tizenContact.organization.jobTitle));\n }\n\n contact.organizations = organizations.length > 0 ? organizations : null;\n }\n\n // categories\n else if (field.indexOf('categories') === 0) {\n\n var categories = [];\n\n if (tizenContact.categories) {\n\n for (index = 0 ; index < tizenContact.categories.length ; ++index) {\n categories.push(\n new ContactField(\n 'MAIN',\n tizenContact.categories,\n (index === 0) ));\n }\n\n contact.categories = categories.length > 0 ? categories : null;\n }\n }\n\n // urls\n else if (field.indexOf('urls') === 0) {\n var urls = [];\n\n if (tizenContact.urls) {\n for (index = 0 ; index <tizenContact.urls.length ; ++index) {\n urls.push(\n new ContactField(\n tizenContact.urls[index].type,\n tizenContact.urls[index].url,\n (index === 0)));\n }\n }\n\n contact.urls = urls.length > 0 ? urls : null;\n }\n\n // photos\n else if (field.indexOf('photos') === 0) {\n var photos = [];\n\n if (tizenContact.photoURI) {\n photos.push(new ContactField('URI', tizenContact.photoURI, true));\n }\n\n contact.photos = photos.length > 0 ? photos : null;\n }\n }\n\n return contact;\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/ContactUtils.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/ContactUtils.js: " + e);console.log(e.stack);}
-try {eval("define(\"cordova/plugin/tizen/Device\", function(require, exports, module) {\n\n/*global tizen:false */\nvar channel = require('cordova/channel');\n\n// Tell cordova channel to wait on the CordovaInfoReady event\nchannel.waitForInitialization('onCordovaInfoReady');\n\nfunction Device() {\n this.version = null;\n this.uuid = null;\n this.name = null;\n this.cordova = \"2.2.0rc2\";\n this.platform = \"Tizen\";\n\n var me = this;\n\n function onSuccessCallback(sysInfoProp) {\n me.name = sysInfoProp.model;\n me.uuid = sysInfoProp.imei;\n me.version = sysInfoProp.version;\n channel.onCordovaInfoReady.fire();\n }\n\n function onErrorCallback(error) {\n console.log(\"error initializing cordova: \" + error);\n }\n\n channel.onCordovaReady.subscribe(function() {\n me.getDeviceInfo(onSuccessCallback, onErrorCallback);\n });\n}\n\nDevice.prototype.getDeviceInfo = function(success, fail, args) {\n tizen.systeminfo.getPropertyValue(\"Device\", success, fail);\n};\n\nmodule.exports = new Device();\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/Device.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/Device.js: " + e);console.log(e.stack);}
+try {eval("define(\"cordova/plugin/tizen/Device\", function(require, exports, module) {\n\n/*global tizen:false */\nvar channel = require('cordova/channel');\n\n// Tell cordova channel to wait on the CordovaInfoReady event\nchannel.waitForInitialization('onCordovaInfoReady');\n\nfunction Device() {\n this.version = null;\n this.uuid = null;\n this.name = null;\n this.cordova = \"2.2.0\";\n this.platform = \"Tizen\";\n\n var me = this;\n\n function onSuccessCallback(sysInfoProp) {\n me.name = sysInfoProp.model;\n me.uuid = sysInfoProp.imei;\n me.version = sysInfoProp.version;\n channel.onCordovaInfoReady.fire();\n }\n\n function onErrorCallback(error) {\n console.log(\"error initializing cordova: \" + error);\n }\n\n channel.onCordovaReady.subscribe(function() {\n me.getDeviceInfo(onSuccessCallback, onErrorCallback);\n });\n}\n\nDevice.prototype.getDeviceInfo = function(success, fail, args) {\n tizen.systeminfo.getPropertyValue(\"Device\", success, fail);\n};\n\nmodule.exports = new Device();\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/Device.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/Device.js: " + e);console.log(e.stack);}
try {eval("define(\"cordova/plugin/tizen/File\", function(require, exports, module) {\n\n/*global WebKitBlobBuilder:false */\nvar FileError = require('cordova/plugin/FileError'),\n DirectoryEntry = require('cordova/plugin/DirectoryEntry'),\n FileEntry = require('cordova/plugin/FileEntry'),\n File = require('cordova/plugin/File'),\n FileSystem = require('cordova/plugin/FileSystem');\n\nvar nativeRequestFileSystem = window.webkitRequestFileSystem,\n nativeResolveLocalFileSystemURI = window.webkitResolveLocalFileSystemURL,\n NativeFileReader = window.FileReader;\n\nfunction getFileSystemName(nativeFs) {\n return (nativeFs.name.indexOf(\"Persistent\") != -1) ? \"persistent\" : \"temporary\";\n}\n\nfunction makeEntry(entry) {\n if (entry.isDirectory) {\n return new DirectoryEntry(entry.name, decodeURI(entry.toURL()));\n }\n else {\n return new FileEntry(entry.name, decodeURI(entry.toURL()));\n }\n}\n\nmodule.exports = {\n /* requestFileSystem */\n requestFileSystem: function(successCallback, errorCallback, args) {\n var type = args[0],\n size = args[1];\n\n nativeRequestFileSystem(type, size, function(nativeFs) {\n successCallback(new FileSystem(getFileSystemName(nativeFs), makeEntry(nativeFs.root)));\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* resolveLocalFileSystemURI */\n resolveLocalFileSystemURI: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* DirectoryReader */\n readEntries: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(dirEntry) {\n var reader = dirEntry.createReader();\n reader.readEntries(function(entries) {\n var retVal = [];\n for (var i = 0; i < entries.length; i++) {\n retVal.push(makeEntry(entries[i]));\n }\n successCallback(retVal);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* Entry */\n getMetadata: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n entry.getMetadata(function(metaData) {\n successCallback(metaData.modificationTime);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n moveTo: function(successCallback, errorCallback, args) {\n var srcUri = args[0],\n parentUri = args[1],\n name = args[2];\n\n nativeResolveLocalFileSystemURI(srcUri, function(source) {\n nativeResolveLocalFileSystemURI(parentUri, function(parent) {\n source.moveTo(parent, name, function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n copyTo: function(successCallback, errorCallback, args) {\n var srcUri = args[0],\n parentUri = args[1],\n name = args[2];\n\n nativeResolveLocalFileSystemURI(srcUri, function(source) {\n nativeResolveLocalFileSystemURI(parentUri, function(parent) {\n source.copyTo(parent, name, function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n remove: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n if (entry.fullPath === \"/\") {\n errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);\n } else {\n entry.remove(successCallback, function(error) {\n errorCallback(error.code);\n });\n }\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n getParent: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n entry.getParent(function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* FileEntry */\n getFileMetadata: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n entry.file(function(file) {\n var retVal = new File(file.name, decodeURI(entry.toURL()), file.type, file.lastModifiedDate, file.size);\n successCallback(retVal);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* DirectoryEntry */\n getDirectory: function(successCallback, errorCallback, args) {\n var uri = args[0],\n path = args[1],\n options = args[2];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n entry.getDirectory(path, options, function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n if (error.code === FileError.INVALID_MODIFICATION_ERR) {\n if (options.create) {\n errorCallback(FileError.PATH_EXISTS_ERR);\n } else {\n errorCallback(FileError.ENCODING_ERR);\n }\n } else {\n errorCallback(error.code);\n }\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n removeRecursively: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n if (entry.fullPath === \"/\") {\n errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);\n } else {\n entry.removeRecursively(successCallback, function(error) {\n errorCallback(error.code);\n });\n }\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n getFile: function(successCallback, errorCallback, args) {\n var uri = args[0],\n path = args[1],\n options = args[2];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n entry.getFile(path, options, function(entry) {\n successCallback(makeEntry(entry));\n }, function(error) {\n if (error.code === FileError.INVALID_MODIFICATION_ERR) {\n if (options.create) {\n errorCallback(FileError.PATH_EXISTS_ERR);\n } else {\n errorCallback(FileError.ENCODING_ERR);\n }\n } else {\n errorCallback(error.code);\n }\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* FileReader */\n readAsText: function(successCallback, errorCallback, args) {\n var uri = args[0],\n encoding = args[1];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n var onLoadEnd = function(evt) {\n if (!evt.target.error) {\n successCallback(evt.target.result);\n }\n },\n onError = function(evt) {\n errorCallback(evt.target.error.code);\n };\n\n var reader = new NativeFileReader();\n\n reader.onloadend = onLoadEnd;\n reader.onerror = onError;\n entry.file(function(file) {\n reader.readAsText(file, encoding);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n readAsDataURL: function(successCallback, errorCallback, args) {\n var uri = args[0];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n var onLoadEnd = function(evt) {\n if (!evt.target.error) {\n successCallback(evt.target.result);\n }\n },\n onError = function(evt) {\n errorCallback(evt.target.error.code);\n };\n\n var reader = new NativeFileReader();\n\n reader.onloadend = onLoadEnd;\n reader.onerror = onError;\n entry.file(function(file) {\n reader.readAsDataURL(file);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n /* FileWriter */\n write: function(successCallback, errorCallback, args) {\n var uri = args[0],\n text = args[1],\n position = args[2];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n var onWriteEnd = function(evt) {\n if(!evt.target.error) {\n successCallback(evt.target.position - position);\n } else {\n errorCallback(evt.target.error.code);\n }\n },\n onError = function(evt) {\n errorCallback(evt.target.error.code);\n };\n\n entry.createWriter(function(writer) {\n var blob = new WebKitBlobBuilder();\n blob.append(text);\n\n writer.onwriteend = onWriteEnd;\n writer.onerror = onError;\n\n writer.seek(position);\n writer.write(blob.getBlob('text/plain'));\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n },\n\n truncate: function(successCallback, errorCallback, args) {\n var uri = args[0],\n size = args[1];\n\n nativeResolveLocalFileSystemURI(uri, function(entry) {\n var onWriteEnd = function(evt) {\n if(!evt.target.error) {\n successCallback(evt.target.length);\n } else {\n errorCallback(evt.target.error.code);\n }\n },\n onError = function(evt) {\n errorCallback(evt.target.error.code);\n };\n\n entry.createWriter(function(writer) {\n writer.onwriteend = onWriteEnd;\n writer.onerror = onError;\n\n writer.truncate(size);\n }, function(error) {\n errorCallback(error.code);\n });\n }, function(error) {\n errorCallback(error.code);\n });\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/File.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/File.js: " + e);console.log(e.stack);}
try {eval("define(\"cordova/plugin/tizen/FileTransfer\", function(require, exports, module) {\n\n/*global WebKitBlobBuilder:false */\nvar FileEntry = require('cordova/plugin/FileEntry'),\n FileTransferError = require('cordova/plugin/FileTransferError'),\n FileUploadResult = require('cordova/plugin/FileUploadResult');\n\nvar nativeResolveLocalFileSystemURI = window.webkitResolveLocalFileSystemURL;\n\nfunction getParentPath(filePath) {\n var pos = filePath.lastIndexOf('/');\n return filePath.substring(0, pos + 1);\n}\n\nfunction getFileName(filePath) {\n var pos = filePath.lastIndexOf('/');\n return filePath.substring(pos + 1);\n}\n\nmodule.exports = {\n upload: function(successCallback, errorCallback, args) {\n var filePath = args[0],\n server = args[1],\n fileKey = args[2],\n fileName = args[3],\n mimeType = args[4],\n params = args[5],\n /*trustAllHosts = args[6],*/\n chunkedMode = args[7];\n\n nativeResolveLocalFileSystemURI(filePath, function(entry) {\n entry.file(function(file) {\n function uploadFile(blobFile) {\n var fd = new FormData();\n\n fd.append(fileKey, blobFile, fileName);\n for (var prop in params) {\n if(params.hasOwnProperty(prop)) {\n fd.append(prop, params[prop]);\n }\n }\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", server);\n xhr.onload = function(evt) {\n if (xhr.status == 200) {\n var result = new FileUploadResult();\n result.bytesSent = file.size;\n result.responseCode = xhr.status;\n result.response = xhr.response;\n successCallback(result);\n } else if (xhr.status == 404) {\n errorCallback(new FileTransferError(FileTransferError.INVALID_URL_ERR));\n } else {\n errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));\n }\n };\n xhr.ontimeout = function(evt) {\n errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));\n };\n\n xhr.send(fd);\n }\n\n var bytesPerChunk;\n if (chunkedMode === true) {\n bytesPerChunk = 1024 * 1024; // 1MB chunk sizes.\n } else {\n bytesPerChunk = file.size;\n }\n var start = 0;\n var end = bytesPerChunk;\n while (start < file.size) {\n var chunk = file.webkitSlice(start, end, mimeType);\n uploadFile(chunk);\n start = end;\n end = start + bytesPerChunk;\n }\n },\n function(error) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n }\n );\n },\n function(error) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n }\n );\n },\n\n download: function(successCallback, errorCallback, args) {\n var url = args[0],\n filePath = args[1];\n\n var xhr = new XMLHttpRequest();\n\n function writeFile(fileEntry) {\n fileEntry.createWriter(function(writer) {\n writer.onwriteend = function(evt) {\n if (!evt.target.error) {\n successCallback(new FileEntry(fileEntry.name, fileEntry.toURL()));\n } else {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n }\n };\n\n writer.onerror = function(evt) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n };\n\n var builder = new WebKitBlobBuilder();\n builder.append(xhr.response);\n var blob = builder.getBlob();\n writer.write(blob);\n },\n function(error) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n });\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == xhr.DONE) {\n if (xhr.status == 200 && xhr.response) {\n nativeResolveLocalFileSystemURI(getParentPath(filePath), function(dir) {\n dir.getFile(getFileName(filePath), {create: true}, writeFile, function(error) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n });\n }, function(error) {\n errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));\n });\n } else if (xhr.status == 404) {\n errorCallback(new FileTransferError(FileTransferError.INVALID_URL_ERR));\n } else {\n errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));\n }\n }\n };\n\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"arraybuffer\";\n xhr.send();\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/FileTransfer.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/FileTransfer.js: " + e);console.log(e.stack);}
try {eval("define(\"cordova/plugin/tizen/Media\", function(require, exports, module) {\n\n/*global Media:false, webkitURL:false */\nvar MediaError = require('cordova/plugin/MediaError'),\n audioObjects = {};\n\nmodule.exports = {\n create: function (successCallback, errorCallback, args) {\n var id = args[0], src = args[1];\n console.log(\"media::create() - id =\" + id + \", src =\" + src);\n audioObjects[id] = new Audio(src);\n audioObjects[id].onStalledCB = function () {\n console.log(\"media::onStalled()\");\n audioObjects[id].timer = window.setTimeout(function () {\n audioObjects[id].pause();\n if (audioObjects[id].currentTime !== 0)\n audioObjects[id].currentTime = 0;\n console.log(\"media::onStalled() - MEDIA_ERROR -> \" + MediaError.MEDIA_ERR_ABORTED);\n var err = new MediaError(MediaError.MEDIA_ERR_ABORTED, \"Stalled\");\n Media.onStatus(id, Media.MEDIA_ERROR, err);\n }, 2000);\n };\n audioObjects[id].onEndedCB = function () {\n console.log(\"media::onEndedCB() - MEDIA_STATE -> MEDIA_STOPPED\");\n Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);\n };\n audioObjects[id].onErrorCB = function () {\n console.log(\"media::onErrorCB() - MEDIA_ERROR -> \" + event.srcElement.error);\n Media.onStatus(id, Media.MEDIA_ERROR, event.srcElement.error);\n };\n audioObjects[id].onPlayCB = function () {\n console.log(\"media::onPlayCB() - MEDIA_STATE -> MEDIA_STARTING\");\n Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STARTING);\n };\n audioObjects[id].onPlayingCB = function () {\n console.log(\"media::onPlayingCB() - MEDIA_STATE -> MEDIA_RUNNING\");\n Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_RUNNING);\n };\n audioObjects[id].onDurationChangeCB = function () {\n console.log(\"media::onDurationChangeCB() - MEDIA_DURATION -> \" + audioObjects[id].duration);\n Media.onStatus(id, Media.MEDIA_DURATION, audioObjects[id].duration);\n };\n audioObjects[id].onTimeUpdateCB = function () {\n console.log(\"media::onTimeUpdateCB() - MEDIA_POSITION -> \" + audioObjects[id].currentTime);\n Media.onStatus(id, Media.MEDIA_POSITION, audioObjects[id].currentTime);\n };\n audioObjects[id].onCanPlayCB = function () {\n console.log(\"media::onCanPlayCB()\");\n window.clearTimeout(audioObjects[id].timer);\n audioObjects[id].play();\n };\n },\n startPlayingAudio: function (successCallback, errorCallback, args) {\n var id = args[0], src = args[1], options = args[2];\n console.log(\"media::startPlayingAudio() - id =\" + id + \", src =\" + src + \", options =\" + options);\n audioObjects[id].addEventListener('canplay', audioObjects[id].onCanPlayCB);\n audioObjects[id].addEventListener('ended', audioObjects[id].onEndedCB);\n audioObjects[id].addEventListener('timeupdate', audioObjects[id].onTimeUpdateCB);\n audioObjects[id].addEventListener('durationchange', audioObjects[id].onDurationChangeCB);\n audioObjects[id].addEventListener('playing', audioObjects[id].onPlayingCB);\n audioObjects[id].addEventListener('play', audioObjects[id].onPlayCB);\n audioObjects[id].addEventListener('error', audioObjects[id].onErrorCB);\n audioObjects[id].addEventListener('stalled', audioObjects[id].onStalledCB);\n audioObjects[id].play();\n },\n stopPlayingAudio: function (successCallback, errorCallback, args) {\n var id = args[0];\n window.clearTimeout(audioObjects[id].timer);\n audioObjects[id].pause();\n if (audioObjects[id].currentTime !== 0)\n audioObjects[id].currentTime = 0;\n console.log(\"media::stopPlayingAudio() - MEDIA_STATE -> MEDIA_STOPPED\");\n Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);\n audioObjects[id].removeEventListener('canplay', audioObjects[id].onCanPlayCB);\n audioObjects[id].removeEventListener('ended', audioObjects[id].onEndedCB);\n audioObjects[id].removeEventListener('timeupdate', audioObjects[id].onTimeUpdateCB);\n audioObjects[id].removeEventListener('durationchange', audioObjects[id].onDurationChangeCB);\n audioObjects[id].removeEventListener('playing', audioObjects[id].onPlayingCB);\n audioObjects[id].removeEventListener('play', audioObjects[id].onPlayCB);\n audioObjects[id].removeEventListener('error', audioObjects[id].onErrorCB);\n audioObjects[id].removeEventListener('error', audioObjects[id].onStalledCB);\n },\n seekToAudio: function (successCallback, errorCallback, args) {\n var id = args[0], milliseconds = args[1];\n console.log(\"media::seekToAudio()\");\n audioObjects[id].currentTime = milliseconds;\n successCallback( audioObjects[id].currentTime);\n },\n pausePlayingAudio: function (successCallback, errorCallback, args) {\n var id = args[0];\n console.log(\"media::pausePlayingAudio() - MEDIA_STATE -> MEDIA_PAUSED\");\n audioObjects[id].pause();\n Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_PAUSED);\n },\n getCurrentPositionAudio: function (successCallback, errorCallback, args) {\n var id = args[0];\n console.log(\"media::getCurrentPositionAudio()\");\n successCallback(audioObjects[id].currentTime);\n },\n release: function (successCallback, errorCallback, args) {\n var id = args[0];\n window.clearTimeout(audioObjects[id].timer);\n console.log(\"media::release()\");\n },\n setVolume: function (successCallback, errorCallback, args) {\n var id = args[0], volume = args[1];\n console.log(\"media::setVolume()\");\n audioObjects[id].volume = volume;\n },\n startRecordingAudio: function (successCallback, errorCallback, args) {\n var id = args[0], src = args[1];\n console.log(\"media::startRecordingAudio() - id =\" + id + \", src =\" + src);\n\n function gotStreamCB(stream) {\n audioObjects[id].src = webkitURL.createObjectURL(stream);\n console.log(\"media::startRecordingAudio() - stream CB\");\n }\n\n function gotStreamFailedCB(error) {\n console.log(\"media::startRecordingAudio() - error CB:\" + error.toString());\n }\n\n if (navigator.webkitGetUserMedia) {\n audioObjects[id] = new Audio();\n navigator.webkitGetUserMedia('audio', gotStreamCB, gotStreamFailedCB);\n } else {\n console.log(\"webkitGetUserMedia not supported\");\n }\n successCallback();\n },\n stopRecordingAudio: function (successCallback, errorCallback, args) {\n var id = args[0];\n console.log(\"media::stopRecordingAudio() - id =\" + id);\n audioObjects[id].pause();\n successCallback();\n }\n};\n\n});\n\n//@ sourceURL=lib/tizen/plugin/tizen/Media.js")} catch(e) {console.log("exception: in lib/tizen/plugin/tizen/Media.js: " + e);console.log(e.stack);}
diff --git a/js/cordova.tizen.js b/js/cordova.tizen.js
index c4c0819..bd470b5 100644
--- a/js/cordova.tizen.js
+++ b/js/cordova.tizen.js
@@ -1,6 +1,6 @@
-// commit 884cb0e8f4809b6182b41101c092eee1139f82da
+// commit 02b91c5313ff37d74a58f71775170afd360f4a1f
-// File generated at :: Wed Oct 24 2012 12:54:26 GMT-0700 (PDT)
+// File generated at :: Thu Nov 01 2012 09:47:22 GMT-0700 (PDT)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -2636,7 +2636,7 @@
errorCallback(error);
};
- exec(win, errorCallback, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id]);
+ exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id]);
};
/**
@@ -6560,7 +6560,7 @@
this.version = null;
this.uuid = null;
this.name = null;
- this.cordova = "2.2.0rc2";
+ this.cordova = "2.2.0";
this.platform = "Tizen";
var me = this;