work on sieve templates
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 3 Jul 2011 23:09:12 +0000 (23:09 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:28:46 +0000 (21:28 +0000)
webcit/static/t/sieve/display.html
webcit/static/t/sieve/list.html

index 222dd346f8e6293589f09a45480beac869f8038c..d34a0edff71bbc5d22b576488d5bb8f1d29a6e6d 100644 (file)
@@ -1,18 +1,19 @@
 
+<script type="text/javascript">
+
 /*
  * This script should get called by every onChange event...
  *
  */
-<script type="text/javascript">
 
 var highest_active_rule = (-1);
 
 function UpdateRules() {
 /*
- * Show only the active rows...
+ * Show only the active rows... /// TODO 255-> we need no limit anymore.
  */
   highest_active_rule = (-1);
-  for (i=0; i< <?SIEVE:MAX_RULES>; ++i) {
+  for (i=0; i< 255; ++i) {
    if ($('active'+i).checked) {
      $('rule' + i).style.display = 'block';
      highest_active_rule = i;
@@ -21,6 +22,7 @@ function UpdateRules() {
      $('rule' + i).style.display = 'none';
    }
   }
+
 /*
  * Show only the fields relevant to the rules...
  */
@@ -65,14 +67,15 @@ function UpdateRules() {
       $('div_fileinto'+i).style.display = 'none';
       $('div_redirect'+i).style.display = 'none';
       $('div_automsg'+i).style.display = 'none';
-    }
-    if (highest_active_rule < <?SIEVE:MAX_RULES> - 1) {
+    }/* TODO: we don't have any limits anymore */
+    if (highest_active_rule < 255 - 1) {
       $('div_addrule').style.display = 'block';
     } else {
       $('div_addrule').style.display = 'none';
     }
   }
 }
+
 /*
  * Add a rule (really, just un-hide it)
  */
@@ -81,6 +84,7 @@ function AddRule() {
   $('active'+highest_active_rule).checked = true;
   UpdateRules();
 }
+
 /*
  * Swap two rules
  */
@@ -104,6 +108,7 @@ function SwapRules(ra, rb) {
     $(things[i]+rb).value = tempval;
   }
 }
+
 /*
  * Delete a rule (percolate the deleted rule out to the end, then deactivate it)
  */
@@ -120,4 +125,4 @@ function DeleteRule(rd) {
 
 <div id="div_addrule"><a href="javascript:AddRule();"><?_("Add rule")></a><br></div>
 <script type="text/javascript">UpdateRules();</script>
-
+</div>
index f564250d2cc9842d2b4678e7f7aa1f36b986d445..ead4cada001b8f87041c48be91ebbc25e620459f 100644 (file)
@@ -1,5 +1,10 @@
-<?--("iterate over an empty template, so we have the states already loaded for below")><?ITERATE("SIEVE:SCRIPTS", ="sieve_empty")><script type="text/javascript">
+<?=("head")><?=("important_msg")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
+
+<?--("iterate over an empty template, so we have the states already loaded for below")><?ITERATE("SIEVE:SCRIPTS", ="sieve_empty")>
+<script type="text/javascript">
+
 var previously_active_script;                                                                  
+
 function ToggleSievePanels() {
  d = ($('sieveform').bigaction.options[$('sieveform').bigaction.selectedIndex].value);
  for (i=0; i<3; ++i) {
@@ -11,7 +16,7 @@ function ToggleSievePanels() {
   }
  }
 }
-                                                                       
+
 function ToggleScriptPanels() {
  d = ($('sieveform').active_script.options[$('sieveform').active_script.selectedIndex].value);
  if ($('script_' + previously_active_script)) {
@@ -22,7 +27,7 @@ function ToggleScriptPanels() {
 }
 </script>                                                              
 <div id="banner">
-<img src="static/advanpage2_48x.gif">
+<img src="static/webcit_icons/essen/32x32/config.png">
 <h1><?_("View/edit server-side mail filters")></h1>
 </div>
 
@@ -49,7 +54,8 @@ function ToggleScriptPanels() {
 <?--("The webcit managed scripts div")>
 
 <div id="sievediv1" style="display:none">
-       display_rules_editor_inner_div();
+
+<?=("sieve_display")>
 </div>
 <?--("The I am smart and can write my own Sieve scripts div ")>
 
@@ -75,11 +81,11 @@ function ToggleScriptPanels() {
 <div align="center"><br>
 <input type="submit" name="save_button" value='<?_("Save changes")>'>
 &nbsp;
-<input type="submit" name="cancel_button" value='(?_("Cancel")>'>
+<input type="submit" name="cancel_button" value='<?_("Cancel")>'>
 </div></form>
 
 </td></tr></table>
 
 <script type="text/javascript">ToggleSievePanels();</script>
-
-
+</div> <!-- end of 'content' div -->
+<?=("trailing")>