gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-backoffice] 02/02: Enable/disable cherry pick submit


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] 02/02: Enable/disable cherry pick submit button..
Date: Mon, 30 Jul 2018 15:20:00 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository backoffice.

commit 40d1791063477094ad5f9851ede9a82990d913ed
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Jul 30 15:19:18 2018 +0200

    Enable/disable cherry pick submit button..
    
    .. depending no whether inputs are valid or not.
---
 js/backoffice.js                                   | 23 +++++++++++-----------
 .../backoffice/templates/backoffice.html           |  4 +++-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/js/backoffice.js b/js/backoffice.js
index 77361d9..13539b4 100644
--- a/js/backoffice.js
+++ b/js/backoffice.js
@@ -480,7 +480,8 @@ function toggle_loader(){
  * whether the user selected "order" ("transfer") on the
  * dedicated form.
  */
-function track_cherry_pick(form){
+function track_cherry_pick(){
+  var form = document.getElementById("choices");
   var types = xpath_get("address@hidden'radio']", form);
   for(var i in [0, 1]){
     if (!types.snapshotItem(i).checked)
@@ -652,8 +653,8 @@ var VALID_TT_INPUTS = 0;
 
 function validate_exchange_url(text_input)
 {
-  var submit_button = xpath_get("//address@hidden'submit']",
-                                document);
+  var submit_button = document.getElementById
+    ("submit-cherry-pick");
 
   if (text_input.value.match
     (/^https:\/\/[a-zA-Z]+\.[a-zA-Z]+\//))
@@ -667,16 +668,16 @@ function validate_exchange_url(text_input)
     VALID_TT_INPUTS &= ~2;
   }
 
-  if (2 == VALID_TT_INPUTS)
+  if (3 == VALID_TT_INPUTS)
     submit_button.disabled = false;
   else submit_button.disabled = true;
 }
 
 function validate_wtid(text_input)
 {
-  var submit_button = xpath_get("//address@hidden'submit']",
-                                document);
-
+  var submit_button = document.getElementById
+    ("submit-cherry-pick");
+  
   if (text_input.value.match(/^[A-Za-z0-9]+$/))
   {
     console.log("Good value", text_input.value);
@@ -688,16 +689,16 @@ function validate_wtid(text_input)
     VALID_TT_INPUTS &= ~1;
   }
 
-  if (2 == VALID_TT_INPUTS)
+  if (3 == VALID_TT_INPUTS)
     submit_button.disabled = false;
   else submit_button.disabled = true;
 }
 
 function validate_order_id(text_input)
 {
-  var submit_button = xpath_get("//address@hidden'submit']",
-                                document);
-
+  var submit_button = document.getElementById
+    ("submit-cherry-pick");
+  
   if (text_input.value.match(/^[A-Za-z0-9]+$/))
   {
     console.log("Good value", text_input.value);
diff --git a/talerbackoffice/backoffice/templates/backoffice.html 
b/talerbackoffice/backoffice/templates/backoffice.html
index 144a060..3e1ef91 100644
--- a/talerbackoffice/backoffice/templates/backoffice.html
+++ b/talerbackoffice/backoffice/templates/backoffice.html
@@ -49,8 +49,10 @@
     <div>
       <form action="">
         <input type="button"
+               id="submit-cherry-pick"
+               disabled
                value="submit"
-               onclick='track_cherry_pick(this.parentNode)'>
+               onclick='track_cherry_pick()'>
         </input>
       </form>
     </div>

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]