You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2016/09/09 00:59:45 UTC

[1/3] cordova-plugin-dialogs git commit: CB-11281 windows: defaultText is not taken as input if no input by user fixed

Repository: cordova-plugin-dialogs
Updated Branches:
  refs/heads/master c1fc59cbf -> 03c8ad9df


CB-11281 windows: defaultText is not taken as input if no input by user fixed


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

Branch: refs/heads/master
Commit: 484ad35659d50b2d66539b6a7b77ffde6d76d7f5
Parents: e0efdef
Author: DeshanKTD <de...@gmail.com>
Authored: Wed Aug 24 00:53:48 2016 +0530
Committer: DeshanKTD <de...@gmail.com>
Committed: Wed Aug 24 00:53:48 2016 +0530

----------------------------------------------------------------------
 src/windows/NotificationProxy.js | 2 +-
 tests/tests.js                   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/484ad356/src/windows/NotificationProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/NotificationProxy.js b/src/windows/NotificationProxy.js
index c9c9233..82f9020 100644
--- a/src/windows/NotificationProxy.js
+++ b/src/windows/NotificationProxy.js
@@ -74,7 +74,7 @@ function createPromptDialog(title, message, buttons, defaultText, callback) {
 
     function makeButtonCallback(idx) {
         return function () {
-            var value = dlg.querySelector('#prompt-input').value;
+            var value = dlg.querySelector('#prompt-input').value || defaultText;
             dlgWrap.parentNode.removeChild(dlgWrap);
 
             if (callback) {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/484ad356/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index f5836f1..7056c0d 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -114,7 +114,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
             buttons);
     };
 
-    var promptDialog = function (message, title, buttons) {
+    var promptDialog = function (message, title, buttons,defaultText) {
         clearLog();
         navigator.notification.prompt(message,
             function (r) {
@@ -131,7 +131,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
                 }
             },
             title,
-            buttons);
+            buttons,defaultText);
     };
 
     /******************************************************************************/
@@ -147,7 +147,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
         '<p/> <div id="confirm"></div>' +
         'Expected result: Dialog will say "You pressed confirm". Press Yes, No, or Maybe, Not Sure to close dialog. Status box will tell you what option you selected, and should use 1-based indexing.' +
         '<p/> <div id="prompt"></div>' +
-        'Expected result: Dialog will say "You pressed prompt". Enter any message and press Yes, No, or Maybe, Not Sure to close dialog. Status box will tell you what option you selected and message you entered, and should use 1-based indexing.' +
+        'Expected result: Dialog will say "You pressed prompt". Enter any message and press Yes, No, or Maybe, Not Sure to close dialog. Status box will tell you what option you selected and message you entered or if empty, it will display "Default Text", and should use 1-based indexing.' +
         '<p/> <div id="built_in_alert"></div>' +
         'Expected result: Dialog will have title "index.html" and say "You pressed alert" Press OK to close dialog. Nothing will get updated in status box.' +
         '<p/> <div id="built_in_confirm"></div>' +
@@ -182,7 +182,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
     }, 'confirm');
 
     createActionButton('Prompt Dialog', function () {
-        promptDialog('You pressed prompt.', 'Prompt Dialog', ['Yes', 'No', 'Maybe, Not Sure']);
+        promptDialog('You pressed prompt.', 'Prompt Dialog', ['Yes', 'No', 'Maybe, Not Sure'],'Default Text');
     }, 'prompt');
 
     createActionButton('Built-in Alert Dialog', function () {


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


[2/3] cordova-plugin-dialogs git commit: Merge branch 'master' of https://github.com/DeshanKTD/cordova-plugin-dialogs

Posted by pu...@apache.org.
Merge branch 'master' of https://github.com/DeshanKTD/cordova-plugin-dialogs


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

Branch: refs/heads/master
Commit: f3242eef1166f47196be4ec9f7bd6db2dd8fc185
Parents: c1fc59c 484ad35
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 8 17:58:49 2016 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 8 17:58:49 2016 -0700

----------------------------------------------------------------------
 src/windows/NotificationProxy.js | 2 +-
 tests/tests.js                   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/f3242eef/src/windows/NotificationProxy.js
----------------------------------------------------------------------


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


[3/3] cordova-plugin-dialogs git commit: Select the text and put default value in the input directly.

Posted by pu...@apache.org.
Select the text and put default value in the input directly.


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

Branch: refs/heads/master
Commit: 03c8ad9df8a529007a592bfc42cb4631f3440f4f
Parents: f3242ee
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 8 17:59:28 2016 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 8 17:59:28 2016 -0700

----------------------------------------------------------------------
 src/windows/NotificationProxy.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/03c8ad9d/src/windows/NotificationProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/NotificationProxy.js b/src/windows/NotificationProxy.js
index 57dfb96..2d32f83 100644
--- a/src/windows/NotificationProxy.js
+++ b/src/windows/NotificationProxy.js
@@ -81,6 +81,7 @@ function createPromptDialog(title, message, buttons, defaultText, callback) {
     dlg.querySelector('#lbl-title').appendChild(document.createTextNode(title));
     dlg.querySelector('#lbl-message').appendChild(document.createTextNode(message));
     dlg.querySelector('#prompt-input').setAttribute('placeholder', defaultText);
+    dlg.querySelector('#prompt-input').setAttribute('value', defaultText);
 
     function makeButtonCallback(idx) {
         return function () {
@@ -114,7 +115,7 @@ function createPromptDialog(title, message, buttons, defaultText, callback) {
     document.body.appendChild(dlgWrap);
 
     // make sure input field is under focus
-    dlg.querySelector('#prompt-input').focus();
+    dlg.querySelector('#prompt-input').select();
 
     return dlgWrap;
 }


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