Touchgui/plugins/org.apache.cordova.vibration/doc/zh/index.md

changeset 0
e8ccd40d0ef6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Touchgui/plugins/org.apache.cordova.vibration/doc/zh/index.md	Thu Jun 04 14:50:33 2015 +0200
     1.3 @@ -0,0 +1,170 @@
     1.4 +<!---
     1.5 +    Licensed to the Apache Software Foundation (ASF) under one
     1.6 +    or more contributor license agreements.  See the NOTICE file
     1.7 +    distributed with this work for additional information
     1.8 +    regarding copyright ownership.  The ASF licenses this file
     1.9 +    to you under the Apache License, Version 2.0 (the
    1.10 +    "License"); you may not use this file except in compliance
    1.11 +    with the License.  You may obtain a copy of the License at
    1.12 +
    1.13 +      http://www.apache.org/licenses/LICENSE-2.0
    1.14 +
    1.15 +    Unless required by applicable law or agreed to in writing,
    1.16 +    software distributed under the License is distributed on an
    1.17 +    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    1.18 +    KIND, either express or implied.  See the License for the
    1.19 +    specific language governing permissions and limitations
    1.20 +    under the License.
    1.21 +-->
    1.22 +
    1.23 +# org.apache.cordova.vibration
    1.24 +
    1.25 +這個外掛程式將對齊與 W3C 振動規範 HTTP://www.w3.org/TR/vibration/
    1.26 +
    1.27 +這個外掛程式提供了方法振動設備。
    1.28 +
    1.29 +## 安裝
    1.30 +
    1.31 +    cordova plugin add org.apache.cordova.vibration
    1.32 +    
    1.33 +
    1.34 +## 支援的平臺
    1.35 +
    1.36 +navigator.vibrate  
    1.37 +navigator.notification.vibrate-亞馬遜火 OS-Android-黑莓 10-火狐瀏覽器作業系統 — — iOS-Windows Phone 7 和 8
    1.38 +
    1.39 +navigator.notification.vibrateWithPattern,  
    1.40 +navigator.notification.cancelVibration-安卓系統
    1.41 +
    1.42 +## 震動 (推薦)
    1.43 +
    1.44 +此函數具有三個不同的功能,基於參數傳遞給它。
    1.45 +
    1.46 +### 標準振動
    1.47 +
    1.48 +為給定時間振動設備。
    1.49 +
    1.50 +    navigator.vibrate(time)
    1.51 +    
    1.52 +
    1.53 +或
    1.54 +
    1.55 +    navigator.vibrate([time])
    1.56 +    
    1.57 +
    1.58 +-**時間**: 毫秒以振動裝置。*(人數)*
    1.59 +
    1.60 +#### 示例
    1.61 +
    1.62 +    // Vibrate for 3 seconds
    1.63 +    navigator.vibrate(3000);
    1.64 +    
    1.65 +    // Vibrate for 3 seconds
    1.66 +    navigator.vibrate([3000]);
    1.67 +    
    1.68 +
    1.69 +#### iOS 的怪癖
    1.70 +
    1.71 +*   **時間**: 忽略指定的時間和震動的一個預先設定的時間。
    1.72 +    
    1.73 +    navigator.vibrate(3000); // 3000 is ignored
    1.74 +
    1.75 +#### Windows 和黑莓的怪癖
    1.76 +
    1.77 +*   **時間**: 最長時間是 5000ms (5s) 和最小時間為 1ms
    1.78 +    
    1.79 +    navigator.vibrate(8000); // will be truncated to 5000
    1.80 +
    1.81 +### 以一種模式 (安卓系統和僅限 Windows) 振動
    1.82 +
    1.83 +振動具有給定模式的設備
    1.84 +
    1.85 +    navigator.vibrate(pattern);   
    1.86 +    
    1.87 +
    1.88 +*   **模式**: 序列的持續時間 (以毫秒為單位) 為其打開或關閉振動器。*(數位陣列)*
    1.89 +
    1.90 +#### 示例
    1.91 +
    1.92 +    // Vibrate for 1 second
    1.93 +    // Wait for 1 second
    1.94 +    // Vibrate for 3 seconds
    1.95 +    // Wait for 1 second
    1.96 +    // Vibrate for 5 seconds
    1.97 +    navigator.vibrate([1000, 1000, 3000, 1000, 5000]);
    1.98 +    
    1.99 +
   1.100 +### 取消振動 (iOS 中不支援)
   1.101 +
   1.102 +立即取消任何當前正在運行的振動。
   1.103 +
   1.104 +    navigator.vibrate(0)
   1.105 +    
   1.106 +
   1.107 +或
   1.108 +
   1.109 +    navigator.vibrate([])
   1.110 +    
   1.111 +
   1.112 +或
   1.113 +
   1.114 +    navigator.vibrate([0])
   1.115 +    
   1.116 +
   1.117 +在一個為 0 的參數中傳遞,空陣列或陣列的一個元素的值為 0 將取消任何振動。
   1.118 +
   1.119 +## *notification.vibrate (已棄用)
   1.120 +
   1.121 +為給定時間振動設備。
   1.122 +
   1.123 +    navigator.notification.vibrate(time)
   1.124 +    
   1.125 +
   1.126 +*   **時間**: 毫秒以振動裝置。*(人數)*
   1.127 +
   1.128 +### 示例
   1.129 +
   1.130 +    // Vibrate for 2.5 seconds
   1.131 +    navigator.notification.vibrate(2500);
   1.132 +    
   1.133 +
   1.134 +### iOS 的怪癖
   1.135 +
   1.136 +*   **時間**: 忽略指定的時間和震動的一個預先設定的時間。
   1.137 +    
   1.138 +        navigator.notification.vibrate();
   1.139 +        navigator.notification.vibrate(2500);   // 2500 is ignored
   1.140 +        
   1.141 +
   1.142 +## *notification.vibrateWithPattern (已棄用)
   1.143 +
   1.144 +振動具有給定模式的設備。
   1.145 +
   1.146 +    navigator.notification.vibrateWithPattern(pattern, repeat)
   1.147 +    
   1.148 +
   1.149 +*   **模式**: 序列的持續時間 (以毫秒為單位) 為其打開或關閉振動器。*(數位陣列)*
   1.150 +*   **重複**: 在其開始重複 (會重複,直到被取消),或-1 為不重複 (預設值) 模式陣列中的可選索引。*(人數)*
   1.151 +
   1.152 +### 示例
   1.153 +
   1.154 +    // Immediately start vibrating
   1.155 +    // vibrate for 100ms,
   1.156 +    // wait for 100ms,
   1.157 +    // vibrate for 200ms,
   1.158 +    // wait for 100ms,
   1.159 +    // vibrate for 400ms,
   1.160 +    // wait for 100ms,
   1.161 +    // vibrate for 800ms,
   1.162 +    // (do not repeat)
   1.163 +    navigator.notification.vibrateWithPattern([0, 100, 100, 200, 100, 400, 100, 800]);
   1.164 +    
   1.165 +
   1.166 +## *notification.cancelVibration (已棄用)
   1.167 +
   1.168 +立即取消任何當前正在運行的振動。
   1.169 +
   1.170 +    navigator.notification.cancelVibration()
   1.171 +    
   1.172 +
   1.173 +* 請注意--對齊方式與 w3c 規範,因出演的方法將被淘汰
   1.174 \ No newline at end of file

mercurial