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 131A4DF0E for ; Tue, 14 May 2013 21:12:43 +0000 (UTC) Received: (qmail 15487 invoked by uid 500); 14 May 2013 21:12:42 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 15398 invoked by uid 500); 14 May 2013 21:12:42 -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 14917 invoked by uid 99); 14 May 2013 21:12:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2013 21:12:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 18C408CF4; Tue, 14 May 2013 21:12:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Tue, 14 May 2013 21:12:57 -0000 Message-Id: In-Reply-To: <88ae71b4ffc34ebe93bf3caed6f2fd5f@git.apache.org> References: <88ae71b4ffc34ebe93bf3caed6f2fd5f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/38] js commit: [BlackBerry10] Removed Notication API implementation [BlackBerry10] Removed Notication API implementation - now exists as core plugin in template - clobbered navigation.notification.vibrate() Reviewed by Bryan Higgins Tested by Tracy Li Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/b205fd1d Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/b205fd1d Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/b205fd1d Branch: refs/heads/3.0.0 Commit: b205fd1da28aa4619731c6fcd5a85be05c9ab120 Parents: 64b5b08 Author: jkeshavarzi Authored: Mon Apr 8 15:22:44 2013 -0400 Committer: Bryan Higgins Committed: Fri May 3 09:49:39 2013 -0400 ---------------------------------------------------------------------- lib/blackberry10/exec.js | 1 - .../plugin/blackberry10/notification.js | 52 --------------- lib/blackberry10/plugin/blackberry10/platform.js | 11 +++ lib/blackberry10/plugin/blackberry10/vibrate.js | 31 +++++++++ 4 files changed, 42 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b205fd1d/lib/blackberry10/exec.js ---------------------------------------------------------------------- diff --git a/lib/blackberry10/exec.js b/lib/blackberry10/exec.js index 80fa69e..ad9c673 100644 --- a/lib/blackberry10/exec.js +++ b/lib/blackberry10/exec.js @@ -24,7 +24,6 @@ var cordova = require('cordova'), 'Accelerometer' : require('cordova/plugin/blackberry10/accelerometer'), 'Compass' : require('cordova/plugin/blackberry10/magnetometer'), 'Capture' : require('cordova/plugin/blackberry10/capture'), - 'Notification' : require('cordova/plugin/blackberry10/notification'), 'Media': require('cordova/plugin/blackberry10/media'), 'FileTransfer': require('cordova/plugin/blackberry10/fileTransfer') }; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b205fd1d/lib/blackberry10/plugin/blackberry10/notification.js ---------------------------------------------------------------------- diff --git a/lib/blackberry10/plugin/blackberry10/notification.js b/lib/blackberry10/plugin/blackberry10/notification.js deleted file mode 100644 index 9de87b8..0000000 --- a/lib/blackberry10/plugin/blackberry10/notification.js +++ /dev/null @@ -1,52 +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 cordova = require('cordova'); - -module.exports = { - alert: function (args, win, fail) { - if (args.length !== 3) { - return {"status" : 9, "message" : "Notification action - alert arguments not found"}; - } - - //Unpack and map the args - var msg = args[0], - title = args[1], - btnLabel = args[2]; - - blackberry.ui.dialog.customAskAsync.apply(this, [ msg, [ btnLabel ], win, { "title" : title } ]); - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" }; - }, - confirm: function (args, win, fail) { - if (args.length !== 3) { - return {"status" : 9, "message" : "Notification action - confirm arguments not found"}; - } - - //Unpack and map the args - var msg = args[0], - title = args[1], - btnLabel = args[2], - btnLabels = btnLabel.split(","); - - blackberry.ui.dialog.customAskAsync.apply(this, [msg, btnLabels, win, {"title" : title} ]); - return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" }; - } -}; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b205fd1d/lib/blackberry10/plugin/blackberry10/platform.js ---------------------------------------------------------------------- diff --git a/lib/blackberry10/plugin/blackberry10/platform.js b/lib/blackberry10/plugin/blackberry10/platform.js index 9678434..b283554 100644 --- a/lib/blackberry10/plugin/blackberry10/platform.js +++ b/lib/blackberry10/plugin/blackberry10/platform.js @@ -46,6 +46,17 @@ module.exports = { clobbers: { requestFileSystem: { path: "cordova/plugin/blackberry10/requestFileSystem" + }, + navigator: { + children: { + notification: { + children: { + vibrate: { + path: 'cordova/plugin/blackberry10/vibrate' + } + } + } + } } }, merges: { http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b205fd1d/lib/blackberry10/plugin/blackberry10/vibrate.js ---------------------------------------------------------------------- diff --git a/lib/blackberry10/plugin/blackberry10/vibrate.js b/lib/blackberry10/plugin/blackberry10/vibrate.js new file mode 100644 index 0000000..ba05294 --- /dev/null +++ b/lib/blackberry10/plugin/blackberry10/vibrate.js @@ -0,0 +1,31 @@ +/* + * + * 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. + * +*/ + +module.exports = function (time) { + var proto = Object.getPrototypeOf(navigator); + + if (proto && proto.vibrate) { + proto.vibrate(time); + } else if (proto && proto.webkitVibrate) { + //Older OS contain webkit prefix + proto.webkitVibrate(time); + } +};