--- /dev/null
+#tree_container{\r
+height:200px;\r
+width:300px;\r
+position:relative;\r
+border:solid 1px #b7b7b7;\r
+}\r
+\r
+.green{\r
+color:green;\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
--- /dev/null
+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
+ green:{\r
+ openIcon: 'mif-tree-open-icon',//css class open icon\r
+ closeIcon: 'mif-tree-close-icon',// css class close icon\r
+ cls: 'green'\r
+ }\r
+ },\r
+ dfltType: 'folder',//default node type\r
+ height: 18//node height\r
+ });\r
+\r
+ var json = [\r
+ {\r
+ "property": {\r
+ "name": "root added green type"\r
+ },\r
+ "children": [\r
+ {\r
+ "property": {\r
+ "name": "node1 removed folder type. No more types"\r
+ }\r
+ },\r
+ {\r
+ "property": {\r
+ "name": "node2"\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
+ tree.addEvent('load', function(){\r
+ this.root.addType('green');\r
+ this.root.getFirst().removeType('folder');\r
+ });\r
+ // load tree from json.\r
+ tree.load({\r
+ json: json\r
+ });\r
+ \r
+});
\ No newline at end of file
--- /dev/null
+<!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>Change node type example</h1>\r
+ <div id="tree_container"></div>\r
+ <p>\r
+ <a href="../index.html">Back</a>\r
+ </p>\r
+</body>\r
+</html>\r