| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Upload Form</title> | |
| 5 <script> | |
| 6 var intervalId; | |
| 7 function onTick() { | |
| 8 var label = document.getElementById('upload_label'); | |
| 9 label.innerHTML += '.'; | |
| 10 } | |
| 11 | |
| 12 function onUploadSubmit() { | |
| 13 document.getElementById('upload_target').contentWindow.document.body. | |
| 14 innerHTML = ''; | |
| 15 var label = document.getElementById('upload_label'); | |
| 16 label.innerHTML = 'Uploading "' + document.forms[0].upload.value + '"'; | |
| 17 label.style.display = ''; | |
| 18 intervalId = window.setInterval(onTick, 500); | |
| 19 return true; | |
| 20 } | |
| 21 | |
| 22 function onUploadDone() { | |
| 23 var label = document.getElementById('upload_label'); | |
| 24 label.style.display = 'none'; | |
| 25 window.clearInterval(intervalId); | |
| 26 return true; | |
| 27 } | |
| 28 </script> | |
| 29 </head> | |
| 30 <body> | |
| 31 <form action="/common/upload" method="post" name="upload_form" | |
| 32 target="upload_target" enctype="multipart/form-data" | |
| 33 onsubmit="onUploadSubmit();"> | |
| 34 <div> | |
| 35 Enter a file to upload: | |
| 36 <div><input id="upload" name="upload" type="file"/></div> | |
| 37 <div><input id="go" type="submit" value="Go!"/></div> | |
| 38 </div> | |
| 39 <div id="upload_label" style="display:none"></div> | |
| 40 <iframe src="" id="upload_target" name="upload_target" | |
| 41 style="width:300px;height:200px"> | |
| 42 </iframe> | |
| 43 </form> | |
| 44 </body> | |
| 45 </html> | |
| OLD | NEW |