[freeside-commits] freeside/httemplate/elements file-upload.html, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Thu Aug 14 04:56:09 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv9979/httemplate/elements
Modified Files:
file-upload.html
Log Message:
customer import: add progress bar & redirect to a search of the imported customers, #3475
Index: file-upload.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/file-upload.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- file-upload.html 15 Apr 2008 20:47:56 -0000 1.1
+++ file-upload.html 14 Aug 2008 11:56:07 -0000 1.2
@@ -1,10 +1,13 @@
-
-<script type="text/javascript">
+<SCRIPT TYPE="text/javascript">
function doUpload(form, callback) {
var name = 'form' + Math.floor(Math.random() * 99999); // perlize?
var d = document.createElement('DIV');
- d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+name+'" name="'+name+'" onload="uploadComplete(\''+name+'\')"></iframe>';
+ d.innerHTML = '<iframe style="display:none" src="about:blank" ' +
+ 'id="' + name + '" ' +
+ 'name="' + name + '" ' +
+ 'onload="uploadComplete(\'' + name + '\')">' +
+ '</iframe>';
document.body.appendChild(d);
var i = document.getElementById(name);
@@ -32,8 +35,8 @@
document.getElementById('r').innerHTML = d.body.innerHTML;
if (typeof(i.onComplete) == 'function') {
var p;
- if (p = d.body.innerHTML.indexOf("Freeside File Upload Successful ") >= 0) {
- var v = d.body.innerHTML.substr(p+33)
+ if (p = d.body.innerHTML.indexOf("File Upload Successful ") >= 0) {
+ var v = d.body.innerHTML.substr(p+24);
var u = document.getElementById('uploaded_files');
v = v.substr(0, v.indexOf(';'));
u.value = v;
@@ -44,37 +47,28 @@
}
}
-</script>
+</SCRIPT>
+
+<INPUT TYPE="hidden" NAME="uploaded_files" ID="uploaded_files" VALUE="" />
+
+<INPUT TYPE="hidden" NAME="upload_fields" VALUE="<% join(',', @field) %>" />
- <input type="hidden" name="uploaded_files" id="uploaded_files" value="" />
- <input type="hidden" name="upload_fields" value="<% join(',', @field) %>" />
% foreach (@field) {
- <tr>
- <th><% shift @label %></th>
- <td><input type="file" name="<% $_ %>" /></td>
- </tr>
+ <TR>
+ <TH><% shift @label %></TH>
+ <TD><INPUT TYPE="file" NAME="<% $_ %>" /></TD>
+ </TR>
% }
- <div style="display:<% $debug ? 'visible' : 'none' %>">Debugging: <pre id="r"></pre></div>
-<%init>
-my %param = @_;
-
-my $debug = $param{'debug'};
+<DIV STYLE="display:<% $param{debug} ? 'visible' : 'none' %>">
+ Debugging: <PRE ID="r"></PRE>
+</DIV>
-my $callback = $param{'callback'} || "''";
+<%init>
-my @label = ();
-if ( ref($param{'label'}) ) {
- push @label, @{$param{'label'}};
-}else{
- push @label, $param{'label'};
-}
+my %param = @_;
-my @field = ();
-if ( ref($param{'field'}) ) {
- push @field, @{$param{'field'}};
-}else{
- push @field, $param{'field'};
-}
+my @label = ref($param{'label'}) ? @{$param{'label'}} : ($param{'label'});
+my @field = ref($param{'field'}) ? @{$param{'field'}} : ($param{'field'});
</%init>
More information about the freeside-commits
mailing list