From fa9e5946fe8d6f540ed6ab5739778cb316b60f5d Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 31 Jul 2011 15:00:28 +0200 Subject: [PATCH] Icon url example --- javascript/mif-tree/Demos/IconUrl/demo.css | 279 ++++++++++++++++++ javascript/mif-tree/Demos/IconUrl/demo.js | 66 +++++ .../mif-tree/Demos/IconUrl/folder-close.gif | Bin 0 -> 933 bytes .../mif-tree/Demos/IconUrl/folder-open.gif | Bin 0 -> 955 bytes javascript/mif-tree/Demos/IconUrl/index.html | 20 ++ javascript/mif-tree/Demos/index.html | 1 + 6 files changed, 366 insertions(+) create mode 100755 javascript/mif-tree/Demos/IconUrl/demo.css create mode 100755 javascript/mif-tree/Demos/IconUrl/demo.js create mode 100755 javascript/mif-tree/Demos/IconUrl/folder-close.gif create mode 100755 javascript/mif-tree/Demos/IconUrl/folder-open.gif create mode 100755 javascript/mif-tree/Demos/IconUrl/index.html diff --git a/javascript/mif-tree/Demos/IconUrl/demo.css b/javascript/mif-tree/Demos/IconUrl/demo.css new file mode 100755 index 0000000..af7074a --- /dev/null +++ b/javascript/mif-tree/Demos/IconUrl/demo.css @@ -0,0 +1,279 @@ +#tree_container{ +height:200px; +width:200px; +position:relative; +border:solid 1px #b7b7b7; +} + + +/*@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/IconUrl/demo.js b/javascript/mif-tree/Demos/IconUrl/demo.js new file mode 100755 index 0000000..c22af88 --- /dev/null +++ b/javascript/mif-tree/Demos/IconUrl/demo.js @@ -0,0 +1,66 @@ +window.addEvent('domready',function(){ + tree = new Mif.Tree({ + container: $('tree_container'),// tree container + types: {// node types + folder: { + openIcon: 'mif-tree-open-icon',//css class open icon + closeIcon: 'mif-tree-close-icon'// css class close icon + } + }, + dfltType: 'folder',//default node type + height: 18//node height + }); + + var json = [ + { + "property": { + "name": "root" + }, + "children": [ + { + "property": { + "name": "node1" + } + }, + { + "property": { + "name": "node2", + "openIconUrl": "folder-open.gif", + "closeIconUrl": "folder-close.gif" + }, + "state": { + "open": true + }, + "children":[ + { + "property": { + "name": "node2.1" + } + }, + { + "property": { + "name": "node2.2" + } + } + ] + }, + { + "property": { + "name": "node4" + } + }, + { + "property": { + "name": "node3" + } + } + ] + } + ]; + + // load tree from json. + tree.load({ + json: json + }); + +}); diff --git a/javascript/mif-tree/Demos/IconUrl/folder-close.gif b/javascript/mif-tree/Demos/IconUrl/folder-close.gif new file mode 100755 index 0000000000000000000000000000000000000000..5f6b188b5ff9b073ce7ddd9f232891259057a989 GIT binary patch literal 933 zcmds$>r0aX7{y;p%nyd z;)dp&rlPjI4Bg!3=FCf^rjmKX`{vZ9PN(l__GfhXaXy}h2hMS)KcYH^*b+9x9&s#~ zMV5iA0Qi6ar~zsLAy5a1fCi9_fSD$s4d?*600n7EfQbzg2c}$@N^n?$qcR+p;~*VI zHjG^C=i{IV2gNXiVEZ);Oc>Izla3u0b~3PQhK)TocJp8?#(^06P;8kA!)83T60w~E z0~fnB+v@_Xy@WOtx-e)N&@r$P4s9%S@z{umJ^}h9Y^Fn>u`e`eXSyRsyjah_w(bhhilhs}WdF#Cr0^ujG1uWIaD>ems9n!)tG1erZVk zCeQ1aa%Ju89&whWHKVtK)7#1E5wjJNTzO}Xtb^0nou`y=RXselw4h&Bh&dn3`(VNE zXf^;#uMX$KwNq(z0FNU8o9 zD>YwfVJW+~n7oV02bg|{X*z!UW9Avmfpaew)B%fwVSBU8of%fMAWT#lA*zfV?c=qI zvdB>iMqM#Z#}wT(O2^N~nD8bie3w;E4P!wID#oHFqN|DBz)vOz?_iLE5oi2xJsP=> z@3eJ=mu@&xI}}Ow-6GW#QcX3gT`+v_kCJxSdy`aA_Y`jCcKoZ!|7i~UmKFpdCY+An zJKh9gok_%8IZquak!77KZp*a`vB;xX+c%a{{k$*G7>XhXM-RKplruC>)<~5!`z%f9 zReIuTz9r|hP4LQXfqVG}C#B?FT<}uvCBL{9OGlYSrp-l9;;iP4FWc&*Yq`-O``W+_ lTWc28zFOq(#yS`1VWGJ0IP2 literal 0 HcmV?d00001 diff --git a/javascript/mif-tree/Demos/IconUrl/folder-open.gif b/javascript/mif-tree/Demos/IconUrl/folder-open.gif new file mode 100755 index 0000000000000000000000000000000000000000..b8fa48bd1b59b75dca8c91446c0e0c62064fe013 GIT binary patch literal 955 zcmds$`7hf67{+c0G23W{Q^6y^J@_Gj$LC(n=1n>TqLPnw6FefS;XHlZc11ii=_ zkaYkL-~)|7GtdIG0s^2N-QKogFmNNBR4$;NRGj&pIGhZ8+4XjwQZ!f6H0g*b@9p`K{`PR3y>jxwO( z;H2?rmyexLsH3nK4Rs9mVz3_zbt3kXv7d~C6da`CcMcBnR7;#GS&33wJR#;zj+H9J zWwMbHY`(-s0Jegl3c+>=cEYh01ywAz8Q4w5ZuPio1WI!T}^4@Lj}V2jQ8&n zNAy>^bEN|uEIh}8E0)}_M8mHDEC)g#xcX{c9=xH9)~;k7FXwjgqXqR0K|OP3jN2o~ zCub;_al{-Ai!|K~4L`gw|AL(N+mg{WvtjG9m<M3(?cv!q1A-6|HdpUm zZGteYCK9af*-cl8@(nBIlU5!W7+4uvbo)=2^tJt;N<|*B)(lk=>)=PN9 zC_PFdp&LIL4OK?OdskYxHL*M5jN5FTQ~Jvq6hhme;H<&Gr3vkhi&MEuW#(fN?o2rR E1xxnW!T + + + + + + + + + + Mif.Tree Demo + + +

Icon url example

+
+

+ Back +

+ + diff --git a/javascript/mif-tree/Demos/index.html b/javascript/mif-tree/Demos/index.html index 15d6c85..a925de4 100755 --- a/javascript/mif-tree/Demos/index.html +++ b/javascript/mif-tree/Demos/index.html @@ -24,6 +24,7 @@
  • Tree toggle event demo
  • Tree other style
  • Add/remove node type demo +
  • set icon using url instead class