plupload.vsdoc.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. // Namespaces
  2. plupload = {}
  3. plupload.runtimes = {}
  4. // Classes
  5. plupload.runtimes.BrowserPlus = function() {
  6. /// <summary>Yahoo BrowserPlus implementation.</summary>
  7. }
  8. plupload.runtimes.BrowserPlus.init = function(uploader, callback) {
  9. /// <summary>Initializes the browserplus runtime.</summary>
  10. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  11. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  12. }
  13. plupload.runtimes.Flash = function() {
  14. /// <summary>FlashRuntime implementation.</summary>
  15. }
  16. plupload.runtimes.Flash.init = function(uploader, callback) {
  17. /// <summary>Initializes the upload runtime.</summary>
  18. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  19. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  20. }
  21. plupload.runtimes.Gears = function() {
  22. /// <summary>Gears implementation.</summary>
  23. }
  24. plupload.runtimes.Gears.init = function(uploader, callback) {
  25. /// <summary>Initializes the upload runtime.</summary>
  26. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  27. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  28. }
  29. plupload.runtimes.Html4 = function() {
  30. /// <summary>HTML4 implementation.</summary>
  31. }
  32. plupload.runtimes.Html4.init = function(uploader, callback) {
  33. /// <summary>Initializes the upload runtime.</summary>
  34. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  35. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  36. }
  37. plupload.runtimes.Html5 = function() {
  38. /// <summary>HMTL5 implementation.</summary>
  39. }
  40. plupload.runtimes.Html5.init = function(uploader, callback) {
  41. /// <summary>Initializes the upload runtime.</summary>
  42. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  43. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  44. }
  45. plupload.runtimes.Silverlight = function() {
  46. /// <summary>Silverlight implementation.</summary>
  47. }
  48. plupload.runtimes.Silverlight.init = function(uploader, callback) {
  49. /// <summary>Initializes the upload runtime.</summary>
  50. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  51. /// <param name="callback" type="function">Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  52. }
  53. plupload.Uploader = function(settings) {
  54. /// <summary>Uploader class, an instance of this class will be created for each upload field.</summary>
  55. /// <param name="settings" type="Object">Initialization settings, to be used by the uploader instance and runtimes.</param>
  56. /// <field name="state" type="Number">Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. These states are controlled by the stop/start methods. The default value is STOPPED.</field>
  57. /// <field name="runtime" type="String">Current runtime name.</field>
  58. /// <field name="features" type="Object">Map of features that are available for the uploader runtime. Features will be filled before the init event is called, these features can then be used to alter the UI for the end user. Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize.</field>
  59. /// <field name="files" type="Array">Current upload queue, an array of File instances.</field>
  60. /// <field name="settings" type="Object">Object with name/value settings.</field>
  61. /// <field name="total" type="plupload.QueueProgress">Total progess information. How many files has been uploaded, total percent etc.</field>
  62. /// <field name="id" type="String">Unique id for the Uploader instance.</field>
  63. }
  64. plupload.Uploader.prototype.init = function() {
  65. /// <summary>Initializes the Uploader instance and adds internal event listeners.</summary>
  66. }
  67. plupload.Uploader.prototype.refresh = function() {
  68. /// <summary>Refreshes the upload instance by dispatching out a refresh event to all runtimes.</summary>
  69. }
  70. plupload.Uploader.prototype.start = function() {
  71. /// <summary>Starts uploading the queued files.</summary>
  72. }
  73. plupload.Uploader.prototype.stop = function() {
  74. /// <summary>Stops the upload of the queued files.</summary>
  75. }
  76. plupload.Uploader.prototype.getFile = function(id) {
  77. /// <summary>Returns the specified file object by id.</summary>
  78. /// <param name="id" type="String">File id to look for.</param>
  79. /// <returns type="plupload.File">File object or undefined if it wasn't found;</returns>
  80. }
  81. plupload.Uploader.prototype.removeFile = function(file) {
  82. /// <summary>Removes a specific file.</summary>
  83. /// <param name="file" type="plupload.File">File to remove from queue.</param>
  84. }
  85. plupload.Uploader.prototype.splice = function(start, length) {
  86. /// <summary>Removes part of the queue and returns the files removed.</summary>
  87. /// <param name="start" type="Number" integer="true">(Optional) Start index to remove from.</param>
  88. /// <param name="length" type="Number" integer="true">(Optional) Lengh of items to remove.</param>
  89. /// <returns type="Array">Array of files that was removed.</returns>
  90. }
  91. plupload.Uploader.prototype.trigger = function(name, Multiple) {
  92. /// <summary>Dispatches the specified event name and it's arguments to all listeners.</summary>
  93. /// <param name="name" type="String">Event name to fire.</param>
  94. /// <param name="Multiple" type="Object..">arguments to pass along to the listener functions.</param>
  95. }
  96. plupload.Uploader.prototype.bind = function(name, func, scope) {
  97. /// <summary>Adds an event listener by name.</summary>
  98. /// <param name="name" type="String">Event name to listen for.</param>
  99. /// <param name="func" type="function">Function to call ones the event gets fired.</param>
  100. /// <param name="scope" type="Object">Optional scope to execute the specified function in.</param>
  101. }
  102. plupload.Uploader.prototype.unbind = function(name, func) {
  103. /// <summary>Removes the specified event listener.</summary>
  104. /// <param name="name" type="String">Name of event to remove.</param>
  105. /// <param name="func" type="function">Function to remove from listener.</param>
  106. }
  107. plupload.Uploader.prototype.unbindAll = function() {
  108. /// <summary>Removes all event listeners.</summary>
  109. }
  110. plupload.Uploader.prototype.destroy = function() {
  111. /// <summary>Destroys Plupload instance and cleans after itself.</summary>
  112. }
  113. plupload.File = function(id, name, size) {
  114. /// <summary>File instance.</summary>
  115. /// <param name="id" type="String">Unique file id.</param>
  116. /// <param name="name" type="String">File name.</param>
  117. /// <param name="size" type="Number" integer="true">File size in bytes.</param>
  118. /// <field name="id" type="String">File id this is a globally unique id for the specific file.</field>
  119. /// <field name="name" type="String">File name for example "myfile.gif".</field>
  120. /// <field name="size" type="Number">File size in bytes.</field>
  121. /// <field name="loaded" type="Number">Number of bytes uploaded of the files total size.</field>
  122. /// <field name="percent" type="Number">Number of percentage uploaded of the file.</field>
  123. /// <field name="status" type="Number">Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.</field>
  124. }
  125. plupload.Runtime = function() {
  126. /// <summary>Runtime class gets implemented by each upload runtime.</summary>
  127. }
  128. plupload.Runtime.init = function(uploader, callback) {
  129. /// <summary>Initializes the upload runtime.</summary>
  130. /// <param name="uploader" type="plupload.Uploader">Uploader instance that needs to be initialized.</param>
  131. /// <param name="callback" type="function">Callback function to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.</param>
  132. }
  133. plupload.QueueProgress = function() {
  134. /// <summary>Runtime class gets implemented by each upload runtime.</summary>
  135. /// <field name="size" type="Number">Total queue file size.</field>
  136. /// <field name="loaded" type="Number">Total bytes uploaded.</field>
  137. /// <field name="uploaded" type="Number">Number of files uploaded.</field>
  138. /// <field name="failed" type="Number">Number of files failed to upload.</field>
  139. /// <field name="queued" type="Number">Number of files yet to be uploaded.</field>
  140. /// <field name="percent" type="Number">Total percent of the uploaded bytes.</field>
  141. /// <field name="bytesPerSec" type="Number">Bytes uploaded per second.</field>
  142. }
  143. plupload.QueueProgress.prototype.reset = function() {
  144. /// <summary>Resets the progress to it's initial values.</summary>
  145. }
  146. // Namespaces
  147. plupload.STOPPED = new Object();
  148. plupload.STARTED = new Object();
  149. plupload.QUEUED = new Object();
  150. plupload.UPLOADING = new Object();
  151. plupload.FAILED = new Object();
  152. plupload.DONE = new Object();
  153. plupload.GENERIC_ERROR = new Object();
  154. plupload.HTTP_ERROR = new Object();
  155. plupload.IO_ERROR = new Object();
  156. plupload.SECURITY_ERROR = new Object();
  157. plupload.INIT_ERROR = new Object();
  158. plupload.FILE_SIZE_ERROR = new Object();
  159. plupload.FILE_EXTENSION_ERROR = new Object();
  160. plupload.mimeTypes = new Object();
  161. plupload.extend = function(target, obj) {
  162. /// <summary>Extends the specified object with another object.</summary>
  163. /// <param name="target" type="Object">Object to extend.</param>
  164. /// <param name="obj" type="Object..">Multiple objects to extend with.</param>
  165. /// <returns type="Object">Same as target, the extended object.</returns>
  166. }
  167. plupload.cleanName = function(s) {
  168. /// <summary>Cleans the specified name from national characters (diacritics).</summary>
  169. /// <param name="s" type="String">String to clean up.</param>
  170. /// <returns type="String">Cleaned string.</returns>
  171. }
  172. plupload.addRuntime = function(name, obj) {
  173. /// <summary>Adds a specific upload runtime like for example flash or gears.</summary>
  174. /// <param name="name" type="String">Runtime name for example flash.</param>
  175. /// <param name="obj" type="Object">Object containing init/destroy method.</param>
  176. }
  177. plupload.guid = function() {
  178. /// <summary>Generates an unique ID.</summary>
  179. /// <returns type="String">Virtually unique id.</returns>
  180. }
  181. plupload.formatSize = function(size) {
  182. /// <summary>Formats the specified number as a size string for example 1024 becomes 1 KB.</summary>
  183. /// <param name="size" type="Number" integer="true">Size to format as string.</param>
  184. /// <returns type="String">Formatted size string.</returns>
  185. }
  186. plupload.getPos = function(node, root) {
  187. /// <summary>Returns the absolute x, y position of an Element.</summary>
  188. /// <param name="node" type="Element" domElement="true">HTML element or element id to get x, y position from.</param>
  189. /// <param name="root" type="Element" domElement="true">Optional root element to stop calculations at.</param>
  190. /// <returns type="object">Absolute position of the specified element object with x, y fields.</returns>
  191. }
  192. plupload.parseSize = function(size) {
  193. /// <summary>Parses the specified size string into a byte value.</summary>
  194. /// <param name="size" type="">String to parse or number to just pass through.</param>
  195. /// <returns type="Number" integer="true">Size in bytes.</returns>
  196. }
  197. plupload.xmlEncode = function(s) {
  198. /// <summary>Encodes the specified string.</summary>
  199. /// <param name="s" type="String">String to encode.</param>
  200. /// <returns type="String">Encoded string.</returns>
  201. }
  202. plupload.toArray = function(obj) {
  203. /// <summary>Forces anything into an array.</summary>
  204. /// <param name="obj" type="Object">Object with length field.</param>
  205. /// <returns type="Array">Array object containing all items.</returns>
  206. }