class_plupload.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  2. <html>
  3. <head>
  4. <title>Class: plupload</title>
  5. <meta name="generator" content="MoxieDoc" />
  6. <link rel="stylesheet" type="text/css" href="css/reset.css" />
  7. <link rel="stylesheet" type="text/css" href="css/grids.css" />
  8. <link rel="stylesheet" type="text/css" href="css/general.css" />
  9. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  10. <script type="text/javascript">
  11. google.load("jquery", "1.3");
  12. </script>
  13. <script type="text/javascript" src="js/jquery.treeview.min.js"></script>
  14. <script type="text/javascript" src="js/general.js"></script>
  15. </head>
  16. <body>
  17. <div class="classDetailsContent">
  18. <h1>plupload</h1>
  19. <table class="classDetails">
  20. <tr>
  21. <td class="first">Class</td>
  22. <td class="last">plupload</td>
  23. </tr>
  24. <tr>
  25. <td class="first">Type</td>
  26. <td class="last">Singleton</td>
  27. </tr>
  28. </table>
  29. <div class="classDescription">Plupload class with some global constants and functions.
  30. </div>
  31. <h4>Example</h4>
  32. <pre class="brush: js;">// Encode entities
  33. console.log(plupload.xmlEncode("My string &lt;&gt;"));
  34. // Generate unique id
  35. console.log(plupload.guid());</pre>
  36. <div class="summaryLists">
  37. <h2>Public Properties</h2>
  38. <table class="Properties summary">
  39. <thead>
  40. <tr>
  41. <th>Property</th>
  42. <th>Defined By</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <tr>
  47. <td class="first">
  48. <div>
  49. <a class="memberName" href="class_plupload.html#DONE">DONE</a> : Object</div>
  50. <div class="summary">
  51. <span class="static">[static] </span>File has been uploaded successfully</div>
  52. </td>
  53. <td class="last">plupload</td>
  54. </tr>
  55. <tr class="even">
  56. <td class="first">
  57. <div>
  58. <a class="memberName" href="class_plupload.html#FAILED">FAILED</a> : Object</div>
  59. <div class="summary">
  60. <span class="static">[static] </span>File has failed to be uploaded</div>
  61. </td>
  62. <td class="last">plupload</td>
  63. </tr>
  64. <tr>
  65. <td class="first">
  66. <div>
  67. <a class="memberName" href="class_plupload.html#FILE_EXTENSION_ERROR">FILE_EXTENSION_ERROR</a> : Object</div>
  68. <div class="summary">
  69. <span class="static">[static] </span>File extension error.</div>
  70. </td>
  71. <td class="last">plupload</td>
  72. </tr>
  73. <tr class="even">
  74. <td class="first">
  75. <div>
  76. <a class="memberName" href="class_plupload.html#FILE_SIZE_ERROR">FILE_SIZE_ERROR</a> : Object</div>
  77. <div class="summary">
  78. <span class="static">[static] </span>File size error.</div>
  79. </td>
  80. <td class="last">plupload</td>
  81. </tr>
  82. <tr>
  83. <td class="first">
  84. <div>
  85. <a class="memberName" href="class_plupload.html#GENERIC_ERROR">GENERIC_ERROR</a> : Object</div>
  86. <div class="summary">
  87. <span class="static">[static] </span>Generic error for example if an exception is thrown inside Silverlight.</div>
  88. </td>
  89. <td class="last">plupload</td>
  90. </tr>
  91. <tr class="even">
  92. <td class="first">
  93. <div>
  94. <a class="memberName" href="class_plupload.html#HTTP_ERROR">HTTP_ERROR</a> : Object</div>
  95. <div class="summary">
  96. <span class="static">[static] </span>HTTP transport error.</div>
  97. </td>
  98. <td class="last">plupload</td>
  99. </tr>
  100. <tr>
  101. <td class="first">
  102. <div>
  103. <a class="memberName" href="class_plupload.html#INIT_ERROR">INIT_ERROR</a> : Object</div>
  104. <div class="summary">
  105. <span class="static">[static] </span>Initialization error.</div>
  106. </td>
  107. <td class="last">plupload</td>
  108. </tr>
  109. <tr class="even">
  110. <td class="first">
  111. <div>
  112. <a class="memberName" href="class_plupload.html#IO_ERROR">IO_ERROR</a> : Object</div>
  113. <div class="summary">
  114. <span class="static">[static] </span>Generic I/O error.</div>
  115. </td>
  116. <td class="last">plupload</td>
  117. </tr>
  118. <tr>
  119. <td class="first">
  120. <div>
  121. <a class="memberName" href="class_plupload.html#mimeTypes">mimeTypes</a> : Object</div>
  122. <div class="summary">
  123. <span class="static">[static] </span>Mime type lookup table.</div>
  124. </td>
  125. <td class="last">plupload</td>
  126. </tr>
  127. <tr class="even">
  128. <td class="first">
  129. <div>
  130. <a class="memberName" href="class_plupload.html#QUEUED">QUEUED</a> : Object</div>
  131. <div class="summary">
  132. <span class="static">[static] </span>File is queued for upload</div>
  133. </td>
  134. <td class="last">plupload</td>
  135. </tr>
  136. <tr>
  137. <td class="first">
  138. <div>
  139. <a class="memberName" href="class_plupload.html#SECURITY_ERROR">SECURITY_ERROR</a> : Object</div>
  140. <div class="summary">
  141. <span class="static">[static] </span>Generic I/O error.</div>
  142. </td>
  143. <td class="last">plupload</td>
  144. </tr>
  145. <tr class="even">
  146. <td class="first">
  147. <div>
  148. <a class="memberName" href="class_plupload.html#STARTED">STARTED</a> : Object</div>
  149. <div class="summary">
  150. <span class="static">[static] </span>Upload process is running</div>
  151. </td>
  152. <td class="last">plupload</td>
  153. </tr>
  154. <tr>
  155. <td class="first">
  156. <div>
  157. <a class="memberName" href="class_plupload.html#STOPPED">STOPPED</a> : Object</div>
  158. <div class="summary">
  159. <span class="static">[static] </span>Inital state of the queue and also the state ones it's finished all it's uploads.</div>
  160. </td>
  161. <td class="last">plupload</td>
  162. </tr>
  163. <tr class="even">
  164. <td class="first">
  165. <div>
  166. <a class="memberName" href="class_plupload.html#UPLOADING">UPLOADING</a> : Object</div>
  167. <div class="summary">
  168. <span class="static">[static] </span>File is being uploaded</div>
  169. </td>
  170. <td class="last">plupload</td>
  171. </tr>
  172. </tbody>
  173. </table>
  174. <h2>Public Methods</h2>
  175. <table class="Methods summary">
  176. <thead>
  177. <tr>
  178. <th>Method</th>
  179. <th>Defined By</th>
  180. </tr>
  181. </thead>
  182. <tbody>
  183. <tr>
  184. <td class="first">
  185. <div>
  186. <a class="memberName" href="class_plupload.html#addRuntime">addRuntime</a>(name:String, obj:Object):void</div>
  187. <div class="summary">
  188. <span class="static">[static] </span>Adds a specific upload runtime like for example flash or gears.</div>
  189. </td>
  190. <td class="last">plupload</td>
  191. </tr>
  192. <tr class="even">
  193. <td class="first">
  194. <div>
  195. <a class="memberName" href="class_plupload.html#cleanName">cleanName</a>(s:String):String</div>
  196. <div class="summary">
  197. <span class="static">[static] </span>Cleans the specified name from national characters (diacritics).</div>
  198. </td>
  199. <td class="last">plupload</td>
  200. </tr>
  201. <tr>
  202. <td class="first">
  203. <div>
  204. <a class="memberName" href="class_plupload.html#extend">extend</a>(target:Object, obj:Object..):Object</div>
  205. <div class="summary">
  206. <span class="static">[static] </span>Extends the specified object with another object.</div>
  207. </td>
  208. <td class="last">plupload</td>
  209. </tr>
  210. <tr class="even">
  211. <td class="first">
  212. <div>
  213. <a class="memberName" href="class_plupload.html#formatSize">formatSize</a>(size:Number):String</div>
  214. <div class="summary">
  215. <span class="static">[static] </span>Formats the specified number as a size string for example 1024 becomes 1 KB.</div>
  216. </td>
  217. <td class="last">plupload</td>
  218. </tr>
  219. <tr>
  220. <td class="first">
  221. <div>
  222. <a class="memberName" href="class_plupload.html#getPos">getPos</a>(node:Element, root:Element):object</div>
  223. <div class="summary">
  224. <span class="static">[static] </span>Returns the absolute x, y position of an Element.</div>
  225. </td>
  226. <td class="last">plupload</td>
  227. </tr>
  228. <tr class="even">
  229. <td class="first">
  230. <div>
  231. <a class="memberName" href="class_plupload.html#guid">guid</a>():String</div>
  232. <div class="summary">
  233. <span class="static">[static] </span>Generates an unique ID.</div>
  234. </td>
  235. <td class="last">plupload</td>
  236. </tr>
  237. <tr>
  238. <td class="first">
  239. <div>
  240. <a class="memberName" href="class_plupload.html#parseSize">parseSize</a>(size:String/Number):Number</div>
  241. <div class="summary">
  242. <span class="static">[static] </span>Parses the specified size string into a byte value.</div>
  243. </td>
  244. <td class="last">plupload</td>
  245. </tr>
  246. <tr class="even">
  247. <td class="first">
  248. <div>
  249. <a class="memberName" href="class_plupload.html#toArray">toArray</a>(obj:Object):Array</div>
  250. <div class="summary">
  251. <span class="static">[static] </span>Forces anything into an array.</div>
  252. </td>
  253. <td class="last">plupload</td>
  254. </tr>
  255. <tr>
  256. <td class="first">
  257. <div>
  258. <a class="memberName" href="class_plupload.html#xmlEncode">xmlEncode</a>(s:String):String</div>
  259. <div class="summary">
  260. <span class="static">[static] </span>Encodes the specified string.</div>
  261. </td>
  262. <td class="last">plupload</td>
  263. </tr>
  264. </tbody>
  265. </table>
  266. </div>
  267. <div class="detailsList">
  268. <div class="details">
  269. <h2>Property details</h2>
  270. <div class="memberDetails" id="DONE">
  271. <h3>DONE<span class="memberType">property</span>
  272. </h3>
  273. <code class="syntax">public static DONE : Object</code>
  274. <div class="memberDescription">File has been uploaded successfully
  275. </div>
  276. </div>
  277. <div class="memberDetails" id="FAILED">
  278. <h3>FAILED<span class="memberType">property</span>
  279. </h3>
  280. <code class="syntax">public static FAILED : Object</code>
  281. <div class="memberDescription">File has failed to be uploaded
  282. </div>
  283. </div>
  284. <div class="memberDetails" id="FILE_EXTENSION_ERROR">
  285. <h3>FILE_EXTENSION_ERROR<span class="memberType">property</span>
  286. </h3>
  287. <code class="syntax">public static FILE_EXTENSION_ERROR : Object</code>
  288. <div class="memberDescription">File extension error. If the user selects a file that isn't valid according to the filters setting.
  289. </div>
  290. </div>
  291. <div class="memberDetails" id="FILE_SIZE_ERROR">
  292. <h3>FILE_SIZE_ERROR<span class="memberType">property</span>
  293. </h3>
  294. <code class="syntax">public static FILE_SIZE_ERROR : Object</code>
  295. <div class="memberDescription">File size error. If the user selects a file that is to large it will be blocked and an error of this type will be triggered.
  296. </div>
  297. </div>
  298. <div class="memberDetails" id="GENERIC_ERROR">
  299. <h3>GENERIC_ERROR<span class="memberType">property</span>
  300. </h3>
  301. <code class="syntax">public static GENERIC_ERROR : Object</code>
  302. <div class="memberDescription">Generic error for example if an exception is thrown inside Silverlight.
  303. </div>
  304. </div>
  305. <div class="memberDetails" id="HTTP_ERROR">
  306. <h3>HTTP_ERROR<span class="memberType">property</span>
  307. </h3>
  308. <code class="syntax">public static HTTP_ERROR : Object</code>
  309. <div class="memberDescription">HTTP transport error. For example if the server produces a HTTP status other than 200.
  310. </div>
  311. </div>
  312. <div class="memberDetails" id="INIT_ERROR">
  313. <h3>INIT_ERROR<span class="memberType">property</span>
  314. </h3>
  315. <code class="syntax">public static INIT_ERROR : Object</code>
  316. <div class="memberDescription">Initialization error. Will be triggered if no runtime was initialized.
  317. </div>
  318. </div>
  319. <div class="memberDetails" id="IO_ERROR">
  320. <h3>IO_ERROR<span class="memberType">property</span>
  321. </h3>
  322. <code class="syntax">public static IO_ERROR : Object</code>
  323. <div class="memberDescription">Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.
  324. </div>
  325. </div>
  326. <div class="memberDetails" id="mimeTypes">
  327. <h3>mimeTypes<span class="memberType">property</span>
  328. </h3>
  329. <code class="syntax">public static mimeTypes : Object</code>
  330. <div class="memberDescription">Mime type lookup table.
  331. </div>
  332. </div>
  333. <div class="memberDetails" id="QUEUED">
  334. <h3>QUEUED<span class="memberType">property</span>
  335. </h3>
  336. <code class="syntax">public static QUEUED : Object</code>
  337. <div class="memberDescription">File is queued for upload
  338. </div>
  339. </div>
  340. <div class="memberDetails" id="SECURITY_ERROR">
  341. <h3>SECURITY_ERROR<span class="memberType">property</span>
  342. </h3>
  343. <code class="syntax">public static SECURITY_ERROR : Object</code>
  344. <div class="memberDescription">Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.
  345. </div>
  346. </div>
  347. <div class="memberDetails" id="STARTED">
  348. <h3>STARTED<span class="memberType">property</span>
  349. </h3>
  350. <code class="syntax">public static STARTED : Object</code>
  351. <div class="memberDescription">Upload process is running
  352. </div>
  353. </div>
  354. <div class="memberDetails" id="STOPPED">
  355. <h3>STOPPED<span class="memberType">property</span>
  356. </h3>
  357. <code class="syntax">public static STOPPED : Object</code>
  358. <div class="memberDescription">Inital state of the queue and also the state ones it's finished all it's uploads.
  359. </div>
  360. </div>
  361. <div class="memberDetails last" id="UPLOADING">
  362. <h3>UPLOADING<span class="memberType">property</span>
  363. </h3>
  364. <code class="syntax">public static UPLOADING : Object</code>
  365. <div class="memberDescription">File is being uploaded
  366. </div>
  367. </div>
  368. </div>
  369. <div class="details">
  370. <h2>Method details</h2>
  371. <div class="memberDetails" id="addRuntime">
  372. <h3>addRuntime<span class="memberType">method</span>
  373. </h3>
  374. <code class="syntax">public static
  375. function addRuntime(name:String, obj:Object):void</code>
  376. <div class="memberDescription">Adds a specific upload runtime like for example flash or gears.
  377. </div>
  378. <h4>Parameters</h4>
  379. <table class="params">
  380. <tr>
  381. <td class="first">name:String</td>
  382. <td class="last">Runtime name for example flash.</td>
  383. </tr>
  384. <tr>
  385. <td class="first">obj:Object</td>
  386. <td class="last">Object containing init/destroy method.</td>
  387. </tr>
  388. </table>
  389. </div>
  390. <div class="memberDetails" id="cleanName">
  391. <h3>cleanName<span class="memberType">method</span>
  392. </h3>
  393. <code class="syntax">public static
  394. function cleanName(s:String):String</code>
  395. <div class="memberDescription">Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _.
  396. </div>
  397. <h4>Parameters</h4>
  398. <table class="params">
  399. <tr>
  400. <td class="first">s:String</td>
  401. <td class="last">String to clean up.</td>
  402. </tr>
  403. </table>
  404. <h4>Returns</h4>
  405. <div class="returns">String - Cleaned string.</div>
  406. </div>
  407. <div class="memberDetails" id="extend">
  408. <h3>extend<span class="memberType">method</span>
  409. </h3>
  410. <code class="syntax">public static
  411. function extend(target:Object, obj:Object..):Object</code>
  412. <div class="memberDescription">Extends the specified object with another object.
  413. </div>
  414. <h4>Parameters</h4>
  415. <table class="params">
  416. <tr>
  417. <td class="first">target:Object</td>
  418. <td class="last">Object to extend.</td>
  419. </tr>
  420. <tr>
  421. <td class="first">obj:Object..</td>
  422. <td class="last">Multiple objects to extend with.</td>
  423. </tr>
  424. </table>
  425. <h4>Returns</h4>
  426. <div class="returns">Object - Same as target, the extended object.</div>
  427. </div>
  428. <div class="memberDetails" id="formatSize">
  429. <h3>formatSize<span class="memberType">method</span>
  430. </h3>
  431. <code class="syntax">public static
  432. function formatSize(size:Number):String</code>
  433. <div class="memberDescription">Formats the specified number as a size string for example 1024 becomes 1 KB.
  434. </div>
  435. <h4>Parameters</h4>
  436. <table class="params">
  437. <tr>
  438. <td class="first">size:Number</td>
  439. <td class="last">Size to format as string.</td>
  440. </tr>
  441. </table>
  442. <h4>Returns</h4>
  443. <div class="returns">String - Formatted size string.</div>
  444. </div>
  445. <div class="memberDetails" id="getPos">
  446. <h3>getPos<span class="memberType">method</span>
  447. </h3>
  448. <code class="syntax">public static
  449. function getPos(node:Element, root:Element):object</code>
  450. <div class="memberDescription">Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.
  451. </div>
  452. <h4>Parameters</h4>
  453. <table class="params">
  454. <tr>
  455. <td class="first">node:Element</td>
  456. <td class="last">HTML element or element id to get x, y position from.</td>
  457. </tr>
  458. <tr>
  459. <td class="first">root:Element</td>
  460. <td class="last">Optional root element to stop calculations at.</td>
  461. </tr>
  462. </table>
  463. <h4>Returns</h4>
  464. <div class="returns">object - Absolute position of the specified element object with x, y fields.</div>
  465. </div>
  466. <div class="memberDetails" id="guid">
  467. <h3>guid<span class="memberType">method</span>
  468. </h3>
  469. <code class="syntax">public static
  470. function guid():String</code>
  471. <div class="memberDescription">Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers.
  472. The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages
  473. to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique.
  474. It's more probable for the earth to be hit with an ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property
  475. to an user unique key.
  476. </div>
  477. <h4>Returns</h4>
  478. <div class="returns">String - Virtually unique id.</div>
  479. </div>
  480. <div class="memberDetails" id="parseSize">
  481. <h3>parseSize<span class="memberType">method</span>
  482. </h3>
  483. <code class="syntax">public static
  484. function parseSize(size:String/Number):Number</code>
  485. <div class="memberDescription">Parses the specified size string into a byte value. For example 10kb becomes 10240.
  486. </div>
  487. <h4>Parameters</h4>
  488. <table class="params">
  489. <tr>
  490. <td class="first">size:String/Number</td>
  491. <td class="last">String to parse or number to just pass through.</td>
  492. </tr>
  493. </table>
  494. <h4>Returns</h4>
  495. <div class="returns">Number - Size in bytes.</div>
  496. </div>
  497. <div class="memberDetails" id="toArray">
  498. <h3>toArray<span class="memberType">method</span>
  499. </h3>
  500. <code class="syntax">public static
  501. function toArray(obj:Object):Array</code>
  502. <div class="memberDescription">Forces anything into an array.
  503. </div>
  504. <h4>Parameters</h4>
  505. <table class="params">
  506. <tr>
  507. <td class="first">obj:Object</td>
  508. <td class="last">Object with length field.</td>
  509. </tr>
  510. </table>
  511. <h4>Returns</h4>
  512. <div class="returns">Array - Array object containing all items.</div>
  513. </div>
  514. <div class="memberDetails last" id="xmlEncode">
  515. <h3>xmlEncode<span class="memberType">method</span>
  516. </h3>
  517. <code class="syntax">public static
  518. function xmlEncode(s:String):String</code>
  519. <div class="memberDescription">Encodes the specified string.
  520. </div>
  521. <h4>Parameters</h4>
  522. <table class="params">
  523. <tr>
  524. <td class="first">s:String</td>
  525. <td class="last">String to encode.</td>
  526. </tr>
  527. </table>
  528. <h4>Returns</h4>
  529. <div class="returns">String - Encoded string.</div>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. </body>
  535. </html>