summaryrefslogtreecommitdiff
path: root/httemplate/edit/rate.cgi
diff options
context:
space:
mode:
authorivan <ivan>2005-02-20 08:44:40 +0000
committerivan <ivan>2005-02-20 08:44:40 +0000
commitd6047391feb3236374e16fd73240d9821d77fe06 (patch)
tree26cd3c1df50a28ed50ce77669a31d672748866a6 /httemplate/edit/rate.cgi
parent9e1ec0694dff61d375af8c0ef0e3895a7f1e07fd (diff)
use a javascript layer instead of a browser popup (popup blockers), really generalize the progressbar code to make it easy to use as a component
Diffstat (limited to 'httemplate/edit/rate.cgi')
-rw-r--r--httemplate/edit/rate.cgi46
1 files changed, 7 insertions, 39 deletions
diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi
index 1c5d61dc5..ce56768d1 100644
--- a/httemplate/edit/rate.cgi
+++ b/httemplate/edit/rate.cgi
@@ -32,42 +32,13 @@ END
))
%>
-<!-- <FORM ACTION="<%=$p1%>rate.cgi" NAME="OneTrueForm" METHOD=POST onSubmit="document.OneTrueForm.submit.disabled=true"> -->
-
-<SCRIPT TYPE="text/javascript" SRC="../elements/jsrsClient.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript">
-function process () {
- document.OneTrueForm.submit.disabled=true;
-
- var Hash = new Array();
- var x = 0;
- var fieldName;
- for (var i = 0; i<document.OneTrueForm.elements.length; i++) {
- fieldName = document.OneTrueForm.elements[i].name;
- if ( (fieldName.indexOf('rate') > -1)
- || (fieldName.indexOf('min_') > -1)
- || (fieldName.indexOf('sec_') > -1)
- )
- {
- Hash[x++] = fieldName;
- Hash[x++] = document.OneTrueForm.elements[i].value;
- }
- }
-
- jsrsPOST = true;
- //jsrsExecute( 'process/rate.cgi', myCallback, 'process_rate', Hash );
- jsrsExecute( 'process/rate.cgi', myCallback, 'start_job', Hash );
-
-}
-
-function myCallback( jobnum ) {
- var progressWindow = window.open('../../misc/progress.html?jobnum=' + jobnum + ';url=<%=$p%>browse/rate.cgi', 'progressWindow', 'toolbar=no,location=no,directories=no,scrollbars=no,menubar=no,status=no,width=420,height=128');
- progressWindow.opener = self;
- //progressWindow.opener = document;
-}
-
-</SCRIPT>
-
+<%= include('/elements/progress-init.html',
+ 'OneTrueForm',
+ [ 'rate', 'min_', 'sec_' ],
+ 'process/rate.cgi',
+ $p.'browse/rate.cgi',
+ )
+%>
<FORM NAME="OneTrueForm">
<INPUT TYPE="hidden" NAME="ratenum" VALUE="<%= $rate->ratenum %>">
@@ -124,9 +95,6 @@ Rate plan
<BR><INPUT NAME="submit" TYPE="button" VALUE="<%=
$rate->ratenum ? "Apply changes" : "Add rate plan"
%>" onClick="document.OneTrueForm.submit.disabled=true; process();">
-Please make sure to allow popups from this site in order to view the progress window.
-<!-- Please be patient, <%= $rate->ratenum ? 'editing' : 'adding' %>
-a rate plan can take a few minutes... -->
</FORM>
</BODY>