[Rt-commit] r2496 - in rt/branches/QUEBEC-EXPERIMENTAL: html/NoAuth html/Prefs html/Widgets lib/t/regression

clkao at bestpractical.com clkao at bestpractical.com
Wed Mar 23 00:22:09 EST 2005


Author: clkao
Date: Wed Mar 23 00:22:08 2005
New Revision: 2496

Modified:
   rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/list.js
   rt/branches/QUEBEC-EXPERIMENTAL/html/Prefs/MyRT.html
   rt/branches/QUEBEC-EXPERIMENTAL/html/Widgets/SelectionBox
   rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t
Log:
Fix js (still disabled for now).
Make test pass.

Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/list.js
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/list.js	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/NoAuth/list.js	Wed Mar 23 00:22:08 2005
@@ -1,5 +1,4 @@
 /* by TKirby, released under GPL */
-
 /* Define the "list" Class */
 Class("list").define({
  name : null,
@@ -43,8 +42,13 @@
 	 if((src.childNodes[i].nodeName=="input" || src.childNodes[i].nodeName=="INPUT")
 	    && (src.childNodes[i].type=="submit" || src.childNodes[i].type=="SUBMIT")) {
 
-	     if (src.childNodes[i].name.indexOf("Save") < 0)
-		 src.childNodes[i].type = "button";
+	     if (src.childNodes[i].name.indexOf("Save") < 0) {
+		 var tmp	= document.createElement("input");
+		 tmp.type	= "button";
+		 tmp.name	= src.childNodes[i].name;
+		 tmp.value	= src.childNodes[i].value;
+		 src.replaceChild(tmp,src.childNodes[i]);
+	     }
 
 	     if(src.childNodes[i].name=="add")
 		 src.childNodes[i].onclick = new Function(this.name+".add();");
@@ -106,5 +110,3 @@
   for(i=0;i<this.sels[1].length;i++) this.sels[1][i].selected = true;
  }
 });
-
-

Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Prefs/MyRT.html	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Prefs/MyRT.html	Wed Mar 23 00:22:08 2005
@@ -50,13 +50,13 @@
     Searches => \@sys_searches
 &>
 
-<& /Widgets/SelectionBox:header &>
+<& /Widgets/SelectionBox:header, nojs => 1 &>
 
 <& /Elements/ListActions, actions => \@actions &>
 <br />
 % for my $pane (@panes) {
 <&|/Elements/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &>
-<& /Widgets/SelectionBox:show, self => $pane &></&>
+<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &></&>
 <br />
 % }
 <&|/Elements/TitleBox, title => loc('Options'), bodyclass => "" &>
@@ -142,6 +142,6 @@
 		  Selected => [map {join('-',@{$_}{qw/type name/})} @{$portlets->{$pane}}]);
 }
 
-$m->comp ('/Widgets/SelectionBox:process', %ARGS, self => $_) for @panes;
+$m->comp ('/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1) for @panes;
 
 </%INIT>

Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Widgets/SelectionBox
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Widgets/SelectionBox	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Widgets/SelectionBox	Wed Mar 23 00:22:08 2005
@@ -72,11 +72,13 @@
 %# if the SelectionBox is created with AutoSave option, OnSubmit will be called
 %# on every button clicked in non-js mode.
 <%method header>
-% if (0) {
-% # no javascript for now. it's broken in ie
+% unless ($nojs) {
 <script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/class.js"></script>
 <script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/list.js"></script>
 % }
+<%ARGS>
+$nojs => 0
+</%ARGS>
 </%method>
 
 <%method new>
@@ -174,7 +176,11 @@
 </%method>
 
 <%method show>
-<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>" onSubmit="//list_<% $name %>.selectAll();">
+<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>"
+% unless ($nojs) {
+onSubmit="list_<% $name %>.selectAll();"
+% }
+>
 <input type="hidden" name="<% $self->{Name} %>-Submit" value="1">
 <& SelectionBox:current, self => $self &>
 <input type="hidden" name="fromjs" value="0">
@@ -208,12 +214,15 @@
 % }
 </form>
 
+% unless ($nojs) {
 <script type="text/javascript">
-//var list_<%$name%> = new list(document.getElementById("SelectionBox-<% $name %>"), 0, "list_<%$name%>");
+var list_<%$name%> = new list(document.getElementById("SelectionBox-<% $name %>"), 0, "list_<%$name%>");
 </script>
+% }
 <%ARGS>
 $self => undef
 $size => 10
+$nojs => 0
 </%ARGS>
 <%INIT>
 my $name = $self->{Name};

Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/18custom_frontpage.t	Wed Mar 23 00:22:08 2005
@@ -54,7 +54,7 @@
 $m->field ('body-Selected' => ['component-QuickCreate', 'system-Unowned Tickets', 'system-My Tickets']);
 $m->click_button (name => 'remove');
 $m->form_name ('SelectionBox-body');
-$m->click_button (name => 'body-Save');
+#$m->click_button (name => 'body-Save');
 $m->get ( BaseURL );
 $m->content_lacks ('highest priority tickets', 'remove everything from body pane');
 
@@ -71,6 +71,6 @@
 $m->click_button (name => 'movedown');
 
 $m->form_name ('SelectionBox-body');
-$m->click_button (name => 'body-Save');
+#$m->click_button (name => 'body-Save');
 $m->get ( BaseURL );
 $m->content_like (qr'highest priority tickets', 'adds them back');


More information about the Rt-commit mailing list