Advertisement
jtl999

Untitled

Dec 23rd, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  5.  
  6. <title>Plupload - jQuery UI Widget</title>
  7.  
  8. <link rel="stylesheet" href="../../vendor/jquery-ui.css" type="text/css" />
  9. <link rel="stylesheet" href="../../js/jquery.ui.plupload/css/jquery.ui.plupload.css" type="text/css" />
  10.  
  11. <script src="../../vendor/jquery.min.js"></script>
  12. <script type="text/javascript" src="../../vendor/jquery-ui.min.js"></script>
  13.  
  14. <!-- production -->
  15. <script type="text/javascript" src="../../js/plupload.full.min.js"></script>
  16. <script type="text/javascript" src="../../js/jquery.ui.plupload/jquery.ui.plupload.js"></script>
  17.  
  18. <!-- debug
  19. <script type="text/javascript" src="../../js/moxie.js"></script>
  20. <script type="text/javascript" src="../../js/plupload.dev.js"></script>
  21. <script type="text/javascript" src="../../js/jquery.ui.plupload/jquery.ui.plupload.js"></script>
  22. -->
  23.  
  24. </head>
  25. <body style="font: 13px Verdana; background: #eee; color: #333">
  26.  
  27. <h1>jQuery UI Widget</h1>
  28.  
  29. <p>You can see this example with different themes on the <a href="http://plupload.com/example_jquery_ui.php">www.plupload.com</a> website.</p>
  30.  
  31. <form id="form" method="post" action="../dump.php">
  32. <div id="uploader">
  33. <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
  34. </div>
  35. <br />
  36. <input type="submit" value="Submit" />
  37. </form>
  38.  
  39. <script type="text/javascript">
  40. // Initialize the widget when the DOM is ready
  41. $(function() {
  42. $("#uploader").plupload({
  43. // General settings
  44. runtimes : 'html5,flash,silverlight,html4',
  45. url : '../upload.php',
  46.  
  47. // User can upload no more then 20 files in one go (sets multiple_queues to false)
  48. max_file_count: 20,
  49.  
  50. chunk_size: '1mb',
  51.  
  52. // Resize images on clientside if we can
  53. resize : {
  54. width : 200,
  55. height : 200,
  56. quality : 90,
  57. crop: true // crop to exact dimensions
  58. },
  59.  
  60. // Rename files by clicking on their titles
  61. rename: true,
  62.  
  63. // Sort files
  64. sortable: true,
  65.  
  66. // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
  67. dragdrop: true,
  68.  
  69. // Views to activate
  70. views: {
  71. list: true,
  72. thumbs: true, // Show thumbs
  73. active: 'thumbs'
  74. },
  75.  
  76. // Flash settings
  77. flash_swf_url : '../../js/Moxie.swf',
  78.  
  79. // Silverlight settings
  80. silverlight_xap_url : '../../js/Moxie.xap'
  81. });
  82.  
  83.  
  84. // Handle the case when form was submitted before uploading has finished
  85. $('#form').submit(function(e) {
  86. // Files in queue upload them first
  87. if ($('#uploader').plupload('getFiles').length > 0) {
  88.  
  89. // When all files are uploaded submit form
  90. $('#uploader').on('complete', function() {
  91. $('#form')[0].submit();
  92. });
  93.  
  94. $('#uploader').plupload('start');
  95. } else {
  96. alert("You must have at least one file in the queue.");
  97. }
  98. return false; // Keep the form from submitting
  99. });
  100. });
  101. </script>
  102. </body>
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement