Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / NativeDD.html
1 <html>\r
2 <head>\r
3   <title>The source code</title>\r
4     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
5     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
6 </head>\r
7 <body  onload="prettyPrint();">\r
8     <pre class="prettyprint lang-js">\r
9 <div id="cls-Ext.air.DragType"></div>/**\r
10  * @class Ext.air.DragType\r
11  * \r
12  * Drag drop type constants\r
13  * \r
14  * @singleton\r
15  */\r
16 Ext.air.DragType = {\r
17         <div id="prop-Ext.air.DragType-TEXT"></div>/**\r
18          * Constant for text data\r
19          */\r
20         TEXT : 'text/plain',\r
21         <div id="prop-Ext.air.DragType-HTML"></div>/**\r
22          * Constant for html data\r
23          */\r
24         HTML : 'text/html',\r
25         <div id="prop-Ext.air.DragType-URL"></div>/**\r
26          * Constant for url data\r
27          */\r
28         URL : 'text/uri-list',\r
29         <div id="prop-Ext.air.DragType-BITMAP"></div>/**\r
30          * Constant for bitmap data\r
31          */\r
32         BITMAP : 'image/x-vnd.adobe.air.bitmap',\r
33         <div id="prop-Ext.air.DragType-FILES"></div>/**\r
34          * Constant for file list data\r
35          */\r
36         FILES : 'application/x-vnd.adobe.air.file-list'\r
37 };\r
38 \r
39 \r
40 // workaround for DD dataTransfer Clipboard not having hasFormat\r
41 \r
42 Ext.apply(Ext.EventObjectImpl.prototype, {\r
43         hasFormat : function(format){\r
44                 if (this.browserEvent.dataTransfer) {\r
45                         for (var i = 0, len = this.browserEvent.dataTransfer.types.length; i < len; i++) {\r
46                                 if(this.browserEvent.dataTransfer.types[i] == format) {\r
47                                         return true;\r
48                                 }\r
49                         }\r
50                 }\r
51                 return false;\r
52         },\r
53         \r
54         getData : function(type){\r
55                 return this.browserEvent.dataTransfer.getData(type);\r
56         }\r
57 });\r
58 \r
59 \r
60 </pre>    \r
61 </body>\r
62 </html>