Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36C61102CA for ; Thu, 13 Jun 2013 21:52:51 +0000 (UTC) Received: (qmail 87283 invoked by uid 500); 13 Jun 2013 21:52:50 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 87234 invoked by uid 500); 13 Jun 2013 21:52:50 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 87118 invoked by uid 99); 13 Jun 2013 21:52:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jun 2013 21:52:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7456181642C; Thu, 13 Jun 2013 21:52:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hermwong@apache.org To: commits@cordova.apache.org Date: Thu, 13 Jun 2013 21:52:58 -0000 Message-Id: <9d40876a66554bb2a5b48d0c50593a92@git.apache.org> In-Reply-To: <5d4654546ef44174b4cf666fbe1a15a9@git.apache.org> References: <5d4654546ef44174b4cf666fbe1a15a9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/13] js commit: remove notification apis from cordova-js remove notification apis from cordova-js Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/df4a3a31 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/df4a3a31 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/df4a3a31 Branch: refs/heads/3.0.0 Commit: df4a3a31f6a2515e8ab19ca8d1240c940d0c1e12 Parents: 7d503ee Author: hermwong Authored: Tue May 14 14:36:56 2013 -0700 Committer: hermwong Committed: Tue May 14 14:36:56 2013 -0700 ---------------------------------------------------------------------- lib/android/plugin/android/notification.js | 74 --------------- lib/android/plugin/notification/symbols.js | 25 ----- lib/common/plugin/notification.js | 118 ------------------------ lib/common/plugin/notification/symbols.js | 24 ----- 4 files changed, 241 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/df4a3a31/lib/android/plugin/android/notification.js ---------------------------------------------------------------------- diff --git a/lib/android/plugin/android/notification.js b/lib/android/plugin/android/notification.js deleted file mode 100644 index 8936a5c..0000000 --- a/lib/android/plugin/android/notification.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. - * -*/ - -var exec = require('cordova/exec'); - -/** - * Provides Android enhanced notification API. - */ -module.exports = { - activityStart : function(title, message) { - // If title and message not specified then mimic Android behavior of - // using default strings. - if (typeof title === "undefined" && typeof message == "undefined") { - title = "Busy"; - message = 'Please wait...'; - } - - exec(null, null, 'Notification', 'activityStart', [ title, message ]); - }, - - /** - * Close an activity dialog - */ - activityStop : function() { - exec(null, null, 'Notification', 'activityStop', []); - }, - - /** - * Display a progress dialog with progress bar that goes from 0 to 100. - * - * @param {String} - * title Title of the progress dialog. - * @param {String} - * message Message to display in the dialog. - */ - progressStart : function(title, message) { - exec(null, null, 'Notification', 'progressStart', [ title, message ]); - }, - - /** - * Close the progress dialog. - */ - progressStop : function() { - exec(null, null, 'Notification', 'progressStop', []); - }, - - /** - * Set the progress dialog value. - * - * @param {Number} - * value 0-100 - */ - progressValue : function(value) { - exec(null, null, 'Notification', 'progressValue', [ value ]); - } -}; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/df4a3a31/lib/android/plugin/notification/symbols.js ---------------------------------------------------------------------- diff --git a/lib/android/plugin/notification/symbols.js b/lib/android/plugin/notification/symbols.js deleted file mode 100644 index c639dc2..0000000 --- a/lib/android/plugin/notification/symbols.js +++ /dev/null @@ -1,25 +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. - * -*/ - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/notification', 'navigator.notification'); -modulemapper.merges('cordova/plugin/android/notification', 'navigator.notification'); http://git-wip-us.apache.org/repos/asf/cordova-js/blob/df4a3a31/lib/common/plugin/notification.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/notification.js b/lib/common/plugin/notification.js deleted file mode 100644 index 919e050..0000000 --- a/lib/common/plugin/notification.js +++ /dev/null @@ -1,118 +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. - * -*/ - -var exec = require('cordova/exec'); -var platform = require('cordova/platform'); - -/** - * Provides access to notifications on the device. - */ - -module.exports = { - - /** - * Open a native alert dialog, with a customizable title and button text. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} completeCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Alert) - * @param {String} buttonLabel Label of the close button (default: OK) - */ - alert: function(message, completeCallback, title, buttonLabel) { - var _title = (title || "Alert"); - var _buttonLabel = (buttonLabel || "OK"); - exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]); - }, - - /** - * Open a native confirm dialog, with a customizable title and button text. - * The result that the user selects is returned to the result callback. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} resultCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Confirm) - * @param {Array} buttonLabels Array of the labels of the buttons (default: ['OK', 'Cancel']) - */ - confirm: function(message, resultCallback, title, buttonLabels) { - var _title = (title || "Confirm"); - var _buttonLabels = (buttonLabels || ["OK", "Cancel"]); - - // Strings are deprecated! - if (typeof _buttonLabels === 'string') { - console.log("Notification.confirm(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array)."); - } - - // Some platforms take an array of button label names. - // Other platforms take a comma separated list. - // For compatibility, we convert to the desired type based on the platform. - if (platform.id == "android" || platform.id == "ios" || platform.id == "windowsphone" || platform.id == "blackberry10") { - if (typeof _buttonLabels === 'string') { - var buttonLabelString = _buttonLabels; - _buttonLabels = _buttonLabels.split(","); // not crazy about changing the var type here - } - } else { - if (Array.isArray(_buttonLabels)) { - var buttonLabelArray = _buttonLabels; - _buttonLabels = buttonLabelArray.toString(); - } - } - exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]); - }, - - /** - * Open a native prompt dialog, with a customizable title and button text. - * The following results are returned to the result callback: - * buttonIndex Index number of the button selected. - * input1 The text entered in the prompt dialog box. - * - * @param {String} message Dialog message to display (default: "Prompt message") - * @param {Function} resultCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the dialog (default: "Prompt") - * @param {Array} buttonLabels Array of strings for the button labels (default: ["OK","Cancel"]) - * @param {String} defaultText Textbox input value (default: "Default text") - */ - prompt: function(message, resultCallback, title, buttonLabels, defaultText) { - var _message = (message || "Prompt message"); - var _title = (title || "Prompt"); - var _buttonLabels = (buttonLabels || ["OK","Cancel"]); - var _defaultText = (defaultText || "Default text"); - exec(resultCallback, null, "Notification", "prompt", [_message, _title, _buttonLabels, _defaultText]); - }, - - /** - * Causes the device to vibrate. - * - * @param {Integer} mills The number of milliseconds to vibrate for. - */ - vibrate: function(mills) { - exec(null, null, "Notification", "vibrate", [mills]); - }, - - /** - * Causes the device to beep. - * On Android, the default notification ringtone is played "count" times. - * - * @param {Integer} count The number of beeps. - */ - beep: function(count) { - exec(null, null, "Notification", "beep", [count]); - } -}; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/df4a3a31/lib/common/plugin/notification/symbols.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/notification/symbols.js b/lib/common/plugin/notification/symbols.js deleted file mode 100644 index e4d249b..0000000 --- a/lib/common/plugin/notification/symbols.js +++ /dev/null @@ -1,24 +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. - * -*/ - - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.defaults('cordova/plugin/notification', 'navigator.notification');