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 9FF8AFA8B for ; Mon, 26 May 2014 14:21:21 +0000 (UTC) Received: (qmail 10668 invoked by uid 500); 26 May 2014 14:21:21 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 10581 invoked by uid 500); 26 May 2014 14:21:21 -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 9959 invoked by uid 99); 26 May 2014 14:21:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2014 14:21:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8CA739A56CC; Mon, 26 May 2014 14:21:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: agrieve@apache.org To: commits@cordova.apache.org Date: Mon, 26 May 2014 14:21:34 -0000 Message-Id: <2ef35dede0ed47a8a162e3922e873eea@git.apache.org> In-Reply-To: <540b08efb3484348896535325b85a107@git.apache.org> References: <540b08efb3484348896535325b85a107@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/51] [partial] Add non-en docs for 3.5.0 http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/device/device.version.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/device/device.version.md b/docs/fr/3.5.0/cordova/device/device.version.md new file mode 100644 index 0000000..9abd2d6 --- /dev/null +++ b/docs/fr/3.5.0/cordova/device/device.version.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. +--- + +# device.version + +Retourne la version du système d'exploitation de l'appareil. + + var string = device.version; + + +## Plates-formes supportées + +* Android 2.1+ +* BlackBerry WebWorks (OS 5.0 et plus) +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +## Exemple court + + // Android : Froyo OS renvoie "2.2" + // Eclair OS renvoie "2.1", "2.0.1", ou "2.0" + // Peut également renvoyer par exemple "2.1-update1" + // + // BlackBerry : Torch 9800 sous OS 6.0 renvoie "6.0.0.600" + // + // iPhone : iOS 3.2 renvoie "3.2" + // + // Windows Phone 7 : renvoie la version actuelle de l'OS, par exemple on Mango returns 7.10.7720 + // Tizen: returns "TIZEN_20120425_2" + var deviceVersion = device.version; + + +## Exemple complet + + + + + Device Properties Example + + + + + +

Loading device properties...

+ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.backbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.backbutton.md b/docs/fr/3.5.0/cordova/events/events.backbutton.md new file mode 100644 index 0000000..8f8c979 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.backbutton.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. +--- + +# backbutton + +L'évènement se déclenche lorsque l'utilisateur appuie sur le bouton retour. + + document.addEventListener("backbutton", yourCallbackFunction, false); + + +## Détails + +Afin de modifier le comportement par défaut du bouton retour, attachez un écouteur pour l'évènement `backbutton` généralement en appelant `document.addEventListener` une fois l'évènement `deviceready` reçu. Il n'est désormais plus nécessaire d'appeler d'autres méthodes pour altérer le comportement du bouton retour. + +## Plates-formes supportées + +* Amazon Fire OS +* Android +* BlackBerry 10 +* Windows Phone 7 et 8 + +## Exemple court + + document.addEventListener("backbutton", onBackKeyDown, false); + + function onBackKeyDown() { + // Handle the back button + } + + +## Exemple complet + + + + + Back Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.batterycritical.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.batterycritical.md b/docs/fr/3.5.0/cordova/events/events.batterycritical.md new file mode 100644 index 0000000..5ead35c --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.batterycritical.md @@ -0,0 +1,85 @@ +--- + +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. +--- + +# batterycritical + +L'évènement se déclenche lorsque la batterie a atteint un seuil critique. + + window.addEventListener("batterycritical", yourCallbackFunction, false); + + +## Détails + +L'évènement se déclenche lorsque le pourcentage de charge de la batterie a atteint un seuil critique. Cette valeur est spécifique à l'appareil. + +Le gestionnaire `batterycritical` est appelé avec un objet contenant deux propriétés : + +* **level** : le taux de charge de la batterie (0-100). *(Number)* + +* **isPlugged** : un booléen indiquant si l'appareil est en cours de chargement ou non. *(Boolean)* + +Les applications devraient en général utiliser `window.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* iOS +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* Paciarelli + +## Exemple court + + window.addEventListener("batterycritical", onBatteryCritical, false); + + function onBatteryCritical(info) { + // Handle the battery critical event + alert("Battery Level Critical " + info.level + "%\nRecharge Soon!"); + } + + +## Exemple complet + + + + + Battery Critical Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.batterylow.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.batterylow.md b/docs/fr/3.5.0/cordova/events/events.batterylow.md new file mode 100644 index 0000000..297990f --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.batterylow.md @@ -0,0 +1,85 @@ +--- + +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. +--- + +# batterylow + +L'évènement se déclenche lorsque la batterie a atteint le seuil de bas niveau. + + window.addEventListener("batterylow", yourCallbackFunction, false); + + +## Détails + +L'évènement se déclenche lorsque le pourcentage de charge de la batterie a atteint un niveau faible, cette valeur est spécifique à l'appareil. + +Le gestionnaire `batterylow` est appelé avec un objet contenant deux propriétés : + +* **level** : le taux de charge de la batterie (0-100). *(Number)* + +* **isPlugged** : un booléen indiquant si l'appareil est en cours de chargement ou non. *(Boolean)* + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* iOS +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* Paciarelli + +## Exemple court + + window.addEventListener("batterylow", onBatteryLow, false); + + function onBatteryLow(info) { + // Handle the battery low event + alert("Battery Level Low " + info.level + "%"); + } + + +## Exemple complet + + + + + Device Ready Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.batterystatus.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.batterystatus.md b/docs/fr/3.5.0/cordova/events/events.batterystatus.md new file mode 100644 index 0000000..fbc5665 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.batterystatus.md @@ -0,0 +1,90 @@ +--- + +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. +--- + +# batterystatus + +L'évènement se déclenche lorsque l'état de la batterie évolue. + + window.addEventListener("batterystatus", yourCallbackFunction, false); + + +## Détails + +L'évènement se déclenche lorsque le taux de charge de la batterie gagne ou perd au moins un pourcent, ou quand l'appareil est branché ou débranché. + +Le gestionnaire est appelé avec un objet contenant deux propriétés : + +* **level** : le taux de charge de la batterie (0-100). *(Number)* + +* **isPlugged** : un booléen indiquant si l'appareil est en cours de chargement ou non. *(Boolean)* + +Les applications devraient en général utiliser `window.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* iOS +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* Windows Phone 7 et 8 +* Paciarelli + +## Notes au sujet de Windows Phone 7 et 8 + +Windows Phone 7 ne fournit pas d'API native pour déterminer le niveau de la batterie, de ce fait la propriété `level` n'est pas disponible. La propriété `isPlugged` *est* quant à elle prise en charge. + +## Exemple court + + window.addEventListener("batterystatus", onBatteryStatus, false); + + function onBatteryStatus(info) { + // Handle the online event + console.log("Level: " + info.level + " isPlugged: " + info.isPlugged); + } + + +## Exemple complet + + + + + Device Ready Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.deviceready.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.deviceready.md b/docs/fr/3.5.0/cordova/events/events.deviceready.md new file mode 100644 index 0000000..fe37a4b --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.deviceready.md @@ -0,0 +1,79 @@ +--- + +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. +--- + +# deviceready + +L'évènement se déclenche lorsque Cordova est entièrement chargé. + + document.addEventListener("deviceready", yourCallbackFunction, false); + + +## Détails + +Cet évènement est essentiel à n'importe quelle application. Il signale que les API matérielles Cordova ont été chargées et sont prêtes à être utilisées. + +Cordova est constitué de deux bases de code : native et JavaScript. Tant que le code natif est en cours de chargement, une image personnalisée est affichée. Cependant, le code JavaScript est chargé seulement lorsque le DOM charge. Cela signifie que l'application web peut potentiellement appeler une fonction Cordova JavaScript avant le code natif correspondant soit disponible. + +L'évènement `deviceready` se déclenche quand Cordova est totalement chargé. Une fois cet évènement déclenché, vous pouvez en toute sécurité faire appels aux API Cordova. Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois le DOM du document HTML chargé. + +L'évènement `deviceready` se comporte différemment des autres évènements. Tout gestionnaire additionnel enregistré après le déclenchement de `deviceready` est appelé immédiatement. + +## Plates-formes supportées + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Paciarelli +* Windows Phone 7 et 8 +* Windows 8 + +## Exemple court + + document.addEventListener("deviceready", onDeviceReady, false); + + function onDeviceReady() { + // Now safe to use device APIs + } + + +## Exemple complet + + + + + Device Ready Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.endcallbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.endcallbutton.md b/docs/fr/3.5.0/cordova/events/events.endcallbutton.md new file mode 100644 index 0000000..4070ad9 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.endcallbutton.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. +--- + +# endcallbutton + +Cet évènement se déclenche lorsque l'utilisateur appuie sur la touche fin d'appel. + + document.addEventListener("endcallbutton", yourCallbackFunction, false); + + +## Détails + +L'évènement modifie le comportement par défaut de la touche fin d'appel. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* BlackBerry 10 + +## Exemple court + + document.addEventListener("endcallbutton", onEndCallKeyDown, false); + + function onEndCallKeyDown() { + // Handle the end call button + } + + +## Exemple complet + + + + + End Call Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.md b/docs/fr/3.5.0/cordova/events/events.md new file mode 100644 index 0000000..8f43b44 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.md @@ -0,0 +1,47 @@ +--- + +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. +--- + +# Évènements + +> Évènements du cycle de vie de Cordova. + +## Types d'évènements + +* deviceready +* pause +* resume +* backbutton +* menubutton +* searchbutton +* startcallbutton +* endcallbutton +* volumedownbutton +* volumeupbutton + +## Ajouté par [org.apache.cordova.battery-statut][1] des événements + + [1]: https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md + +* batterycritical +* batterylow +* batterystatus + +## Événements ajoutés par [org.apache.cordova.network-informations][2] + + [2]: https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md + +* online +* offline \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.menubutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.menubutton.md b/docs/fr/3.5.0/cordova/events/events.menubutton.md new file mode 100644 index 0000000..5a14d04 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.menubutton.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. +--- + +# menubutton + +L'évènement se déclenche lorsque l'utilisateur appuie sur la touche menu. + + document.addEventListener("menubutton", yourCallbackFunction, false); + + +## Détails + +Appliquer un gestionnaire d'évènements remplace le comportement par défaut du bouton menu. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Amazon Fire OS +* Android +* BlackBerry 10 + +## Exemple court + + document.addEventListener("menubutton", onMenuKeyDown, false); + + function onMenuKeyDown() { + // Handle the back button + } + + +## Exemple complet + + + + + Menu Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.offline.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.offline.md b/docs/fr/3.5.0/cordova/events/events.offline.md new file mode 100644 index 0000000..d1cb172 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.offline.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. +--- + +# offline + +L'évènement se déclenche lorsqu'une application se déconnecte, quand l'appareil n'est pas connecté à Internet. + + document.addEventListener("offline", yourCallbackFunction, false); + + +## Détails + +L'évènement `offline` se déclenche lorsqu'un appareil précédemment connecté perd sa connexion au réseau, empêchant ainsi l'application d'accéder à Internet. Il repose sur les mêmes informations que l'API Connection et se déclenche quand `connection.type` passe de `NONE` à une autre valeur. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* iOS +* Windows Phone 7 et 8 +* Paciarelli +* Windows 8 + +## Exemple court + + document.addEventListener("offline", onOffline, false); + + function onOffline() { + // Handle the offline event + } + + +## Exemple complet + + + + + Offline Example + + + + + + + + + +## Notes au sujet d'iOS + +Lors du démarrage initial, le déclenchement du premier évènement offline (si applicable) prend au moins une seconde. + +## Notes au sujet de Windows Phone 7 + +Lorsque l'application est exécutée dans l'émulateur, la valeur de la propriété `connection.status` est toujours inconnue, ainsi cet évènement n'est *pas* déclenché. + +## Notes au sujet de Windows Phone 8 + +L'émulateur signale le type de connexion comme `Cellular`, type qui ne change jamais, ainsi l'évènement n'est *pas* déclenché. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.online.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.online.md b/docs/fr/3.5.0/cordova/events/events.online.md new file mode 100644 index 0000000..09092f5 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.online.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. +--- + +# online + +L'évènement se déclenche lorsqu'une application se connecte, quand l'appareil est connecté à Internet. + + document.addEventListener("online", yourCallbackFunction, false); + + +## Détails + +L'évènement `online` se déclenche lorsqu'un appareil précédemment non-connecté se connecte au réseau, permettant ainsi à l'application d'accéder à Internet. Il repose sur les mêmes informations que l'API Connection et se déclenche quand la valeur de `connection.type` devient `NONE`. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* iOS +* Windows Phone 7 et 8 +* Paciarelli +* Windows 8 + +## Exemple court + + document.addEventListener("online", onOnline, false); + + function onOnline() { + // Handle the online event + } + + +## Exemple complet + + + + + Online Example + + + + + + + + + +## Notes au sujet d'iOS + +Lors du démarrage initial, le déclenchement du premier évènement `online` (si applicable) prend au moins une seconde avant quoi `connection.type` vaut `UNKNOWN`. + +## Notes au sujet de Windows Phone 7 + +Lorsque l'application est exécutée dans l'émulateur, la valeur de la propriété `connection.status` est toujours inconnue, ainsi cet évènement n'est *pas* déclenché. + +## Notes au sujet de Windows Phone 8 + +L'émulateur signale le type de connexion comme `Cellular`, type qui ne change jamais, ainsi l'évènement n'est *pas* déclenché. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.pause.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.pause.md b/docs/fr/3.5.0/cordova/events/events.pause.md new file mode 100644 index 0000000..89bd67f --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.pause.md @@ -0,0 +1,88 @@ +--- + +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. +--- + +# pause + +L'évènement se déclenche quand une application est mise en arrière-plan. + + document.addEventListener("pause", yourCallbackFunction, false); + + +## Détails + +L'évènement `pause` se déclenche lorsque la plate-forme native met l'application en arrière-plan, généralement lorsque l'utilisateur bascule vers une autre application. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 et 8 +* Windows 8 + +## Exemple court + + document.addEventListener("pause", onPause, false); + + function onPause() { + // Handle the pause event + } + + +## Exemple complet + + + + + Pause Example + + + + + + + + + +## Notes au sujet d'iOS + +Dans un gestionnaire de l'évènement `pause`, tous les appels à l'API Cordova ou vers des plugins natifs passant par l'Objective-C ne fonctionnent pas, de même pour tous les appels interactifs tels que des alertes ou `console.log()`. Ceux-ci sont traités uniquement lorsque l'application revient au premier plan, lors du prochain passage de la boucle d'exécution. + +Sous iOS, l'évènement spécifique `resign` est disponible comme alternative à `pause` et détecte quand les utilisateurs pressent le bouton de **verrouillage** pour verrouiller l'appareil avec l'application en cours d'exécution au premier plan. Si l'application (et l'appareil) est prévue pour le multitâche, un évènement `pause` lui est ultérieurement associé, mais seulement sous iOS 5. En réalité, sous iOS 5, toutes les applications verrouillées prévues pour le multitâche sont envoyées à l'arrière-plan. Afin qu'une application puisse continuer à s'exécuter lorsque l'appareil est verrouillé sous iOS 5, il faudra désactiver le multitâche pour celle-ci en réglant [UIApplicationExitsOnSuspend][1] sur `YES`. Sous iOS 4, l'application continuera de s'exécuter même si l'appareil est verrouillé, modifier la valeur de ce paramètre n'a aucun effet. + + [1]: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.resume.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.resume.md b/docs/fr/3.5.0/cordova/events/events.resume.md new file mode 100644 index 0000000..6ba14e4 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.resume.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. +--- + +# resume + +L'évènement se déclenche lorsqu'une application est renvoyée au premier plan. + + document.addEventListener("resume", yourCallbackFunction, false); + + +## Détails + +L'évènement `resume` se déclenche lorsque la plate-forme native sort l'application de l'arrière-plan. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 et 8 +* Windows 8 + +## Exemple court + + document.addEventListener("resume", onResume, false); + + function onResume() { + // Handle the resume event + } + + +## Exemple complet + + + + + Resume Example + + + + + + + + + +## Notes au sujet d'iOS + +Toutes les fonctions interactives appelées à partir d'un gestionnaire de l'évènement `pause` s'exécutent plus tard, lorsque l'application est reprise, comme l'évènement `resume` l'indique. Il s'agit notamment d'alertes, `console.log()` et tous les appels vers des plugins ou l'API Cordova passant par l'Objective-C. + +* évènement **active** + + Sous iOS, l'évènement spécifique `active` est disponible comme alternative à `resume` et détecte quand les utilisateurs pressent le bouton de **verrouillage** pour déverrouiller l'appareil avec l'application en cours d'exécution au premier plan. Si l'application (et l'appareil) est prévue pour le multitâche, un évènement `resume` lui est ultérieurement associé, mais seulement sous iOS 5. En réalité, sous iOS 5, toutes les applications verrouillées prévues pour le multitâche sont envoyées à l'arrière-plan. Afin qu'une application puisse continuer à s'exécuter lorsque l'appareil est verrouillé sous iOS 5, il faudra désactiver le multitâche pour celle-ci en réglant [UIApplicationExitsOnSuspend][1] sur `YES`. Sous iOS 4, l'application continuera de s'exécuter même si l'appareil est verrouillé, modifier la valeur de ce paramètre n'a aucun effet. + +* évènement **resume** + + Si appelées depuis un gestionnaire de l'évènement `resume`, les fonctions interactives telles que `alert()` doivent être enveloppées d'un appel à `setTimeout()` avec un délai de zéro millisecondes, sinon l'application sera bloquée. Par exemple : + + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } + + + [1]: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.searchbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.searchbutton.md b/docs/fr/3.5.0/cordova/events/events.searchbutton.md new file mode 100644 index 0000000..9754a2d --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.searchbutton.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. +--- + +# searchbutton + +L'évènement se déclenche lorsque l'utilisateur appuie sur le bouton rechercher sous Android. + + document.addEventListener("searchbutton", yourCallbackFunction, false); + + +## Détails + +Si vous souhaitez modifier le comportement par défaut de bouton rechercher sous Android, vous pouvez enregistrer un écouteur pour l'événement 'searchbutton'. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* Android + +## Exemple court + + document.addEventListener("searchbutton", onSearchKeyDown, false); + + function onSearchKeyDown() { + // Handle the search button + } + + +## Exemple complet + + + + + Search Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.startcallbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.startcallbutton.md b/docs/fr/3.5.0/cordova/events/events.startcallbutton.md new file mode 100644 index 0000000..69e2e02 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.startcallbutton.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. +--- + +# startcallbutton + +L'évènement se déclenche lorsque l'utilisateur appuie sur la touche d'appel. + + document.addEventListener("startcallbutton", yourCallbackFunction, false); + + +## Détails + +Si vous souhaitez modifier le comportement par défaut de la touche d'appel, vous pouvez enregistrer un écouteur pour l'évènement `startcallbutton`. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* BlackBerry 10 + +## Exemple court + + document.addEventListener("startcallbutton", onStartCallKeyDown, false); + + function onStartCallKeyDown() { + // Handle the start call button + } + + +## Exemple complet + + + + + Start Call Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.volumedownbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.volumedownbutton.md b/docs/fr/3.5.0/cordova/events/events.volumedownbutton.md new file mode 100644 index 0000000..40005c7 --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.volumedownbutton.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. +--- + +# volumedownbutton + +L'évènement se déclenche lorsque l'utilisateur clique sur le bouton diminution du volume. + + document.addEventListener("volumedownbutton", yourCallbackFunction, false); + + +## Détails + +Si vous souhaitez modifier le comportement par défaut du bouton diminution du volume, vous pouvez enregistrer un écouteur pour l'évènement `volumedownbutton`. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* BlackBerry 10 + +## Exemple court + + document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); + + function onVolumeDownKeyDown() { + // Handle the volume down button + } + + +## Exemple complet + + + + + Volume Down Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/events/events.volumeupbutton.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/events/events.volumeupbutton.md b/docs/fr/3.5.0/cordova/events/events.volumeupbutton.md new file mode 100644 index 0000000..dd9edcc --- /dev/null +++ b/docs/fr/3.5.0/cordova/events/events.volumeupbutton.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. +--- + +# volumeupbutton + +L'évènement se déclenche lorsque l'utilisateur clique sur le bouton augmentation du volume. + + document.addEventListener("volumeupbutton", yourCallbackFunction, false); + + +## Détails + +Si vous souhaitez modifier le comportement par défaut du bouton augmentation du volume, vous pouvez enregistrer un écouteur pour l'évènement `volumeupbutton`. + +Les applications devraient en général utiliser `document.addEventListener` pour attacher un écouteur d'évènements, une fois l'évènement `deviceready` déclenché. + +## Plates-formes supportées + +* BlackBerry 10 + +## Exemple court + + document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); + + function onVolumeUpKeyDown() { + // Handle the volume up button + } + + +## Exemple complet + + + + + Volume Up Button Example + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/file/directoryentry/directoryentry.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/file/directoryentry/directoryentry.md b/docs/fr/3.5.0/cordova/file/directoryentry/directoryentry.md new file mode 100644 index 0000000..4d7a7ea --- /dev/null +++ b/docs/fr/3.5.0/cordova/file/directoryentry/directoryentry.md @@ -0,0 +1,394 @@ +--- + +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. +--- + +# DirectoryEntry + +Cet objet représente un répertoire sur un système de fichiers, tel que défini par la spécification [W3C répertoires et systèmes][1] . + + [1]: http://www.w3.org/TR/file-system-api/ + +## Propriétés + +* **isFile**: toujours `false` . *(booléen)* + +* **isDirectory**: toujours `true` . *(booléen)* + +* **name**: le nom du `DirectoryEntry` , à l'exclusion du chemin menant à celle-ci. *(DOMString)* + +* **fullPath**: le chemin d'accès complet absolu de la racine au `DirectoryEntry` . *(DOMString)* + +**Remarque :** L'attribut suivant est défini par la spécification W3C, mais n'est *pas* supportée : + +* **filesystem**: le système de fichiers sur lequel le `DirectoryEntry` réside. *(Système de fichiers)* + +## Méthodes + +Les méthodes suivantes peuvent être appelées sur un objet `DirectoryEntry` : + +* **getMetadata**: recherche des métadonnées relatives à un répertoire. + +* **setMetadata**: définit des métadonnées sur un répertoire. + +* **moveTo**: déplace un répertoire vers un autre emplacement sur le système de fichiers. + +* **copyTo**: copie un répertoire vers un autre emplacement sur le système de fichiers. + +* **toURL**: renvoie une URL pour aider à localiser un répertoire. + +* **remove**: supprime un répertoire. Le répertoire doit être vide. + +* **getParent**: cherche le répertoire parent. + +* **createReader**: crée un nouveau `DirectoryReader` qui peut lire les entrées d'un répertoire. + +* **getDirectory**: crée ou recherche un répertoire. + +* **getFile**: crée ou recherche un fichier. + +* **removeRecursively**: supprime un répertoire et tout son contenu. + +## Plates-formes prises en charge + +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* iOS +* Windows Phone 7 et 8 +* Windows 8 + +## getMetadata + +Rechercher des métadonnées relatives à un répertoire. + +**Paramètres :** + +* **successCallback**: une fonction de callback pour exécuter avec un objet `Metadata`. *(Fonction)* + +* **errorCallback**: une fonction de callback à exécuter si une erreur se produit lors de la récupération du `Metadata` . Appelée avec un objet `FileError`. *(Fonction)* + +**Petit exemple** + + function success(metadata) {console.log ("date de modification:" + metadata.modificationTime);} + + function fail(error) {alert(error.code);} + + / / Demande l'objet de métadonnées pour cette entrée entry.getMetadata (succès, échec) ; + + +## setMetadata + +Définit les attributs étendus d'un répertoire, ou les métadonnées. *Ne fonctionne actuellement que sur iOS.* + +**Paramètres :** + +* **successCallback**: un callback qui s'exécute lorsque les métadonnées sont correctement définies. *(Fonction)* + +* **errorCallback**: un callback qui s'exécute lorsque les métadonnées ne parviennent pas à être définie. *(Fonction)* + +* **metadataObject**: un objet qui contient les clés et les valeurs de métadonnées. *(Objet)* + +**Petit exemple** + + function success() { + console.log("The metadata was successfully set."); + } + + function fail() { + alert("There was an error in setting the metadata"); + } + + // Set the metadata + entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1}); + + +**Spécificités iOS** + +* Seulement l'atttribut étendu `com.apple.MobileBackup` est pris en charge. Affecte la valeur `1` pour empêcher que le répertoire en cours soit sauvegardé sur iCloud. Affecte la valeur `` pour ré-activer la sauvegarde du répertoire sur iCloud. + +**Petit exemple** + + function setFolderMetadata(localFileSystem, subFolder, metadataKey, metadataValue) + { + var onSetMetadataWin = function() { + console.log("success setting metadata") + } + var onSetMetadataFail = function() { + console.log("error setting metadata") + } + + var onGetDirectoryWin = function(parent) { + var data = {}; + data[metadataKey] = metadataValue; + parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data); + } + var onGetDirectoryFail = function() { + console.log("error getting dir") + } + + var onFSWin = function(fileSystem) { + fileSystem.root.getDirectory(subFolder, {create: true, exclusive: false}, onGetDirectoryWin, onGetDirectoryFail); + } + + var onFSFail = function(evt) { + console.log(evt.target.error.code); + } + + window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); + } + + setFolderMetadata(LocalFileSystem.PERSISTENT, "Backups", "com.apple.MobileBackup", 1); + + +## moveTo + +Déplace un répertoire vers un autre emplacement sur le système de fichiers. Une erreur se produit si l'application tente de : + +* déplacer un répertoire à l'intérieur de lui-même ou à n'importe quel enfant à n'importe quelle profondeur. + +* déplacer un répertoire dans son parent, si un nom différent de son répertoire en cours n'est pas fourni. + +* déplacer un répertoire vers un chemin occupé par un fichier. + +* déplacer un répertoire vers un chemin occupé par un répertoire qui n'est pas vide. + +Déplacer un répertoire sur le dessus un répertoire vide existant tente de supprimer et de remplacer ce répertoire. + +**Paramètres :** + +* **parent**: le répertoire parent vers laquelle déplacer le répertoire. *(DirectoryEntry)* + +* **newName**: le nouveau nom du répertoire. Par défaut, le nom actuel si non spécifié. *(DOMString)* + +* **successCallback**: une fonction de rappel qui s'exécute avec le `DirectoryEntry` objet pour le nouveau répertoire. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous tentez de déplacer le répertoire. Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(entry) { + console.log("New Path: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function moveDir(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + newName = document.getElementById('newName').value, + parentEntry = new DirectoryEntry(parentName, parent); + + // move the directory to a new directory and rename it + entry.moveTo(parentEntry, newName, success, fail); + } + + +## copyTo + +Copier un répertoire vers un autre emplacement sur le système de fichiers. Une erreur se produit si l'application tente de : + +* copier un répertoire à l'intérieur de lui-même à toute profondeur. + +* copier un répertoire dans sa société mère, si un nom différent de son répertoire en cours n'est pas fourni. + +Répertoire des copies sont toujours récursifs et copiez tout le contenu du répertoire. + +**Paramètres :** + +* **parent**: le répertoire parent dans lequel copier le répertoire. *(DirectoryEntry)* + +* **newName**: le nouveau nom du répertoire. Par défaut, le nom actuel si non spécifié. *(DOMString)* + +* **successCallback**: une fonction de rappel qui s'exécute avec le `DirectoryEntry` objet pour le nouveau répertoire. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous tentez de copier l'annuaire sous-jacent. Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function win(entry) { + console.log("New Path: " + entry.fullPath); + } + + function fail(error) { + alert(error.code); + } + + function copyDir(entry) { + var parent = document.getElementById('parent').value, + parentName = parent.substring(parent.lastIndexOf('/')+1), + newName = document.getElementById('newName').value, + parentEntry = new DirectoryEntry(parentName, parent); + + // copy the directory to a new directory and rename it + entry.copyTo(parentEntry, newName, success, fail); + } + + +## toURL + +Retourne une URL qui peut être utilisée pour localiser le répertoire. + +**Petit exemple** + + // Get the URL for this directory + var dirURL = entry.toURL(); + console.log(dirURL); + + +## supprimer + +Supprime un répertoire. Une erreur se produit si l'application tente de : + +* supprimer un répertoire qui n'est pas vide. + +* Supprimez le répertoire racine du système de fichiers. + +**Paramètres :** + +* **successCallback**: une fonction de rappel qui s'exécute après que le répertoire est supprimé. Appelé sans paramètre. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous tentez de supprimer le répertoire. Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(entry) {console.log ("l'enlèvement a réussi");} + + function fail(error) {alert ("erreur de suppression de répertoire: ' + error.code);} + + / / supprimer ce répertoire entry.remove (succès, échec) ; + + +## getParent + +Rechercher le parent `DirectoryEntry` contenant le répertoire. + +**Paramètres :** + +* **successCallback**: un rappel passé parent du répertoire `DirectoryEntry` . *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous tentez de récupérer le parent `DirectoryEntry` . Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(parent) { + console.log("Parent Name: " + parent.name); + } + + function fail(error) { + alert('Failed to get parent directory: ' + error.code); + } + + // Get the parent DirectoryEntry + entry.getParent(success, fail); + + +## createReader + +Crée une nouvelle DirectoryReader pour lire le contenu d'un répertoire. + +**Petit exemple** + + // create a directory reader + var directoryReader = entry.createReader(); + + +## getDirectory + +Crée ou lève les yeux un répertoire existant. Une erreur se produit si l'application tente de : + +* Créez un répertoire dont le parent immédiat n'existe pas encore. + +**Paramètres :** + +* **chemin d'accès**: le chemin vers le répertoire leva ou créé. Un chemin absolu ou un chemin d'accès relatif de cette `DirectoryEntry` . *(DOMString)* + +* **options**: Options pour spécifier si le répertoire est créé s'il n'existe pas. *(Drapeaux)* + +* **successCallback**: une fonction de rappel qui s'exécute avec un `DirectoryEntry` objet. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous créez ou en levant le répertoire. Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(dirEntry) {console.log ("nom du répertoire:" + dirEntry.name);} + + function fail(error) {alert ("Impossible de créer le nouveau répertoire:" + error.code);} + + / / Récupérer un répertoire existant, ou créer si elle n'existe pas déjà entry.getDirectory (« Nouveau_répertoire », {créer : true, exclusif : false}, succès, échec) ; + + +## getFile + +Crée ou lève les yeux un fichier. Une erreur se produit si l'application tente de : + +* Créez un fichier dont le parent immédiat n'existe pas encore. + +**Paramètres :** + +* **chemin d'accès**: le chemin d'accès au fichier pour être levé ou créé. Un chemin absolu ou un chemin d'accès relatif de cette `DirectoryEntry` . *(DOMString)* + +* **options**: Options pour spécifier si le fichier est créé s'il n'existe pas. *(Drapeaux)* + +* **successCallback**: un rappel passé un `FileEntry` objet. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous créez ou en levant le fichier. Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(fileEntry) {console.log ("nom de fichier:" + fileEntry.name);} + + function fail(error) {alert ("Impossible de récupérer le fichier:" + error.code);} + + / / Récupérer un fichier existant, ou créer si elle n'existe pas de entry.getFile (« newFile.txt », {créer : vrai, exclusif : false}, succès, échec) ; + + +## removeRecursively + +Supprime un répertoire et tout son contenu. En cas d'erreur (par exemple en essayant de supprimer un répertoire contenant un fichier qui ne peut pas être supprimé), une partie du contenu du répertoire peuvent être supprimées. Une erreur se produit si l'application tente de : + +* Supprimez le répertoire racine du système de fichiers. + +**Paramètres :** + +* **successCallback**: un rappel qui s'exécute après le `DirectoryEntry` a été supprimé. Appelé sans paramètre. *(Fonction)* + +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lorsque vous tentez de supprimer le `DirectoryEntry` . Appelée avec un `FileError` objet. *(Fonction)* + +**Petit exemple** + + function success(parent) { + console.log("Remove Recursively Succeeded"); + } + + function fail(error) { + alert("Failed to remove directory or it's contents: " + error.code); + } + + // remove the directory and all it's contents + entry.removeRecursively(success, fail); + + +## Bizarreries de blackBerry + +Peut échouer avec un `ControlledAccessException` dans les cas suivants : + +* Une application tente d'accéder à un répertoire créé par une installation précédente de l'application. + +> Solution : Vérifiez les répertoires temporaires sont nettoyés manuellement, ou par l'application avant la réinstallation. + +* Si le périphérique est connecté par USB. + +> Solution : déconnecter le câble USB de l'appareil et exécutez à nouveau. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/fr/3.5.0/cordova/file/directoryreader/directoryreader.md ---------------------------------------------------------------------- diff --git a/docs/fr/3.5.0/cordova/file/directoryreader/directoryreader.md b/docs/fr/3.5.0/cordova/file/directoryreader/directoryreader.md new file mode 100644 index 0000000..a84a0b7 --- /dev/null +++ b/docs/fr/3.5.0/cordova/file/directoryreader/directoryreader.md @@ -0,0 +1,62 @@ +--- + +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. +--- + +# DirectoryReader + +Un objet qui répertorie les fichiers et répertoires d'un répertoire, tel que défini dans la spécification [W3C répertoires et systèmes][1] . + + [1]: http://www.w3.org/TR/file-system-api/ + +## Méthodes + +* **readEntries**: lire les entrées d'un répertoire. + +## Plates-formes prises en charge + +* Android +* BlackBerry WebWorks (OS 5.0 et plus) +* iOS +* Windows Phone 7 et 8 +* Windows 8 + +## readEntries + +Lire les entrées dans ce répertoire. + +**Paramètres :** + +* **successCallback**: un callback qui est passé à un tableau d'objets `FileEntry` et `DirectoryEntry`. *(Fonction)* + +* **errorCallback**: un callback qui s'exécute si une erreur se produit lors de la récupération de la liste de répertoires. Appelée avec un objet `FileError`. *(Fonction)* + +**Petit exemple** + + function success(entries) { + var i; + for (i=0; i Une API permettant de lire, écrire et naviguer dans les hiérarchies d'un système de fichiers, basée sur [celle du w3c][1]. + + [1]: http://www.w3.org/TR/FileAPI + +## Objets + +* DirectoryEntry +* DirectoryReader +* Fichier +* FileEntry +* FileError +* FileReader +* Système de fichiers +* Transfert de fichiers +* FileTransferError +* FileUploadOptions +* FileUploadResult +* FileWriter +* Drapeaux +* Local +* Métadonnées + +## Accéder à la fonctionnalité + +Depuis la version 3.0, Cordova implémente les API liées à l'appareil en tant que *plugins*. Utiliser la commande `plugin` de l'Interface en Ligne de Commande, décrite dans la section intitulée L'Interface en Ligne de Commande, afin d'ajouter ou retirer cette fonctionnalité à un projet : + + $ cordova plugin add org.apache.cordova.file + $ cordova plugin ls + [ 'org.apache.cordova.file' ] + $ cordova plugin rm org.apache.cordova.file + + +Pour utiliser le plugin de transfert de fichiers vous devez ajouter celui-ci séparément : + + $ cordova plugin add org.apache.cordova.file-transfer + $ cordova plugin ls + [ 'org.apache.cordova.file-transfer' ] + $ cordova plugin rm org.apache.cordova.file-transfer + + +Ces commandes s'appliquent à toutes les plates-formes ciblées mais modifient les paramètres de configuration spécifiques aux différentes plates-formes tel que décrit ci-dessous : + +* Android + + (in app/res/xml/config.xml) + + + + + + + + (in app/AndroidManifest.xml) + + + +* BlackBerry WebWorks + + (in www/plugins.xml) + + + + + + + + (in www/config.xml) + + + + + access_shared + + + +* iOS (dans `config.xml`) + + + + + + + + + +Certaines plates-formes peuvent prendre en charge cette fonctionnalité sans nécessiter aucune configuration spéciale. Voir *Support de plate-forme* dans la section vue d'ensemble. \ No newline at end of file