http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/connection/connection.type.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/connection/connection.type.md b/www/docs/zh-cn/3.1.0/cordova/connection/connection.type.md new file mode 100644 index 0000000..ff2b8ea --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/connection/connection.type.md @@ -0,0 +1,125 @@ +--- +license: > + 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. + +title: connection.type +--- + +# connection.type + +檢æ¥ç¶åæ´»åç網路é£æ¥ã + +## 說æ + +æ¤å±¬æ§æä¾å¿«éçæ¹æ³ä¾ç¢ºå®è¨åç網路é£æ¥çæ ï¼åé£ç·é¡åã + +## æ¯æ´çå¹³èº + +* iOS +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + function checkConnection() { + var networkState = navigator.connection.type; + + var states = {}; + states[Connection.UNKNOWN] = 'Unknown connection'; + states[Connection.ETHERNET] = 'Ethernet connection'; + states[Connection.WIFI] = 'WiFi connection'; + states[Connection.CELL_2G] = 'Cell 2G connection'; + states[Connection.CELL_3G] = 'Cell 3G connection'; + states[Connection.CELL_4G] = 'Cell 4G connection'; + states[Connection.CELL] = 'Cell generic connection'; + states[Connection.NONE] = 'No network connection'; + + alert('Connection type: ' + states[networkState]); + } + + checkConnection(); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>navigator.connection.type Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + checkConnection(); + } + + function checkConnection() { + var networkState = navigator.connection.type; + + var states = {}; + states[Connection.UNKNOWN] = 'Unknown connection'; + states[Connection.ETHERNET] = 'Ethernet connection'; + states[Connection.WIFI] = 'WiFi connection'; + states[Connection.CELL_2G] = 'Cell 2G connection'; + states[Connection.CELL_3G] = 'Cell 3G connection'; + states[Connection.CELL_4G] = 'Cell 4G connection'; + states[Connection.CELL] = 'Cell generic connection'; + states[Connection.NONE] = 'No network connection'; + + alert('Connection type: ' + states[networkState]); + } + + </script> + </head> + <body> + <p>A dialog box will report the network state.</p> + </body> + </html> + + +## API æ´æ¹ + +ç§ç¾å¤ç¦ 2.3.0ï¼ç´å° `Connection` ç©ä»¶ç訪åéé `navigator.network.connection` å¾ææ¹çºå ¶ä¸, `navigator.connection` 以å¹é ç W3C è¦ç¯ã å®å¨å ¶åå§ä½ç½®ï¼æ¯ä»ç¶å¯ç¨ï¼ä½å·²å»¢æ£ï¼æçµå°è¢«åªé¤ã + +## iOS çæªç + +* iOS ç¡æ³æª¢æ¸¬å°è窩網路é£æ¥çé¡åã + * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +## Windows Phone æªç + +* When running in the emulator, always detects `navigator.connection.type` as `Connection.UNKNOWN`. + +* Windows Phone ä¸è½æª¢æ¸¬çè窩網路é£æ¥çé¡åã + + * `navigator.connection.type` is set to `Connection.CELL` for all cellular data. + +## Tizen æªç + +* Tizen åªå¯ä»¥æª¢æ¸¬ä¸å WiFi æè è窩é£æ¥ã + * `navigator.connection.type` is set to `Connection.CELL_2G` for all cellular data. \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/Contact/contact.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/Contact/contact.md b/www/docs/zh-cn/3.1.0/cordova/contacts/Contact/contact.md new file mode 100644 index 0000000..6c28cb9 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/Contact/contact.md @@ -0,0 +1,257 @@ +--- +license: > + 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. + +title: é£çµ¡äºº +--- + +# é£çµ¡äºº + +å å«æè¿°è¯ç¹«ï¼å¦ä½¿ç¨è çå人ææ¥åé£çµ¡äººç屬æ§ã + +## å±¬æ§ + +* **id**ï¼ ä¸åå ¨åå¯ä¸èå¥ç¢¼ã*() DOMString* + +* **顯示å稱**ï¼ æ¤é£çµ¡äººï¼é©åæ¼åæçµä½¿ç¨è 顯示çå稱ã*() DOMString* + +* **å稱**ï¼ å å«ææå 件ç人çå稱çç©ä»¶ã*(é£çµ¡äººå§å)* + +* **æµç¨±**: ä¼éç解決é£çµ¡äººå稱ã*() DOMString* + +* **ææ©**ï¼ ä¸åé£åçææé£çµ¡äººçé»è©±è碼ã*(ContactField[])* + +* **é»åéµä»¶**ï¼ ææé£çµ¡äººçé»åéµä»¶å°åçé£åã*(ContactField[])* + +* **ä½å**ï¼ è©²é£çµ¡äººçææä½åçé£åã*(ContactAddress[])* + +* **ims**ï¼ ææé£çµ¡äººç IM ä½åçé£åã*(ContactField[])* + +* **çµç¹**ï¼ è©²é£çµ¡äººçææçµç¹çé£åã*(ContactOrganization[])* + +* **çæ¥**ï¼ é£çµ¡äººççæ¥ã*ï¼æ¥æï¼* + +* **注**ï¼ æéé£çµ¡äººç注éã*() DOMString* + +* **ç §ç**ï¼ é£åé£çµ¡äººçç §çã*(ContactField[])* + +* **é¡å¥**ï¼ é£åèé£çµ¡äººéè¯çææ使ç¨è å®ç¾©çé¡å¥ã*(ContactField[])* + +* **url**ï¼ é£åèé£çµ¡äººéè¯ç web é ã*(ContactField[])* + +## æ¹æ³ + +* **å é**ï¼ è¿åä¸åæ°ç `Contact` ç©ä»¶å°±æ¯èª¿ç¨ç©ä»¶ç深層å¯æ¬ `id` 屬æ§è¨ç½®çº`null`. + +* **åªé¤**ï¼ å¾è¨åçé£çµ¡äººè³æ庫ä¸åªé¤é£çµ¡äººï¼å¦åå·è¡é¯èª¤åæªè `[ContactError](../ContactError/contactError.html)` ç©ä»¶ã + +* **ä¿å**ï¼ å°ä¸åæ°çé£çµ¡äººä¿åå°è¨åçé£çµ¡äººè³æ庫ä¸ï¼ææ´æ°ç¾æçé£çµ¡äºº ï¼å¦æå·²åå¨å ·æç¸å**id**çé£çµ¡äººã + +## 詳細è³è¨ + +`Contact`ç©ä»¶è¡¨ç¤ºä½¿ç¨è çé£çµ¡äººã å¯ä»¥åµå»ºã åå²ï¼æå¾è¨åçé£çµ¡äººè³æ庫ä¸åªé¤çé£çµ¡äººã é£çµ¡äººå¯ä»¥é (å®ç¨ææ¹éï¼ å¾è³æ庫ä¸æª¢ç´¢ééèª¿ç¨ `[contacts.find](../contacts.find.html)` æ¹æ³ã + +**注ï¼**ä¸æ¯ææçä¸é¢ååºçé£çµ¡äººæ¬ä½å¹³èºæ¯æ´çæ¯åè¨åãè«æª¢æ¥æ¯åå¹³èº*çæªç*ç¯ç解詳細è³è¨ã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## ä¿åå¿«éç¤ºä¾ + + function onSuccess(contact) { + alert("Save Success"); + }; + + function onError(contactError) { + alert("Error = " + contactError.code); + }; + + // create a new contact object + var contact = navigator.contacts.create(); + contact.displayName = "Plumber"; + contact.nickname = "Plumber"; // specify both to support all devices + + // populate some fields + var name = new ContactName(); + name.givenName = "Jane"; + name.familyName = "Doe"; + contact.name = name; + + // save to device + contact.save(onSuccess,onError); + + +## å éå¿«éç¤ºä¾ + + // clone the contact object + var clone = contact.clone(); + clone.name.givenName = "John"; + console.log("Original contact name = " + contact.name.givenName); + console.log("Cloned contact name = " + clone.name.givenName); + + +## åªé¤å¿«éç¤ºä¾ + + function onSuccess() { + alert("Removal Success"); + }; + + function onError(contactError) { + alert("Error = " + contactError.code); + }; + + // remove the contact from the device + contact.remove(onSuccess,onError); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + // create + var contact = navigator.contacts.create(); + contact.displayName = "Plumber"; + contact.nickname = "Plumber"; // specify both to support all devices + var name = new ContactName(); + name.givenName = "Jane"; + name.familyName = "Doe"; + contact.name = name; + + // save + contact.save(onSaveSuccess,onSaveError); + + // clone + var clone = contact.clone(); + clone.name.givenName = "John"; + console.log("Original contact name = " + contact.name.givenName); + console.log("Cloned contact name = " + clone.name.givenName); + + // remove + contact.remove(onRemoveSuccess,onRemoveError); + } + + // onSaveSuccess: Get a snapshot of the current contacts + // + function onSaveSuccess(contact) { + alert("Save Success"); + } + + // onSaveError: Failed to get the contacts + // + function onSaveError(contactError) { + alert("Error = " + contactError.code); + } + + // onRemoveSuccess: Get a snapshot of the current contacts + // + function onRemoveSuccess(contacts) { + alert("Removal Success"); + } + + // onRemoveError: Failed to get the contacts + // + function onRemoveError(contactError) { + alert("Error = " + contactError.code); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> + + +## Android 2.X çæªç + +* **é¡å¥**ï¼ ä¸æ¯æ´ Android 2.X è¨åä¸ï¼è¿å`null`. + +## é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ çæªç + +* **id**ï¼ æ¯æ´ãç±è©²è¨ååé æä¿å該é£çµ¡äººã + +* **顯示å稱**ï¼ æ¯æ´ãé»è**user1**æ¬ä½ä¸åå²ã + +* **æµç¨±**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **ææ©**ï¼ é¨åæ¯æ´ã é»è©±è碼åå²å¨é»èçæ¬ä½**homePhone1**å**homePhone2**ä¸ï¼å¦æ*é¡å*æ¯ 'å家'ï¼ **workPhone1**å**workPhone2**å¦æ*é¡å*æ¯ 'å·¥ä½'ï¼**ææ©**å¦æ*é¡å*çºè¡åé»è©±ï¼ **faxPhone** ï¼å¦æ*é¡å*æ¯å³çï¼ **pagerPhone** ï¼å¦æ*é¡å*æ¯ 'å¼å«å¨' å**otherPhone**å¦æ*é¡å*æ¯ä»¥ä¸é½ä¸æ¯ã + +* **é»åéµä»¶**ï¼ é¨åæ¯æ´ã 第ä¸åé»åéµä»¶å°ååå¥åå²å¨é»è**é»åéµä»¶ 1**ï¼**é»åéµä»¶ 2**ã**é»åéµä»¶ 3**æ¬ä½ã + +* **ä½å**ï¼ é¨åæ¯æ´ã第ä¸å第äºåä½ååå¥åå²å¨é»è**家åºä½å**å**workAddress**æ¬ä½ä¸ã + +* **ims**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **çµç¹**ï¼ é¨åæ¯æ´ã **å稱**å**æ¨é¡**ç第ä¸åçµç¹åå²å¨é»è**å ¬å¸**å**æ¨é¡**æ¬ä½ä¸ï¼åå¥ã + +* **ç §ç**ï¼ é¨åæ¯æ´ã æ¯æ´å®ä¸ç縮ç¥å大å°çç §çã è¥è¦è¨ç½®é£çµ¡äººçç §çï¼ééå¨ä»»ä¸ base64 編碼çååææåååç URLã ååä¿åå°é»èææ©çé£çµ¡äººè³æ庫åææ¯ä¾ç¸®å°ã é£çµ¡äººç §çè¿å base64 編碼çååã + +* **é¡å¥**ï¼ é¨åæ¯æ´ãæ¯æ´çåªæ*åæ¥*å*å人*çé¡å¥ã + +* **url**ï¼ é¨åæ¯æ´ã第ä¸å URL åå²å¨é»èææ©**網é **æ¬ä½ä¸ã + +## iOS çæªç + +* **顯示å稱**ï¼ ä¸è¿åç iOS ä¸æ¯æ´ `null` é¤éææ²æ `ContactName` æå®ï¼å¨é種æ æ³ä¸å®å°è¿åè¤åå稱ï¼**綽è**æ `""` ï¼åå¥ã + +* **çæ¥**ï¼ å¿ é è¼¸å ¥ JavaScript ä½çº `Date` ç©ä»¶ï¼å®å°è¿åç¸åçæ¹å¼ã + +* **ç §ç**ï¼ è¿åå°ååï¼åå²å¨æç¨ç¨å¼çè¨æç®éä¸çæªç URLãç¶æç¨ç¨å¼éåºæåªé¤è¨æç®éçå §å®¹ã + +* **é¡å¥**ï¼ éç®åä¸æ¯æ´å±¬æ§ï¼è¿å`null`. + +## Windows Phone 7 å 8 æªç + +* **顯示å稱**ï¼ ç¶åµå»ºä¸åé£çµ¡äººï¼æä¾ç顯示å稱åæ¸ä¸åäºé¡¯ç¤ºå稱çå¼æª¢ç´¢æ¥æ¾é£çµ¡äººæã + +* **url**ï¼ ç¶åµå»ºä¸åé£çµ¡äººï¼ä½¿ç¨è å¯ä»¥è¼¸å ¥åä¿åå¤å web ä½åï¼ä½åªæä¸åæ¯å¯ç¨æï¼å¯ä»¥ä½¿ç¨æç´¢é£çµ¡äººã + +* **ææ©**ï¼ ä¸æ¯æ´*åç §*é¸é ã å¨*æ¥æ¾*æä½ä¸ä¸æ¯æ¯æ´ç*é¡å*ã åªæä¸å `phoneNumber` å 許çºæ¯å*é¡å*. + +* **é»åéµä»¶**ï¼*åç §*é¸é ä¸åæ¯æ´ã家åºåå人使ç¨å¼ç¨åä¸é»åéµä»¶é ãåªæä¸é 被å 許çºæ¯å*é¡å*. + +* **ä½å**ï¼ å æ¯æ´å·¥ä½å家åº/å人*é¡å*ã家åºåå人*é¡å*å¼ç¨ç¸åçä½åæ¢ç®ãåªæä¸é 被å 許çºæ¯å*é¡å*. + +* **çµç¹**ï¼ å¯ä¸ä¸åå 許ç並ä¸ä¸æ¯æ´ç*æ²»å®*ã*é¡å*å*æ°èé¨*ç屬æ§ã + +* **注æ**ï¼ ä¸æ¯æ´è¿å`null`. + +* **ims**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **çæ¥**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **é¡å¥**: ä¸åæ¯æ´ï¼è¿å`null`. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactAddress/contactaddress.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactAddress/contactaddress.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactAddress/contactaddress.md new file mode 100644 index 0000000..c94ed02 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactAddress/contactaddress.md @@ -0,0 +1,170 @@ +--- +license: > + 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. + +title: ContactAddress +--- + +# ContactAddress + +å å«ä½å屬æ§ç `Contact` ç©ä»¶ã + +## å±¬æ§ + +* **ä¸ä¸é **: è¨ç½®çº `true` å¦ææ¤ `ContactAddress` å å«ä½¿ç¨è çé¦é¸çå¼ã*ï¼å¸æï¼* + +* **é¡å**ï¼ ä¸åå串ï¼ä¾å¦æ示åªç¨®é¡åçæ¬ä½éæ¯*å家*ã*() DOMString* + +* **æ ¼å¼**ï¼ é¡¯ç¤ºæ ¼å¼çå®æ´ä½åã*() DOMString* + +* **streetAddress**ï¼ å®æ´çè¡éä½åã*() DOMString* + +* **å°é»**ï¼ åå¸æå°é»ã*() DOMString* + +* **åå**ï¼ å家æå°åã*() DOMString* + +* **éµéåè**ï¼ éµéåèæéµæ¿ä»£ç¢¼ã*() DOMString* + +* **å家**ï¼ å家å稱ã*() DOMString* + +## 詳細è³è¨ + +`ContactAddress`ç©ä»¶åå²çå®ä¸ä½åçé£çµ¡äººç屬æ§ã A `Contact` ç©ä»¶å¯è½å æ¬å¤åä½åå¨ `ContactAddress[]` é£åã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + // display the address information for all contacts + + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + for (var j = 0; j < contacts[i].addresses.length; j++) { + alert("Pref: " + contacts[i].addresses[j].pref + "\n" + + "Type: " + contacts[i].addresses[j].type + "\n" + + "Formatted: " + contacts[i].addresses[j].formatted + "\n" + + "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" + + "Locality: " + contacts[i].addresses[j].locality + "\n" + + "Region: " + contacts[i].addresses[j].region + "\n" + + "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" + + "Country: " + contacts[i].addresses[j].country); + } + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + // find all contacts + var options = new ContactFindOptions(); + options.filter = ""; + var filter = ["displayName", "addresses"]; + navigator.contacts.find(filter, onSuccess, onError, options); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + // find all contacts + var options = new ContactFindOptions(); + options.filter = ""; + var filter = ["displayName", "addresses"]; + navigator.contacts.find(filter, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + // + function onSuccess(contacts) { + // display the address information for all contacts + for (var i = 0; i < contacts.length; i++) { + for (var j = 0; j < contacts[i].addresses.length; j++) { + alert("Pref: " + contacts[i].addresses[j].pref + "\n" + + "Type: " + contacts[i].addresses[j].type + "\n" + + "Formatted: " + contacts[i].addresses[j].formatted + "\n" + + "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" + + "Locality: " + contacts[i].addresses[j].locality + "\n" + + "Region: " + contacts[i].addresses[j].region + "\n" + + "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" + + "Country: " + contacts[i].addresses[j].country); + } + } + }; + + // onError: Failed to get the contacts + // + function onError(contactError) { + alert('onError!'); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> + + +## Android 2.X çæªç + +* **ä¸ä¸é **: ä¸åæ¯æ´ï¼è¿å `false` Android 2.X çè¨åä¸ã + +## é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ çæªç + +* **ä¸ä¸é **ï¼ è¿åçé»èè¨åä¸ä¸æ¯æ´`false`. + +* **é¡å**ï¼ é¨åæ¯æ´ã*å·¥ä½*å*家åº*é¡åä½åçæ¯åå¯ä¸ä¸åå¯ä»¥åå²æ¯åé£çµ¡äººã + +* **æ ¼å¼å**ï¼ é¨åæ¯æ´ãè¿åç串è¯çææé»èææ©ä½åæ¬ä½ã + +* **streetAddress**: æ¯æ´ãè¿åç串è¯çé»è**ä½å 1**å**ä½å 2**çä½åæ¬ä½ã + +* **ç¾å ´**: æ¯æ´ãé»èææ©**å**ä½åæ¬ä½ä¸åå²ã + +* **åå**ï¼ æ¯æ´ãé»èææ©**stateProvince**ä½åæ¬ä½ä¸åå²ã + +* **éµéåè**: æ¯æ´ãé»èææ©**zipPostal**ä½åæ¬ä½ä¸åå²ã + +* **å家**ï¼ æ¯æ´ã + +## iOS çæªç + +* **ä¸ä¸é **ï¼ è¿åç iOS è¨åä¸ä¸æ¯æ´`false`. + +* **æ ¼å¼å**ï¼ ç®åä¸æ¯æ´ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactError/contactError.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactError/contactError.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactError/contactError.md new file mode 100644 index 0000000..bb5faa8 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactError/contactError.md @@ -0,0 +1,43 @@ +--- +license: > + 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. + +title: ContactError +--- + +# ContactError + +A `ContactError` ç©ä»¶å³é給 `[contactError](../parameters/contactError.html)` åæªæåºç¾é¯èª¤ã + +## å±¬æ§ + +* **代碼**ï¼ ä¸é¢ååºçé å®ç¾©çé¯èª¤ä»£ç¢¼ä¹ä¸ã + +## 常é + +* `ContactError.UNKNOWN_ERROR` +* `ContactError.INVALID_ARGUMENT_ERROR` +* `ContactError.TIMEOUT_ERROR` +* `ContactError.PENDING_OPERATION_ERROR` +* `ContactError.IO_ERROR` +* `ContactError.NOT_SUPPORTED_ERROR` +* `ContactError.PERMISSION_DENIED_ERROR` + +## 說æ + +`ContactError`ç©ä»¶è¿åå°ä½¿ç¨è éé `[contactError](../parameters/contactError.html)` åå¼å½æ¸æåºç¾é¯èª¤ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactField/contactfield.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactField/contactfield.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactField/contactfield.md new file mode 100644 index 0000000..61e76df --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactField/contactfield.md @@ -0,0 +1,145 @@ +--- +license: > + 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. + +title: ContactField +--- + +# ContactField + +æ¯æ´æ³åæ¬ä½å¨ `Contact` ç©ä»¶ãæäºå±¬æ§åå²ä½çº `ContactField` ç©ä»¶å æ¬é»åéµä»¶å°åã é»è©±è碼å Urlã + +## å±¬æ§ + +* **é¡å**ï¼ ä¸åå串ï¼ä¾å¦æ示åªç¨®é¡åçæ¬ä½éæ¯*å家*ã*() DOMString* + +* **å¼**ï¼ æ¬ä½çå¼ï¼å¦é»è©±è碼æé»åéµä»¶å°åã*() DOMString* + +* **ä¸ä¸é **: è¨ç½®çº `true` å¦ææ¤ `ContactField` å å«ä½¿ç¨è çé¦é¸çå¼ã*ï¼å¸æï¼* + +## 詳細è³è¨ + +`ContactField`ç©ä»¶æ¯å¯éç¨çå 件表示æ³æé£çµ¡äººæ¬ä½ã æ¯å `ContactField` ç©ä»¶å å« `value` ï¼ `type` ï¼å `pref` 屬æ§ã A `Contact` ç©ä»¶åå²ä¸çå¹¾åå±¬æ§ `ContactField[]` é£åï¼å¦é»è©±è碼åé»åéµä»¶å°åã + +å¨å¤§å¤æ¸æ æ³ä¸ï¼æ²æä»»ä½é å 確å®çå¼çº `ContactField` ç©ä»¶ç**type**屬æ§ã ä¾å¦ï¼é»è©±è碼å¯ä»¥æå®**é¡å**ç*家åº*ã*å·¥ä½*ã*移å*ã *iPhone*æç±ä¸åç¹å®çè¨åå¹³èºè¯ç¹«è³æ庫æ¯æ´çä»»ä½å ¶ä»å¼çå¼ã ç¶èï¼å°æ¼ `Contact` **çç §ç**æ¬ä½ï¼**é¡å**æ¬ä½æ示è¿åååçæ ¼å¼ï¼ **url**ç**å¼**屬æ§å å«çç §çååæ*base64*ç URL æç**å¼**å å«ä¸å base64 編碼çååå串æã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + // create a new contact + var contact = navigator.contacts.create(); + + // store contact phone numbers in ContactField[] + var phoneNumbers = []; + phoneNumbers[0] = new ContactField('work', '212-555-1234', false); + phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number + phoneNumbers[2] = new ContactField('home', '203-555-7890', false); + contact.phoneNumbers = phoneNumbers; + + // save the contact + contact.save(); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + + function onDeviceReady() { + // create a new contact + var contact = navigator.contacts.create(); + + // store contact phone numbers in ContactField[] + var phoneNumbers = []; + phoneNumbers[0] = new ContactField('work', '212-555-1234', false); + phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number + phoneNumbers[2] = new ContactField('home', '203-555-7890', false); + contact.phoneNumbers = phoneNumbers; + + // save the contact + contact.save(); + + // search contacts, returning display name and phone numbers + var options = new ContactFindOptions(); + options.filter = ""; + filter = ["displayName", "phoneNumbers"]; + navigator.contacts.find(filter, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + // + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + // display phone numbers + for (var j = 0; j < contacts[i].phoneNumbers.length; j++) { + alert("Type: " + contacts[i].phoneNumbers[j].type + "\n" + + "Value: " + contacts[i].phoneNumbers[j].value + "\n" + + "Preferred: " + contacts[i].phoneNumbers[j].pref); + } + } + }; + + // onError: Failed to get the contacts + // + function onError(contactError) { + alert('onError!'); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> + + +## Android çæªç + +* **ä¸ä¸é **: ä¸åæ¯æ´ï¼è¿å`false`. + +## é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ çæªç + +* **é¡å**ï¼ é¨åæ¯æ´ã使ç¨çé»è©±è碼ã + +* **å¼**ï¼ æ¯æ´ã + +* **ä¸ä¸é **: ä¸åæ¯æ´ï¼è¿å`false`. + +## iOS çæªç + +* **ä¸ä¸é **: ä¸åæ¯æ´ï¼è¿å`false`. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactFindOptions/contactfindoptions.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactFindOptions/contactfindoptions.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactFindOptions/contactfindoptions.md new file mode 100644 index 0000000..d30d421 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactFindOptions/contactfindoptions.md @@ -0,0 +1,112 @@ +--- +license: > + 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. + +title: ContactFindOptions +--- + +# ContactFindOptions + +å å«å¯ç¨æ¼ç¯©é¸çµæçå±¬æ§ `[contacts.find](../contacts.find.html)` æä½ã + +## å±¬æ§ + +* **篩é¸å¨**ï¼ ç¨ä¾æ¥æ¾é£çµ¡äººçæç´¢å串ã*() DOMString*ï¼é è¨å¼ï¼`""`) + +* **å¤å**ï¼ ç¢ºå®æ¯å¦æ¥æ¾æä½è¿åå¤åé£çµ¡äººã*ï¼å¸æï¼*ï¼é è¨å¼ï¼`false`) + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + // success callback + function onSuccess(contacts) { + for (var i=0; i<contacts.length; i++) { + alert(contacts[i].displayName); + } + }; + + // error callback + function onError(contactError) { + alert('onError!'); + }; + + // specify contact search criteria + var options = new ContactFindOptions(); + options.filter=""; // empty search string returns all contacts + options.multiple=true; // return multiple results + filter = ["displayName"]; // return contact.displayName field + + // find contacts + navigator.contacts.find(filter, onSuccess, onError, options); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + // specify contact search criteria + var options = new ContactFindOptions(); + options.filter = ""; // empty search string returns all contacts + options.multiple = true; // return multiple results + filter = ["displayName"]; // return contact.displayName field + + // find contacts + navigator.contacts.find(filter, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + // + function onSuccess(contacts) { + for (var i=0; i<contacts.length; i++) { + alert(contacts[i].displayName); + } + }; + + // onError: Failed to get the contacts + // + function onError(contactError) { + alert('onError!'); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactName/contactname.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactName/contactname.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactName/contactname.md new file mode 100644 index 0000000..17dc013 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactName/contactname.md @@ -0,0 +1,147 @@ +--- +license: > + 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. + +title: é£çµ¡äººå§å +--- + +# é£çµ¡äººå§å + +å å«æéçä¸å種é¡çè³è¨ `Contact` ç©ä»¶çå稱ã + +## å±¬æ§ + +* **æ ¼å¼å**ï¼ è©²é£çµ¡äººçå®æ´å稱ã*() DOMString* + +* **家æ**ï¼ é£çµ¡äººçå§æ°ã*() DOMString* + +* **givenName**ï¼ é£çµ¡äººçååã*() DOMString* + +* **ä¹é**ï¼ é£çµ¡äººçä¸éåã*() DOMString* + +* **honorificPrefix**ï¼ é£çµ¡äººçé¦ç¢¼ (ä¾å¦*å ç*æ*å士*ï¼ *(DOMString)* + +* **honorificSuffix**ï¼ é£çµ¡äººç尾碼 ï¼å¦*å¾å¸«*ï¼ã*() DOMString* + +## 詳細è³è¨ + +`ContactName`ç©ä»¶åå²çé£çµ¡äººçå稱屬æ§ã + +## æ¯æ´çå¹³èº + +* Android 2.X +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + alert("Formatted: " + contacts[i].name.formatted + "\n" + + "Family Name: " + contacts[i].name.familyName + "\n" + + "Given Name: " + contacts[i].name.givenName + "\n" + + "Middle Name: " + contacts[i].name.middleName + "\n" + + "Suffix: " + contacts[i].name.honorificSuffix + "\n" + + "Prefix: " + contacts[i].name.honorificSuffix); + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + var options = new ContactFindOptions(); + options.filter = ""; + filter = ["displayName", "name"]; + navigator.contacts.find(filter, onSuccess, onError, options); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var options = new ContactFindOptions(); + options.filter=""; + filter = ["displayName","name"]; + navigator.contacts.find(filter, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + // + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i ++) { + alert("Formatted: " + contacts[i].name.formatted + "\n" + + "Family Name: " + contacts[i].name.familyName + "\n" + + "Given Name: " + contacts[i].name.givenName + "\n" + + "Middle Name: " + contacts[i].name.middleName + "\n" + + "Suffix: " + contacts[i].name.honorificSuffix + "\n" + + "Prefix: " + contacts[i].name.honorificPrefix); + } + }; + + // onError: Failed to get the contacts + // + function onError(contactError) { + alert('onError!'); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> + + +## Android çæªç + +* **æ ¼å¼å**ï¼ é¨åæ¯æ´ï¼åå¯è®ã è¿åç串è¯ç `honorificPrefix` ï¼ `givenName` ï¼ `middleName` ï¼ `familyName` ï¼å`honorificSuffix`. + +## é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ çæªç + +* **æ ¼å¼å**ï¼ é¨åæ¯æ´ãè¿åç串è¯çé»èææ©**åå**å**å§æ°**æ¬ä½ã + +* **家æ**: æ¯æ´ãé»è**å§æ°**æ¬ä½ä¸åå²ã + +* **givenName**ï¼ æ¯æ´ãé»è**åå**æ¬ä½ä¸åå²ã + +* **ä¹é**ï¼ ä¸åæ¯æ´ï¼è¿å`null`. + +* **honorificPrefix**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **honorificSuffix**: ä¸åæ¯æ´ï¼è¿å`null`. + +## iOS çæªç + +* **æ ¼å¼å**ï¼ é¨åæ¯æ´ãè¿å iOS è¤åå稱ï¼ä½çºå¯è®ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/ContactOrganization/contactorganization.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/ContactOrganization/contactorganization.md b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactOrganization/contactorganization.md new file mode 100644 index 0000000..1fd06ae --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/ContactOrganization/contactorganization.md @@ -0,0 +1,153 @@ +--- +license: > + 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. + +title: ContactOrganization +--- + +# ContactOrganization + +å å« `Contact` ç©ä»¶ççµç¹å±¬æ§ã + +## å±¬æ§ + +* **ä¸ä¸é **: è¨ç½®çº `true` å¦ææ¤ `ContactOrganization` å å«ä½¿ç¨è çé¦é¸çå¼ã*ï¼å¸æï¼* + +* **é¡å**ï¼ ä¸åå串ï¼ä¾å¦æ示åªç¨®é¡åçæ¬ä½éæ¯*å家*ã_(DOMString) + +* **å稱**ï¼ çµç¹çå稱ã*() DOMString* + +* **é¨é**ï¼ æ°èé¨çå·¥ç¨åç´ã*() DOMString* + +* **æ¨é¡**ï¼ å¨çµç¹é£çµ¡äººçæ¨é¡ã*() DOMString* + +## 詳細è³è¨ + +`ContactOrganization`ç©ä»¶åå²çé£çµ¡äººççµç¹å±¬æ§ãA `Contact` ç©ä»¶åå²ä¸åæå¤å `ContactOrganization` é£åä¸çç©ä»¶ã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + for (var j = 0; j < contacts[i].organizations.length; j++) { + alert("Pref: " + contacts[i].organizations[j].pref + "\n" + + "Type: " + contacts[i].organizations[j].type + "\n" + + "Name: " + contacts[i].organizations[j].name + "\n" + + "Department: " + contacts[i].organizations[j].department + "\n" + + "Title: " + contacts[i].organizations[j].title); + } + } + }; + + function onError(contactError) { + alert('onError!'); + }; + + var options = new ContactFindOptions(); + options.filter = ""; + filter = ["displayName", "organizations"]; + navigator.contacts.find(filter, onSuccess, onError, options); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var options = new ContactFindOptions(); + options.filter=""; + filter = ["displayName","organizations"]; + navigator.contacts.find(filter, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + // + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + for (var j = 0; j < contacts[i].organizations.length; j++) { + alert("Pref: " + contacts[i].organizations[j].pref + "\n" + + "Type: " + contacts[i].organizations[j].type + "\n" + + "Name: " + contacts[i].organizations[j].name + "\n" + + "Department: " + contacts[i].organizations[j].department + "\n" + + "Title: " + contacts[i].organizations[j].title); + } + } + }; + + // onError: Failed to get the contacts + // + function onError(contactError) { + alert('onError!'); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> + + +## Android 2.X çæªç + +* **ä¸ä¸é **: ä¸æ¯æ´ç Android 2.X çè¨åï¼è¿å`false`. + +## é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ çæªç + +* **ä¸ä¸é **: ä¸æ¯æ´çé»èè¨åï¼è¿å`false`. + +* **é¡å**ï¼ ä¸æ¯æ´çé»èè¨åï¼è¿å`null`. + +* **å稱**ï¼ é¨åæ¯æ´ã第ä¸æ¬¡çµç¹å稱åå²å¨é»è**å ¬å¸**æ¬ä½ä¸ã + +* **é¨**: ä¸åæ¯æ´ï¼è¿å`null`. + +* **æ¨é¡**: é¨åæ¯æ´ã第ä¸æ¬¡çµç¹æ¨é¡æ¯é»è**jobTitle**æ¬ä½ä¸åå²çã + +## iOS çæªç + +* **ä¸ä¸é **ï¼ è¿åç iOS è¨åä¸ä¸æ¯æ´`false`. + +* **é¡å**ï¼ ä¸æ¯æ´ç iOS è¨åä¸ï¼è¿å`null`. + +* **å稱**ï¼ é¨åæ¯æ´ã第ä¸æ¬¡çµç¹å稱åå²å¨ iOS **kABPersonOrganizationProperty**æ¬ä½ä¸ã + +* **æ°èé¨**ï¼ é¨åæ¯æ´ã第ä¸é¨å稱åå²å¨ iOS **kABPersonDepartmentProperty**æ¬ä½ä¸ã + +* **æ¨é¡**: é¨åæ¯æ´ã第ä¸åæ¨é¡æ¯ iOS **kABPersonJobTitleProperty**æ¬ä½ä¸åå²çã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.create.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.create.md b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.create.md new file mode 100644 index 0000000..d3f28b7 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.create.md @@ -0,0 +1,76 @@ +--- +license: > + 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. + +title: contacts.create +--- + +# contacts.create + +è¿åä¸åæ°çé£çµ¡äººç©ä»¶ã + + var contact = navigator.contacts.create(properties); + + +## 說æ + +`contacts.create`æ¹æ³æ¯åæ¥ç並è¿åä¸åæ°ç `Contact` ç©ä»¶ã + +æ¤æ¹æ³ä¸æä¿çé£çµ¡äººç©ä»¶å¨è¨åçé£çµ¡äººè³æ庫ä¸ï¼æ¨éè¦çºå ¶èª¿ç¨ `Contact.save` æ¹æ³ã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 + +## å¿«éçç¤ºä¾ + + var myContact = navigator.contacts.create({"displayName": "Test User"}); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var myContact = navigator.contacts.create({"displayName": "Test User"}); + myContact.note = "This contact has a note."; + console.log("The contact, " + myContact.displayName + ", note: " + myContact.note); + } + + </script> + </head> + <body> + <h1>Example</h1> + <p>Create Contact</p> + </body> + </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.find.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.find.md b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.find.md new file mode 100644 index 0000000..3715fc1 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.find.md @@ -0,0 +1,116 @@ +--- +license: > + 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. + +title: contacts.find +--- + +# contacts.find + +æ¥è©¢è¨åé£çµ¡äººè³æ庫ï¼ä¸¦è¿åä¸åæå¤å `Contact` ç©ä»¶ï¼æ¯åå å«æå®çæ¬ä½ã + + navigator.contacts.find(contactFields, contactSuccess, contactError, contactFindOptions); + + +## 說æ + +`contacts.find`æ¹æ³ä»¥éåæ¥æ¹å¼ï¼å·è¡è¨åçé£çµ¡äººè³æ庫æ¥è©¢ä¸¦è¿åä¸åé£åç `Contact` ç©ä»¶ã æå¾å°çç©ä»¶å³é給 `[contactSuccess](parameters/contactSuccess.html)` **contactSuccess**åæ¸ææå®çåå¼å½æ¸ã + +**ContactFields**åæ¸æå®è¦æç´¢çéå®è©ï¼ä½çºä½¿ç¨çæ¬ä½ï¼åªæé£äºçµæå³é給**contactSuccess**åå¼å½æ¸ã é¶é·åº¦**contactFields**åæ¸æ¯ä¸æ£ç¢ºçµæå¨ `[ContactError](ContactError/contactError.html).INVALID_ARGUMENT_ERROR` ã **ContactFields**å¼çº `"*"` è¿åææé£çµ¡äººæ¬ä½ã + +**ContactFindOptions.filter**å串æ¥è©¢é£çµ¡äººè³æ庫æï¼å¯ä»¥ç¨ä½æ索篩é¸å¨ã å¦ææä¾ï¼ä¸åå大å°å¯«ï¼é¨åå¼å¹é æç¨æ¼å¨**contactFields**åæ¸ä¸æå®çæ¯åæ¬ä½ã å¦ææ*ä»»ä½*æå®çæ¬ä½çå¹é ï¼åè¿å該é£çµ¡äººã + +## åæ¸ + +* **contactFields**ï¼ é£çµ¡äººæ¬ä½ä½¿ç¨ä½çºæç´¢çéå®è©ãçæç `Contact` ç©ä»¶åªè½ä½¿ç¨éäºæ¬ä½çå¼ã*(DOMString[])*[è¦æ±] + +* **contactSuccess**ï¼ å¾è³æ庫è¿åæååå¼å½æ¸èª¿ç¨æ使ç¨çé£çµ¡äººã[è¦æ±] + +* **contactError**ï¼ é¯èª¤åå¼å½æ¸ï¼ç¶ç¼çé¯èª¤æ調ç¨ã[å¯é¸] + +* **contactFindOptions**: æç´¢é¸é ï¼ä»¥é濾é£çµ¡äººã[å¯é¸] + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + function onSuccess(contacts) { + alert('Found ' + contacts.length + ' contacts.'); + }; + + function onError(contactError) { + alert('onError!'); + }; + + // find all contacts with 'Bob' in any name field + var options = new ContactFindOptions(); + options.filter = "Bob"; + options.multiple = true; + var fields = ["displayName", "name"]; + navigator.contacts.find(fields, onSuccess, onError, options); + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Contact Example</title> + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + + function onDeviceReady() { + // find all contacts with 'Bob' in any name field + var options = new ContactFindOptions(); + options.filter = "Bob"; + var fields = ["displayName", "name"]; + navigator.contacts.find(fields, onSuccess, onError, options); + } + + // onSuccess: Get a snapshot of the current contacts + + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + console.log("Display Name = " + contacts[i].displayName); + } + } + + // onError: Failed to get the contacts + + function onError(contactError) { + alert('onError!'); + } + </script> + </head> + + <body> + <h1>Example</h1> + <p>Find Contacts</p> + </body> + </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.md b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.md new file mode 100644 index 0000000..f32e173 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/contacts.md @@ -0,0 +1,109 @@ +--- +license: > + 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. + +title: é£çµ¡äºº +--- + +# é£çµ¡äºº + +> `contacts`ç©ä»¶æä¾å°è¨åçé£çµ¡äººè³æ庫ç訪åã + +**éè¦çé±ç§æ³¨ï¼**é£çµ¡äººè³æçæ¶éå使ç¨æåºäºéè¦çé±ç§åé¡ã æ¨çæç¨ç¨å¼çé±ç§æ¬ååæ該è¨è«å¦ä½æç¨ç¨å¼ä½¿ç¨çé£çµ¡äººè³æåå®æ¯å¦è¢«å ±ç¨èä»»ä½å ¶ä»æ¹ã è¯ç¹«è³è¨è¢«è¦çºææï¼å çºå®æ示äºäººè人éä¿¡ç人åã å æ¤ï¼é¤äºæ¨çæç¨ç¨å¼çé±ç§æ¬ååï¼æ¨æå¼·çèæ ®æä¾å¨æ¨çæç¨ç¨å¼è¨ªåæ使ç¨é£çµ¡äººè³æ ï¼å¦æè¨åä½æ¥ç³»çµ±ä¸æé樣åå·²ç¶ï¼ ä¹åçæéåªæ¯éç¥ã 該éç¥ææä¾ç¸åçè³è¨ä¸ææåºç並ç²å該使ç¨è ç許å¯æ¬ ï¼ä¾å¦ï¼ééçº**確å®**並**ä¸æè¬**æåºçé¸æï¼ã è«æ³¨ææäºæç¨ç¨å¼å¸å ´å¯è½éè¦æ¨çæç¨ç¨å¼æä¾åªæ¯æéçéç¥ï¼ä¸¦å¾è¨ªåé£çµ¡äººè³æä¹å使ç¨è ç²å¾ç許å¯æ¬ã å¨åçé£çµ¡äººè³æå°æå©æ¼é¿å 使ç¨è æ··æ·ä½¿ç¨æç¥çåæ¿«ç¨çé£çµ¡äººè³æçæ¸ æ°åææ¼ç解ç使ç¨è é«é©ã æé詳細è³è¨ï¼è«åé± é±ç§æåã + +## æ¹æ³ + +* [contacts.create](contacts.create.html) +* [contacts.find](contacts.find.html) + +## åæ¸ + +* [contactFields](parameters/contactFields.html) +* [contactSuccess](parameters/contactSuccess.html) +* [contactError](parameters/contactError.html) +* [contactFindOptions](parameters/contactFindOptions.html) + +## ç©ä»¶ + +* é£çµ¡äºº +* [é£çµ¡äººå§å](ContactName/contactname.html) +* [ContactField](ContactField/contactfield.html) +* [ContactAddress](ContactAddress/contactaddress.html) +* [ContactOrganization](ContactOrganization/contactorganization.html) +* [ContactFindOptions](ContactFindOptions/contactfindoptions.html) +* [ContactError](ContactError/contactError.html) + +## 訪ååè½ + +å¾ 3.0 çï¼ç§ç¾å¤ç¦ä½çº*å¤æç¨å¼*實ç¾äºè¨åç´ Apiã ä½¿ç¨ CLI ç `plugin` å½ä»¤ï¼æè¿°å¨å½ä»¤åä»é¢ï¼å¯ä»¥æ·»å æåªé¤ä¸åå°æ¡ï¼çºæ¤åè½ï¼ + + $ cordova plugin add org.apache.cordova.contacts + $ cordova plugin ls + [ 'org.apache.cordova.contacts' ] + $ cordova plugin rm org.apache.cordova.contacts + + +éäºå½ä»¤é©ç¨äºæææéå°æ§çå¹³èºï¼ä½ä¿®æ¹å¦ä¸æè¿°çç¹å®äºå¹³èºçé ç½®è¨ç½®ï¼ + +* Android 系統 + + (in app/res/xml/config.xml) + <feature name="Contacts"> + <param name="android-package" value="org.apache.cordova.ContactManager" /> + </feature> + + (in app/AndroidManifest.xml) + <uses-permission android:name="android.permission.GET_ACCOUNTS" /> + <uses-permission android:name="android.permission.READ_CONTACTS" /> + <uses-permission android:name="android.permission.WRITE_CONTACTS" /> + + +* é»èææ© WebWorks + + (in www/plugins.xml) + <feature name="Contact"> + <param name="blackberry-package" value="org.apache.cordova.pim.Contact" /> + </feature> + + (in www/config.xml) + <feature id="blackberry.find" required="true" version="1.0.0.0" /> + <feature id="blackberry.identity" required="true" version="1.0.0.0" /> + <feature id="blackberry.pim.Address" required="true" version="1.0.0.0" /> + <feature id="blackberry.pim.Contact" required="true" version="1.0.0.0" /> + + +* ï¼å¨ iOS`config.xml`) + + <feature name="Contacts"> + <param name="ios-package" value="CDVContacts" /> + </feature> + + +* Windows Phone + + (in Properties/WPAppManifest.xml) + <Capabilities> + <Capability Name="ID_CAP_CONTACTS" /> + </Capabilities> + + + å¼ç¨ï¼[çº Windows Phone æç¨ç¨å¼æ¸ å®][1] + + [1]: http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx + +ä¸äºå¹³èºå¯è½æ¯æ´æ¤åè½ï¼èç¡éä»»ä½ç¹æ®çé ç½®ãè«åè¦å¨æ¦è¿°é¨åä¸*çå¹³èºæ¯æ´*ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactError.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactError.md b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactError.md new file mode 100644 index 0000000..1c600f6 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactError.md @@ -0,0 +1,29 @@ +--- +license: > + 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. + +title: contactError +--- + +# contactError + +è¯ç¹«å½æ¸çé¯èª¤åå¼å½æ¸ã + + function(error) { + // Handle the error + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFields.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFields.md b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFields.md new file mode 100644 index 0000000..68253bd --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFields.md @@ -0,0 +1,27 @@ +--- +license: > + 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. + +title: contactFields +--- + +# contactFields + +æéåæ¸ç `[contacts.find](../contacts.find.html)` æ¹æ³ï¼ç¨ä¾æå®åªäºæ¬ä½æå å«å¨ `Contact` ç¢ççæ¥æ¾æä½çç©ä»¶ã + + ["å稱"ã"ææ©"ã"é»åéµä»¶"] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFindOptions.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFindOptions.md b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFindOptions.md new file mode 100644 index 0000000..c6f08ee --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactFindOptions.md @@ -0,0 +1,34 @@ +--- +license: > + 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. + +title: contactFindOptions +--- + +# contactFindOptions + +å¯é¸çåæ¸ï¼ `[contacts.find](../contacts.find.html)` æ¹æ³ï¼ç¨æ¼ç¯©é¸å¾é£çµ¡äººè³æ庫è¿åçé£çµ¡äººã + + {篩é¸å¨ï¼""ã å¤åï¼ trueï¼} ï¼ + + +## é¸é + +* **篩é¸å¨**ï¼ ç¨æ¼é濾é£çµ¡äººçæç´¢å串ã*() DOMString*ï¼é è¨å¼ï¼`""`) + +* **å¤å**ï¼ ç¢ºå®æ¯å¦æ¥æ¾æä½è¿åå¤åé£çµ¡äººã*ï¼å¸æï¼*ï¼é è¨å¼ï¼`false`) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactSuccess.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactSuccess.md b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactSuccess.md new file mode 100644 index 0000000..8b66866 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/contacts/parameters/contactSuccess.md @@ -0,0 +1,42 @@ +--- +license: > + 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. + +title: contactSuccess +--- + +# contactSuccess + +æä¾çæååå¼å½æ¸ `Contact` é£åç¢çç `[contacts.find](../contacts.find.html)` æä½ã + + function(contacts) { + // Do something + } + + +## åæ¸ + +* **é£çµ¡äºº**ï¼ é£çµ¡äººé£åç¢ççæ¥æ¾æä½ã*ï¼é£çµ¡äººï¼* + +## ç¤ºä¾ + + function contactSuccess(contacts) { + for (var i=0; i<contacts.length; i++) { + console.log("Display Name = " + contacts[i].displayName); + } + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.cordova.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.cordova.md b/www/docs/zh-cn/3.1.0/cordova/device/device.cordova.md new file mode 100644 index 0000000..a87fda1 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.cordova.md @@ -0,0 +1,78 @@ +--- +license: > + 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. + +title: device.cordova +--- + +# device.cordova + +ç²åç§ç¾å¤ç¦å¨è¨åä¸éè¡ççæ¬ã + + var string = device.cordova; + + +## 說æ + +`device.cordova`è¿åç§ç¾å¤ç¦å¨è¨åä¸éè¡ççæ¬ã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + var name = device.cordova; + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Device Properties Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var element = document.getElementById('deviceProperties'); + element.innerHTML = 'Device Model: ' + device.model + '<br />' + + 'Device Cordova: ' + device.cordova + '<br />' + + 'Device Platform: ' + device.platform + '<br />' + + 'Device UUID: ' + device.uuid + '<br />' + + 'Device Version: ' + device.version + '<br />'; + } + + </script> + </head> + <body> + <p id="deviceProperties">Loading device properties...</p> + </body> + </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.md b/www/docs/zh-cn/3.1.0/cordova/device/device.md new file mode 100644 index 0000000..adbd662 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.md @@ -0,0 +1,103 @@ +--- +license: > + 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. + +title: è¨å +--- + +# è¨å + +> `device`ç©ä»¶æ述該è¨åç硬é«åè»é«ã + +## å±¬æ§ + +* [device.model](device.model.html) +* [device.cordova](device.cordova.html) +* [device.platform](device.platform.html) +* [device.uuid](device.uuid.html) +* [device.version](device.version.html) +* [device.name](device.name.html) + +## è®æ¸ç¯å + +å çº `device` åé å° `window` çç©ä»¶ï¼å®æ¯é±å¼å°å¨å ¨çç¯åå §ã + + // These reference the same `device` + var phoneModel = window.device.model; + var phoneModel = device.model; + + +## 訪ååè½ + +å¾ 3.0 çï¼ç§ç¾å¤ç¦ä½çº*å¤æç¨å¼*實ç¾äºè¨åç´ Apiã ä½¿ç¨ CLI ç `plugin` å½ä»¤ï¼æè¿°å¨å½ä»¤åä»é¢ï¼å¯ä»¥æ·»å æåªé¤ä¸åå°æ¡ï¼çºæ¤åè½ï¼ + + $ cordova plugin add org.apache.cordova.device + $ cordova plugin ls + [ 'org.apache.cordova.device' ] + $ cordova plugin rm org.apache.cordova.device + + +éäºå½ä»¤é©ç¨äºæææéå°æ§çå¹³èºï¼ä½ä¿®æ¹å¦ä¸æè¿°çç¹å®äºå¹³èºçé ç½®è¨ç½®ï¼ + +* Android 系統 + + (in app/res/xml/config.xml) + <feature name="Device"> + <param name="android-package" value="org.apache.cordova.Device" /> + </feature> + + (in app/AndroidManifest.xml) + <uses-permission android:name="android.permission.READ_PHONE_STATE" /> + + +* é»èææ© WebWorks + + (in www/plugins.xml) + <feature name="Device"> + <param name="blackberry-package" value="org.apache.cordova.device.Device" /> + </feature> + + (in www/config.xml) + <feature id="blackberry.app" required="true" version="1.0.0.0" /> + <rim:permissions> + <rim:permit>read_device_identifying_information</rim:permit> + </rim:permissions> + + +* ï¼å¨ Windows Phone`Properties/WPAppManifest.xml`) + + <Capabilities> + <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" /> + <Capability Name="ID_CAP_IDENTITY_DEVICE" /> + <Capability Name="ID_CAP_IDENTITY_USER" /> + </Capabilities> + + + å¼ç¨ï¼[çº Windows Phone æç¨ç¨å¼æ¸ å®][1] + +* ï¼å¨ Tizen`config.xml`) + + <feature name="http://tizen.org/api/systeminfo" required="true"/> + + + å¼ç¨ï¼ [Tizen Web æç¨ç¨å¼çæç¨ç¨å¼æ¸ å®][2] + + [1]: http://msdn.microsoft.com/en-us/library/ff769509%28v=vs.92%29.aspx + [2]: https://developer.tizen.org/help/topic/org.tizen.help.gs/Creating%20a%20Project.html?path=0_1_1_3#8814682_CreatingaProject-EditingconfigxmlFeatures + +ä¸äºå¹³èºå¯è½æ¯æ´æ¤åè½ï¼èç¡éä»»ä½ç¹æ®çé ç½®ãè«åè¦å¨æ¦è¿°é¨åä¸*çå¹³èºæ¯æ´*ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.model.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.model.md b/www/docs/zh-cn/3.1.0/cordova/device/device.model.md new file mode 100644 index 0000000..0e0cd5b --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.model.md @@ -0,0 +1,94 @@ +--- +license: > + 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. + +title: device.model +--- + +# device.model + +ç²åè¨åç模åå稱ã + + var string = device.model; + + +## 說æ + +`device.model`è¿åè¨åç模åæç¢åçå稱ãå¼ç±è¨å製é åè¨ç½®ååä¸ç¢åçä¸åçæ¬å¯è½ä¸åã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + / / Androidï¼ Nexus è¿å"æ¿æ "ï¼Nexus One 代碼åç¨±ï¼ / / æ©æç¾ æ Droid è¿å"ç°é¼ "/ / é»èææ©ï¼ ç«ç¬ 9800 è¿å"9800"/ / iOSï¼ è¿·ä½ ipadï¼è¿åè iPad2ï¼5 ï¼iPhone 5 æ¯ iPhone 5ï¼1ã è«åé± HTTP://theiphonewiki.com/wiki/index.php?title=Models / / var 模å = device.model ï¼ + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Device Properties Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var element = document.getElementById('deviceProperties'); + element.innerHTML = 'Device Model: ' + device.model + '<br />' + + 'Device Cordova: ' + device.cordova + '<br />' + + 'Device Platform: ' + device.platform + '<br />' + + 'Device UUID: ' + device.uuid + '<br />' + + 'Device Version: ' + device.version + '<br />'; + } + + </script> + </head> + <body> + <p id="deviceProperties">Loading device properties...</p> + </body> + </html> + + +## Android çæªç + +* ç²å[ç¢åå稱][1]èä¸æ¯[ç¢ååèå稱][2]ï¼éå¾å¾æ¯çç¢ä»£ç¢¼å稱ã ä¾å¦ï¼Nexus One è¿å `Passion` ï¼åæ©æç¾ æ Droid è¿å`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +## Tizen æªç + +* ä¾å¦ï¼è¿åèä¾æåææ´¾çè¨å模å`TIZEN` + +## Windows Phone 7 å 8 æªç + +* è¿åç±è£½é åæå®çè¨å模åãä¾å¦ï¼ä¸æç¦é»è¿å`SGH-i917`. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.name.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.name.md b/www/docs/zh-cn/3.1.0/cordova/device/device.name.md new file mode 100644 index 0000000..a46a520 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.name.md @@ -0,0 +1,102 @@ +--- +license: > + 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. + +title: device.name +--- + +# device.name + +**WARNING:** `device.name` is deprecated as of version 2.3.0. Use `[device.model](device.model.html)` instead. + +ç²åè¨åç模åå稱ã + + var string = device.name; + + +## 說æ + +`device.name`è¿åè¨åç模åæç¢åçå稱ãæ¤å¼ç±è¨å製é åè¨ç½®ç並ä¸å¯è½ä¸åï¼åä¸ç¢åçä¸åçæ¬ã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + // Android: Nexus One returns "Passion" (Nexus One code name) + // Motorola Droid returns "voles" + // BlackBerry: Torch 9800 returns "9800" + // iOS: All devices returns either "iPhone", "iPod Touch", "iPhone Simulator", "iPad", "iPad Simulator" + // + var name = device.name; + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Device Properties Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var element = document.getElementById('deviceProperties'); + element.innerHTML = 'Device Name: ' + device.name + '<br />' + + 'Device Model: ' + device.model + '<br />' + + 'Device Cordova: ' + device.cordova + '<br />' + + 'Device Platform: ' + device.platform + '<br />' + + 'Device UUID: ' + device.uuid + '<br />' + + 'Device Version: ' + device.version + '<br />'; + } + + </script> + </head> + <body> + <p id="deviceProperties">Loading device properties...</p> + </body> + </html> + + +## Android çæªç + +* ç²å[ç¢åå稱][1]èä¸æ¯[ç¢ååèå稱][2]ï¼éå¾å¾æ¯çç¢ä»£ç¢¼å稱ã ä¾å¦ï¼Nexus One è¿å `Passion` ï¼åæ©æç¾ æ Droid è¿å`voles`. + + [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT + [2]: http://developer.android.com/reference/android/os/Build.html#MODEL + +## Windows Phone 7 å 8 æªç + +* è¿åç±è£½é åæå®çè¨å模åãä¾å¦ï¼ä¸æç¦é»è¿å`SGH-i917`. + +## Tizen æªç + +* ä¾å¦ï¼è¿åèä¾æåææ´¾çè¨å模å`TIZEN` \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.platform.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.platform.md b/www/docs/zh-cn/3.1.0/cordova/device/device.platform.md new file mode 100644 index 0000000..1b4c21f --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.platform.md @@ -0,0 +1,93 @@ +--- +license: > + 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. + +title: device.platform +--- + +# device.platform + +ç²å該è¨åçä½æ¥ç³»çµ±å稱ã + + var string = device.platform; + + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + // Depending on the device, a few examples are: + // - "Android" + // - "BlackBerry" + // - "iOS" + // - "WinCE" + // - "Tizen" + var devicePlatform = device.platform; + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Device Properties Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var element = document.getElementById('deviceProperties'); + element.innerHTML = 'Device Model: ' + device.model + '<br />' + + 'Device Cordova: ' + device.cordova + '<br />' + + 'Device Platform: ' + device.platform + '<br />' + + 'Device UUID: ' + device.uuid + '<br />' + + 'Device Version: ' + device.version + '<br />'; + } + + </script> + </head> + <body> + <p id="deviceProperties">Loading device properties...</p> + </body> + </html> + + +## é»èææ©çæªç + +è¨åå¯è½æè¿åèä¸æ¯å¹³èºå稱çè¨åå¹³èºçæ¬ç·¨èãä¾å¦ï¼Storm2 9550 è¿åä¸åå¼å¦`2.13.0.95`. + +## Windows Phone 7 çæªç + +Windows Phone 7 è¨åå ±åä½çºå¹³èº`WinCE`. + +## Windows Phone 8 æªç + +Windows Phone 8 è¨åå ±åä½çºå¹³èº`Win32NT`. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a890e4de/www/docs/zh-cn/3.1.0/cordova/device/device.uuid.md ---------------------------------------------------------------------- diff --git a/www/docs/zh-cn/3.1.0/cordova/device/device.uuid.md b/www/docs/zh-cn/3.1.0/cordova/device/device.uuid.md new file mode 100644 index 0000000..a6d25a6 --- /dev/null +++ b/www/docs/zh-cn/3.1.0/cordova/device/device.uuid.md @@ -0,0 +1,92 @@ +--- +license: > + 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. + +title: device.uuid +--- + +# device.uuid + +ç²åè¨åçéç¨å¯ä¸èå¥ç¢¼ ([UUID][1]). + + [1]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier + + var string = device.uuid; + + +## 說æ + +UUID å¦ä½çæç詳細è³è¨ç±è¨å製é ååç¹å®äºè¨åçå¹³èºæ模åã + +## æ¯æ´çå¹³èº + +* Android 系統 +* é»èææ© WebWorks ï¼OS 5.0 åæ´é«ï¼ +* iOS +* Tizen +* Windows Phone 7 å 8 +* Windows 8 + +## å¿«éçç¤ºä¾ + + / / Androidï¼ ä¸åé¨æ©ç 64 ä½æ´æ¸ ï¼ä½çºå串è¿åï¼å次!) / / ä¸è¨åç第ä¸æ¬¡ååçæçæ´æ¸ / / / / é»èææ©ï¼ è¿åè¨åç PIN è碼 / / éæ¯ä¹åæ¸åçå¯ä¸æ´æ¸ ï¼ä½çºå串ï¼éç¶!) / / / / iPhoneï¼ ï¼å¾ UIDevice é¡ææªè§£éï¼ / / è¿åä¸åå串çéæ¹å¼åµå»ºçå¤å硬é«æ¨èã + / / å®ä¿èæ¯å¯ä¸çæ¯åè¨å並ä¸è½ç¶ / / å°ä½¿ç¨è 帳æ¶ã + / / Windows Phone 7ï¼ è¿åçéæ¹ä»£ç¢¼çè¨å + ç¶å使ç¨è ï¼/ / å¦ææªå®ç¾©ä½¿ç¨è ï¼åä¸å guid çæç並ä¸å°æä¿çç´å°å¸è¼è©²æç¨ç¨å¼ / / Tizenï¼ è¿åè¨å IMEI ï¼åéè¡åè£ç½®èº«ä»½æ IMEI æ¯ä¸åæ¸ä½ / / ç¨æçæ¯ä¸å UMTS å GSM è¡åé»è©±ã + var deviceID = device.uuid; + + +## å®æ´çç¤ºä¾ + + <!DOCTYPE html> + <html> + <head> + <title>Device Properties Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8"> + + // Wait for device API libraries to load + // + document.addEventListener("deviceready", onDeviceReady, false); + + // device APIs are available + // + function onDeviceReady() { + var element = document.getElementById('deviceProperties'); + element.innerHTML = 'Device Model: ' + device.model + '<br />' + + 'Device Cordova: ' + device.cordova + '<br />' + + 'Device Platform: ' + device.platform + '<br />' + + 'Device UUID: ' + device.uuid + '<br />' + + 'Device Version: ' + device.version + '<br />'; + } + + </script> + </head> + <body> + <p id="deviceProperties">Loading device properties...</p> + </body> + </html> + + +## iOS æªç + +`uuid`å¨ iOS ä¸ä¸æ¯ç¨æçä¸ç¨®è¨åï¼ä½å°æ¼æ¯åæç¨ç¨å¼ï¼çºæ¯åå®è£åä¸ç¸åã å¦ææ¨åªé¤ä¸¦éæ°å®è£æç¨ç¨å¼ï¼å®ææ´æ¹åå¯è½éç¶ä½ åç´ iOSï¼æçè³åç´æ¨çæç¨ç¨å¼æ¯åçæ¬ (æé¡¯å¨ iOS 5.1 ä¸)ã `uuid`ä¸æ¯ä¸åå¯é çå¼ã + +## Windows Phone 7 å 8 æªç + +`uuid`çº Windows Phone 7 éè¦è¨±å¯æ¬ `ID_CAP_IDENTITY_DEVICE` ã Microsoft å¯è½æå¾å¿«å°±æ£ç¨æ¤å±¬æ§ã å¦æè½åä¸æ¯å¯ç¨çæç¨ç¨å¼å°çæä¸åæä¹ æ§ç guid 並ä¿ææç¨ç¨å¼çå®è£å¨è¨åä¸çæçºæéã \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org