simpler still
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 20 Jan 2009 14:55:13 +0000 (14:55 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 20 Jan 2009 14:55:13 +0000 (14:55 +0000)
planetlab/includes/plc_minitabs.php
planetlab/minitabs/minitabs.js
planetlab/nodes/node.php

index 2b2a3eb..9e86f74 100644 (file)
@@ -37,12 +37,7 @@ function plc_tabs($array) {
       }
     }
     $class_value="minitabs-submit";
-    if (! $todo['confirm'] ) {
-       printf('<input class="%s" value="%s" type=submit />',$class_value,$label);
-    } else { 
-      /*      printf('<input class="%s" value="%s" type=button onclick="miniTab.submit(\"%s\")" />',$class_value,$label,$todo['confirm']); */
-      printf('<input class="%s" value="%s" type=button onclick=\'miniTab.submit("%s");\' />',$class_value,$label,$todo['confirm']);
-    }
+    printf('<input class="%s" value="%s" type=button onclick=\'miniTab.submit("%s");\' />',$class_value,$label,$todo['confirm']);
     printf("</form></li>\n");
   }
   print '</ul>';
index 3867bdb..8608e41 100644 (file)
@@ -137,7 +137,8 @@ var miniTab = {
   },
 
  submit: function (message) {
-    if ( ! confirm (message) ) return;
+    /* ask for confirmation if message is not empty */
+    if (message && ! confirm (message) ) return;
     this.inputArr[this.activeTab].parentNode.submit();
   },
 }
index ce0095f..2ed71dc 100644 (file)
@@ -123,13 +123,6 @@ if (empty($nodes)) {
 
     plc_tabs($tabs);
 
-    // the javascript callback we set on the form; this
-    // (*) checks whether we clicked on 'delete'
-    // (*) in this case performs a javascript 'confirm'
-    // (*) then, notice that if we select delete, then cancel, we can select back 'Choose action' 
-    //     so submit only when value is not empty
-    $change='if (document.actions.action.value=="delete") if (! confirm("Are you sure you want to delete ' . $hostname . ' ? ") ) return false; if (document.actions.action.value!="") submit();';
-    
   }    
   
   echo "<hr />";