]> 91.132.146.200 Git - klimbim.git/commitdiff
Icon url example
authorBanana <jumpin.banana@gmail.com>
Sun, 31 Jul 2011 13:00:28 +0000 (15:00 +0200)
committerBanana <jumpin.banana@gmail.com>
Sun, 31 Jul 2011 13:00:28 +0000 (15:00 +0200)
javascript/mif-tree/Demos/IconUrl/demo.css [new file with mode: 0755]
javascript/mif-tree/Demos/IconUrl/demo.js [new file with mode: 0755]
javascript/mif-tree/Demos/IconUrl/folder-close.gif [new file with mode: 0755]
javascript/mif-tree/Demos/IconUrl/folder-open.gif [new file with mode: 0755]
javascript/mif-tree/Demos/IconUrl/index.html [new file with mode: 0755]
javascript/mif-tree/Demos/index.html

diff --git a/javascript/mif-tree/Demos/IconUrl/demo.css b/javascript/mif-tree/Demos/IconUrl/demo.css
new file mode 100755 (executable)
index 0000000..af7074a
--- /dev/null
@@ -0,0 +1,279 @@
+#tree_container{\r
+height:200px;\r
+width:200px;\r
+position:relative;\r
+border:solid 1px #b7b7b7;\r
+}\r
+\r
+\r
+/*@global*/\r
+\r
+.mif-tree-wrapper{\r
+position: absolute;\r
+width: 100%;\r
+height:100%;\r
+margin:0;\r
+padding:0;\r
+overflow:auto;\r
+font-family:sans-serif;\r
+font-size:11px;\r
+line-height:18px;/******Tree node height******/\r
+white-space:nowrap;\r
+cursor:default;\r
+}\r
+\r
+.mif-tree-bg{\r
+width:100%;\r
+height:100%;\r
+position:absolute;\r
+overflow:hidden;\r
+}\r
+\r
+.mif-tree-bg-container{\r
+width:100%;\r
+display:none;\r
+}\r
+\r
+.mif-tree-bg-node{\r
+width:100%;\r
+height:18px;\r
+}\r
+\r
+.mif-tree-bg-selected{\r
+background-color:#dcd7ab;\r
+}\r
+\r
+.mif-tree-wrapper:focus{\r
+outline:0;\r
+}\r
+\r
+.mif-tree-wrapper span{\r
+padding-bottom:2px;\r
+padding-top:2px;\r
+cursor:inherit;\r
+}\r
+\r
+.mif-tree-children{\r
+padding-left:18px;\r
+width:18px;\r
+}\r
+\r
+.mif-tree-node{\r
+width:18px;\r
+background:url('../assets/images/line.gif') repeat-y 8px 0px;\r
+}\r
+\r
+.mif-tree-node-last{\r
+background:url('../assets/images/line.gif') no-repeat 8px 0px;\r
+}\r
+\r
+.mif-tree-name{\r
+cursor: default;\r
+overflow:hidden;\r
+margin-left:4px;\r
+}\r
+\r
+.mif-tree-name a{\r
+color:red;\r
+}\r
+\r
+.mif-tree-name a:hover{\r
+color:blue;\r
+}\r
+\r
+\r
+.mif-tree-node-wrapper{\r
+background:url('../assets/images/horizontal-line.gif') no-repeat 9px center;\r
+}\r
+\r
+/*@gadjets*/\r
+\r
+.mif-tree-gadjet{\r
+background-image:url('../assets/images/gadjets.gif');\r
+padding-right: 16px;\r
+z-index:1;\r
+overflow:hidden;\r
+background-repeat:no-repeat;\r
+cursor:default;\r
+}\r
+\r
+.mif-tree-gadjet-none{\r
+background:none;\r
+}\r
+\r
+.mif-tree-gadjet-minus{\r
+background-position: 0px 50%;\r
+}\r
+\r
+.mif-tree-gadjet-plus{\r
+background-position: -18px 50%;\r
+}\r
+\r
+\r
+.mif-tree-gadjet-hover .mif-tree-gadjet-minus{\r
+background-position: -54px 50%;\r
+}\r
+\r
+.mif-tree-gadjet-hover .mif-tree-gadjet-plus{\r
+background-position: -72px 50%;\r
+}\r
+\r
+\r
+\r
+/*.mif-tree-gadjet-hover{\r
+background-image:url('../assets/images/gadjets-hover.gif');\r
+}*/\r
+\r
+\r
+\r
+\r
+/*@icons*/\r
+.mif-tree-icon{\r
+padding-right:18px;\r
+background-position:0 50%;\r
+background-repeat:no-repeat;\r
+cursor:inherit;\r
+}\r
+\r
+.mif-tree-open-icon{\r
+background-image:url('../assets/images/openicon.gif')\r
+}\r
+\r
+.mif-tree-close-icon{\r
+background-image:url('../assets/images/closeicon.gif')\r
+}\r
+\r
+.mif-tree-loader-open-icon,.mif-tree-loader-close-icon{\r
+background-image:url('../assets/images/mootree_loader.gif');\r
+}\r
+\r
+.mif-tree-book-icon{\r
+background-image:url('../assets/images/book_icon.gif');\r
+}\r
+\r
+.mif-tree-bin-open-icon{\r
+background-image:url('../assets/images/bin_open_icon.gif');\r
+}\r
+\r
+.mif-tree-bin-close-icon{\r
+background-image:url('../assets/images/bin_close_icon.gif');\r
+}\r
+\r
+\r
+\r
+/*@selection*/\r
+\r
+.mif-tree-node-selected .mif-tree-name{\r
+background-color: #010161;\r
+color:#fff;\r
+text-transform:italic;\r
+}\r
+\r
+.mif-tree-hover-node .mif-tree-name{\r
+text-decoration:underline\r
+}\r
+\r
+\r
+\r
+/*@d'n'd*/\r
+.mif-tree-pointer{\r
+height:1px;\r
+overflow: hidden;\r
+position: absolute;\r
+background-image:url('../assets/images/1.gif');\r
+background-repeat:repeat-x;\r
+background-color:#292fef;\r
+}\r
+\r
+\r
+.mif-tree-ghost{\r
+background-color:#fff;\r
+border:solid 2px #e8e8f7;\r
+padding-left:2px;\r
+}\r
+\r
+.mif-tree-ghost span{\r
+padding-top:2px;\r
+padding-bottom:2px;\r
+}\r
+\r
+.mif-tree-ghost .mif-tree-node-wrapper{\r
+background:none;\r
+}\r
+\r
+.mif-tree-ghost span.mif-tree-text{\r
+padding-top:1px;\r
+padding-bottom:1px;\r
+}\r
+\r
+.mif-tree-ghost-icon{\r
+padding-left:16px;\r
+background-color:#fff;\r
+background-repeat:no-repeat;\r
+background-image:url('../assets/images/dropzone.gif');\r
+}\r
+\r
+.mif-tree-ghost-after{\r
+background-position:-64px 2px;\r
+}\r
+\r
+.mif-tree-ghost-before{\r
+background-position:-48px 2px;\r
+}\r
+\r
+.mif-tree-ghost-between{\r
+background-position:-16px 2px;\r
+}\r
+\r
+.mif-tree-ghost-inside{\r
+background-position:-0px 2px;\r
+}\r
+\r
+.mif-tree-ghost-notAllowed{\r
+background-position:-32px 2px;\r
+}\r
+\r
+.mif-tree-drag-current{\r
+background-color:#cfcfd8;\r
+}\r
+\r
+.mif-tree-replace{\r
+background-color:#99c8fb;\r
+}\r
+\r
+\r
+/*@checkbox*/\r
+.mif-tree-checkbox{\r
+padding-left:18px;\r
+}\r
+\r
+.mif-tree-node-checked, .mif-tree-node-checked .mif-tree-checkbox{\r
+background:url('../assets/images/checked.gif') center 2px no-repeat;\r
+}\r
+\r
+.mif-tree-node-unchecked, .mif-tree-node-unchecked .mif-tree-checkbox{\r
+background:url('../assets/images/unchecked.gif') center 2px no-repeat;\r
+}\r
+\r
+.mif-tree-node-checked-selected{\r
+background:url('../assets/images/checked_selected.gif') center 2px no-repeat;\r
+}\r
+\r
+.mif-tree-node-unchecked-selected{\r
+background:url('../assets/images/unchecked_selected.gif') center 2px no-repeat;\r
+}\r
+\r
+\r
+\r
+/*@rename*/\r
+.mif-tree-rename{\r
+display: inline;\r
+line-height: 14px;\r
+height:14px;\r
+cursor: default;\r
+overflow:hidden;\r
+font-family:sans-serif;\r
+font-size:11px;\r
+padding:1px 0;\r
+border:solid 1px black;\r
+}\r
diff --git a/javascript/mif-tree/Demos/IconUrl/demo.js b/javascript/mif-tree/Demos/IconUrl/demo.js
new file mode 100755 (executable)
index 0000000..c22af88
--- /dev/null
@@ -0,0 +1,66 @@
+window.addEvent('domready',function(){\r
+       tree = new Mif.Tree({\r
+               container: $('tree_container'),// tree container\r
+               types: {// node types\r
+                       folder: {\r
+                               openIcon: 'mif-tree-open-icon',//css class open icon\r
+                               closeIcon: 'mif-tree-close-icon'// css class close icon\r
+                       }\r
+               },\r
+               dfltType: 'folder',//default node type\r
+               height: 18//node height\r
+       });\r
+\r
+       var json = [\r
+               {\r
+                       "property": {\r
+                               "name": "root"\r
+                       },\r
+                       "children": [\r
+                               {\r
+                                       "property": {\r
+                                               "name": "node1"\r
+                                       }\r
+                               },\r
+                               {\r
+                                       "property": {\r
+                                               "name": "node2",\r
+                                               "openIconUrl": "folder-open.gif",\r
+                                               "closeIconUrl": "folder-close.gif"\r
+                                       },\r
+                                       "state": {\r
+                                               "open": true\r
+                                       },\r
+                                       "children":[\r
+                                               {\r
+                                                       "property": {\r
+                                                               "name": "node2.1"\r
+                                                       }\r
+                                               },\r
+                                               {\r
+                                                       "property": {\r
+                                                               "name": "node2.2"\r
+                                                       }\r
+                                               }\r
+                                       ]\r
+                               },\r
+                               {\r
+                                       "property": {\r
+                                               "name": "node4"\r
+                                       }\r
+                               },\r
+                               {\r
+                                       "property": {\r
+                                               "name": "node3"\r
+                                       }\r
+                               }\r
+                       ]\r
+               }\r
+       ];\r
+       \r
+       // load tree from json.\r
+       tree.load({\r
+               json: json\r
+       });\r
+       \r
+});\r
diff --git a/javascript/mif-tree/Demos/IconUrl/folder-close.gif b/javascript/mif-tree/Demos/IconUrl/folder-close.gif
new file mode 100755 (executable)
index 0000000..5f6b188
Binary files /dev/null and b/javascript/mif-tree/Demos/IconUrl/folder-close.gif differ
diff --git a/javascript/mif-tree/Demos/IconUrl/folder-open.gif b/javascript/mif-tree/Demos/IconUrl/folder-open.gif
new file mode 100755 (executable)
index 0000000..b8fa48b
Binary files /dev/null and b/javascript/mif-tree/Demos/IconUrl/folder-open.gif differ
diff --git a/javascript/mif-tree/Demos/IconUrl/index.html b/javascript/mif-tree/Demos/IconUrl/index.html
new file mode 100755 (executable)
index 0000000..a973c51
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+       <link rel="stylesheet" href="../assets/styles/demos.css" type="text/css" />\r
+       <link rel="stylesheet" href="demo.css" type="text/css" />\r
+       <script type="text/javascript" src="../../mootools-core-1.3.2-full-nocompat.js"></script>\r
+       <script type="text/javascript" src="../../mootools-more-1.3.2.1.js"></script>\r
+       <script type="text/javascript" src="../../mif.tree_for-mt-1.3.2.js"></script>\r
+       <script type="text/javascript" src="demo.js"></script>\r
+       <title>Mif.Tree Demo</title>\r
+</head>\r
+<body>\r
+       <h1>Icon url example</h1>\r
+       <div id="tree_container"></div>\r
+       <p>\r
+               <a href="../index.html">Back</a>\r
+       </p>\r
+</body>\r
+</html>\r
index 15d6c85be815002d5452a92e17984ad60c00404c..a925de4eed633b40d0d7c3caec31ca2251e31d42 100755 (executable)
@@ -24,6 +24,7 @@
                                        <li><a href="Toggle/index.html">Tree toggle event demo</a></li>
                                        <li><a href="TreeOtherStyle/index.html">Tree other style</a></li>
                                        <li><a href="changeType/index.html">Add/remove node type demo</a>
+                                       <li><a href="IconUrl/index.html">set icon using url instead class</a>
                                </ul>
                        </div>
                        <div id="footer">