[Rt-commit] r2322 - in rt/branches/QUEBEC-EXPERIMENTAL: html/NoAuth
html/Prefs html/Widgets lib/t/regression
clkao at bestpractical.com
clkao at bestpractical.com
Wed Mar 9 00:15:21 EST 2005
Author: clkao
Date: Wed Mar 9 00:15:21 2005
New Revision: 2322
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:
Move selectAll to form onSubmit.
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 9 00:15:21 2005
@@ -43,9 +43,6 @@
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 != "submit")
- src.childNodes[i].type = "button";
-
if(src.childNodes[i].name=="add")
src.childNodes[i].onclick = new Function(this.name+".add();");
if(src.childNodes[i].name=="remove")
@@ -54,10 +51,6 @@
src.childNodes[i].onclick = new Function(this.name+".moveup();");
if(src.childNodes[i].name=="movedown")
src.childNodes[i].onclick = new Function(this.name+".movedown();");
- if(src.childNodes[i].type=="submit") {
- src.childNodes[i].onclick = new Function(this.name+".selectAll();");
- }
-
}
}
if (esrc) {
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 9 00:15:21 2005
@@ -127,6 +127,7 @@
{ type => $1,
name => $2,
}} @{$sel->{Current}}];
+ print "saving";
$user->SetPreferences('HomepageSettings', $portlets);
push @actions, loc ('Preferences saved for [_1].', $pane);
delete $session{'my_rt_portlets'};
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 9 00:15:21 2005
@@ -91,7 +91,9 @@
}
$self->{Selected} = $ARGS{$self->{Name}.'-Selected'};
-$self->{Selected} = [$self->{Selected}] unless ref ($self->{Selected});
+if ($self->{Selected} && !ref($self->{Selected})) {
+ $self->{Selected} = [$self->{Selected}];
+}
if ($ARGS{fromjs}) {
$self->{Current} = $self->{Selected};
@@ -141,7 +143,7 @@
# XXX: Verify Current are within $self->{Available} here
-if ($ARGS{submit}) {
+if ($ARGS{$self->{Name}.'-Save'}) {
$self->{OnSubmit}->($self);
delete $self->{Modified};
}
@@ -166,7 +168,7 @@
</%method>
<%method show>
-<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>">
+<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>" onSubmit="list_<% $name %>.selectAll();">
<input type="hidden" name="<% $self->{Name} %>-Submit" value="1">
<& SelectionBox:current, self => $self &>
<input type="hidden" name="fromjs" value="0">
@@ -175,13 +177,13 @@
<b><&|/l&>(Modified, Please save)</&></b>
% }
<br>
-<select name="<%$name%>-Available" multiple >
+<select name="<%$name%>-Available" id="<%$name%>-Available" multiple >
% for (@{$self->{Available}}) {
<option value="<% $_->[0] %>"><% $_->[1] %></option>
% }
</select>
<input name="add" type="submit" value="->"/>
-<select name="<%$name%>-Selected" multiple>
+<select name="<%$name%>-Selected" id="<%$name%>-Selected" multiple>
% for (@{$self->{Current}}) {
<option value="<% $_ %>"
% if (exists $selected{$_}) {
@@ -193,10 +195,8 @@
<input name="moveup" type="submit" value="^"/>
<input name="movedown" type="submit" value="v"/>
<input name="remove" type="submit" value="X"/>
- <input name="submit" type="submit" value="<&|/l&>Save</&>"/>
-%# the save button does not work because it's not direct child of the form element
-%#<& /Elements/Submit, Caption => loc("Save"), Label => loc('Save'), Name => $name.'-Save' &>
+<& /Elements/Submit, Caption => loc("Save"), Label => loc('Save'), Name => $name.'-Save' &>
</form>
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 9 00:15:21 2005
@@ -26,7 +26,7 @@
$m->field ('body-Selected' => ['component-QuickCreate', 'system-My Requests', 'system-My Tickets']);
$m->click_button (name => 'remove');
$m->form_name ('SelectionBox-body');
-$m->click_button (name => 'submit');
+$m->click_button (name => 'body-Save');
$m->get ( BaseURL );
$m->content_lacks ('highest priority tickets', 'remove everything from body pane');
@@ -43,6 +43,6 @@
$m->click_button (name => 'movedown');
$m->form_name ('SelectionBox-body');
-$m->click_button (name => 'submit');
+$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