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/07/27 02:29:17 UTC
[71/78] [abbrv] [partial] added platform specs and basic work
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/device.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/device.js b/lib/cordova-1.9.0/lib/webos/js/device.js
deleted file mode 100755
index 9fa543a..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/device.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the
- * phone, etc.
- * @constructor
- */
-function Device() {
- this.platform = "palm";
- this.version = null;
- this.name = null;
- this.uuid = null;
- this.deviceInfo = null;
-};
-
-/*
- * A direct call to return device information.
- * Example:
- * var deviceinfo = JSON.stringify(navigator.device.getDeviceInfo()).replace(/,/g, ', ');
- */
-Device.prototype.getDeviceInfo = function() {
- return this.deviceInfo;//JSON.parse(PalmSystem.deviceInfo);
-};
-
-/*
- * needs to be invoked in a <script> nested within the <body> it tells WebOS that the app is ready
- TODO: see if we can get this added as in a document.write so that the user doesn't have to explicitly call this method
- * Dependencies: Mojo.onKeyUp
- * Example:
- * navigator.device.deviceReady();
- */
-Device.prototype.deviceReady = function() {
-
- // tell webOS this app is ready to show
- if (window.PalmSystem) {
- // setup keystroke events for forward and back gestures
- document.body.addEventListener("keyup", Mojo.onKeyUp, true);
-
- setTimeout(function() { PalmSystem.stageReady(); PalmSystem.activate(); }, 1);
- alert = this.showBanner;
- }
-
- // fire deviceready event; taken straight from phonegap-iphone
- // put on a different stack so it always fires after DOMContentLoaded
- window.setTimeout(function () {
- var e = document.createEvent('Events');
- e.initEvent('deviceready');
- document.dispatchEvent(e);
- }, 10);
-
- this.setUUID();
- this.setDeviceInfo();
-};
-
-Device.prototype.setDeviceInfo = function() {
- var parsedData = JSON.parse(PalmSystem.deviceInfo);
-
- this.deviceInfo = parsedData;
- this.version = parsedData.platformVersion;
- this.name = parsedData.modelName;
-};
-
-Device.prototype.setUUID = function() {
- //this is the only system property webos provides (may change?)
- var that = this;
- this.service = navigator.service.Request('palm://com.palm.preferences/systemProperties', {
- method:"Get",
- parameters:{"key": "com.palm.properties.nduid" },
- onSuccess: function(result) {
- that.uuid = result["com.palm.properties.nduid"];
- }
- });
-
-
-};
-
-
-if (typeof window.device == 'undefined') window.device = navigator.device = new Device();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/file.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/file.js b/lib/cordova-1.9.0/lib/webos/js/file.js
deleted file mode 100755
index e585e38..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/file.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides generic read and write access to the mobile device file system.
- */
-function File() {
- /**
- * The data of a file.
- */
- this.data = "";
- /**
- * The name of the file.
- */
- this.name = "";
-};
-
-/*
- * Reads a file from the mobile device. This function is asyncronous.
- * @param {String} fileName The name (including the path) to the file on the mobile device.
- * The file name will likely be device dependant.
- * @param {Function} successCallback The function to call when the file is successfully read.
- * @param {Function} errorCallback The function to call when there is an error reading the file from the device.
- */
-File.prototype.read = function(fileName, successCallback, errorCallback) {
- //Mojo has no file i/o yet, so we use an xhr. very limited
- var path = fileName; //incomplete
- //Mojo.Log.error(path);
- navigator.debug.error(path);
-
- if (typeof successCallback != 'function')
- successCallback = function () {};
- if (typeof errorCallback != 'function')
- errorCallback = function () {};
-
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200 && xhr.responseText != null) {
- this.data = xhr.responseText;
- this.name = path;
- successCallback(this.data);
- } else {
- errorCallback({ name: xhr.status, message: "could not read file: " + path });
- }
- }
- };
- xhr.open("GET", path, true);
- xhr.send();
-};
-
-/*
- * Writes a file to the mobile device.
- * @param {File} file The file to write to the device.
- */
-File.prototype.write = function(file) {
- //Palm does not provide file i/o
-};
-
-if (typeof navigator.file == "undefined") navigator.file = new File();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/geolocation.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/geolocation.js b/lib/cordova-1.9.0/lib/webos/js/geolocation.js
deleted file mode 100755
index 519b987..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/geolocation.js
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to device GPS data.
- * @constructor
- */
-function Geolocation() {
- /**
- * The last known GPS position.
- */
- this.lastPosition = null;
- this.lastError = null;
- this.callbacks = {
- onLocationChanged: [],
- onError: []
- };
-};
-
-/*
- * Asynchronously aquires the current position.
- * @param {Function} successCallback The function to call when the position
- * data is available
- * @param {Function} errorCallback The function to call when there is an error
- * getting the position data.
- * @param {PositionOptions} options The options for getting the position data
- * such as timeout.
- */
-Geolocation.prototype.getCurrentPosition = function(successCallback, errorCallback, options) {
- /*
- var referenceTime = 0;
- if (this.lastPosition)
- referenceTime = this.lastPosition.timestamp;
- else
- this.start(options);
- */
-
- var timeout = 20000;
- if (typeof(options) == 'object' && options.timeout)
- timeout = options.timeout;
-
- if (typeof(successCallback) != 'function')
- successCallback = function() {};
- if (typeof(errorCallback) != 'function')
- errorCallback = function() {};
-
- /*
- var dis = this;
- var delay = 0;
- var timer = setInterval(function() {
- delay += interval;
-
- //if we have a new position, call success and cancel the timer
- if (dis.lastPosition && typeof(dis.lastPosition) == 'object' && dis.lastPosition.timestamp > referenceTime) {
- successCallback(dis.lastPosition);
- clearInterval(timer);
- } else if (delay >= timeout) { //else if timeout has occured then call error and cancel the timer
- errorCallback();
- clearInterval(timer);
- }
- //else the interval gets called again
- }, interval);
- */
-
- var responseTime;
- if (timeout <= 5000)
- responseTime = 1;
- else if (5000 < timeout <= 20000)
- responseTime = 2;
- else
- responseTime = 3;
-
- var timer = setTimeout(function() {
- errorCallback({
- message: "timeout"
- });
- },
- timeout);
-
- var startTime = (new Date()).getTime();
-
- var alias = this;
-
- // It may be that getCurrentPosition is less reliable than startTracking ... but
- // not sure if we want to be starting and stopping the tracker if we're not watching.
- //new Mojo.Service.Request('palm://com.palm.location', {
- navigator.service.Request('palm://com.palm.location', {
- method: "getCurrentPosition",
- parameters: {
- responseTime: responseTime
- },
- onSuccess: function(event) {
- alias.lastPosition = {
- coords: {
- latitude: event.latitude,
- longitude: event.longitude,
- altitude: (event.altitude >= 0 ? event.altitude: null),
- speed: (event.velocity >= 0 ? event.velocity: null),
- heading: (event.heading >= 0 ? event.heading: null),
- accuracy: (event.horizAccuracy >= 0 ? event.horizAccuracy: null),
- altitudeAccuracy: (event.vertAccuracy >= 0 ? event.vertAccuracy: null)
- },
- timestamp: new Date().getTime()
- };
-
- var responseTime = alias.lastPosition.timestamp - startTime;
- if (responseTime <= timeout)
- {
- clearTimeout(timer);
- successCallback(alias.lastPosition);
- }
- },
- onFailure: function() {
- errorCallback();
- }
- });
-
-};
-
-/*
- * Asynchronously aquires the position repeatedly at a given interval.
- * @param {Function} successCallback The function to call each time the position
- * data is available
- * @param {Function} errorCallback The function to call when there is an error
- * getting the position data.
- * @param {PositionOptions} options The options for getting the position data
- * such as timeout and the frequency of the watch.
- */
-Geolocation.prototype.watchPosition = function(successCallback, errorCallback, options) {
- // Invoke the appropriate callback with a new Position object every time the implementation
- // determines that the position of the hosting device has changed.
- var frequency = 10000;
- if (typeof(options) == 'object' && options.frequency)
- frequency = options.frequency;
-
- this.start(options, errorCallback);
-
- var referenceTime = 0;
- if (this.lastPosition)
- referenceTime = this.lastPosition.timestamp;
-
- var alias = this;
- return setInterval(function() {
- // check if we have a new position, if so call our successcallback
- if (!alias.lastPosition)
- return;
-
- if (alias.lastPosition.timestamp > referenceTime)
- successCallback(alias.lastPosition);
- },
- frequency);
-};
-
-
-/*
- * Clears the specified position watch.
- * @param {String} watchId The ID of the watch returned from #watchPosition.
- */
-Geolocation.prototype.clearWatch = function(watchId) {
- clearInterval(watchId);
- this.stop();
-};
-
-Geolocation.prototype.start = function(options, errorCallback) {
- //options.timeout;
- //options.interval;
- if (typeof(errorCallback) != 'function')
- errorCallback = function() {};
-
- var that = this;
- var frequency = 10000;
- if (typeof(options) == 'object' && options.frequency)
- frequency = options.frequency;
-
- var responseTime;
- if (frequency <= 5000)
- responseTime = 1;
- else if (5000 < frequency <= 20000)
- responseTime = 2;
- else
- responseTime = 3;
-
- //location tracking does not support setting a custom interval :P
- this.trackingHandle = navigator.service.Request('palm://com.palm.location', {
- method: 'startTracking',
- parameters: {
- subscribe: true
- },
- onSuccess: function(event) {
- that.lastPosition = {
- coords: {
- latitude: event.latitude,
- longitude: event.longitude,
- altitude: (event.altitude >= 0 ? event.altitude: null),
- speed: (event.velocity >= 0 ? event.velocity: null),
- heading: (event.heading >= 0 ? event.heading: null),
- accuracy: (event.horizAccuracy >= 0 ? event.horizAccuracy: null),
- altitudeAccuracy: (event.vertAccuracy >= 0 ? event.vertAccuracy: null)
- },
- timestamp: new Date().getTime()
- };
- },
- onFailure: function() {
- errorCallback();
- }
- });
-};
-
-Geolocation.prototype.stop = function() {
- this.trackingHandle.cancel();
-};
-
-if (typeof navigator.geolocation == "undefined") navigator.geolocation = new Geolocation();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/map.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/map.js b/lib/cordova-1.9.0/lib/webos/js/map.js
deleted file mode 100755
index 8b19644..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/map.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to native mapping applications on the device.
- */
-function Map() {
-
-};
-
-/*
- * Shows a native map on the device with pins at the given positions.
- * @param {Array} positions
- */
-Map.prototype.show = function(positions) {
-
- var jsonPos = {};
- var pos = null;
- if (typeof positions == 'object') {
- // If positions is an array, then get the first only, since google's query
- // can't take more than one marker (believe it or not).
- // Otherwise we assume its a single position object.
- if (positions.length) {
- pos = positions[0];
- } else {
- pos = positions;
- }
- }
- else if (navigator.geolocation.lastPosition) {
- pos = navigator.geolocation.lastPosition;
- } else {
- // If we don't have a position, lets use nitobi!
- pos = { coords: { latitude: 49.28305, longitude: -123.10689 } };
- }
-
- this.service = navigator.service.Request('palm://com.palm.applicationManager', {
- method: 'open',
- parameters: {
- id: 'com.palm.app.maps',
- params: {
- query: "@" + pos.coords.latitude + "," + pos.coords.longitude
- }
- }
- });
-
-};
-
-if (typeof navigator.map == "undefined") navigator.map = new Map();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/mojo.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/mojo.js b/lib/cordova-1.9.0/lib/webos/js/mojo.js
deleted file mode 100755
index 1c7949f..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/mojo.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-//===========================
-// Mojo Dependencies - we still need to rely on these minimal parts of the Mojo framework - should try to find if we can get access to lower level APIs
-// so that we can remove dependence of Mojo
-//===========================
-
-Mojo = {
- contentIndicator: false,
-
- // called by webOS in certain cases
- relaunch: function() {
- var launch = JSON.parse(PalmSystem.launchParams);
-
- if (launch['palm-command'] && launch['palm-command'] == 'open-app-menu')
- this.fireEvent(window, "appmenuopen");
- else
- this.fireEvent(window, "palmsystem", launch);
- },
-
- // called by webOS when your app gets focus
- stageActivated: function() {
- this.fireEvent(window, "activate");
- },
-
- // called by webOS when your app loses focus
- stageDeactivated: function() {
- this.fireEvent(window, "deactivate");
- },
-
- // this is a stub -- called by webOS when orientation changes
- // but the preferred method is to use the orientationchanged
- // DOM event
- screenOrientationChanged: function(dir) {
- },
-
- // used to redirect keyboard events to DOM event "back"
- onKeyUp: function(e) {
- if (e.keyCode == 27)
- this.fireEvent(window, "back");
- },
-
- // private method, used to fire off DOM events
- fireEvent: function(element, event, data) {
- var e = document.createEvent("Event");
- e.initEvent(event, false, true);
-
- if (data)
- e.data = data;
-
- element.dispatchEvent(e);
- },
-
- /*
- not sure if these stubs are still needed since the Log object is encapsulated in debugconsole class
- and the Service object is encapsulated in the Service class
- */
- // stubs to make v8 happier
- Service: {},
- Log: {}
-
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/mouse.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/mouse.js b/lib/cordova-1.9.0/lib/webos/js/mouse.js
deleted file mode 100755
index b002500..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/mouse.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function Mouse() {
-
-};
-
-/*
- * Possibly useful for automated testing, this call to PalmSystem triggers a mouse click (i.e. touch event).
- * x coordinate & y coordinate of where the screen was touched and also a true/false flag to tell WebOS if it should simulate the mouse click
- * @param {Number} x
- * @param {Number} y
- * @param {Boolean} state
- * Example:
- * navigator.mouse.simulateMouseClick(10, 10, true);
- */
-Mouse.prototype.simulateMouseClick = function(x, y, state) {
- PalmSystem.simulateMouseClick(x, y, state || true);
-};
-
-if (typeof navigator.mouse == "undefined") navigator.mouse = new Mouse();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/network.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/network.js b/lib/cordova-1.9.0/lib/webos/js/network.js
deleted file mode 100755
index 12fc57a..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/network.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function Network() {
- /*
- * The last known Network status.
- */
- this.lastReachability = null;
-};
-
-Network.prototype.isReachable = function(hostName, successCallback, options) {
- this.request = navigator.service.Request('palm://com.palm.connectionmanager', {
- method: 'getstatus',
- parameters: {},
- onSuccess: function(result) {
-
- var status = NetworkStatus.NOT_REACHABLE;
- if (result.isInternetConnectionAvailable == true) {
-
- if (result.wan.state == "connected") {
- status = NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK;
- }
-
- if (result.wifi.state == "connected") {
- status = NetworkStatus.REACHABLE_VIA_WIFI_NETWORK;
- }
-
- }
- successCallback(status);
- },
- onFailure: function() {}
- });
-
-};
-
-Network.prototype.connection = function(hostName, successCallback, options) {
- this.request = navigator.service.Request('palm://com.palm.connectionmanager', {
- method: 'getstatus',
- parameters: {},
- onSuccess: function(result) {
- successCallback(result);
- },
- onFailure: function() {}
- });
-};
-
-Network.prototype.connection.type = function(hostName, successCallback, options) {
- navigator.network.isReachable(hostName,successCallback, options);
-};
-
-function Connection() {
- this.code = null;
- this.message = "";
-};
-
-Connection.UNKNOWN = 'unknown';
-Connection.ETHERNET = 'ethernet';
-Connection.WIFI = 'wifi';
-Connection.CELL_2G = '2g';
-Connection.CELL_3G = '3g';
-Connection.CELL_4G = '4g';
-Connection.NONE = 'none';
-
-/*
- * This class contains information about any NetworkStatus.
- * @constructor
- */
-function NetworkStatus() {
- this.code = null;
- this.message = "";
-};
-
-NetworkStatus.NOT_REACHABLE = 0;
-NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK = 1;
-NetworkStatus.REACHABLE_VIA_WIFI_NETWORK = 2;
-
-if (typeof navigator.network == "undefined") navigator.network = new Network();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/notification.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/notification.js b/lib/cordova-1.9.0/lib/webos/js/notification.js
deleted file mode 100755
index 9a3b559..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/notification.js
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to notifications on the device.
- */
-function Notification() {
-
- };
-
-/*
- * adds a dashboard to the WebOS app
- * @param {String} url
- * @param {String} html
- * Example:
- * navigator.notification.newDashboard("dashboard.html");
- */
-Notification.prototype.newDashboard = function(url, html) {
- var win = window.open(url, "_blank", "attributes={\"window\":\"dashboard\"}");
- html && win.document.write(html);
- win.PalmSystem.stageReady();
-};
-
-/*
- * Displays a banner notification. If specified, will send your 'response' object as data via the 'palmsystem' DOM event.
- * If no 'icon' filename is specified, will use a small version of your application icon.
- * @param {String} message
- * @param {Object} response
- * @param {String} icon
- * @param {String} soundClass class of the sound; supported classes are: "ringtones", "alerts", "alarm", "calendar", "notification"
- * @param {String} soundFile partial or full path to the sound file
- * @param {String} soundDurationMs of sound in ms
- * Example:
- * navigator.notification.showBanner('test message');
- */
-Notification.prototype.showBanner = function(message, response, icon, soundClass, soundFile, soundDurationMs) {
- var response = response || {
- banner: true
- };
- PalmSystem.addBannerMessage(message, JSON.stringify(response), icon, soundClass, soundFile, soundDurationMs);
-};
-
-/**
- * Remove a banner from the banner area. The category parameter defaults to 'banner'. Will not remove
- * messages that are already displayed.
- * @param {String} category
- Value defined by the application and usually same one used in {@link showBanner}.
- It is used if you have more than one kind of banner message.
- */
-Notification.prototype.removeBannerMessage = function(category) {
- var bannerKey = category || 'banner';
- var bannerId = this.banners.get(bannerKey);
- if (bannerId) {
- try {
- PalmSystem.removeBannerMessage(bannerId);
- } catch(removeBannerException) {
- window.debug.error(removeBannerException.toString());
- }
- }
-};
-
-/*
- * Remove all pending banner messages from the banner area. Will not remove messages that are already displayed.
- */
-Notification.prototype.clearBannerMessage = function() {
- PalmSystem.clearBannerMessage();
-};
-
-/*
- * This function vibrates the device
- * @param {number} duration The duration in ms to vibrate for.
- * @param {number} intensity The intensity of the vibration
- */
-Notification.prototype.vibrate = function(duration, intensity) {
- //the intensity for palm is inverted; 0=high intensity, 100=low intensity
- //this is opposite from our api, so we invert
- if (isNaN(intensity) || intensity > 100 || intensity <= 0)
- intensity = 0;
- else
- intensity = 100 - intensity;
-
- // if the app id does not have the namespace "com.palm.", an error will be thrown here
- //this.vibhandle = new Mojo.Service.Request("palm://com.palm.vibrate", {
- this.vibhandle = navigator.service.Request("palm://com.palm.vibrate", {
- method: 'vibrate',
- parameters: {
- 'period': intensity,
- 'duration': duration
- }
- },
- false);
-};
-
-/*
- * Plays the specified sound
- * @param {String} soundClass class of the sound; supported classes are: "ringtones", "alerts", "alarm", "calendar", "notification"
- * @param {String} soundFile partial or full path to the sound file
- * @param {String} soundDurationMs of sound in ms
- */
-Notification.prototype.beep = function(soundClass, soundFile, soundDurationMs) {
- PalmSystem.playSoundNotification(soundClass, soundFile, soundDurationMs);
-};
-
-/*
- * displays a notification
- * @param {String} message
- * @param {Object} response
- * @param {String} icon
- */
-Notification.prototype.alert = function(message, response, icon) {
- var response = response || {
- banner: true
- };
- navigator.notification.showBanner(message, response, icon);
-};
-
-if (typeof navigator.notification == 'undefined') {
- navigator.notification = new Notification();
- alert = navigator.notification.alert;
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/orientation.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/orientation.js b/lib/cordova-1.9.0/lib/webos/js/orientation.js
deleted file mode 100755
index c45ba65..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/orientation.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to the device orientation.
- * @constructor
- */
-function Orientation() {
- this.started = false;
-};
-
-/*
- * Manually sets the orientation of the application window.
- * 'up', 'down', 'left' or 'right' used to specify fixed window orientation
- * 'free' WebOS will change the window orientation to match the device orientation
- * @param {String} orientation
- * Example:
- * navigator.orientation.setOrientation('up');
- */
-Orientation.prototype.setOrientation = function(orientation) {
- PalmSystem.setWindowOrientation(orientation);
-};
-
-/*
- * Returns the current window orientation
- */
-Orientation.prototype.getCurrentOrientation = function() {
- return PalmSystem.windowOrientation;
-};
-
-/*
- * Starts the native orientationchange event listener.
- */
-Orientation.prototype.start = function (successCallback) {
- var that = this;
- // This subscribes the callback once for the successCallback function
- that.callback = function (e) {
- document.removeEventListener("orientationChanged", that.callback);
- successCallback(e.orientation);
- }
-
- document.addEventListener("orientationChanged", that.callback);
-
- // This subscribes setOrientation to be constantly updating the currentOrientation property
- document.addEventListener("orientationchange", function(event) {
- var orient = null;
- switch (event.position) {
- case 0: orient = DisplayOrientation.FACE_UP; break;
- case 1: orient = DisplayOrientation.FACE_DOWN; break;
- case 2: orient = DisplayOrientation.PORTRAIT; break;
- case 3: orient = DisplayOrientation.REVERSE_PORTRAIT; break;
- case 4: orient = DisplayOrientation.LANDSCAPE_RIGHT_UP; break;
- case 5: orient = DisplayOrientation.LANDSCAPE_LEFT_UP; break;
- default: return; //orientationchange event seems to get thrown sometimes with a null event position
- }
- that.setOrientation(orient);
- });
- this.started = true;
-};
-
-/*
- * Asynchronously aquires the orientation repeatedly at a given interval.
- * @param {Function} successCallback The function to call each time the orientation
- * data is available.
- * @param {Function} errorCallback The function to call when there is an error
- * getting the orientation data.
- */
-Orientation.prototype.watchOrientation = function(successCallback, errorCallback, options) {
- // Invoke the appropriate callback with a new Position object every time the implementation
- // determines that the position of the hosting device has changed.
- this.getCurrentOrientation(successCallback, errorCallback);
- var interval = 1000;
- if (options && !isNaN(options.interval))
- interval = options.interval;
- var that = this;
- return setInterval(function() {
- that.getCurrentOrientation(successCallback, errorCallback);
- }, interval);
-};
-
-/*
- * Clears the specified orientation watch.
- * @param {String} watchId The ID of the watch returned from #watchOrientation.
- */
-Orientation.prototype.clearWatch = function(watchId) {
- clearInterval(watchId);
-};
-
-/*
- * This class encapsulates the possible orientation values.
- * @constructor
- */
-function DisplayOrientation() {
- this.code = null;
- this.message = "";
-};
-
-DisplayOrientation.PORTRAIT = 0;
-DisplayOrientation.REVERSE_PORTRAIT = 1;
-DisplayOrientation.LANDSCAPE_LEFT_UP = 2;
-DisplayOrientation.LANDSCAPE_RIGHT_UP = 3;
-DisplayOrientation.FACE_UP = 4;
-DisplayOrientation.FACE_DOWN = 5;
-
-if (typeof navigator.orientation == "undefined") navigator.orientation = new Orientation();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/position.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/position.js b/lib/cordova-1.9.0/lib/webos/js/position.js
deleted file mode 100755
index 5954730..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/position.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function Position(coords) {
- this.coords = coords;
- this.timestamp = new Date().getTime();
-};
-
-function Coordinates(lat, lng, alt, acc, head, vel, altacc) {
- /*
- * The latitude of the position.
- */
- this.latitude = lat;
- /*
- * The longitude of the position,
- */
- this.longitude = lng;
- /*
- * The accuracy of the position.
- */
- this.accuracy = acc;
- /*
- * The altitude of the position.
- */
- this.altitude = alt;
- /*
- * The direction the device is moving at the position.
- */
- this.heading = head;
- /*
- * The velocity with which the device is moving at the position.
- */
- this.speed = vel;
- /*
- * The altitude accuracy of the position.
- */
- this.altitudeAccuracy = (typeof(altacc) != 'undefined') ? altacc : null;
-};
-
-/*
- * This class specifies the options for requesting position data.
- * @constructor
- */
-function PositionOptions() {
- /*
- * Specifies the desired position accuracy.
- */
- this.enableHighAccuracy = true;
- /*
- * The timeout after which if position data cannot be obtained the errorCallback
- * is called.
- */
- this.timeout = 10000;
-};
-
-/*
- * This class contains information about any GSP errors.
- * @constructor
- */
-function PositionError() {
- this.code = null;
- this.message = "";
-};
-
-PositionError.UNKNOWN_ERROR = 0;
-PositionError.PERMISSION_DENIED = 1;
-PositionError.POSITION_UNAVAILABLE = 2;
-PositionError.TIMEOUT = 3;
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/service.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/service.js b/lib/cordova-1.9.0/lib/webos/js/service.js
deleted file mode 100755
index 7a062fb..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/service.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function Service() {
-
-};
-
-Service.prototype.Request = function (uri, params) {
- var req = new PalmServiceBridge();
- var url = uri + "/" + (params.method || "");
- req.url = url;
-
- this.req = req;
- this.url = url;
- this.params = params || {};
-
- this.call(params);
-
- return this;
-};
-
-Service.prototype.call = function(params) {
- var onsuccess = null;
- var onfailure = null;
- var oncomplete = null;
-
- if (typeof params.onSuccess === 'function')
- onsuccess = params.onSuccess;
-
- if (typeof params.onFailure === 'function')
- onerror = params.onFailure;
-
- if (typeof params.onComplete === 'function')
- oncomplete = params.onComplete;
-
- this.req.onservicecallback = callback;
-
- function callback(msg) {
- var response = JSON.parse(msg);
-
- if ((response.errorCode) && onfailure)
- onfailure(response);
- else if (onsuccess)
- onsuccess(response);
-
- if (oncomplete)
- oncomplete(response);
- }
-
- this.data = (typeof params.parameters === 'object') ? JSON.stringify(params.parameters) : '{}';
-
- this.req.call(this.url, this.data);
-}
-
-if (typeof navigator.service == "undefined") navigator.service = new Service();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/sms.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/sms.js b/lib/cordova-1.9.0/lib/webos/js/sms.js
deleted file mode 100755
index ba8adb3..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/sms.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to the device SMS functionality.
- * @constructor
- */
-function Sms() {
-
- };
-
-/*
- * Sends an SMS message.
- * @param {Integer} number The phone number to send the message to.
- * @param {String} message The contents of the SMS message to send.
- * @param {Function} successCallback The function to call when the SMS message is sent.
- * @param {Function} errorCallback The function to call when there is an error sending the SMS message.
- * @param {PositionOptions} options The options for accessing the GPS location such as timeout and accuracy.
- */
-Sms.prototype.send = function(number, message, successCallback, errorCallback, options) {
- try {
- this.service = navigator.service.Request('palm://com.palm.applicationManager', {
- method: 'launch',
- parameters: {
- id: "com.palm.app.messaging",
- params: {
- composeAddress: number,
- messageText: message
- }
- }
- });
- successCallback();
- } catch(ex) {
- errorCallback({
- name: "SMSerror",
- message: ex.name + ": " + ex.message
- });
- }
-};
-
-if (typeof navigator.sms == "undefined") navigator.sms = new Sms();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/telephony.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/telephony.js b/lib/cordova-1.9.0/lib/webos/js/telephony.js
deleted file mode 100755
index 7bda4ef..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/telephony.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * This class provides access to the telephony features of the device.
- * @constructor
- */
-function Telephony() {
- this.number = "";
-};
-
-/*
- * Calls the specifed number.
- * @param {Integer} number The number to be called.
- */
-Telephony.prototype.send = function(number) {
- this.number = number;
- this.service = navigator.service.Request('palm://com.palm.applicationManager', {
- method: 'open',
- parameters: {
- target: "tel://" + number
- }
- });
-};
-
-if (typeof navigator.telephony == "undefined") navigator.telephony = new Telephony();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/window.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/window.js b/lib/cordova-1.9.0/lib/webos/js/window.js
deleted file mode 100755
index ebdab41..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/window.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function Window() {
-
- };
-
-/*
- * This is a thin wrapper for 'window.open()' which optionally sets document contents to 'html', and calls 'PalmSystem.stageReady()'
- * on your new card. Note that this new card will not come with your framework (if any) or anything for that matter.
- * @param {String} url
- * @param {String} html
- * Example:
- * navigator.window.newCard('about:blank', '<html><body>Hello again!</body></html>');
- */
-Window.prototype.newCard = function(url, html) {
- var win = window.open(url || "");
- if (html)
- win.document.write(html);
- win.PalmSystem.stageReady();
-};
-
-/*
- * Enable or disable full screen display (full screen removes the app menu bar and the rounded corners of the screen).
- * @param {Boolean} state
- * Example:
- * navigator.window.setFullScreen(true);
- */
-Window.prototype.setFullScreen = function(state) {
- // valid state values are: true or false
- PalmSystem.enableFullScreenMode(state);
-};
-
-/*
- * used to set the window properties of the WebOS app
- * @param {Object} props
- * Example:
- * private method used by other member functions - ideally we shouldn't call this method
- */
-Window.prototype.setWindowProperties = function(props) {
- if (typeof props === 'object')
- navigator.windowProperties = props;
-
- PalmSystem.setWindowProperties(props || this.windowProperties);
-};
-
-/*
- * Enable or disable screen timeout. When enabled, the device screen will not dim. This is useful for navigation, clocks or other "dock" apps.
- * @param {Boolean} state
- * Example:
- * navigator.window.blockScreenTimeout(true);
- */
-Window.prototype.blockScreenTimeout = function(state) {
- navigator.windowProperties.blockScreenTimeout = state;
- this.setWindowProperties();
-};
-
-/*
- * Sets the lightbar to be a little dimmer for screen locked notifications.
- * @param {Boolean} state
- * Example:
- * navigator.window.setSubtleLightbar(true);
- */
-Window.prototype.setSubtleLightbar = function(state) {
- navigator.windowProperties.setSubtleLightbar = state;
- this.setWindowProperties();
-};
-
-if (typeof navigator.window == 'undefined') navigator.window = new Window();
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/js/windowproperties.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/js/windowproperties.js b/lib/cordova-1.9.0/lib/webos/js/windowproperties.js
deleted file mode 100755
index 2b749f5..0000000
--- a/lib/cordova-1.9.0/lib/webos/js/windowproperties.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*
- * Object for storing WebOS window properties
- */
-function WindowProperties() {
- blockScreenTimeout = false;
- setSubtleLightbar = false;
- fastAccelerometer = false;
-};
-
-if (typeof navigator.windowProperties == 'undefined') navigator.windowProperties = new WindowProperties();
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/webos/lib/thumbs.0.5.2.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/webos/lib/thumbs.0.5.2.js b/lib/cordova-1.9.0/lib/webos/lib/thumbs.0.5.2.js
deleted file mode 100755
index c5770c6..0000000
--- a/lib/cordova-1.9.0/lib/webos/lib/thumbs.0.5.2.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-The MIT License
-
-Copyright (c) 2010 Michael Brooks
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-(function(window) {
-
- /**
- * Do not use thumbs.js on touch-enabled devices
- *
- * Thanks to Jesse MacFadyen (purplecabbage):
- * https://gist.github.com/850593#gistcomment-22484
- */
- try {
- document.createEvent('TouchEvent');
- return;
- }
- catch(e) {
- }
-
- /**
- * Map touch events to mouse events
- */
- var eventMap = {
- 'mousedown': 'touchstart',
- 'mouseup': 'touchend',
- 'mousemove': 'touchmove'
- };
-
- /**
- * Fire touch events
- *
- * Monitor mouse events and fire a touch event on the
- * object broadcasting the mouse event. This approach
- * likely has poorer performance than hijacking addEventListener
- * but it is a little more browser friendly.
- */
- window.addEventListener('load', function() {
- for (var key in eventMap) {
- document.body.addEventListener(key, function(e) {
- // Supports:
- // - addEventListener
- // - setAttribute
- var event = createTouchEvent(eventMap[e.type], e);
- e.target.dispatchEvent(event);
-
- // Supports:
- // - element.ontouchstart
- var fn = e.target['on' + eventMap[e.type]];
- if (typeof fn === 'function') fn(e);
- }, false);
- }
- }, false);
-
- /**
- * Utility function to create a touch event.
- *
- * @param name {String} of the event
- * @return event {Object}
- */
- var createTouchEvent = function(name, e) {
- var event = document.createEvent('MouseEvents');
-
- event.initMouseEvent(
- name,
- e.bubbles,
- e.cancelable,
- e.view,
- e.detail,
- e.screenX,
- e.screenY,
- e.clientX,
- e.clientY,
- e.ctrlKey,
- e.altKey,
- e.shiftKey,
- e.metaKey,
- e.button,
- e.relatedTarget
- );
-
- return event;
- };
-
-})(window);
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/CordovaStarter-1.9.0.zip
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/CordovaStarter-1.9.0.zip b/lib/cordova-1.9.0/lib/windows-phone/CordovaStarter-1.9.0.zip
deleted file mode 100755
index a04ad3b..0000000
Binary files a/lib/cordova-1.9.0/lib/windows-phone/CordovaStarter-1.9.0.zip and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/LICENSE
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/LICENSE b/lib/cordova-1.9.0/lib/windows-phone/LICENSE
deleted file mode 100755
index 6a504ba..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/LICENSE
+++ /dev/null
@@ -1,12 +0,0 @@
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/NOTICE
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/NOTICE b/lib/cordova-1.9.0/lib/windows-phone/NOTICE
deleted file mode 100755
index c38e7d7..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/README.md b/lib/cordova-1.9.0/lib/windows-phone/README.md
deleted file mode 100755
index e589bb6..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-Cordova for WP7 Mango
-===
-
-Cordova WP7 is a .net application library that lets you create Cordova applications targeting WP7 Mango devices.
-Cordova based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript.
-
-Requires
----
-
-- Windows Phone SDK 7.1 [http://create.msdn.com/en-us/home/getting_started]
-
-
-Getting Started
----
-
-- copy the file CordovaStarter-x.x.x.zip to the folder : \My Documents\Visual Studio 2010\Templates\ProjectTemplates\
- - if you have just installed VisualStudio, you should launch it once to create this folder
- - if you prefer, you may add the project instead to the "Silverlight for Windows Phone" subfolder of "Visual C#". This is up to you, and only affects where the project template is shown when creating a new project. Also, You may need to create this folder.
-- Launch Visual Studio 2010 and select to create a new project
- - CordovaStarter should be listed as an option, give your new project a name
- - Note: The description will let you know the version of Cordova you are targetting, if you have multiple templates.
- - If you do not see it, you may have to select the top level 'Visual C#' to see it
-- Build and Run it!
-
-Important!!!
----
-
-When you add or remove files/folders in the www folder you will need to do the following
-
-- ensure the new item is included in the project ( Content ) This includes ALL images/css/html/js/* and anything that you want available at runtime.
-- Do not modify the CordovaSourceDictionary.xml file which is included in the project, it is auto-generated for you when you build.
-
-Known Issues
----
-
-You cannot deploy (and thus debug) the framework if you want to make use
-of various Media features by default (like taking a picture, capturing
-audio, etc.). This is because the Zune software
-locks the media library and somehow that affects your device. For a
-workaround, please check out this [MSDN blog article](http://blogs.msdn.com/b/jaimer/archive/2010/11/03/tips-for-debugging-wp7-media-apps-with-wpconnect.aspx).
-
-
-BUGS?
------
-File them at Apache Incubator
-https://issues.apache.org/jira/browse/CB
-
-
-Further Reading
----
-
-- [http://docs.phonegap.com](http://docs.phonegap.com)
-- [http://wiki.phonegap.com](http://wiki.phonegap.com)
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/VERSION b/lib/cordova-1.9.0/lib/windows-phone/VERSION
deleted file mode 100755
index f8e233b..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-1.9.0
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/bin/create.bat b/lib/cordova-1.9.0/lib/windows-phone/bin/create.bat
deleted file mode 100755
index 70b6203..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/bin/create.bat
+++ /dev/null
@@ -1 +0,0 @@
-cscript bin\\create.js $*
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/244fae11/lib/cordova-1.9.0/lib/windows-phone/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-1.9.0/lib/windows-phone/bin/create.js b/lib/cordova-1.9.0/lib/windows-phone/bin/create.js
deleted file mode 100755
index c58997c..0000000
--- a/lib/cordova-1.9.0/lib/windows-phone/bin/create.js
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/*
- * create a cordova/wp7 project
- *
- * USAGE
- * ./create [path package activity]
- */
-
-function Usage()
-{
- WScript.Echo("Usage: create [PATH]"); // [PACKAGE] [ACTIVITY]");
- WScript.Echo("Creates a new cordova/wp7 project.");
-}
-
-var ForReading = 1, ForWriting = 2, ForAppending = 8;
-var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
-
-function read(filename) {
- //WScript.Echo('Reading in ' + filename);
- var fso=WScript.CreateObject("Scripting.FileSystemObject");
- var f=fso.OpenTextFile(filename, 1,2);
- var s=f.ReadAll();
- f.Close();
- return s;
-}
-
-function write(filename, contents) {
- var fso=WScript.CreateObject("Scripting.FileSystemObject");
- var f=fso.OpenTextFile(filename, ForWriting, TristateTrue);
- f.Write(contents);
- f.Close();
-}
-function replaceInFile(filename, regexp, replacement) {
- write(filename,read(filename).replace(regexp,replacement));
-}
-function exec(s, output) {
- WScript.Echo('Executing::' + s);
- var o=shell.Exec(s);
- while (o.Status == 0) {
- WScript.Sleep(100);
- }
- WScript.Echo(o.StdErr.ReadAll());
- WScript.Echo("Command exited with code " + o.Status);
-}
-
-function fork(s) {
- WScript.Echo('Executing ' + s);
- var o=shell.Exec(s);
- while (o.Status != 1) {
- WScript.Sleep(100);
- }
- WScript.Echo(o.StdOut.ReadAll());
- WScript.Echo(o.StdErr.ReadAll());
- WScript.Echo("Command exited with code " + o.Status);
-}
-
-function genGuid()
-{
- var TypeLib = WScript.CreateObject("Scriptlet.TypeLib");
- strGuid = TypeLib.Guid.split("}")[0]; // there is extra crap after the } that is causing file streams to break, probably an EOF ...
- strGuid = strGuid.replace(/[\{\}]/g,"");
- return strGuid;
-}
-
-var args = WScript.Arguments,
- PROJECT_PATH="..\\example\\",
- PACKAGE="org.apache.cordova.example",
- ACTIVITY="cordovaExample",
- shell=WScript.CreateObject("WScript.Shell");
-
-// working dir
-var ROOT = WScript.ScriptFullName.split('\\bin\\create.js').join('');
-
-if (args.Count() > 0)
-{
- PROJECT_PATH = args(0);
- if(PROJECT_PATH.indexOf("--help") > -1 ||
- PROJECT_PATH.indexOf("/?") > -1 )
- {
- Usage();
- WScript.Quit(1);
- }
-
- if(args.Count() > 1)
- {
- PACKAGE=args(1);
- }
-
- if(args.Count() > 2)
- {
- ACTIVITY=args(2);
- }
-
-}
-
-// WScript.Echo("ROOT = " + ROOT);
-// WScript.Echo('PROJECT_PATH ' + PROJECT_PATH);
-// WScript.Echo('PACKAGE ' + PACKAGE);
-// WScript.Echo('ACTIVITY ' + ACTIVITY);
-
-var PACKAGE_AS_PATH=PACKAGE.replace(/\./g, '\\');
-WScript.Echo("Package as path: " + PACKAGE_AS_PATH);
-
-var newProjGuid = genGuid();
-
-// Copy the template source files to the new destination
-exec('cmd /c xcopy templates\\full ' + PROJECT_PATH + ' /S /Y');
-// replace the guid in the AppManifest
-replaceInFile(PROJECT_PATH + "\\Properties\\WMAppManifest.xml","$guid1$",newProjGuid);
-// replace safe-project-name in AppManifest
-replaceInFile(PROJECT_PATH + "\\Properties\\WMAppManifest.xml",/\$safeprojectname\$/g,ACTIVITY);
-
-WScript.Echo("Generated project : " + PROJECT_PATH + ACTIVITY);
-
-// TODO: Name the project according to the arguments
-// update the solution to include the new project by name
-// version BS
-// index.html title set to project name ?
-
-
-
-
-
-
-// var ACTIVITY_PATH=PROJECT_PATH+'\\src\\'+PACKAGE_AS_PATH+'\\'+ACTIVITY+'.java';
-// var MANIFEST_PATH=PROJECT_PATH+'\\AndroidManifest.xml';
-// var TARGET=shell.Exec('android.bat list targets').StdOut.ReadAll().match(/id:\s([0-9]).*/)[1];
-// var VERSION=read('VERSION').replace(/\r\n/,'').replace(/\n/,'');
-
-// WScript.Echo("Project path: " + PROJECT_PATH);
-// WScript.Echo("Package: " + PACKAGE);
-// WScript.Echo("Activity: " + ACTIVITY);
-// WScript.Echo("Package as path: " + PACKAGE_AS_PATH);
-// WScript.Echo("Activity path: " + ACTIVITY_PATH);
-// WScript.Echo("Manifest path: " + MANIFEST_PATH);
-// WScript.Echo("Cordova version: " + VERSION);