]> 91.132.146.200 Git - klimbim.git/commitdiff
tree toggle working
authorBanana <jumpin.banana@gmail.com>
Fri, 29 Jul 2011 19:55:05 +0000 (21:55 +0200)
committerBanana <jumpin.banana@gmail.com>
Fri, 29 Jul 2011 19:55:05 +0000 (21:55 +0200)
javascript/mif-tree/Demos/Select/index.html
javascript/mif-tree/Demos/Toggle/demo.css [new file with mode: 0755]
javascript/mif-tree/Demos/Toggle/demo.js [new file with mode: 0755]
javascript/mif-tree/Demos/Toggle/index.html [new file with mode: 0755]
javascript/mif-tree/Demos/index.html

index 12b0f50da8845d23d8d2555b9e7525227b73c9be..25afd470740c1345daa27b9a2592ff031511d51c 100755 (executable)
        <h1>Tree select demo</h1>\r
        <div id="tree_container"></div>\r
        <h3>Log: </h3>\r
-       <ol id="log" ></ul>\r
+       <ol id="log" ></ol>\r
+       <br style="clear: both"/>\r
+       <p>\r
+               <a href="../index.html">Back</a>\r
+       </p>\r
 </body>\r
 </html>\r
diff --git a/javascript/mif-tree/Demos/Toggle/demo.css b/javascript/mif-tree/Demos/Toggle/demo.css
new file mode 100755 (executable)
index 0000000..424e84e
--- /dev/null
@@ -0,0 +1,300 @@
+h3.log{\r
+margin:1em 0;\r
+}\r
+\r
+\r
+#log{\r
+white-space:nowrap;\r
+width:300px;\r
+height:200px;\r
+border:solid 1px #cfcad2;\r
+}\r
+\r
+ol#log li{\r
+margin-left:30px;\r
+}\r
+\r
+ol#log{\r
+overflow:auto;\r
+}\r
+\r
+#tree_container{\r
+height:200px;\r
+width:300px;\r
+position:relative;\r
+border:solid 1px #b7b7b7;\r
+}\r
+\r
+\r
+/*||||||||||||||||||||TREE||||||||||||||||||||*/\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
+/*.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
+\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-highlighter{\r
+height:18px;\r
+overflow:hidden;\r
+width:100%;\r
+background:#b64553;\r
+position:absolute;\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 .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/Toggle/demo.js b/javascript/mif-tree/Demos/Toggle/demo.js
new file mode 100755 (executable)
index 0000000..1993c85
--- /dev/null
@@ -0,0 +1,19 @@
+window.addEvent('domready',function(){\r
+       SimpleTree = new Mif.Tree({\r
+               container: $('tree_container'),\r
+               types: {\r
+                       folder: {\r
+                               openIcon: 'mif-tree-open-icon',\r
+                               closeIcon: 'mif-tree-close-icon'\r
+                       }\r
+               },\r
+               dfltType: 'folder',\r
+               height: 18\r
+       })\r
+       .load({\r
+               url: '../assets/files/simpleTree.json'\r
+       })\r
+       .addEvent('toggle',function(node, state){\r
+               $('log').adopt(new Element('li').set('html', node.name+' '+(state ? 'expanded' : 'collapsed')));\r
+       });\r
+});\r
diff --git a/javascript/mif-tree/Demos/Toggle/index.html b/javascript/mif-tree/Demos/Toggle/index.html
new file mode 100755 (executable)
index 0000000..e26f467
--- /dev/null
@@ -0,0 +1,22 @@
+<!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>Tree select demo.</title>\r
+</head>\r
+<body>\r
+       <h1>Tree select demo</h1>\r
+       <div id="tree_container"></div>\r
+       <h3 class="log">Log: </h3>\r
+       <ol id="log" ></ol>\r
+       <p>\r
+               <a href="../index.html">Back</a>\r
+       </p>\r
+</body>\r
+</html>\r
index 1db4060fb03a84df6a7e00bb7d0ccd5511e959e6..c6e71322eb8b9030021eaf43663232497eb02b4a 100755 (executable)
@@ -21,6 +21,7 @@
                                <ul>
                                        <li><a href="SimpleTree/index.html">Simple Tree</a></li>
                                        <li><a href="Select/index.html">Tree select event demo</a></li>
+                                       <li><a href="Toggle/index.html">Tree toggle event demo</a></li>
                                </ul>
                        </div>
                        <div id="footer">