From: Banana Date: Mon, 1 Aug 2011 12:10:01 +0000 (+0200) Subject: protected node demo working X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=b81e45bc87bed4ad3a0a1ca599bc2e0f8e924e71;p=klimbim.git protected node demo working --- diff --git a/javascript/mif-tree/Demos/ProtectedNode/demo.css b/javascript/mif-tree/Demos/ProtectedNode/demo.css new file mode 100755 index 0000000..22df99e --- /dev/null +++ b/javascript/mif-tree/Demos/ProtectedNode/demo.css @@ -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 index 0000000..b037194 --- /dev/null +++ b/javascript/mif-tree/Demos/ProtectedNode/demo.js @@ -0,0 +1,50 @@ +window.addEvent('domready',function(){ + tree = new Mif.Tree({ + container: $('tree_container'), + types: { + folder: { + openIcon: 'mif-tree-open-icon', + closeIcon: 'mif-tree-close-icon' + } + }, + dfltType: 'folder', + height: 20 + }) + .load({ + url: '../assets/files/simpleTree.json' + }) + .addEvent('load', function(){ + this.root.recursive(function(){ + this.toggle(); + }); + this.select(this.root); + }); + + + $('rename').addEvent('click', function(){ + var node = tree.getSelected(); + if(!node) return; + node.rename(); + }); + + + $('remove').addEvent('click', function(){ + var node = tree.getSelected(); + if(!node) return; + node.remove(); + }); + + + $('protect').addEvent('click', function(){ + var node = tree.getSelected(); + if(!node) return; + node.set({ + property: { + renameDenied: node.property.renameDenied ? false : true, + removeDenied: node.property.removeDenied ? false : true, + name: node.property.renameDenied ? node.property.name.replace(/ protected/, '') : node.property.name+' protected' + } + }); + }); + +}); \ 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 index 0000000..d07a9b5 --- /dev/null +++ b/javascript/mif-tree/Demos/ProtectedNode/index.html @@ -0,0 +1,25 @@ + + + + + + + + + + + Protected from change node demo. + + +

protected from change node

+
+ + + + + +

+ Back +

+ + diff --git a/javascript/mif-tree/Demos/changeType/demo.css b/javascript/mif-tree/Demos/changeType/demo.css index 86bd5ba..2a4294c 100755 --- a/javascript/mif-tree/Demos/changeType/demo.css +++ b/javascript/mif-tree/Demos/changeType/demo.css @@ -1,282 +1,282 @@ -#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; -} +#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; +} diff --git a/javascript/mif-tree/Demos/index.html b/javascript/mif-tree/Demos/index.html index ddaf1b4..be0da84 100755 --- a/javascript/mif-tree/Demos/index.html +++ b/javascript/mif-tree/Demos/index.html @@ -41,6 +41,7 @@
  • Another add node demo
  • reload children and update clicked node name
  • cookie storage
  • +
  • protected from change node