michael@0: michael@0: michael@0: # org.apache.cordova.dialogs michael@0: michael@0: このプラグインはいくつかのネイティブのダイアログの UI 要素へのアクセスを提供します。 michael@0: michael@0: ## インストール michael@0: michael@0: cordova plugin add org.apache.cordova.dialogs michael@0: michael@0: michael@0: ## メソッド michael@0: michael@0: * `navigator.notification.alert` michael@0: * `navigator.notification.confirm` michael@0: * `navigator.notification.prompt` michael@0: * `navigator.notification.beep` michael@0: michael@0: ## navigator.notification.alert michael@0: michael@0: カスタムの警告またはダイアログ ボックスが表示されます。 ほとんどコルドバ ネイティブ] ダイアログ ボックスの使用この機能がいくつかのプラットフォームを使用して、ブラウザーの `alert` 関数は、通常より少なくカスタマイズ可能です。 michael@0: michael@0: navigator.notification.alert(message, alertCallback, [title], [buttonName]) michael@0: michael@0: michael@0: * **メッセージ**: ダイアログ メッセージ。*(文字列)* michael@0: michael@0: * **alertCallback**: 警告ダイアログが閉じられたときに呼び出すコールバック。*(機能)* michael@0: michael@0: * **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Alert`) michael@0: michael@0: * **buttonName**: ボタンの名前。*(文字列)*(省略可能、既定値は`OK`) michael@0: michael@0: ### 例 michael@0: michael@0: function alertDismissed() { michael@0: // do something michael@0: } michael@0: michael@0: navigator.notification.alert( michael@0: 'You are the winner!', // message michael@0: alertDismissed, // callback michael@0: 'Game Over', // title michael@0: 'Done' // buttonName michael@0: ); michael@0: michael@0: michael@0: ### サポートされているプラットフォーム michael@0: michael@0: * アマゾン火 OS michael@0: * アンドロイド michael@0: * ブラックベリー 10 michael@0: * Firefox の OS michael@0: * iOS michael@0: * Tizen michael@0: * Windows Phone 7 と 8 michael@0: * Windows 8 michael@0: michael@0: ### Windows Phone 7 と 8 癖 michael@0: michael@0: * 組み込みのブラウザー警告がない呼び出しを次のように 1 つをバインドすることができます `alert()` 、グローバル スコープで。 michael@0: michael@0: window.alert = navigator.notification.alert; michael@0: michael@0: michael@0: * 両方の `alert` と `confirm` は非ブロッキング呼び出し、結果は非同期的にのみ利用できます。 michael@0: michael@0: ### Firefox OS 互換: michael@0: michael@0: 両方のネイティブ ブロック `window.alert()` ノン ブロッキングと `navigator.notification.alert()` は利用できます。 michael@0: michael@0: ## navigator.notification.confirm michael@0: michael@0: カスタマイズ可能な確認のダイアログ ボックスが表示されます。 michael@0: michael@0: navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels]) michael@0: michael@0: michael@0: * **メッセージ**: ダイアログ メッセージ。*(文字列)* michael@0: michael@0: * **confirmCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)* michael@0: michael@0: * **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Confirm`) michael@0: michael@0: * **buttonLabels**: ボタンのラベルを指定する文字列の配列。*(配列)*(省略可能、既定値は [ `OK,Cancel` ]) michael@0: michael@0: ### confirmCallback michael@0: michael@0: `confirmCallback`の確認ダイアログ ボックスでボタンを押したときに実行されます。 michael@0: michael@0: コールバック引数 `buttonIndex` *(番号)*は、押されたボタンのインデックス。 メモこと、インデックスを使用して 1 ベースのインデックス化、ので、値は `1` 、 `2` 、 `3` 、等。 michael@0: michael@0: ### 例 michael@0: michael@0: function onConfirm(buttonIndex) { michael@0: alert('You selected button ' + buttonIndex); michael@0: } michael@0: michael@0: navigator.notification.confirm( michael@0: 'You are the winner!', // message michael@0: onConfirm, // callback to invoke with index of button pressed michael@0: 'Game Over', // title michael@0: ['Restart','Exit'] // buttonLabels michael@0: ); michael@0: michael@0: michael@0: ### サポートされているプラットフォーム michael@0: michael@0: * アマゾン火 OS michael@0: * アンドロイド michael@0: * ブラックベリー 10 michael@0: * Firefox の OS michael@0: * iOS michael@0: * Tizen michael@0: * Windows Phone 7 と 8 michael@0: * Windows 8 michael@0: michael@0: ### Windows Phone 7 と 8 癖 michael@0: michael@0: * 組み込みブラウザーの機能はありません `window.confirm` が割り当てることによってバインドすることができます。 michael@0: michael@0: window.confirm = navigator.notification.confirm; michael@0: michael@0: michael@0: * 呼び出しを `alert` と `confirm` では非ブロッキング、結果は非同期的にのみ使用できます。 michael@0: michael@0: ### Firefox OS 互換: michael@0: michael@0: 両方のネイティブ ブロック `window.confirm()` ノン ブロッキングと `navigator.notification.confirm()` は利用できます。 michael@0: michael@0: ## navigator.notification.prompt michael@0: michael@0: ブラウザーのより詳細にカスタマイズはネイティブのダイアログ ボックスが表示されます `prompt` 関数。 michael@0: michael@0: navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText]) michael@0: michael@0: michael@0: * **メッセージ**: ダイアログ メッセージ。*(文字列)* michael@0: michael@0: * **promptCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)* michael@0: michael@0: * **タイトル**: *(文字列)* (省略可能、既定値のタイトル] ダイアログ`Prompt`) michael@0: michael@0: * **buttonLabels**: ボタンを指定する文字列の配列*(配列)* (省略可能、既定値のラベル`["OK","Cancel"]`) michael@0: michael@0: * **これら**: 既定テキスト ボックスの入力値 ( `String` ) (省略可能、既定: 空の文字列) michael@0: michael@0: ### promptCallback michael@0: michael@0: `promptCallback`プロンプト ダイアログ ボックス内のボタンのいずれかを押したときに実行されます。`results`コールバックに渡されるオブジェクトに、次のプロパティが含まれています。 michael@0: michael@0: * **buttonIndex**: 押されたボタンのインデックス。*(数)*メモこと、インデックスを使用して 1 ベースのインデックス化、ので、値は `1` 、 `2` 、 `3` 、等。 michael@0: michael@0: * **input1**: プロンプト ダイアログ ボックスに入力したテキスト。*(文字列)* michael@0: michael@0: ### 例 michael@0: michael@0: function onPrompt(results) { michael@0: alert("You selected button number " + results.buttonIndex + " and entered " + results.input1); michael@0: } michael@0: michael@0: navigator.notification.prompt( michael@0: 'Please enter your name', // message michael@0: onPrompt, // callback to invoke michael@0: 'Registration', // title michael@0: ['Ok','Exit'], // buttonLabels michael@0: 'Jane Doe' // defaultText michael@0: ); michael@0: michael@0: michael@0: ### サポートされているプラットフォーム michael@0: michael@0: * アマゾン火 OS michael@0: * アンドロイド michael@0: * Firefox の OS michael@0: * iOS michael@0: * Windows Phone 7 と 8 michael@0: michael@0: ### Android の癖 michael@0: michael@0: * Android は最大 3 つのボタンをサポートしているし、それ以上無視します。 michael@0: michael@0: * アンドロイド 3.0 と後、ホロのテーマを使用するデバイスを逆の順序でボタンが表示されます。 michael@0: michael@0: ### Firefox OS 互換: michael@0: michael@0: 両方のネイティブ ブロック `window.prompt()` ノン ブロッキングと `navigator.notification.prompt()` は利用できます。 michael@0: michael@0: ## navigator.notification.beep michael@0: michael@0: デバイス サウンドをビープ音を再生します。 michael@0: michael@0: navigator.notification.beep(times); michael@0: michael@0: michael@0: * **回**: ビープ音を繰り返す回数。*(数)* michael@0: michael@0: ### 例 michael@0: michael@0: // Beep twice! michael@0: navigator.notification.beep(2); michael@0: michael@0: michael@0: ### サポートされているプラットフォーム michael@0: michael@0: * アマゾン火 OS michael@0: * アンドロイド michael@0: * ブラックベリー 10 michael@0: * iOS michael@0: * Tizen michael@0: * Windows Phone 7 と 8 michael@0: * Windows 8 michael@0: michael@0: ### アマゾン火 OS 癖 michael@0: michael@0: * アマゾン火 OS デフォルト**設定/表示 & サウンド**パネルの下に指定した**通知音**を果たしています。 michael@0: michael@0: ### Android の癖 michael@0: michael@0: * アンドロイド デフォルト**通知着信音****設定/サウンド & ディスプレイ**パネルの下に指定を果たしています。 michael@0: michael@0: ### Windows Phone 7 と 8 癖 michael@0: michael@0: * コルドバ分布からジェネリック ビープ音ファイルに依存します。 michael@0: michael@0: ### Tizen の癖 michael@0: michael@0: * Tizen は、メディア API 経由でオーディオ ファイルを再生してビープ音を実装します。 michael@0: michael@0: * ビープ音ファイルする必要があります短いである必要があります、 `sounds` 、アプリケーションのルート ディレクトリのサブディレクトリと命名する必要があります`beep.wav`.