cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From surajpindo...@apache.org
Subject cordova-plugin-contacts git commit: [CB-8076] Provide error support for browser platform
Date Thu, 23 Feb 2017 19:29:37 GMT
Repository: cordova-plugin-contacts
Updated Branches:
  refs/heads/master 8febb96b2 -> 308922827


[CB-8076] Provide error support for browser platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/30892282
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/30892282
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/30892282

Branch: refs/heads/master
Commit: 308922827c24e63470c05896ad90b31a134ba2b5
Parents: 8febb96
Author: Suraj Pindoria <surajpindoria@apache.org>
Authored: Tue Apr 19 12:58:45 2016 -0700
Committer: Suraj Pindoria <surajpindoria@apache.org>
Committed: Thu Feb 23 11:29:48 2017 -0800

----------------------------------------------------------------------
 plugin.xml                   |  7 +++++++
 src/browser/ContactsProxy.js | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/30892282/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index b0dde6c..8a36d16 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -155,6 +155,13 @@
         <framework src="CoreGraphics.framework" />
     </platform>
 
+    <!-- Browser -->
+    <platform name="browser">
+        <js-module src="src/browser/ContactsProxy.js" name="ContactsProxy">
+            <merges target="navigator.contacts" />
+        </js-module>
+    </platform>
+
     <!-- blackberry10 -->
     <platform name="blackberry10">
         <config-file target="www/config.xml" parent="/widget">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/30892282/src/browser/ContactsProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/ContactsProxy.js b/src/browser/ContactsProxy.js
new file mode 100644
index 0000000..9f11b73
--- /dev/null
+++ b/src/browser/ContactsProxy.js
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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 notSupported() {
+    console.log('Contacts is not supported');
+    return false;
+}
+
+module.exports = {
+    create: notSupported,
+    find: notSupported,
+    pickContact: notSupported
+};
+
+require('cordova/exec/proxy').add('Contacts', module.exports);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message