]> 91.132.146.200 Git - klimbim.git/commitdiff
protected node demo working
authorBanana <banana@starscream.de>
Mon, 1 Aug 2011 12:10:01 +0000 (14:10 +0200)
committerBanana <banana@starscream.de>
Mon, 1 Aug 2011 12:10:01 +0000 (14:10 +0200)
javascript/mif-tree/Demos/ProtectedNode/demo.css [new file with mode: 0755]
javascript/mif-tree/Demos/ProtectedNode/demo.js [new file with mode: 0755]
javascript/mif-tree/Demos/ProtectedNode/index.html [new file with mode: 0755]
javascript/mif-tree/Demos/changeType/demo.css
javascript/mif-tree/Demos/index.html

diff --git a/javascript/mif-tree/Demos/ProtectedNode/demo.css b/javascript/mif-tree/Demos/ProtectedNode/demo.css
new file mode 100755 (executable)
index 0000000..22df99e
--- /dev/null
@@ -0,0 +1,280 @@
+#tree_container{
+height:200px;
+width:150px;
+position:relative;
+border:solid 1px #9f9f9f;
+}
+
+
+/*@global*/
+
+.mif-tree-wrapper{
+position: absolute;
+width: 100%;
+height:100%;
+margin:0;
+padding:0;
+overflow:auto;
+font-family:sans-serif;
+font-size:11px;
+line-height:18px;/******Tree node height******/
+white-space:nowrap;
+cursor:default;
+}
+
+.mif-tree-bg{
+width:100%;
+height:100%;
+position:absolute;
+overflow:hidden;
+}
+
+.mif-tree-bg-container{
+width:100%;
+display:none;
+}
+
+.mif-tree-bg-node{
+width:100%;
+height:18px;
+}
+
+.mif-tree-bg-selected{
+background-color:#dcd7ab;
+}
+
+.mif-tree-wrapper:focus{
+outline:0;
+}
+
+.mif-tree-wrapper span{
+padding-bottom:2px;
+padding-top:2px;
+cursor:inherit;
+}
+
+.mif-tree-children{
+padding-left:18px;
+width:18px;
+}
+
+.mif-tree-node{
+width:18px;
+background:url('../assets/images/line.gif') repeat-y 8px 0px;
+}
+
+.mif-tree-node-last{
+background:url('../assets/images/line.gif') no-repeat 8px 0px;
+}
+
+.mif-tree-name{
+cursor: default;
+overflow:hidden;
+margin-left:4px;
+}
+
+.mif-tree-name a{
+color:red;
+}
+
+.mif-tree-name a:hover{
+color:blue;
+}
+
+
+.mif-tree-node-wrapper{
+background:url('../assets/images/horizontal-line.gif') no-repeat 9px center;
+}
+
+/*@gadjets*/
+
+.mif-tree-gadjet{
+background-image:url('../assets/images/gadjets.gif');
+padding-right: 16px;
+z-index:1;
+overflow:hidden;
+background-repeat:no-repeat;
+cursor:default;
+}
+
+.mif-tree-gadjet-none{
+background:none;
+}
+
+.mif-tree-gadjet-minus{
+background-position: 0px 50%;
+}
+
+.mif-tree-gadjet-plus{
+background-position: -18px 50%;
+}
+
+
+.mif-tree-gadjet-hover .mif-tree-gadjet-minus{
+background-position: -54px 50%;
+}
+
+.mif-tree-gadjet-hover .mif-tree-gadjet-plus{
+background-position: -72px 50%;
+}
+
+
+
+/*.mif-tree-gadjet-hover{
+background-image:url('../assets/images/gadjets-hover.gif');
+}*/
+
+
+
+
+/*@icons*/
+.mif-tree-icon{
+padding-right:18px;
+background-position:0 50%;
+background-repeat:no-repeat;
+cursor:inherit;
+}
+
+.mif-tree-open-icon{
+background-image:url('../assets/images/openicon.gif')
+}
+
+.mif-tree-close-icon{
+background-image:url('../assets/images/closeicon.gif')
+}
+
+.mif-tree-loader-open-icon,.mif-tree-loader-close-icon{
+background-image:url('../assets/images/mootree_loader.gif');
+}
+
+.mif-tree-book-icon{
+background-image:url('../assets/images/book_icon.gif');
+}
+
+.mif-tree-bin-open-icon{
+background-image:url('../assets/images/bin_open_icon.gif');
+}
+
+.mif-tree-bin-close-icon{
+background-image:url('../assets/images/bin_close_icon.gif');
+}
+
+
+
+
+/*@selection*/
+
+.mif-tree-node-selected .mif-tree-name{
+background-color: #010161;
+color:#fff;
+text-transform:italic;
+}
+
+.mif-tree-hover-node .mif-tree-name{
+text-decoration:underline
+}
+
+
+
+/*@d'n'd*/
+.mif-tree-pointer{
+height:1px;
+overflow: hidden;
+position: absolute;
+background-image:url('../assets/images/1.gif');
+background-repeat:repeat-x;
+background-color:#292fef;
+}
+
+
+.mif-tree-ghost{
+background-color:#fff;
+border:solid 2px #e8e8f7;
+padding-left:2px;
+}
+
+.mif-tree-ghost span{
+padding-top:2px;
+padding-bottom:2px;
+}
+
+.mif-tree-ghost .mif-tree-node-wrapper{
+background:none;
+}
+
+.mif-tree-ghost span.mif-tree-text{
+padding-top:1px;
+padding-bottom:1px;
+}
+
+.mif-tree-ghost-icon{
+padding-left:16px;
+background-color:#fff;
+background-repeat:no-repeat;
+background-image:url('../assets/images/dropzone.gif');
+}
+
+.mif-tree-ghost-after{
+background-position:-64px 2px;
+}
+
+.mif-tree-ghost-before{
+background-position:-48px 2px;
+}
+
+.mif-tree-ghost-between{
+background-position:-16px 2px;
+}
+
+.mif-tree-ghost-inside{
+background-position:-0px 2px;
+}
+
+.mif-tree-ghost-notAllowed{
+background-position:-32px 2px;
+}
+
+.mif-tree-drag-current{
+background-color:#cfcfd8;
+}
+
+.mif-tree-replace{
+background-color:#99c8fb;
+}
+
+
+/*@checkbox*/
+.mif-tree-checkbox{
+padding-left:18px;
+}
+
+.mif-tree-node-checked, .mif-tree-node-checked .mif-tree-checkbox{
+background:url('../assets/images/checked.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-unchecked, .mif-tree-node-unchecked .mif-tree-checkbox{
+background:url('../assets/images/unchecked.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-checked-selected{
+background:url('../assets/images/checked_selected.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-unchecked-selected{
+background:url('../assets/images/unchecked_selected.gif') center 2px no-repeat;
+}
+
+
+
+/*@rename*/
+.mif-tree-rename{
+display: inline;
+line-height: 14px;
+height:14px;
+cursor: default;
+overflow:hidden;
+font-family:sans-serif;
+font-size:11px;
+padding:1px 0;
+border:solid 1px black;
+}
\ No newline at end of file
diff --git a/javascript/mif-tree/Demos/ProtectedNode/demo.js b/javascript/mif-tree/Demos/ProtectedNode/demo.js
new file mode 100755 (executable)
index 0000000..b037194
--- /dev/null
@@ -0,0 +1,50 @@
+window.addEvent('domready',function(){\r
+       tree = 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: 20\r
+       })\r
+       .load({\r
+               url: '../assets/files/simpleTree.json'\r
+       })\r
+       .addEvent('load', function(){\r
+               this.root.recursive(function(){\r
+                       this.toggle();\r
+               });\r
+               this.select(this.root);\r
+       });\r
+       \r
+       \r
+       $('rename').addEvent('click', function(){\r
+               var node = tree.getSelected();\r
+           if(!node) return;\r
+           node.rename();\r
+       });\r
+       \r
+       \r
+       $('remove').addEvent('click', function(){\r
+               var node = tree.getSelected();\r
+           if(!node) return;\r
+           node.remove();\r
+       });     \r
+\r
+\r
+       $('protect').addEvent('click', function(){\r
+               var node = tree.getSelected();\r
+           if(!node) return;\r
+           node.set({\r
+                       property: {\r
+                               renameDenied: node.property.renameDenied ? false : true, \r
+                               removeDenied: node.property.removeDenied ? false : true,\r
+                               name: node.property.renameDenied ? node.property.name.replace(/ protected/, '') : node.property.name+' protected'\r
+                       }\r
+               });\r
+       });     \r
+               \r
+});
\ No newline at end of file
diff --git a/javascript/mif-tree/Demos/ProtectedNode/index.html b/javascript/mif-tree/Demos/ProtectedNode/index.html
new file mode 100755 (executable)
index 0000000..d07a9b5
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <link rel="stylesheet" href="../assets/styles/demos.css" type="text/css" />
+       <link rel="stylesheet" href="demo.css" type="text/css" />
+       <script type="text/javascript" src="../../mootools-core-1.3.2-full-nocompat.js"></script>
+       <script type="text/javascript" src="../../mootools-more-1.3.2.1.js"></script>
+       <script type="text/javascript" src="../../mif.tree_for-mt-1.3.2.js"></script>
+       <script type="text/javascript" src="demo.js"></script>
+       <title>Protected from change node demo.</title>
+</head>
+<body>
+       <h1>protected from change node</h1>
+       <div id="tree_container"></div>
+
+       <input type="button" id="rename" value="rename"/>
+       <input type="button" id="remove" value="remove"/>
+
+       <input type="button" id="protect" value="toggle normal or protected"/>
+       <p>
+               <a href="../index.html">Back</a>
+       </p>
+</body>
+</html>
index 86bd5ba048cf26ee7307cad68092040d070aa486..2a4294c624512be9d86fa44e97d1a0194e7f8be5 100755 (executable)
-#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
+#tree_container{
+height:200px;
+width:300px;
+position:relative;
+border:solid 1px #b7b7b7;
+}
+
+.green{
+color:green;
+}
+
+/*@global*/
+
+.mif-tree-wrapper{
+position: absolute;
+width: 100%;
+height:100%;
+margin:0;
+padding:0;
+overflow:auto;
+font-family:sans-serif;
+font-size:11px;
+line-height:18px;/******Tree node height******/
+white-space:nowrap;
+cursor:default;
+}
+
+.mif-tree-bg{
+width:100%;
+height:100%;
+position:absolute;
+overflow:hidden;
+}
+
+.mif-tree-bg-container{
+width:100%;
+display:none;
+}
+
+.mif-tree-bg-node{
+width:100%;
+height:18px;
+}
+
+.mif-tree-bg-selected{
+background-color:#dcd7ab;
+}
+
+.mif-tree-wrapper:focus{
+outline:0;
+}
+
+.mif-tree-wrapper span{
+padding-bottom:2px;
+padding-top:2px;
+cursor:inherit;
+}
+
+.mif-tree-children{
+padding-left:18px;
+width:18px;
+}
+
+.mif-tree-node{
+width:18px;
+background:url('../assets/images/line.gif') repeat-y 8px 0px;
+}
+
+.mif-tree-node-last{
+background:url('../assets/images/line.gif') no-repeat 8px 0px;
+}
+
+.mif-tree-name{
+cursor: default;
+overflow:hidden;
+margin-left:4px;
+}
+
+.mif-tree-name a{
+color:red;
+}
+
+.mif-tree-name a:hover{
+color:blue;
+}
+
+
+.mif-tree-node-wrapper{
+background:url('../assets/images/horizontal-line.gif') no-repeat 9px center;
+}
+
+/*@gadjets*/
+
+.mif-tree-gadjet{
+background-image:url('../assets/images/gadjets.gif');
+padding-right: 16px;
+z-index:1;
+overflow:hidden;
+background-repeat:no-repeat;
+cursor:default;
+}
+
+.mif-tree-gadjet-none{
+background:none;
+}
+
+.mif-tree-gadjet-minus{
+background-position: 0px 50%;
+}
+
+.mif-tree-gadjet-plus{
+background-position: -18px 50%;
+}
+
+
+.mif-tree-gadjet-hover .mif-tree-gadjet-minus{
+background-position: -54px 50%;
+}
+
+.mif-tree-gadjet-hover .mif-tree-gadjet-plus{
+background-position: -72px 50%;
+}
+
+
+
+/*.mif-tree-gadjet-hover{
+background-image:url('../assets/images/gadjets-hover.gif');
+}*/
+
+
+
+
+/*@icons*/
+.mif-tree-icon{
+padding-right:18px;
+background-position:0 50%;
+background-repeat:no-repeat;
+cursor:inherit;
+}
+
+.mif-tree-open-icon{
+background-image:url('../assets/images/openicon.gif')
+}
+
+.mif-tree-close-icon{
+background-image:url('../assets/images/closeicon.gif')
+}
+
+.mif-tree-loader-open-icon,.mif-tree-loader-close-icon{
+background-image:url('../assets/images/mootree_loader.gif');
+}
+
+.mif-tree-book-icon{
+background-image:url('../assets/images/book_icon.gif');
+}
+
+.mif-tree-bin-open-icon{
+background-image:url('../assets/images/bin_open_icon.gif');
+}
+
+.mif-tree-bin-close-icon{
+background-image:url('../assets/images/bin_close_icon.gif');
+}
+
+
+
+/*@selection*/
+
+.mif-tree-node-selected .mif-tree-name{
+background-color: #010161;
+color:#fff;
+text-transform:italic;
+}
+
+.mif-tree-hover-node .mif-tree-name{
+text-decoration:underline
+}
+
+
+
+/*@d'n'd*/
+.mif-tree-pointer{
+height:1px;
+overflow: hidden;
+position: absolute;
+background-image:url('../assets/images/1.gif');
+background-repeat:repeat-x;
+background-color:#292fef;
+}
+
+
+.mif-tree-ghost{
+background-color:#fff;
+border:solid 2px #e8e8f7;
+padding-left:2px;
+}
+
+.mif-tree-ghost span{
+padding-top:2px;
+padding-bottom:2px;
+}
+
+.mif-tree-ghost .mif-tree-node-wrapper{
+background:none;
+}
+
+.mif-tree-ghost span.mif-tree-text{
+padding-top:1px;
+padding-bottom:1px;
+}
+
+.mif-tree-ghost-icon{
+padding-left:16px;
+background-color:#fff;
+background-repeat:no-repeat;
+background-image:url('../assets/images/dropzone.gif');
+}
+
+.mif-tree-ghost-after{
+background-position:-64px 2px;
+}
+
+.mif-tree-ghost-before{
+background-position:-48px 2px;
+}
+
+.mif-tree-ghost-between{
+background-position:-16px 2px;
+}
+
+.mif-tree-ghost-inside{
+background-position:-0px 2px;
+}
+
+.mif-tree-ghost-notAllowed{
+background-position:-32px 2px;
+}
+
+.mif-tree-drag-current{
+background-color:#cfcfd8;
+}
+
+.mif-tree-replace{
+background-color:#99c8fb;
+}
+
+
+/*@checkbox*/
+.mif-tree-checkbox{
+padding-left:18px;
+}
+
+.mif-tree-node-checked, .mif-tree-node-checked .mif-tree-checkbox{
+background:url('../assets/images/checked.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-unchecked, .mif-tree-node-unchecked .mif-tree-checkbox{
+background:url('../assets/images/unchecked.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-checked-selected{
+background:url('../assets/images/checked_selected.gif') center 2px no-repeat;
+}
+
+.mif-tree-node-unchecked-selected{
+background:url('../assets/images/unchecked_selected.gif') center 2px no-repeat;
+}
+
+
+
+/*@rename*/
+.mif-tree-rename{
+display: inline;
+line-height: 14px;
+height:14px;
+cursor: default;
+overflow:hidden;
+font-family:sans-serif;
+font-size:11px;
+padding:1px 0;
+border:solid 1px black;
+}
index ddaf1b4a18062511520696ee078a1634451a6c0e..be0da84694de9c395ef102fd16e7221ecf7234a4 100755 (executable)
@@ -41,6 +41,7 @@
                                        <li><a href="AddNode2/index.html">Another add node demo</a></li>
                                        <li><a href="reloadChildren/index.html">reload children and update clicked node name</a></li>
                                        <li><a href="CookieStorage/index.html">cookie storage</a></li>
+                                       <li><a href="ProtectedNode/index.html">protected from change node</a></li>
                                </ul>
                        </div>
                        <div id="footer">