compass-jquery-plugin 0.3.3.0 → 0.3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -4
- data/VERSION.yml +1 -1
- data/lib/handle_js_files.rb +1 -1
- data/lib/jquery/gridify/grid_column.rb +4 -0
- data/lib/jquery/gridify/grid_options.rb +5 -1
- data/lib/jquery/gridify/grid_view.rb +8 -3
- data/templates/dynatree/jquery.dynatree.js +184 -73
- data/templates/dynatree/jquery.dynatree.min.js +78 -76
- data/templates/emulators/emulators/galaxy.tab.7.7.landscape.png +0 -0
- data/templates/emulators/emulators/{palm.pre.2.landscape.scss → galaxy.tab.7.7.landscape.scss} +7 -7
- data/templates/emulators/emulators/galaxy.tab.7.7.portrait.png +0 -0
- data/templates/emulators/emulators/{palm.pre.2.portrait.scss → galaxy.tab.7.7.portrait.scss} +7 -7
- data/templates/emulators/manifest.rb +4 -4
- data/templates/graphics/config/initializers/graphics.rb +1 -1
- data/templates/graphics/highcharts/dark-blue.js +257 -159
- data/templates/graphics/highcharts/dark-blue.min.js +4 -2
- data/templates/graphics/highcharts/dark-green.js +257 -159
- data/templates/graphics/highcharts/dark-green.min.js +4 -2
- data/templates/graphics/highcharts/gray.js +252 -154
- data/templates/graphics/highcharts/gray.min.js +4 -2
- data/templates/graphics/highcharts/grid.js +84 -84
- data/templates/graphics/highcharts/highslide-full.min.js +3 -3
- data/templates/graphics/highcharts/highslide.js +3391 -0
- data/templates/graphics/highcharts/highslide.min.js +132 -0
- data/templates/graphics/jquery.ganttView.min.js +4 -4
- data/templates/graphics/jquery.highcharts.js +15379 -1071
- data/templates/graphics/jquery.highcharts.min.js +384 -167
- data/templates/graphics/jquery.sparkline.min.js +2 -2
- data/templates/graphics/manifest.rb +2 -0
- data/templates/ical/jquery.ical.min.js +46 -47
- data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +2 -2
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +2 -2
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +20 -19
- data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +7 -6
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +28 -28
- data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-th.js +134 -0
- data/templates/jqgrid/i18n/jqgrid/locale-th.min.js +6 -0
- data/templates/jqgrid/jquery.jqGrid.js +674 -598
- data/templates/jqgrid/jquery.jqGrid.min.js +444 -441
- data/templates/jqgrid/jquery/jqGrid.scss +0 -3
- data/templates/jqgrid/manifest.rb +2 -0
- data/templates/jqtouch/jquery.jqtouch.js +201 -156
- data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
- data/templates/jqtouch/jquery/touch/apple.scss +2 -2
- data/templates/jqtouch/jquery/touch/default.scss +2 -2
- data/templates/jquery/amplify.store.js +111 -78
- data/templates/jquery/amplify.store.min.js +6 -6
- data/templates/jquery/history.js +3 -3
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
- data/templates/jquery/jquery-ui.js +1286 -1042
- data/templates/jquery/jquery-ui.min.js +320 -316
- data/templates/jquery/jquery.contextMenu.js +2 -2
- data/templates/jquery/jquery.easing.js +152 -152
- data/templates/jquery/jquery.easing.min.js +7 -7
- data/templates/jquery/jquery.farbtastic.min.js +2 -2
- data/templates/jquery/jquery.form.js +30 -30
- data/templates/jquery/jquery.haml.min.js +5 -5
- data/templates/jquery/jquery.hotkeys.min.js +1 -1
- data/templates/jquery/jquery.js +419 -311
- data/templates/jquery/jquery.layout.js +59 -40
- data/templates/jquery/jquery.min.js +176 -176
- data/templates/jquery/jquery.themeswitchertool.js +37 -37
- data/templates/jquery/jquery.tmpl.js +4 -4
- data/templates/jquery/jquery.tmpl.min.js +9 -9
- data/templates/jquery/jquery.tmplPlus.min.js +3 -3
- data/templates/jquery/jquery.tokeninput.js +613 -490
- data/templates/jquery/jquery.tokeninput.min.js +17 -14
- data/templates/jquery/jquery/ui/_theme.scss +39 -63
- data/templates/jquery/json.js +31 -15
- data/templates/jstree/jquery.jstree.js +415 -410
- data/templates/jstree/jquery.jstree.min.js +134 -133
- data/templates/markitup/jquery.markitup.js +567 -560
- data/templates/markitup/jquery.markitup.min.js +1 -1
- data/templates/markitup/jquery/markitup/sets/default.scss +7 -3
- data/templates/markitup/jquery/markitup/sets/default/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup.scss +3 -10
- data/templates/markitup/jquery/markitup/skins/markitup/bg-container.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/simple.scss +2 -3
- data/templates/markitup/jquery/markitup/skins/simple/menu.png +0 -0
- data/templates/markitup/manifest.rb +2 -0
- data/templates/markitup/markitup/jquery.markitup.set.default.js +21 -21
- data/templates/markitup/markitup/jquery.markitup.set.default.min.js +3 -2
- data/templates/mobile/jquery.mobile.js +5230 -2846
- data/templates/mobile/jquery.mobile.min.js +192 -46
- data/templates/mobile/jquery/mobile/_base.scss +141 -18
- data/templates/mobile/jquery/mobile/default.scss +263 -66
- data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia.scss +242 -53
- data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
- data/templates/tiny_mce/manifest.rb +2 -0
- data/templates/tiny_mce/tiny_mce/langs/de.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/example_dependency/editor_plugin.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/example_dependency/editor_plugin_src.js +1 -0
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +16 -17
- data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +9 -10
- data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/langs/de_dlg.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +1 -1
- data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de.js +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +1 -1
- data/templates/tiny_mce/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +1 -1
- data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +1 -1
- data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
- data/templates/tools/flowplayer.min.js +1 -1
- data/templates/tools/jquery.tools.js +17 -17
- data/templates/tools/jquery.tools.min.js +22 -22
- metadata +17 -9
- data/templates/emulators/emulators/palm.pre.2.landscape.png +0 -0
- data/templates/emulators/emulators/palm.pre.2.portrait.png +0 -0
@@ -1,66 +1,66 @@
|
|
1
1
|
(function(){if(!jQuery||!jQuery.jstree){var o=!1,p=!1,q=!1;(function(c){c.vakata={};c.vakata.css={get_css:function(a,c,b){var a=a.toLowerCase(),e=b.cssRules||b.rules,d=0;do{if(e.length&&d>e.length+5)break;if(e[d].selectorText&&e[d].selectorText.toLowerCase()==a)return c===!0?(b.removeRule&&b.removeRule(d),b.deleteRule&&b.deleteRule(d),!0):e[d]}while(e[++d]);return!1},add_css:function(a,b){if(c.jstree.css.get_css(a,!1,b))return!1;b.insertRule?b.insertRule(a+" { }",0):b.addRule(a,null,0);return c.vakata.css.get_css(a)},
|
2
2
|
remove_css:function(a,b){return c.vakata.css.get_css(a,!0,b)},add_sheet:function(a){var b=!1,e=!0;if(a.str)return a.title&&(b=c("style[id='"+a.title+"-stylesheet']")[0]),b?e=!1:(b=document.createElement("style"),b.setAttribute("type","text/css"),a.title&&b.setAttribute("id",a.title+"-stylesheet")),b.styleSheet?e?(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet.cssText=a.str):b.styleSheet.cssText=b.styleSheet.cssText+" "+a.str:(b.appendChild(document.createTextNode(a.str)),document.getElementsByTagName("head")[0].appendChild(b)),
|
3
|
-
b.sheet||b.styleSheet;if(a.url)if(document.createStyleSheet)try{document.createStyleSheet(a.url)}catch(d){}else return b=document.createElement("link"),b.rel="stylesheet",b.type="text/css",b.media="all",b.href=a.url,document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet}};var a=[],b=-1,d={},e={};c.fn.jstree=function(f){var b=typeof f=="string",e=Array.prototype.slice.call(arguments,1),
|
4
|
-
b=b&&c.isFunction(b[f])?b[f].apply(b,e):b;if(typeof b!=="undefined"&&(f.indexOf("is_"===0
|
5
|
-
|
6
|
-
d[f].__init.apply(a[b])});setTimeout(function(){a[b].init()},0)});return
|
3
|
+
b.sheet||b.styleSheet;if(a.url)if(document.createStyleSheet)try{document.createStyleSheet(a.url)}catch(d){}else return b=document.createElement("link"),b.rel="stylesheet",b.type="text/css",b.media="all",b.href=a.url,document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet}};var a=[],b=-1,d={},e={};c.fn.jstree=function(f){var b=typeof f=="string",e=Array.prototype.slice.call(arguments,1),h=this;if(b){if(f.substring(0,1)=="_")return h;this.each(function(){var b=a[c.data(this,"jstree_instance_id")],
|
4
|
+
b=b&&c.isFunction(b[f])?b[f].apply(b,e):b;if(typeof b!=="undefined"&&(f.indexOf("is_")===0||b!==!0&&b!==!1))return h=b,!1})}else this.each(function(){var b=c.data(this,"jstree_instance_id"),g=[],h=f?c.extend({},!0,f):{},l=c(this),n=!1,r=[],g=g.concat(e);l.data("jstree")&&g.push(l.data("jstree"));h=g.length?c.extend.apply(null,[!0,h].concat(g)):h;typeof b!=="undefined"&&a[b]&&a[b].destroy();b=parseInt(a.push({}),10)-1;c.data(this,"jstree_instance_id",b);h.plugins=c.isArray(h.plugins)?h.plugins:c.jstree.defaults.plugins.slice();
|
5
|
+
h.plugins.unshift("core");h.plugins=h.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");n=c.extend(!0,{},c.jstree.defaults,h);n.plugins=h.plugins;c.each(d,function(a){c.inArray(a,n.plugins)===-1?(n[a]=null,delete n[a]):r.push(a)});n.plugins=r;a[b]=new c.jstree._instance(b,c(this).addClass("jstree jstree-"+b),n);c.each(a[b]._get_settings().plugins,function(c,f){a[b].data[f]={}});c.each(a[b]._get_settings().plugins,function(c,f){d[f]&&
|
6
|
+
d[f].__init.apply(a[b])});setTimeout(function(){a[b]&&a[b].init()},0)});return h};c.jstree={defaults:{plugins:[]},_focused:function(){return a[b]||null},_reference:function(f){if(a[f])return a[f];var b=c(f);!b.length&&typeof f==="string"&&(b=c("#"+f));return!b.length?null:a[b.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(a,b,e){this.data={core:{}};this.get_settings=function(){return c.extend(!0,{},e)};this._get_settings=function(){return e};this.get_index=function(){return a};
|
7
7
|
this.get_container=function(){return b};this.get_container_ul=function(){return b.children("ul:eq(0)")};this._set_settings=function(a){e=c.extend(!0,{},e,a)}},_fn:{},plugin:function(a,b){b=c.extend({},{__init:c.noop,__destroy:c.noop,_fn:{},defaults:!1},b);d[a]=b;c.jstree.defaults[a]=b.defaults;c.each(b._fn,function(b,e){e.plugin=a;e.old=c.jstree._fn[b];c.jstree._fn[b]=function(){var a,f=e,d=Array.prototype.slice.call(arguments);a=new c.Event("before.jstree");var g=!1;if(!(this.data.core.locked===
|
8
8
|
!0&&b!=="unlock"&&b!=="is_locked")){do{if(f&&f.plugin&&c.inArray(f.plugin,this._get_settings().plugins)!==-1)break;f=f.old}while(f);if(f){if(b.indexOf("_")===0)a=f.apply(this,d);else{a=this.get_container().triggerHandler(a,{func:b,inst:this,args:d,plugin:f.plugin});if(a===!1)return;typeof a!=="undefined"&&(d=a);a=f.apply(c.extend({},this,{__callback:function(a){this.get_container().triggerHandler(b+".jstree",{inst:this,args:d,rslt:a,rlbk:g})},__rollback:function(){return g=this.get_rollback()},__call_old:function(a){return f.old.apply(this,
|
9
|
-
a?Array.prototype.slice.call(arguments,1):d)}}),d)}return a}}};c.jstree._fn[b].old=e.old;c.jstree._fn[b].plugin=a})},rollback:function(b){b&&(c.isArray(b)||(b=[b]),c.each(b,function(b
|
9
|
+
a?Array.prototype.slice.call(arguments,1):d)}}),d)}return a}}};c.jstree._fn[b].old=e.old;c.jstree._fn[b].plugin=a})},rollback:function(b){b&&(c.isArray(b)||(b=[b]),c.each(b,function(c,b){a[b.i].set_rollback(b.h,b.d)}))}};c.jstree._fn=c.jstree._instance.prototype={};c(function(){var a=navigator.userAgent.toLowerCase(),b=(a.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],e=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";
|
10
10
|
if(/msie/.test(a)&&parseInt(b,10)==6){o=!0;try{document.execCommand("BackgroundImageCache",!1,!0)}catch(d){}e+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}/msie/.test(a)&&
|
11
11
|
parseInt(b,10)==7&&(p=!0,e+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } ");!/compatible/.test(a)&&/mozilla/.test(a)&&parseFloat(b,10)<1.9&&(q=!0,e+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ");c.vakata.css.add_sheet({str:e,title:"jstree"})});c.jstree.plugin("core",{__init:function(){this.data.core.locked=!1;this.data.core.to_open=
|
12
12
|
this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:!1,animation:500,initially_open:[],initially_load:[],open_parents:!0,notify_plugins:!0,rtl:!1,load_open:!1,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();this._get_settings().core.rtl&&this.get_container().addClass("jstree-rtl").css("direction","rtl");this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>"+
|
13
|
-
this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",c.proxy(function(a){
|
14
|
-
|
15
|
-
|
16
|
-
f!=e){a[f].set_focus();break}e===b&&(b=-1);this.get_container().unbind(".jstree").undelegate(".jstree").removeData("
|
13
|
+
this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",c.proxy(function(a){this.toggle_node(c(a.target))},this)).bind("mousedown.jstree",c.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(){var a;if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){a=window.getSelection();
|
14
|
+
try{a.removeAllRanges(),a.collapse()}catch(c){}}});this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",c.proxy(function(a,b){var e=this._get_node(b.rslt.obj),d=this;e===-1&&(e=this.get_container_ul());e.length&&e.find("li").each(function(){var a=c(this);a.data("jstree")&&c.each(a.data("jstree"),function(b,f){d.data[b]&&c.isFunction(d["_"+b+"_notify"])&&d["_"+b+"_notify"].call(d,a,f)})})},this));this._get_settings().core.load_open&&this.get_container().bind("load_node.jstree",
|
15
|
+
c.proxy(function(a,b){var e=this._get_node(b.rslt.obj),d=this;e===-1&&(e=this.get_container_ul());e.length&&e.find("li.jstree-open:not(:has(ul))").each(function(){d.load_node(this,c.noop,c.noop)})},this));this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var f,e=this.get_index(),j=this._get_settings(),h=this;c.each(j.plugins,function(a,c){try{d[c].__destroy.apply(h)}catch(b){}});this.__callback();if(this.is_focused())for(f in a)if(a.hasOwnProperty(f)&&
|
16
|
+
f!=e){a[f].set_focus();break}e===b&&(b=-1);this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});c(document).unbind(".jstree-"+e).undelegate(".jstree-"+e);a[e]=null;delete a[e]},_core_notify:function(a,c){c.opened&&this.open_node(a,!1,!0)},lock:function(){this.data.core.locked=!0;this.get_container().children("ul").addClass("jstree-locked").css("opacity",
|
17
17
|
"0.7");this.__callback({})},unlock:function(){this.data.core.locked=!1;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var a=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){this.id&&a.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,
|
18
|
-
"\\."))});this.__callback(a.data.core.to_open)},save_loaded:function(){},reload_nodes:function(a){var b=this,e=!0,d=[],k=[];if(!a&&(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=c.map(c.makeArray(this.data.core.to_open),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.")}),this.data.core.to_load=c.map(c.makeArray(this.data.core.to_load),function(a){return"#"+
|
19
|
-
"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.")}),this.data.core.to_open.length))this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open);if(this.data.core.to_load.length&&(c.each(this.data.core.to_load,function(a,b){if(b=="#")return!0;c(b).length?d.push(b):k.push(b)}),d.length))this.data.core.to_load=k,c.each(d,function(a,c){b._is_loaded(c)||(b.load_node(c,function(){b.reload_nodes(!0)},function(){b.reload_nodes(!0)}),
|
20
|
-
c.each(this.data.core.to_open,function(a,c){b.open_node(c,!1,!0)});if(e)this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){b.__callback({},b)},50),this.data.core.refreshing=!1,this.reopen()},reopen:function(){var a=this;this.data.core.to_open.length&&c.each(this.data.core.to_open,function(b
|
21
|
-
this.load_node(a,function(){
|
22
|
-
if(b.is(".jstree")||a==-1)return-1;b=b.closest("li",this.get_container());return b.length?b:!1},_get_next:function(a,
|
23
|
-
if(!a.length)return!1;if(
|
24
|
-
|
25
|
-
a!==-1&&a.hasClass("jstree-closed")},is_leaf:function(a){return(a=this._get_node(a))&&a!==-1&&a.hasClass("jstree-leaf")},correct_state:function(a){a=this._get_node(a);if(!a||a===-1)return!1;a.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},open_node:function(a,b
|
26
|
-
(this._get_settings().core.open_parents&&a.parentsUntil(".jstree",".jstree-closed").each(function(){d.open_node(this,!1,!0)}),e&&a.children("ul").css("display","none"),a.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"),e?a.children("ul").stop(!0,!0).slideDown(e,function(){this.style.display="";d.after_open(a)}):d.after_open(a),this.__callback({obj:a}),
|
27
|
-
|
28
|
-
toggle_node:function(a){a=this._get_node(a);if(a.hasClass("jstree-closed"))return this.open_node(a);if(a.hasClass("jstree-open"))return this.close_node(a)},open_all:function(a,b
|
29
|
-
|
30
|
-
a.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(!0),d:this.data}},set_rollback:function(a,
|
31
|
-
b,
|
32
|
-
e));if(typeof b=="string")l.attr("href","#")[m.html_titles?"html":"text"](b);else{if(!b.attr)b.attr={};if(!b.attr.href)b.attr.href="#";l.attr(b.attr)[m.html_titles?"html":"text"](b.title);b.language&&l.addClass(b.language)}l.prepend("<ins class='jstree-icon'> </ins>");b.icon&&(b.icon.indexOf("/")===-1?l.children("ins").addClass(b.icon):l.children("ins").css("background","url('"+b.icon+"') center center no-repeat"));
|
33
|
-
b==="before"&&(b="first"),b==="after"&&(b="last"));switch(b){case "before":a.before(
|
34
|
-
l=a}if(l===-1||l.get(0)===this.get_container().get(0))l=-1;this.clean_node(l);this.__callback({obj:
|
35
|
-
a.children("INS").clone();a.html(b).prepend(c);this.__callback({obj:a,name:b});return!0}else return a=a.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:a,name:b}),a.nodeValue=b},rename_node:function(a,b){a=this._get_node(a);this.__rollback();a&&a.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))&&this.__callback({obj:a,name:b})},delete_node:function(a){a=this._get_node(a);if(!a.length)return!1;
|
36
|
-
d=this;a.each(function(){e=e.add(d._get_prev(this))});a=a.detach();b!==-1&&b.find("> ul > li").length===0&&b.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");this.clean_node(b);this.__callback({obj:a,prev:e,parent:b});return a},prepare_move:function(a,b,d,
|
37
|
-
this;
|
38
|
-
case "inside":case "first":
|
39
|
-
|
40
|
-
"copy_"+this.id})):b=a.o;a.or.length?a.or.before(b):(a.np.children("ul").length||c("<ul />").appendTo(a.np),a.np.children("ul:eq(0)").append(b));try{a.ot.clean_node(a.op),a.rt.clean_node(a.np),a.op.find("> ul > li").length||a.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(m){}if(
|
18
|
+
"\\.").replace(/\:/g,"\\:"))});this.__callback(a.data.core.to_open)},save_loaded:function(){},reload_nodes:function(a){var b=this,e=!0,d=[],k=[];if(!a&&(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=c.map(c.makeArray(this.data.core.to_open),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_load=c.map(c.makeArray(this.data.core.to_load),function(a){return"#"+
|
19
|
+
a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_open.length))this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open);if(this.data.core.to_load.length&&(c.each(this.data.core.to_load,function(a,b){if(b=="#")return!0;c(b).length?d.push(b):k.push(b)}),d.length))this.data.core.to_load=k,c.each(d,function(a,c){b._is_loaded(c)||(b.load_node(c,function(){b.reload_nodes(!0)},function(){b.reload_nodes(!0)}),
|
20
|
+
e=!1)});this.data.core.to_open.length&&c.each(this.data.core.to_open,function(a,c){b.open_node(c,!1,!0)});if(e)this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){b.__callback({},b)},50),this.data.core.refreshing=!1,this.reopen()},reopen:function(){var a=this;this.data.core.to_open.length&&c.each(this.data.core.to_open,function(c,b){a.open_node(b,!1,!0)});this.__callback({})},refresh:function(a){var c=this;this.save_opened();a||(a=-1);(a=this._get_node(a))||
|
21
|
+
(a=-1);a!==-1?a.children("UL").remove():this.get_container_ul().empty();this.load_node(a,function(){c.__callback({obj:a});c.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(!this.is_focused()){var a=c.jstree._focused();a&&a.unset_focus();this.get_container().addClass("jstree-focused");b=this.get_index();this.__callback()}},is_focused:function(){return b==this.get_index()},unset_focus:function(){this.is_focused()&&(this.get_container().removeClass("jstree-focused"),b=
|
22
|
+
-1);this.__callback()},_get_node:function(a){var b=c(a,this.get_container());if(b.is(".jstree")||a==-1)return-1;b=b.closest("li",this.get_container());return b.length?b:!1},_get_next:function(a,c){a=this._get_node(a);return a===-1?this.get_container().find("> ul > li:first-child"):!a.length?!1:c?a.nextAll("li").size()>0?a.nextAll("li:eq(0)"):!1:a.hasClass("jstree-open")?a.find("li:eq(0)"):a.nextAll("li").size()>0?a.nextAll("li:eq(0)"):a.parentsUntil(".jstree","li").next("li").eq(0)},_get_prev:function(a,
|
23
|
+
c){a=this._get_node(a);if(a===-1)return this.get_container().find("> ul > li:last-child");if(!a.length)return!1;if(c)return a.prevAll("li").length>0?a.prevAll("li:eq(0)"):!1;if(a.prev("li").length){for(a=a.prev("li").eq(0);a.hasClass("jstree-open");)a=a.children("ul:eq(0)").children("li:last");return a}else{var b=a.parentsUntil(".jstree","li:eq(0)");return b.length?b:!1}},_get_parent:function(a){a=this._get_node(a);if(a==-1||!a.length)return!1;a=a.parentsUntil(".jstree","li:eq(0)");return a.length?
|
24
|
+
a:-1},_get_children:function(a){a=this._get_node(a);return a===-1?this.get_container().children("ul:eq(0)").children("li"):!a.length?!1:a.children("ul:eq(0)").children("li")},get_path:function(a,c){var b=[],e=this,a=this._get_node(a);if(a===-1||!a||!a.length)return!1;a.parentsUntil(".jstree","li").each(function(){b.push(c?this.id:e.get_text(this))});b.reverse();b.push(c?a.attr("id"):this.get_text(a));return b},_get_string:function(a){return this._get_settings().core.strings[a]||a},is_open:function(a){return(a=
|
25
|
+
this._get_node(a))&&a!==-1&&a.hasClass("jstree-open")},is_closed:function(a){return(a=this._get_node(a))&&a!==-1&&a.hasClass("jstree-closed")},is_leaf:function(a){return(a=this._get_node(a))&&a!==-1&&a.hasClass("jstree-leaf")},correct_state:function(a){a=this._get_node(a);if(!a||a===-1)return!1;a.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},open_node:function(a,c,b){a=this._get_node(a);if(!a.length)return!1;if(!a.hasClass("jstree-closed"))return c&&
|
26
|
+
c.call(),!1;var e=b||o?0:this._get_settings().core.animation,d=this;this._is_loaded(a)?(this._get_settings().core.open_parents&&a.parentsUntil(".jstree",".jstree-closed").each(function(){d.open_node(this,!1,!0)}),e&&a.children("ul").css("display","none"),a.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"),e?a.children("ul").stop(!0,!0).slideDown(e,function(){this.style.display="";d.after_open(a)}):d.after_open(a),this.__callback({obj:a}),c&&c.call()):
|
27
|
+
(a.children("a").addClass("jstree-loading"),this.load_node(a,function(){d.open_node(a,c,b)},c))},after_open:function(a){this.__callback({obj:a})},close_node:function(a,c){var a=this._get_node(a),b=c||o?0:this._get_settings().core.animation,e=this;if(!a.length||!a.hasClass("jstree-open"))return!1;b&&a.children("ul").attr("style","display:block !important");a.removeClass("jstree-open").addClass("jstree-closed");b?a.children("ul").stop(!0,!0).slideUp(b,function(){this.style.display="";e.after_close(a)}):
|
28
|
+
e.after_close(a);this.__callback({obj:a})},after_close:function(a){this.__callback({obj:a})},toggle_node:function(a){a=this._get_node(a);if(a.hasClass("jstree-closed"))return this.open_node(a);if(a.hasClass("jstree-open"))return this.close_node(a)},open_all:function(a,c,b){a=a?this._get_node(a):-1;if(!a||a===-1)a=this.get_container_ul();b?a=a.find("li.jstree-closed"):(b=a,a=a.is(".jstree-closed")?a.find("li.jstree-closed").andSelf():a.find("li.jstree-closed"));var e=this;a.each(function(){var a=this;
|
29
|
+
e._is_loaded(this)?e.open_node(this,!1,!c):e.open_node(this,function(){e.open_all(a,c,b)},!c)});b.find("li.jstree-closed").length===0&&this.__callback({obj:b})},close_all:function(a,c){var b=this,a=a?this._get_node(a):this.get_container();if(!a||a===-1)a=this.get_container_ul();a.find("li.jstree-open").andSelf().each(function(){b.close_node(this,!c)});this.__callback({obj:a})},clean_node:function(a){a=a&&a!=-1?c(a):this.get_container_ul();a=a.is("li")?a.find("li").andSelf():a.find("li");a.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
|
30
|
+
a.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:a})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(!0),d:this.data}},set_rollback:function(a,c){this.get_container().empty().append(a);this.data=c;this.__callback()},load_node:function(a){this.__callback({obj:a})},_is_loaded:function(){return!0},create_node:function(a,b,e,d,k){var a=this._get_node(a),b=typeof b==="undefined"?"last":
|
31
|
+
b,i=c("<li />"),m=this._get_settings().core,l;if(a!==-1&&!a.length)return!1;if(!k&&!this._is_loaded(a))return this.load_node(a,function(){this.create_node(a,b,e,d,!0)}),!1;this.__rollback();typeof e==="string"&&(e={data:e});e||(e={});e.attr&&i.attr(e.attr);e.metadata&&i.data(e.metadata);e.state&&i.addClass("jstree-"+e.state);if(!e.data)e.data=this._get_string("new_node");if(!c.isArray(e.data))l=e.data,e.data=[],e.data.push(l);c.each(e.data,function(a,b){l=c("<a />");c.isFunction(b)&&(b=b.call(this,
|
32
|
+
e));if(typeof b=="string")l.attr("href","#")[m.html_titles?"html":"text"](b);else{if(!b.attr)b.attr={};if(!b.attr.href)b.attr.href="#";l.attr(b.attr)[m.html_titles?"html":"text"](b.title);b.language&&l.addClass(b.language)}l.prepend("<ins class='jstree-icon'> </ins>");if(!b.icon&&e.icon)b.icon=e.icon;b.icon&&(b.icon.indexOf("/")===-1?l.children("ins").addClass(b.icon):l.children("ins").css("background","url('"+b.icon+"') center center no-repeat"));i.append(l)});i.prepend("<ins class='jstree-icon'> </ins>");
|
33
|
+
a===-1&&(a=this.get_container(),b==="before"&&(b="first"),b==="after"&&(b="last"));switch(b){case "before":a.before(i);l=this._get_parent(a);break;case "after":a.after(i);l=this._get_parent(a);break;case "inside":case "first":a.children("ul").length||a.append("<ul />");a.children("ul").prepend(i);l=a;break;case "last":a.children("ul").length||a.append("<ul />");a.children("ul").append(i);l=a;break;default:a.children("ul").length||a.append("<ul />"),b||(b=0),l=a.children("ul").children("li").eq(b),
|
34
|
+
l.length?l.before(i):a.children("ul").append(i),l=a}if(l===-1||l.get(0)===this.get_container().get(0))l=-1;this.clean_node(l);this.__callback({obj:i,parent:l});d&&d.call(this,i);return i},get_text:function(a){a=this._get_node(a);if(!a.length)return!1;var b=this._get_settings().core.html_titles,a=a.children("a:eq(0)");return b?(a=a.clone(),a.children("INS").remove(),a.html()):(a=a.contents().filter(function(){return this.nodeType==3})[0],a.nodeValue)},set_text:function(a,b){a=this._get_node(a);if(!a.length)return!1;
|
35
|
+
a=a.children("a:eq(0)");if(this._get_settings().core.html_titles){var c=a.children("INS").clone();a.html(b).prepend(c);this.__callback({obj:a,name:b});return!0}else return a=a.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:a,name:b}),a.nodeValue=b},rename_node:function(a,b){a=this._get_node(a);this.__rollback();a&&a.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))&&this.__callback({obj:a,name:b})},delete_node:function(a){a=this._get_node(a);if(!a.length)return!1;
|
36
|
+
this.__rollback();var b=this._get_parent(a),e=c([]),d=this;a.each(function(){e=e.add(d._get_prev(this))});a=a.detach();b!==-1&&b.find("> ul > li").length===0&&b.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");this.clean_node(b);this.__callback({obj:a,prev:e,parent:b});return a},prepare_move:function(a,b,d,h,k){var i={};i.ot=c.jstree._reference(a)||this;i.o=i.ot._get_node(a);i.r=b===-1?-1:this._get_node(b);i.p=typeof d==="undefined"||d===!1?"last":d;if(k||!e.o||!(e.o[0]===i.o[0]&&
|
37
|
+
e.r[0]===i.r[0]&&e.p===i.p)){i.ot=c.jstree._reference(i.o)||this;i.rt=c.jstree._reference(i.r)||this;if(i.r===-1||!i.r)switch(i.cr=-1,i.p){case "first":case "before":case "inside":i.cp=0;break;case "after":case "last":i.cp=i.rt.get_container().find(" > ul > li").length;break;default:i.cp=i.p}else{if(!/^(before|after)$/.test(i.p)&&!this._is_loaded(i.r))return this.load_node(i.r,function(){this.prepare_move(a,b,d,h,!0)});switch(i.p){case "before":i.cp=i.r.index();i.cr=i.rt._get_parent(i.r);break;case "after":i.cp=
|
38
|
+
i.r.index()+1;i.cr=i.rt._get_parent(i.r);break;case "inside":case "first":i.cp=0;i.cr=i.r;break;case "last":i.cp=i.r.find(" > ul > li").length;i.cr=i.r;break;default:i.cp=i.p,i.cr=i.r}}i.np=i.cr==-1?i.rt.get_container():i.cr;i.op=i.ot._get_parent(i.o);i.cop=i.o.index();if(i.op===-1)i.op=i.ot?i.ot.get_container():this.get_container();!/^(before|after)$/.test(i.p)&&i.op&&i.np&&i.op[0]===i.np[0]&&i.o.index()<i.cp&&i.cp++;i.or=i.np.find(" > ul > li:nth-child("+(i.cp+1)+")");e=i}this.__callback(e);h&&
|
39
|
+
h.call(this,e)},check_move:function(){var a=e,b=!0,c=a.r===-1?this.get_container():a.r;if(!a||!a.o||a.or[0]===a.o[0])return!1;if(a.op&&a.np&&a.op[0]===a.np[0]&&a.cp-1===a.o.index())return!1;a.o.each(function(){if(c.parentsUntil(".jstree","li").andSelf().index(this)!==-1)return b=!1});return b},move_node:function(a,b,d,h,k,i){if(!k)return this.prepare_move(a,b,d,function(a){this.move_node(a,!1,!1,h,!0,i)});if(h)e.cy=!0;if(!i&&!this.check_move())return!1;this.__rollback();b=!1;h?(b=a.o.clone(!0),b.find("*[id]").andSelf().each(function(){if(this.id)this.id=
|
40
|
+
"copy_"+this.id})):b=a.o;a.or.length?a.or.before(b):(a.np.children("ul").length||c("<ul />").appendTo(a.np),a.np.children("ul:eq(0)").append(b));try{a.ot.clean_node(a.op),a.rt.clean_node(a.np),a.op.find("> ul > li").length||a.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(m){}if(h)e.cy=!0,e.oc=b;this.__callback(e);return e},_get_move:function(){return e}}})})(jQuery);(function(c){var a,b,d;c(function(){/msie/.test(navigator.userAgent.toLowerCase())?
|
41
41
|
(b=c('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),d=c('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),a=b.width()-d.width(),b.add(d).remove()):(b=c("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1E3,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}),a=100-b.width(),b.parent().remove())});c.jstree.plugin("ui",
|
42
42
|
{__init:function(){this.data.ui.selected=c();this.data.ui.last_selected=!1;this.data.ui.hovered=null;this.data.ui.to_select=this.get_settings().ui.initially_select;this.get_container().delegate("a","click.jstree",c.proxy(function(a){a.preventDefault();a.currentTarget.blur();c(a.currentTarget).hasClass("jstree-loading")||this.select_node(a.currentTarget,!0,a)},this)).delegate("a","mouseenter.jstree",c.proxy(function(a){c(a.currentTarget).hasClass("jstree-loading")||this.hover_node(a.target)},this)).delegate("a",
|
43
|
-
"mouseleave.jstree",c.proxy(function(a){c(a.currentTarget).hasClass("jstree-loading")||this.dehover_node(a.target)},this)).bind("reopen.jstree",c.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",c.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",c.proxy(function(){this.reselect()},this)).bind("close_node.jstree",c.proxy(function(a,b){var d=this._get_settings().ui,j=this._get_node(b.rslt.obj),
|
44
|
-
c(),k=this;d.selected_parent_close!==!1&&
|
43
|
+
"mouseleave.jstree",c.proxy(function(a){c(a.currentTarget).hasClass("jstree-loading")||this.dehover_node(a.target)},this)).bind("reopen.jstree",c.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",c.proxy(function(){this.dehover_node();this.save_selected()},this)).bind("set_rollback.jstree",c.proxy(function(){this.reselect()},this)).bind("close_node.jstree",c.proxy(function(a,b){var d=this._get_settings().ui,j=this._get_node(b.rslt.obj),h=j&&j.length?j.children("ul").find("a.jstree-clicked"):
|
44
|
+
c(),k=this;d.selected_parent_close!==!1&&h.length&&h.each(function(){k.deselect_node(this);d.selected_parent_close==="select_parent"&&k.select_node(j)})},this)).bind("delete_node.jstree",c.proxy(function(a,b){var c=this._get_settings().ui.select_prev_on_delete,d=this._get_node(b.rslt.obj),d=d&&d.length?d.find("a.jstree-clicked"):[],h=this;d.each(function(){h.deselect_node(this)});c&&d.length&&b.rslt.prev.each(function(){if(this.parentNode)return h.select_node(this),!1})},this)).bind("move_node.jstree",
|
45
45
|
c.proxy(function(a,b){b.rslt.cy&&b.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:!0,select_prev_on_delete:!0,disable_selecting_children:!1,initially_select:[]},_fn:{_get_node:function(a,b){if(typeof a==="undefined"||a===null)return b?this.data.ui.selected:this.data.ui.last_selected;var d=c(a,this.get_container());if(d.is(".jstree")||
|
46
|
-
a==-1)return-1;d=d.closest("li",this.get_container());return d.length?d:!1},_ui_notify:function(a,b){b.selected&&this.select_node(a,!1)},save_selected:function(){var a=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){this.id&&a.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\."))});this.__callback(this.data.ui.to_select)},reselect:function(){var a=this,b=this.data.ui.to_select,
|
47
|
-
function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.")});c.each(b,function(b,c){c&&c!=="#"&&a.select_node(c)});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(){this.save_selected();return this.__call_old()},hover_node:function(a){a=this._get_node(a);if(!a.length)return!1;a.hasClass("jstree-hovered")||
|
48
|
-
this._fix_scroll(a);this.__callback({obj:a})},dehover_node:function(){var a=this.data.ui.hovered;if(!a||!a.length)return!1;if(this.data.ui.hovered[0]===a.children("a").removeClass("jstree-hovered").parent()[0])this.data.ui.hovered=null;this.__callback({obj:a})},select_node:function(a,b,c){a=this._get_node(a);if(a==-1||!a||!a.length)return!1;var d=this._get_settings().ui,
|
49
|
-
|
50
|
-
"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();d.select_limit==-1||a.length<d.select_limit?(this.data.ui.last_selected.removeClass("jstree-last-selected"),this.data.ui.selected.each(function(){this!==l.data.ui.last_selected[0]&&l.deselect_node(this)}),
|
51
|
-
1<=d.select_limit)m=!0}}if(m&&!
|
52
|
-
if(b<0)c.scrollTop=c.scrollTop+b-1;if(b+this.data.core.li_height+(c.scrollWidth>c.offsetWidth?a:0)>c.offsetHeight)c.scrollTop+=b-c.offsetHeight+this.data.core.li_height+1+(c.scrollWidth>c.offsetWidth?a:0)}},deselect_node:function(a){a=this._get_node(a);if(!a.length)return!1;if(this.is_selected(a)){a.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(a);if(this.data.ui.last_selected.get(0)===
|
53
|
-
toggle_select:function(a){a=this._get_node(a);if(!a.length)return!1;this.is_selected(a)?this.deselect_node(a):this.select_node(a)},is_selected:function(a){return this.data.ui.selected.index(this._get_node(a))>=0},get_selected:function(a){return a?c(a).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(a){a=a?c(a).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();
|
54
|
-
c([]);this.data.ui.last_selected=!1;this.__callback({obj:a})}}});c.jstree.defaults.plugins.push("ui")})(jQuery);(function(c){c.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",c.proxy(function(a,b){if(this._get_settings().crrm.move.open_onmove){var c=this;b.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){c.open_node(this,!1,!0)})}},this))},defaults:{input_width_limit:200,
|
55
|
-
check_move:function(){return!0}}},_fn:{_show_input:function(a,b){var a=this._get_node(a),d=this._get_settings().core.rtl,e=this._get_settings().crrm.input_width_limit,f=a.children("ins").width(),g=a.find("> a:visible > ins").width()*a.find("> a:visible > ins").length,j=this.get_text(a),
|
56
|
-
border:"1px solid silver",position:"absolute",left:d?"auto":f+g+4+"px",right:d?f+g+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:c.proxy(function(){var c=a.children(".jstree-rename-input"),d=c.val();d===""&&(d=j);c.remove();this.set_text(a,j);this.rename_node(a,d);b.call(this,a,d,j);a.css("position","")},this),keyup:function(a){a=a.keyCode||a.which;a==
|
57
|
-
this.value).width(),e))},keypress:function(a){if((a.keyCode||a.which)==13)return!1}})).children(".jstree-rename-input");this.set_text(a,"");
|
58
|
-
rename:function(a){a=this._get_node(a);this.__rollback();var b=this.__callback;this._show_input(a,function(a,c,f){b.call(this,{obj:a,new_name:c,old_name:f})})},create:function(a,b,d,e,f){var g=this;(a=this._get_node(a))||(a=-1);this.__rollback();return this.create_node(a,b,d,function(a){var b=this._get_parent(a),d=c(a).index();e&&e.call(this,a);b.length&&b.hasClass("jstree-closed")&&this.open_node(b,!1,!0);f?g.__callback({obj:a,
|
59
|
-
c){g.__callback({obj:a,name:c,parent:b,position:d})})})},remove:function(a){var a=this._get_node(a,!0),b=this._get_parent(a),c=this._get_prev(a);this.__rollback();a=this.delete_node(a);a!==!1&&this.__callback({obj:a,prev:c,parent:b})},check_move:function(){
|
60
|
-
if(c==="inside"&&!j.default_position.match(/^(before|after)$/))c=j.default_position;return this.__call_old(!0,a,b,c,e,!1,g)}if(j.always_copy===!0||j.always_copy==="multitree"&&a.rt.get_index()!==a.ot.get_index())e=!0;this.__call_old(!0,a,b,c,e,!0,g)},cut:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;this.data.crrm.cp_nodes=!1;this.data.crrm.ct_nodes=a;this.__callback({obj:a})},copy:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;
|
61
|
-
a;this.__callback({obj:a})},paste:function(a){a=this._get_node(a);if(!a||!a.length)return!1;var b=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes)return!1;if(this.data.crrm.ct_nodes)this.move_node(this.data.crrm.ct_nodes,a),this.data.crrm.ct_nodes=!1;this.data.crrm.cp_nodes&&this.move_node(this.data.crrm.cp_nodes,a,!1,!0);this.__callback({obj:a,nodes:b})}}})})(jQuery);(function(c){var a=
|
62
|
-
{__init:function(){this.get_container().bind("init.jstree",c.proxy(function(){var a=this._get_settings().themes;this.data.themes.dots=a.dots;this.data.themes.icons=a.icons;this.set_theme(a.theme,a.url)},this)).bind("loaded.jstree",c.proxy(function(){this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons()},this))},defaults:{theme:"default",url:!1,dots:!0,icons:!0},_fn:{set_theme:function(b,d){if(!b)return!1;
|
63
|
-
c.inArray(d,a)==-1&&(c.vakata.css.add_sheet({url:d}),a.push(d));if(this.data.themes.theme!=b)this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=b;this.get_container().addClass("jstree-"+b);this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons();this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=!0;this.get_container().children("ul").removeClass("jstree-no-dots")},
|
46
|
+
a==-1)return-1;d=d.closest("li",this.get_container());return d.length?d:!1},_ui_notify:function(a,b){b.selected&&this.select_node(a,!1)},save_selected:function(){var a=this;this.data.ui.to_select=[];this.data.ui.selected.each(function(){this.id&&a.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))});this.__callback(this.data.ui.to_select)},reselect:function(){var a=this,b=this.data.ui.to_select,
|
47
|
+
b=c.map(c.makeArray(b),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});c.each(b,function(b,c){c&&c!=="#"&&a.select_node(c)});this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode});this.__callback()},refresh:function(){this.save_selected();return this.__call_old()},hover_node:function(a){a=this._get_node(a);if(!a.length)return!1;a.hasClass("jstree-hovered")||
|
48
|
+
this.dehover_node();this.data.ui.hovered=a.children("a").addClass("jstree-hovered").parent();this._fix_scroll(a);this.__callback({obj:a})},dehover_node:function(){var a=this.data.ui.hovered;if(!a||!a.length)return!1;if(this.data.ui.hovered[0]===a.children("a").removeClass("jstree-hovered").parent()[0])this.data.ui.hovered=null;this.__callback({obj:a})},select_node:function(a,b,c){a=this._get_node(a);if(a==-1||!a||!a.length)return!1;var d=this._get_settings().ui,h=d.select_multiple_modifier=="on"||
|
49
|
+
d.select_multiple_modifier!==!1&&c&&c[d.select_multiple_modifier+"Key"],k=d.select_range_modifier!==!1&&c&&c[d.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==a[0]&&this.data.ui.last_selected.parent()[0]===a.parent()[0],i=this.is_selected(a),m=!0,l=this;if(b){if(d.disable_selecting_children&&h&&(a.parentsUntil(".jstree","li").children("a.jstree-clicked").length||a.children("ul").find("a.jstree-clicked:eq(0)").length))return!1;m=!1;switch(!0){case k:this.data.ui.last_selected.addClass("jstree-last-selected");
|
50
|
+
a=a[a.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf();d.select_limit==-1||a.length<d.select_limit?(this.data.ui.last_selected.removeClass("jstree-last-selected"),this.data.ui.selected.each(function(){this!==l.data.ui.last_selected[0]&&l.deselect_node(this)}),i=!1,m=!0):m=!1;break;case i&&!h:this.deselect_all();i=!1;m=!0;break;case !i&&!h:if(d.select_limit==-1||d.select_limit>0)this.deselect_all(),m=!0;break;case i&&h:this.deselect_node(a);break;
|
51
|
+
case !i&&h:if(d.select_limit==-1||this.data.ui.selected.length+1<=d.select_limit)m=!0}}if(m&&!i){if(!k)this.data.ui.last_selected=a;a.children("a").addClass("jstree-clicked");d.selected_parent_open&&a.parents(".jstree-closed").each(function(){l.open_node(this,!1,!0)});this.data.ui.selected=this.data.ui.selected.add(a);this._fix_scroll(a.eq(0));this.__callback({obj:a,e:c})}},_fix_scroll:function(b){var c=this.get_container()[0];if(c.scrollHeight>c.offsetHeight&&(b=this._get_node(b))&&!(b===-1||!b.length||
|
52
|
+
!b.is(":visible"))){b=b.offset().top-this.get_container().offset().top;if(b<0)c.scrollTop=c.scrollTop+b-1;if(b+this.data.core.li_height+(c.scrollWidth>c.offsetWidth?a:0)>c.offsetHeight)c.scrollTop+=b-c.offsetHeight+this.data.core.li_height+1+(c.scrollWidth>c.offsetWidth?a:0)}},deselect_node:function(a){a=this._get_node(a);if(!a.length)return!1;if(this.is_selected(a)){a.children("a").removeClass("jstree-clicked");this.data.ui.selected=this.data.ui.selected.not(a);if(this.data.ui.last_selected.get(0)===
|
53
|
+
a.get(0))this.data.ui.last_selected=this.data.ui.selected.eq(0);this.__callback({obj:a})}},toggle_select:function(a){a=this._get_node(a);if(!a.length)return!1;this.is_selected(a)?this.deselect_node(a):this.select_node(a)},is_selected:function(a){return this.data.ui.selected.index(this._get_node(a))>=0},get_selected:function(a){return a?c(a).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(a){a=a?c(a).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();
|
54
|
+
a.children("a.jstree-clicked").removeClass("jstree-clicked");this.data.ui.selected=c([]);this.data.ui.last_selected=!1;this.__callback({obj:a})}}});c.jstree.defaults.plugins.push("ui")})(jQuery);(function(c){c.jstree.plugin("crrm",{__init:function(){this.get_container().bind("move_node.jstree",c.proxy(function(a,b){if(this._get_settings().crrm.move.open_onmove){var c=this;b.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function(){c.open_node(this,!1,!0)})}},this))},defaults:{input_width_limit:200,
|
55
|
+
move:{always_copy:!1,open_onmove:!0,default_position:"last",check_move:function(){return!0}}},_fn:{_show_input:function(a,b){var a=this._get_node(a),d=this._get_settings().core.rtl,e=this._get_settings().crrm.input_width_limit,f=a.children("ins").width(),g=a.find("> a:visible > ins").width()*a.find("> a:visible > ins").length,j=this.get_text(a),h=c("<div />",{css:{position:"absolute",top:"-200px",left:d?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),k=a.css("position","relative").append(c("<input />",
|
56
|
+
{value:j,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver",position:"absolute",left:d?"auto":f+g+4+"px",right:d?f+g+4+"px":"auto",top:"0px",height:this.data.core.li_height-2+"px",lineHeight:this.data.core.li_height-2+"px",width:"150px"},blur:c.proxy(function(){var c=a.children(".jstree-rename-input"),d=c.val();d===""&&(d=j);h.remove();c.remove();this.set_text(a,j);this.rename_node(a,d);b.call(this,a,d,j);a.css("position","")},this),keyup:function(a){a=a.keyCode||a.which;a==
|
57
|
+
27?(this.value=j,this.blur()):a==13?this.blur():k.width(Math.min(h.text("pW"+this.value).width(),e))},keypress:function(a){if((a.keyCode||a.which)==13)return!1}})).children(".jstree-rename-input");this.set_text(a,"");h.css({fontFamily:k.css("fontFamily")||"",fontSize:k.css("fontSize")||"",fontWeight:k.css("fontWeight")||"",fontStyle:k.css("fontStyle")||"",fontStretch:k.css("fontStretch")||"",fontVariant:k.css("fontVariant")||"",letterSpacing:k.css("letterSpacing")||"",wordSpacing:k.css("wordSpacing")||
|
58
|
+
""});k.width(Math.min(h.text("pW"+k[0].value).width(),e))[0].select()},rename:function(a){a=this._get_node(a);this.__rollback();var b=this.__callback;this._show_input(a,function(a,c,f){b.call(this,{obj:a,new_name:c,old_name:f})})},create:function(a,b,d,e,f){var g=this;(a=this._get_node(a))||(a=-1);this.__rollback();return this.create_node(a,b,d,function(a){var b=this._get_parent(a),d=c(a).index();e&&e.call(this,a);b.length&&b.hasClass("jstree-closed")&&this.open_node(b,!1,!0);f?g.__callback({obj:a,
|
59
|
+
name:this.get_text(a),parent:b,position:d}):this._show_input(a,function(a,c){g.__callback({obj:a,name:c,parent:b,position:d})})})},remove:function(a){var a=this._get_node(a,!0),b=this._get_parent(a),c=this._get_prev(a);this.__rollback();a=this.delete_node(a);a!==!1&&this.__callback({obj:a,prev:c,parent:b})},check_move:function(){return!this.__call_old()?!1:!this._get_settings().crrm.move.check_move.call(this,this._get_move())?!1:!0},move_node:function(a,b,c,e,f,g){var j=this._get_settings().crrm.move;
|
60
|
+
if(!f){if(typeof c==="undefined")c=j.default_position;if(c==="inside"&&!j.default_position.match(/^(before|after)$/))c=j.default_position;return this.__call_old(!0,a,b,c,e,!1,g)}if(j.always_copy===!0||j.always_copy==="multitree"&&a.rt.get_index()!==a.ot.get_index())e=!0;this.__call_old(!0,a,b,c,e,!0,g)},cut:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;this.data.crrm.cp_nodes=!1;this.data.crrm.ct_nodes=a;this.__callback({obj:a})},copy:function(a){a=this._get_node(a,!0);if(!a||!a.length)return!1;
|
61
|
+
this.data.crrm.ct_nodes=!1;this.data.crrm.cp_nodes=a;this.__callback({obj:a})},paste:function(a){a=this._get_node(a);if(!a||!a.length)return!1;var b=this.data.crrm.ct_nodes?this.data.crrm.ct_nodes:this.data.crrm.cp_nodes;if(!this.data.crrm.ct_nodes&&!this.data.crrm.cp_nodes)return!1;if(this.data.crrm.ct_nodes)this.move_node(this.data.crrm.ct_nodes,a),this.data.crrm.ct_nodes=!1;this.data.crrm.cp_nodes&&this.move_node(this.data.crrm.cp_nodes,a,!1,!0);this.__callback({obj:a,nodes:b})}}})})(jQuery);(function(c){var a=
|
62
|
+
[];c.jstree._themes=!1;c.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",c.proxy(function(){var a=this._get_settings().themes;this.data.themes.dots=a.dots;this.data.themes.icons=a.icons;this.set_theme(a.theme,a.url)},this)).bind("loaded.jstree",c.proxy(function(){this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons()},this))},defaults:{theme:"default",url:!1,dots:!0,icons:!0},_fn:{set_theme:function(b,d){if(!b)return!1;
|
63
|
+
d||(d=c.jstree._themes+b+".css");c.inArray(d,a)==-1&&(c.vakata.css.add_sheet({url:d}),a.push(d));if(this.data.themes.theme!=b)this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=b;this.get_container().addClass("jstree-"+b);this.data.themes.dots?this.show_dots():this.hide_dots();this.data.themes.icons?this.show_icons():this.hide_icons();this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=!0;this.get_container().children("ul").removeClass("jstree-no-dots")},
|
64
64
|
hide_dots:function(){this.data.themes.dots=!1;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this.data.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this.data.themes.icons=!0;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=!1;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()}}});
|
65
65
|
c(function(){if(c.jstree._themes===!1)c.jstree._themes="/stylesheets/compiled/jquery/jstree/"});c.jstree.defaults.plugins.push("themes")})(jQuery);(function(c){var a=[];c.jstree.plugin("hotkeys",{__init:function(){if(typeof c.hotkeys==="undefined")throw"jsTree hotkeys: jQuery hotkeys plugin not included.";if(!this.data.ui)throw"jsTree hotkeys: jsTree UI plugin not included.";c.each(this._get_settings().hotkeys,function(b,d){d!==!1&&c.inArray(b,a)==-1&&(c(document).bind("keydown",b,function(a){var d;
|
66
66
|
var g=c.jstree._focused(),j;g&&g.data&&g.data.hotkeys&&g.data.hotkeys.enabled&&(j=g._get_settings().hotkeys[b])&&(d=j.call(g,a));return d}),a.push(b))});this.get_container().bind("lock.jstree",c.proxy(function(){if(this.data.hotkeys.enabled)this.data.hotkeys.enabled=!1,this.data.hotkeys.revert=!0},this)).bind("unlock.jstree",c.proxy(function(){if(this.data.hotkeys.revert)this.data.hotkeys.enabled=!0},this));this.enable_hotkeys()},defaults:{up:function(){this.hover_node(this._get_prev(this.data.ui.hovered||
|
@@ -70,33 +70,33 @@ this.data.ui.last_selected;a&&(a.hasClass("jstree-open")?this.close_node(a):this
|
|
70
70
|
this.data.ui.hovered||this.data.ui.last_selected;a&&a.length&&(a.hasClass("jstree-closed")?this.open_node(a):this.hover_node(this._get_next(a)));return!1},space:function(){this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").click();return!1},"ctrl+space":function(a){a.type="click";this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(a);return!1},"shift+space":function(a){a.type="click";this.data.ui.hovered&&this.data.ui.hovered.children("a:eq(0)").trigger(a);return!1},
|
71
71
|
f2:function(){this.rename(this.data.ui.hovered||this.data.ui.last_selected)},del:function(){this.remove(this.data.ui.hovered||this._get_node(null))}},_fn:{enable_hotkeys:function(){this.data.hotkeys.enabled=!0},disable_hotkeys:function(){this.data.hotkeys.enabled=!1}}})})(jQuery);(function(c){c.jstree.plugin("json_data",{__init:function(){this._get_settings().json_data.progressive_unload&&this.get_container().bind("after_close.jstree",function(a,b){b.rslt.obj.children("ul").remove()})},defaults:{data:!1,
|
72
72
|
ajax:!1,correct_state:!0,progressive_render:!1,progressive_unload:!1},_fn:{load_node:function(a,b,c){var e=this;this.load_node_json(a,function(){e.__callback({obj:e._get_node(a)});b.call(this)},c)},_is_loaded:function(a){var b=this._get_settings().json_data,a=this._get_node(a);return a==-1||!a||!b.ajax&&!b.progressive_render&&!c.isFunction(b.data)||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").length>0},refresh:function(a){var a=this._get_node(a),b=this._get_settings().json_data;
|
73
|
-
a&&a!==-1&&b.progressive_unload&&(c.isFunction(b.data)||b.ajax)&&a.removeData("
|
74
|
-
this.clean_node(a);b&&b.call(this)}else{if(a&&a!==-1)if(a.data("
|
75
|
-
b&&b.call(this)):(a===-1||!a?e.correct_state&&this.get_container().children("ul").empty():(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("
|
76
|
-
b&&b.call(this);break;case !e.data&&!!e.ajax||!!e.data&&!!e.ajax&&a&&a!==-1:g=function(b,
|
77
|
-
|
78
|
-
a.removeData("
|
79
|
-
f=0;for(g=a.length;f<g;f++)
|
80
|
-
"#";
|
81
|
-
e.data("
|
82
|
-
if(b.length)
|
83
|
-
l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length){n=!1;c.inArray("languages",g.plugins)!==-1&&c.isArray(g.languages)&&g.languages.length&&c.each(g.languages,function(a,
|
84
|
-
function(a,
|
85
|
-
if(
|
86
|
-
if(d!==!1)d.style.display="none";d=c.vakata.css.get_css(e+"."+a,!1,this.data.languages.language_css);if(d!==!1)d.style.display="";this.data.languages.current_language=a;this.__callback(a);return!0},get_lang:function(){return this.data.languages.current_language},_get_string:function(a,b){var d=this._get_settings().languages,e=this._get_settings().core.strings;c.isArray(d)&&d.length&&(b=b&&c.inArray(b,d)!=-1?b:this.data.languages.current_language);
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
{__init:function(){this.get_container().bind("load_node.jstree",c.proxy(function(a,
|
95
|
-
1:-1},_fn:{sort:function(a){var b=this._get_settings().sort,d=this;a.append(c.makeArray(a.children("li")).sort(c.proxy(b,d)));a.find("> li > ul").each(function(){d.sort(c(this))});this.clean_node(a)}}})})(jQuery);(function(c){var a=!1,b=!1,d=!1,e=!1,f=!1,g=!1,j=!1,
|
73
|
+
a&&a!==-1&&b.progressive_unload&&(c.isFunction(b.data)||b.ajax)&&a.removeData("jstree_children");return this.__call_old()},load_node_json:function(a,b,d){var e=this.get_settings().json_data,f,g=function(){};f=function(){};if((a=this._get_node(a))&&a!==-1&&(e.progressive_render||e.progressive_unload)&&!a.is(".jstree-open, .jstree-leaf")&&a.children("ul").children("li").length===0&&a.data("jstree_children")){if(f=this._parse_json(a.data("jstree_children"),a))a.append(f),e.progressive_unload||a.removeData("jstree_children");
|
74
|
+
this.clean_node(a);b&&b.call(this)}else{if(a&&a!==-1)if(a.data("jstree_is_loading"))return;else a.data("jstree_is_loading",!0);switch(!0){case !e.data&&!e.ajax:throw"Neither data nor ajax settings supplied.";case c.isFunction(e.data):e.data.call(this,a,c.proxy(function(c){(c=this._parse_json(c,a))?(a===-1||!a?this.get_container().children("ul").empty().append(c.children()):(a.append(c).children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading")),this.clean_node(a),
|
75
|
+
b&&b.call(this)):(a===-1||!a?e.correct_state&&this.get_container().children("ul").empty():(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),e.correct_state&&this.correct_state(a)),d&&d.call(this))},this));break;case !!e.data&&!e.ajax||!!e.data&&!!e.ajax&&(!a||a===-1):if(!a||a==-1)(f=this._parse_json(e.data,a))?(this.get_container().children("ul").empty().append(f.children()),this.clean_node()):e.correct_state&&this.get_container().children("ul").empty();
|
76
|
+
b&&b.call(this);break;case !e.data&&!!e.ajax||!!e.data&&!!e.ajax&&a&&a!==-1:g=function(c,b,f){var i=this.get_settings().json_data.ajax.error;i&&i.call(this,c,b,f);a!=-1&&a.length?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),b==="success"&&e.correct_state&&this.correct_state(a)):b==="success"&&e.correct_state&&this.get_container().children("ul").empty();d&&d.call(this)};e.ajax.context=this;e.ajax.error=g;e.ajax.success=function(d,f,k){var i=this.get_settings().json_data.ajax.success;
|
77
|
+
i&&(d=i.call(this,d,f,k)||d);if(d===""||d&&d.toString&&d.toString().replace(/^[\s\n]+$/,"")===""||!c.isArray(d)&&!c.isPlainObject(d))return g.call(this,k,f,"");(d=this._parse_json(d,a))?(a===-1||!a?this.get_container().children("ul").empty().append(d.children()):(a.append(d).children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading")),this.clean_node(a),b&&b.call(this)):a===-1||!a?e.correct_state&&(this.get_container().children("ul").empty(),b&&b.call(this)):(a.children("a.jstree-loading").removeClass("jstree-loading"),
|
78
|
+
a.removeData("jstree_is_loading"),e.correct_state&&(this.correct_state(a),b&&b.call(this)))};if(!e.ajax.dataType)e.ajax.dataType="json";if(c.isFunction(e.ajax.url))e.ajax.url=e.ajax.url.call(this,a);if(c.isFunction(e.ajax.data))e.ajax.data=e.ajax.data.call(this,a);c.ajax(e.ajax)}}},_parse_json:function(a,b,d){var e=!1,f=this._get_settings(),g=f.json_data,j=f.core.html_titles,h;if(!a)return e;g.progressive_unload&&b&&b!==-1&&b.data("jstree_children",e);if(c.isArray(a)){e=c();if(!a.length)return!1;
|
79
|
+
f=0;for(g=a.length;f<g;f++)h=this._parse_json(a[f],b,!0),h.length&&(e=e.add(h))}else{typeof a=="string"&&(a={data:a});if(!a.data&&a.data!=="")return e;e=c("<li />");a.attr&&e.attr(a.attr);a.metadata&&e.data(a.metadata);a.state&&e.addClass("jstree-"+a.state);if(!c.isArray(a.data))h=a.data,a.data=[],a.data.push(h);c.each(a.data,function(b,d){h=c("<a />");c.isFunction(d)&&(d=d.call(this,a));if(typeof d=="string")h.attr("href","#")[j?"html":"text"](d);else{if(!d.attr)d.attr={};if(!d.attr.href)d.attr.href=
|
80
|
+
"#";h.attr(d.attr)[j?"html":"text"](d.title);d.language&&h.addClass(d.language)}h.prepend("<ins class='jstree-icon'> </ins>");if(!d.icon&&a.icon)d.icon=a.icon;d.icon&&(d.icon.indexOf("/")===-1?h.children("ins").addClass(d.icon):h.children("ins").css("background","url('"+d.icon+"') center center no-repeat"));e.append(h)});e.prepend("<ins class='jstree-icon'> </ins>");a.children&&(g.progressive_render&&a.state!=="open"?e.addClass("jstree-closed").data("jstree_children",a.children):(g.progressive_unload&&
|
81
|
+
e.data("jstree_children",a.children),c.isArray(a.children)&&a.children.length&&(h=this._parse_json(a.children,b,!0),h.length&&(b=c("<ul />"),b.append(h),e.append(b)))))}d||(d=c("<ul />"),d.append(e),e=d);return e},get_json:function(a,b,d,e){var f=[],g=this._get_settings(),j=this,h,k,i,m,l,n,a=this._get_node(a);if(!a||a===-1)a=this.get_container().find("> ul > li");b=c.isArray(b)?b:["id","class"];!e&&this.data.types&&b.push(g.types.type_attr);d=c.isArray(d)?d:[];a.each(function(){i=c(this);h={data:[]};
|
82
|
+
if(b.length)h.attr={};c.each(b,function(a,c){(k=i.attr(c))&&k.length&&k.replace(/jstree[^ ]*/ig,"").length&&(h.attr[c]=(" "+k).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))});if(i.hasClass("jstree-open"))h.state="open";if(i.hasClass("jstree-closed"))h.state="closed";if(i.data())h.metadata=i.data();m=i.children("a");m.each(function(){l=c(this);if(d.length||c.inArray("languages",g.plugins)!==-1||l.children("ins").get(0).style.backgroundImage.length||l.children("ins").get(0).className&&
|
83
|
+
l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length){n=!1;c.inArray("languages",g.plugins)!==-1&&c.isArray(g.languages)&&g.languages.length&&c.each(g.languages,function(a,c){if(l.hasClass(c))return n=c,!1});k={attr:{},title:j.get_text(l,n)};c.each(d,function(a,c){k.attr[c]=(" "+(l.attr(c)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")});c.inArray("languages",g.plugins)!==-1&&c.isArray(g.languages)&&g.languages.length&&c.each(g.languages,
|
84
|
+
function(a,c){if(l.hasClass(c))return k.language=c,!0});if(l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length)k.icon=l.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");if(l.children("ins").get(0).style.backgroundImage.length)k.icon=l.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","")}else k=j.get_text(l);m.length>1?h.data.push(k):h.data=k});i=i.find("> ul > li");
|
85
|
+
if(i.length)h.children=j.get_json(i,b,d,!0);f.push(h)});return f}}})})(jQuery);(function(c){c.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(a){var b=this._get_settings().languages,d=!1,e=".jstree-"+this.get_index()+" a";if(!c.isArray(b)||b.length===0)return!1;if(c.inArray(a,b)==-1)if(b[a])a=b[a];else return!1;if(a==this.data.languages.current_language)return!0;d=c.vakata.css.get_css(e+"."+this.data.languages.current_language,!1,this.data.languages.language_css);
|
86
|
+
if(d!==!1)d.style.display="none";d=c.vakata.css.get_css(e+"."+a,!1,this.data.languages.language_css);if(d!==!1)d.style.display="";this.data.languages.current_language=a;this.__callback(a);return!0},get_lang:function(){return this.data.languages.current_language},_get_string:function(a,b){var d=this._get_settings().languages,e=this._get_settings().core.strings;c.isArray(d)&&d.length&&(b=b&&c.inArray(b,d)!=-1?b:this.data.languages.current_language);return e[b]&&e[b][a]?e[b][a]:e[a]?e[a]:a},get_text:function(a,
|
87
|
+
b){a=this._get_node(a)||this.data.ui.last_selected;if(!a.size())return!1;var d=this._get_settings().languages,e=this._get_settings().core.html_titles;c.isArray(d)&&d.length?(b=b&&c.inArray(b,d)!=-1?b:this.data.languages.current_language,a=a.children("a."+b)):a=a.children("a:eq(0)");return e?(a=a.clone(),a.children("INS").remove(),a.html()):(a=a.contents().filter(function(){return this.nodeType==3})[0],a.nodeValue)},set_text:function(a,b,d){a=this._get_node(a)||this.data.ui.last_selected;if(!a.size())return!1;
|
88
|
+
var e=this._get_settings().languages,f=this._get_settings().core.html_titles;c.isArray(e)&&e.length?(d=d&&c.inArray(d,e)!=-1?d:this.data.languages.current_language,a=a.children("a."+d)):a=a.children("a:eq(0)");return f?(e=a.children("INS").clone(),a.html(b).prepend(e),this.__callback({obj:a,name:b,lang:d}),!0):(a=a.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:a,name:b,lang:d}),a.nodeValue=b)},_load_css:function(){var a=this._get_settings().languages,b="/* languages css */",
|
89
|
+
d=".jstree-"+this.get_index()+" a",e;if(c.isArray(a)&&a.length){this.data.languages.current_language=a[0];for(e=0;e<a.length;e++)b+=d+"."+a[e]+" {",a[e]!=this.data.languages.current_language&&(b+=" display:none; "),b+=" } ";this.data.languages.language_css=c.vakata.css.add_sheet({str:b,title:"jstree-languages"})}},create_node:function(a,b,d,e){return this.__call_old(!0,a,b,d,function(a){var b=this._get_settings().languages,d=a.children("a"),h;if(c.isArray(b)&&b.length){for(h=0;h<b.length;h++)d.is("."+
|
90
|
+
b[h])||a.append(d.eq(0).clone().removeClass(b.join(" ")).addClass(b[h]));d.not("."+b.join(", .")).remove()}e&&e.call(this,a)})}}})})(jQuery);(function(c){c.jstree.plugin("cookies",{__init:function(){if(typeof c.cookie==="undefined")throw"jsTree cookie: jQuery cookie plugin not included.";var a=this._get_settings().cookies,b;if(a.save_loaded&&(b=c.cookie(a.save_loaded))&&b.length)this.data.core.to_load=b.split(",");if(a.save_opened&&(b=c.cookie(a.save_opened))&&b.length)this.data.core.to_open=b.split(",");
|
91
|
+
if(a.save_selected&&(b=c.cookie(a.save_selected))&&b.length&&this.data.ui)this.data.ui.to_select=b.split(",");this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",c.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",c.proxy(function(a){this._get_settings().cookies.auto_save&&this.save_cookie((a.handleObj.namespace+a.handleObj.type).replace("jstree",""))},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",
|
92
|
+
save_selected:"jstree_select",auto_save:!0,cookie_options:{}},_fn:{save_cookie:function(a){if(!this.data.core.refreshing){var b=this._get_settings().cookies;if(a)switch(a){case "open_node":case "close_node":b.save_opened&&(this.save_opened(),c.cookie(b.save_opened,this.data.core.to_open.join(","),b.cookie_options));b.save_loaded&&(this.save_loaded(),c.cookie(b.save_loaded,this.data.core.to_load.join(","),b.cookie_options));break;case "select_node":case "deselect_node":b.save_selected&&this.data.ui&&
|
93
|
+
(this.save_selected(),c.cookie(b.save_selected,this.data.ui.to_select.join(","),b.cookie_options))}else b.save_loaded&&(this.save_loaded(),c.cookie(b.save_loaded,this.data.core.to_load.join(","),b.cookie_options)),b.save_opened&&(this.save_opened(),c.cookie(b.save_opened,this.data.core.to_open.join(","),b.cookie_options)),b.save_selected&&this.data.ui&&(this.save_selected(),c.cookie(b.save_selected,this.data.ui.to_select.join(","),b.cookie_options))}}}})})(jQuery);(function(c){c.jstree.plugin("sort",
|
94
|
+
{__init:function(){this.get_container().bind("load_node.jstree",c.proxy(function(a,c){var d=this._get_node(c.rslt.obj),d=d===-1?this.get_container().children("ul"):d.children("ul");this.sort(d)},this)).bind("rename_node.jstree create_node.jstree create.jstree",c.proxy(function(a,c){this.sort(c.rslt.obj.parent())},this)).bind("move_node.jstree",c.proxy(function(a,c){this.sort((c.rslt.np==-1?this.get_container():c.rslt.np).children("ul"))},this))},defaults:function(a,c){return this.get_text(a)>this.get_text(c)?
|
95
|
+
1:-1},_fn:{sort:function(a){var b=this._get_settings().sort,d=this;a.append(c.makeArray(a.children("li")).sort(c.proxy(b,d)));a.find("> li > ul").each(function(){d.sort(c(this))});this.clean_node(a)}}})})(jQuery);(function(c){var a=!1,b=!1,d=!1,e=!1,f=!1,g=!1,j=!1,h=!1,k=!1;c.vakata.dnd={is_down:!1,is_drag:!1,helper:!1,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(a,b,d){c.vakata.dnd.is_drag&&c.vakata.drag_stop({});try{if(a.currentTarget.unselectable=
|
96
96
|
"on",a.currentTarget.onselectstart=function(){return!1},a.currentTarget.style)a.currentTarget.style.MozUserSelect="none"}catch(e){}c.vakata.dnd.init_x=a.pageX;c.vakata.dnd.init_y=a.pageY;c.vakata.dnd.user_data=b;c.vakata.dnd.is_down=!0;c.vakata.dnd.helper=c("<div id='vakata-dragged' />").html(d);c(document).bind("mousemove",c.vakata.dnd.drag);c(document).bind("mouseup",c.vakata.dnd.drag_stop);return!1},drag:function(a){if(c.vakata.dnd.is_down){if(!c.vakata.dnd.is_drag)if(Math.abs(a.pageX-c.vakata.dnd.init_x)>
|
97
97
|
5||Math.abs(a.pageY-c.vakata.dnd.init_y)>5)c.vakata.dnd.helper.appendTo("body"),c.vakata.dnd.is_drag=!0,c(document).triggerHandler("drag_start.vakata",{event:a,data:c.vakata.dnd.user_data});else return;if(a.type==="mousemove"){var b=c(document),d=b.scrollTop(),b=b.scrollLeft();a.pageY-d<20?(g&&j==="down"&&(clearInterval(g),g=!1),g||(j="up",g=setInterval(function(){c(document).scrollTop(c(document).scrollTop()-c.vakata.dnd.scroll_spd)},150))):g&&j==="up"&&(clearInterval(g),g=!1);c(window).height()-
|
98
|
-
(a.pageY-d)<20?(g&&j==="up"&&(clearInterval(g),g=!1),g||(j="down",g=setInterval(function(){c(document).scrollTop(c(document).scrollTop()+c.vakata.dnd.scroll_spd)},150))):g&&j==="down"&&(clearInterval(g),g=!1);a.pageX-b<20?(f&&
|
99
|
-
f=setInterval(function(){c(document).scrollLeft(c(document).scrollLeft()+c.vakata.dnd.scroll_spd)},150))):f&&
|
98
|
+
(a.pageY-d)<20?(g&&j==="up"&&(clearInterval(g),g=!1),g||(j="down",g=setInterval(function(){c(document).scrollTop(c(document).scrollTop()+c.vakata.dnd.scroll_spd)},150))):g&&j==="down"&&(clearInterval(g),g=!1);a.pageX-b<20?(f&&h==="right"&&(clearInterval(f),f=!1),f||(h="left",f=setInterval(function(){c(document).scrollLeft(c(document).scrollLeft()-c.vakata.dnd.scroll_spd)},150))):f&&h==="left"&&(clearInterval(f),f=!1);c(window).width()-(a.pageX-b)<20?(f&&h==="left"&&(clearInterval(f),f=!1),f||(h="right",
|
99
|
+
f=setInterval(function(){c(document).scrollLeft(c(document).scrollLeft()+c.vakata.dnd.scroll_spd)},150))):f&&h==="right"&&(clearInterval(f),f=!1)}c.vakata.dnd.helper.css({left:a.pageX+c.vakata.dnd.helper_left+"px",top:a.pageY+c.vakata.dnd.helper_top+"px"});c(document).triggerHandler("drag.vakata",{event:a,data:c.vakata.dnd.user_data})}},drag_stop:function(a){f&&clearInterval(f);g&&clearInterval(g);c(document).unbind("mousemove",c.vakata.dnd.drag);c(document).unbind("mouseup",c.vakata.dnd.drag_stop);
|
100
100
|
c(document).triggerHandler("drag_stop.vakata",{event:a,data:c.vakata.dnd.user_data});c.vakata.dnd.helper.remove();c.vakata.dnd.init_x=0;c.vakata.dnd.init_y=0;c.vakata.dnd.user_data={};c.vakata.dnd.is_down=!1;c.vakata.dnd.is_drag=!1}};c(function(){c.vakata.css.add_sheet({str:"#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ",title:"vakata"})});c.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:!1,
|
101
101
|
after:!1,inside:!1,before:!1,off:!1,prepared:!1,w:0,to1:!1,to2:!1,cof:!1,cw:!1,ch:!1,i1:!1,i2:!1,mto:!1};this.get_container().bind("mouseenter.jstree",c.proxy(function(b){c.vakata.dnd.is_drag&&c.vakata.dnd.user_data.jstree&&(this.data.themes&&(d.attr("class","jstree-"+this.data.themes.theme),e&&e.attr("class","jstree-"+this.data.themes.theme),c.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),b.currentTarget===b.target&&c.vakata.dnd.user_data.obj&&c(c.vakata.dnd.user_data.obj).length&&
|
102
102
|
c(c.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==b.target&&(b=c.jstree._reference(b.target),b.data.dnd.foreign?(b=b._get_settings().dnd.drag_check.call(this,{o:a,r:b.get_container(),is_root:!0}),(b===!0||b.inside===!0||b.before===!0||b.after===!0)&&c.vakata.dnd.helper.children("ins").attr("class","jstree-ok")):(b.prepare_move(a,b.get_container(),"last"),b.check_move()&&c.vakata.dnd.helper.children("ins").attr("class","jstree-ok"))))},this)).bind("mouseup.jstree",c.proxy(function(b){if(c.vakata.dnd.is_drag&&
|
@@ -117,49 +117,50 @@ this.data.core.li_height/3?["before","inside","after"]:this.data.dnd.w<=this.dat
|
|
117
117
|
"px",top:this.data.dnd.off.top-6+"px"}).show();e&&e.css({left:a+8+"px",top:this.data.dnd.off.top-1+"px"}).show();break;case "after":d.css({left:a+"px",top:this.data.dnd.off.top+this.data.core.li_height-6+"px"}).show();e&&e.css({left:a+8+"px",top:this.data.dnd.off.top+this.data.core.li_height-1+"px"}).show();break;case "inside":d.css({left:a+(f?-4:4)+"px",top:this.data.dnd.off.top+this.data.core.li_height/2-5+"px"}).show();e&&e.hide();break;default:d.hide(),e&&e.hide()}return k=b}},dnd_open:function(){this.data.dnd.to2=
|
118
118
|
!1;this.open_node(b,c.proxy(this.dnd_prepare,this),!0)},dnd_finish:function(c){this.data.dnd.foreign?(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside)&&this._get_settings().dnd.drag_finish.call(this,{o:a,r:b,p:k}):(this.dnd_prepare(),this.move_node(a,b,k,c[this._get_settings().dnd.copy_modifier+"Key"]));b=a=!1;d.hide();e&&e.hide()},dnd_enter:function(a){if(this.data.dnd.mto)clearTimeout(this.data.dnd.mto),this.data.dnd.mto=!1;var d=this._get_settings().dnd;this.data.dnd.prepared=!1;
|
119
119
|
b=this._get_node(a);d.check_timeout?(this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to1=setTimeout(c.proxy(this.dnd_prepare,this),d.check_timeout)):this.dnd_prepare();if(d.open_timeout){if(this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),b&&b.length&&b.hasClass("jstree-closed"))this.data.dnd.to2=setTimeout(c.proxy(this.dnd_open,this),d.open_timeout)}else b&&b.length&&b.hasClass("jstree-closed")&&this.dnd_open()},dnd_leave:function(a){this.data.dnd.after=!1;this.data.dnd.before=
|
120
|
-
!1;this.data.dnd.inside=!1;c.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");d.hide();e&&e.hide();if(b&&b[0]===a.target.parentNode){if(this.data.dnd.to1)clearTimeout(this.data.dnd.to1),this.data.dnd.to1=!1;if(this.data.dnd.to2)clearTimeout(this.data.dnd.to2),this.data.dnd.to2=!1}},start_drag:function(b,f){a=this._get_node(b);this.data.ui&&this.is_selected(a)&&(a=this._get_node(null,!0));var
|
121
|
-
this._get_settings().core.html_titles||(
|
120
|
+
!1;this.data.dnd.inside=!1;c.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");d.hide();e&&e.hide();if(b&&b[0]===a.target.parentNode){if(this.data.dnd.to1)clearTimeout(this.data.dnd.to1),this.data.dnd.to1=!1;if(this.data.dnd.to2)clearTimeout(this.data.dnd.to2),this.data.dnd.to2=!1}},start_drag:function(b,f){a=this._get_node(b);this.data.ui&&this.is_selected(a)&&(a=this._get_node(null,!0));var g=a.length>1?this._get_string("multiple_selection"):this.get_text(a),h=this.get_container();
|
121
|
+
this._get_settings().core.html_titles||(g=g.replace(/</ig,"<").replace(/>/ig,">"));c.vakata.dnd.drag_start(f,{jstree:!0,obj:a},"<ins class='jstree-icon'></ins>"+g);this.data.themes&&(d&&d.attr("class","jstree-"+this.data.themes.theme),e&&e.attr("class","jstree-"+this.data.themes.theme),c.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme));this.data.dnd.cof=h.offset();this.data.dnd.cw=parseInt(h.width(),10);this.data.dnd.ch=parseInt(h.height(),10);this.data.dnd.active=
|
122
122
|
!0}}});c(function(){c.vakata.css.add_sheet({str:"#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }",
|
123
123
|
title:"jstree"});d=c("<div />").attr({id:"jstree-marker"}).hide().html("»").bind("mouseleave mouseenter",function(a){d.hide();e.hide();a.preventDefault();a.stopImmediatePropagation();return!1}).appendTo("body");e=c("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(a){if(b&&b.length)return b.children("a").trigger(a),a.preventDefault(),a.stopImmediatePropagation(),!1}).bind("mouseleave",function(a){var f=c(a.relatedTarget);if((f.is(".jstree")||f.closest(".jstree").length===
|
124
124
|
0)&&b&&b.length)return b.children("a").trigger(a),d.hide(),e.hide(),a.preventDefault(),a.stopImmediatePropagation(),!1}).appendTo("body");c(document).bind("drag_start.vakata",function(a,b){b.data.jstree&&(d.show(),e&&e.show())});c(document).bind("drag_stop.vakata",function(a,b){b.data.jstree&&(d.hide(),e&&e.hide())})})})(jQuery);(function(c){c.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;if(this.data.ui&&this.data.checkbox.noui)this.select_node=
|
125
125
|
this.deselect_node=this.deselect_all=c.noop,this.get_selected=this.get_checked;this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",c.proxy(function(a,b){this._prepare_checkboxes(b.rslt.obj)},this)).bind("loaded.jstree",c.proxy(function(){this._prepare_checkboxes()},this)).delegate(this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox","click.jstree",c.proxy(function(a){a.preventDefault();this._get_node(a.target).hasClass("jstree-checked")?this.uncheck_node(a.target):
|
126
126
|
this.check_node(a.target);if(this.data.ui&&this.data.checkbox.noui)this.save_selected(),this.data.cookies&&this.save_cookie("select_node");else return a.stopImmediatePropagation(),!1},this))},defaults:{override_ui:!1,two_state:!1,real_checkboxes:!1,checked_parent_open:!0,real_checkboxes_names:function(a){return["check_"+(a[0].id||Math.ceil(Math.random()*1E4)),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},
|
127
127
|
_fn:{_checkbox_notify:function(a,b){b.checked&&this.check_node(a,!1)},_prepare_checkboxes:function(a){a=!a||a==-1?this.get_container().find("> ul > li"):this._get_node(a);if(a!==!1){var b,d=this,e,f=this._get_settings().checkbox.two_state,g=this._get_settings().checkbox.real_checkboxes,j=this._get_settings().checkbox.real_checkboxes_names;a.each(function(){e=c(this);b=e.is("li")&&(e.hasClass("jstree-checked")||g&&e.children(":checked").length)?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var a=
|
128
|
-
c(this),e;a.children("a"+(d.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(f?"jstree-unchecked":b);g&&(a.children(":checkbox").length?a.children(":checkbox").addClass("jstree-real-checkbox"):(e=j.call(d,a),a.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+e[0]+"' name='"+e[0]+"' value='"+e[1]+"' />"))
|
129
|
-
"checked"))
|
130
|
-
if(this._get_settings().checkbox.two_state)b?(a.removeClass("jstree-checked").addClass("jstree-unchecked"),e&&a.children(":checkbox").
|
131
|
-
a.find("li").andSelf();if(!d.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;d.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");e&&d.children(":checkbox").
|
132
|
-
e&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").
|
133
|
-
!1;else a.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),e&&a.children(":checkbox").
|
128
|
+
c(this),e;a.children("a"+(d.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(f?"jstree-unchecked":b);g&&(a.children(":checkbox").length?a.children(":checkbox").addClass("jstree-real-checkbox"):(e=j.call(d,a),a.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+e[0]+"' name='"+e[0]+"' value='"+e[1]+"' />")));f?(a.hasClass("jstree-checked")||a.children(":checked").length)&&
|
129
|
+
a.addClass("jstree-checked").children(":checkbox").prop("checked",!0):(b==="jstree-checked"||a.hasClass("jstree-checked")||a.children(":checked").length)&&a.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",!0)})});f||a.find(".jstree-checked").parent().parent().each(function(){d._repair_state(this)})}},change_state:function(a,b){var a=this._get_node(a),d=!1,e=this._get_settings().checkbox.real_checkboxes;if(!a||a===-1)return!1;b=b===!1||b===!0?b:a.hasClass("jstree-checked");
|
130
|
+
if(this._get_settings().checkbox.two_state)b?(a.removeClass("jstree-checked").addClass("jstree-unchecked"),e&&a.children(":checkbox").prop("checked",!1)):(a.removeClass("jstree-unchecked").addClass("jstree-checked"),e&&a.children(":checkbox").prop("checked",!0));else{if(b){d=a.find("li").andSelf();if(!d.filter(".jstree-checked, .jstree-undetermined").length)return!1;d.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");e&&d.children(":checkbox").prop("checked",!1)}else{d=
|
131
|
+
a.find("li").andSelf();if(!d.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;d.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");e&&d.children(":checkbox").prop("checked",!0);if(this.data.ui)this.data.ui.last_selected=a;this.data.checkbox.last_selected=a}a.parentsUntil(".jstree","li").each(function(){var a=c(this);if(b)if(a.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
|
132
|
+
e&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",!1),!1;else a.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),e&&a.children(":checkbox").prop("checked",!1);else if(a.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),e&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",
|
133
|
+
!1),!1;else a.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),e&&a.children(":checkbox").prop("checked",!0)})}if(this.data.ui&&this.data.checkbox.noui)this.data.ui.selected=this.get_checked();this.__callback(a);return!0},check_node:function(a){if(this.change_state(a,!1)){a=this._get_node(a);if(this._get_settings().checkbox.checked_parent_open){var b=this;a.parents(".jstree-closed").each(function(){b.open_node(this,!1,!0)})}this.__callback({obj:a})}},uncheck_node:function(a){this.change_state(a,
|
134
134
|
!0)&&this.__callback({obj:this._get_node(a)})},check_all:function(){var a=this;(this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,!1)});this.__callback()},uncheck_all:function(){var a=this;(this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,!0)});this.__callback()},is_checked:function(a){a=this._get_node(a);
|
135
135
|
return a.length?a.is(".jstree-checked"):!1},get_checked:function(a,b){a=!a||a===-1?this.get_container():this._get_node(a);return b||this._get_settings().checkbox.two_state?a.find(".jstree-checked"):a.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(a,b){a=!a||a===-1?this.get_container():this._get_node(a);return b||this._get_settings().checkbox.two_state?a.find(".jstree-unchecked"):a.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},
|
136
|
-
show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(a){a=this._get_node(a);if(a.length)
|
137
|
-
0?this.change_state(a,!0):c===f?this.change_state(a,!1):(a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),b&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").
|
138
|
-
"\\.")});this.deselect_all();c.each(b,function(b,c){a.check_node(c)});this.__callback()}else this.__call_old()},save_loaded:function(){var a=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&a.data.core.to_load.push("#"+this.id)})}}});
|
139
|
-
document.createElement("xml"),
|
140
|
-
"text/xml"));if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!=="undefined"){
|
141
|
-
(g.
|
142
|
-
flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/">\t<ul>\t<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">\t\t<xsl:call-template name="nodes">\t\t\t<xsl:with-param name="node" select="." />\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t</xsl:call-template>\t</xsl:for-each>\t</ul></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<xsl:param name="is_last" />\t<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />\t<li>\t<xsl:attribute name="class">\t\t<xsl:if test="$is_last = true()">jstree-last </xsl:if>\t\t<xsl:choose>\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t</xsl:choose>\t\t<xsl:value-of select="@class" />\t</xsl:attribute>\t<xsl:for-each select="@*">\t\t<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t</xsl:if>\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text> </xsl:text></ins>\t<xsl:for-each select="content/name">\t\t<a>\t\t<xsl:attribute name="href">\t\t\t<xsl:choose>\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t</xsl:choose>\t\t</xsl:attribute>\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t<xsl:for-each select="@*">\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t</xsl:if>\t\t</xsl:for-each>\t\t\t<ins>\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t<xsl:text> </xsl:text>\t\t\t</ins>\t\t\t<xsl:copy-of select="./child::node()" />\t\t</a>\t</xsl:for-each>\t<xsl:if test="$children">\t\t<ul>\t\t<xsl:for-each select="//item[@parent_id=$node/attribute::id]">\t\t\t<xsl:call-template name="nodes">\t\t\t\t<xsl:with-param name="node" select="." />\t\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t\t</xsl:call-template>\t\t</xsl:for-each>\t\t</ul>\t</xsl:if>\t</li></xsl:template></xsl:stylesheet>'}
|
143
|
-
c.jstree.plugin("xml_data",{defaults:{data:!1,ajax:!1,xsl:"flat",clean_node:!1,correct_state:!0,get_skip_empty:!1},_fn:{load_node:function(a,c
|
144
|
-
g=function(){},
|
145
|
-
a.append(
|
146
|
-
""),
|
147
|
-
|
148
|
-
(a.children("a.jstree-loading").removeClass("jstree-loading"),a.append(
|
149
|
-
a);if(c.isFunction(
|
150
|
-
|
151
|
-
-1&&c.each(
|
152
|
-
"").replace(/ $/,"")+'"');
|
153
|
-
|
154
|
-
function(){
|
155
|
-
|
156
|
-
(this.data.
|
157
|
-
|
158
|
-
!0;c.
|
159
|
-
c.vakata.context.
|
160
|
-
|
161
|
-
|
162
|
-
"");d+="
|
136
|
+
show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(a){a=this._get_node(a);if(a.length)if(this._get_settings().checkbox.two_state)a.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",!0);else{var b=this._get_settings().checkbox.real_checkboxes,
|
137
|
+
c=a.find("> ul > .jstree-checked").length,e=a.find("> ul > .jstree-undetermined").length,f=a.find("> ul > li").length;f===0?a.hasClass("jstree-undetermined")&&this.change_state(a,!1):c===0&&e===0?this.change_state(a,!0):c===f?this.change_state(a,!1):(a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),b&&a.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",!1))}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var a=
|
138
|
+
this,b=this.data.ui.to_select,b=c.map(c.makeArray(b),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();c.each(b,function(b,c){a.check_node(c)});this.__callback()}else this.__call_old()},save_loaded:function(){var a=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&a.data.core.to_load.push("#"+this.id)})}}});
|
139
|
+
c(function(){c.vakata.css.add_sheet({str:".jstree .jstree-real-checkbox { display:none; } ",title:"jstree"})})})(jQuery);(function(c){c.vakata.xslt=function(a,b,f){var g="",j;if(document.recalc)return j=document.createElement("xml"),g=document.createElement("xml"),j.innerHTML=a,g.innerHTML=b,c("body").append(j).append(g),setTimeout(function(a,b,d){return function(){d.call(null,a.transformNode(b.XMLDocument));setTimeout(function(a,b){return function(){c(a).remove();c(b).remove()}}(a,b),200)}}(j,g,
|
140
|
+
f),100),!0;typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor==="undefined"&&(a=(new DOMParser).parseFromString(a,"text/xml"),b=(new DOMParser).parseFromString(b,"text/xml"));if(typeof window.DOMParser!=="undefined"&&typeof window.XMLHttpRequest!=="undefined"&&typeof window.XSLTProcessor!=="undefined"){j=new XSLTProcessor;g=c.isFunction(j.transformDocument)?typeof window.XMLSerializer!=="undefined":!0;if(!g)return!1;a=(new DOMParser).parseFromString(a,
|
141
|
+
"text/xml");b=(new DOMParser).parseFromString(b,"text/xml");c.isFunction(j.transformDocument)?(g=document.implementation.createDocument("","",null),j.transformDocument(a,b,g,null),f.call(null,(new XMLSerializer).serializeToString(g))):(j.importStylesheet(b),g=j.transformToFragment(a,document),f.call(null,c("<div />").append(g).html()));return!0}return!1};var a={nest:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/">\t<xsl:call-template name="nodes">\t\t<xsl:with-param name="node" select="/root" />\t</xsl:call-template></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<ul>\t<xsl:for-each select="$node/item">\t\t<xsl:variable name="children" select="count(./item) > 0" />\t\t<li>\t\t\t<xsl:attribute name="class">\t\t\t\t<xsl:if test="position() = last()">jstree-last </xsl:if>\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t\t\t</xsl:choose>\t\t\t\t<xsl:value-of select="@class" />\t\t\t</xsl:attribute>\t\t\t<xsl:for-each select="@*">\t\t\t\t<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t</xsl:if>\t\t\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text> </xsl:text></ins>\t\t\t<xsl:for-each select="content/name">\t\t\t\t<a>\t\t\t\t<xsl:attribute name="href">\t\t\t\t\t<xsl:choose>\t\t\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t\t\t</xsl:choose>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t\t\t<xsl:for-each select="@*">\t\t\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t\t\t</xsl:if>\t\t\t\t</xsl:for-each>\t\t\t\t\t<ins>\t\t\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t\t\t</xsl:attribute>\t\t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t\t\t<xsl:text> </xsl:text>\t\t\t\t\t</ins>\t\t\t\t\t<xsl:copy-of select="./child::node()" />\t\t\t\t</a>\t\t\t</xsl:for-each>\t\t\t<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>\t\t</li>\t</xsl:for-each>\t</ul></xsl:template></xsl:stylesheet>',
|
142
|
+
flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/">\t<ul>\t<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">\t\t<xsl:call-template name="nodes">\t\t\t<xsl:with-param name="node" select="." />\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t</xsl:call-template>\t</xsl:for-each>\t</ul></xsl:template><xsl:template name="nodes">\t<xsl:param name="node" />\t<xsl:param name="is_last" />\t<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />\t<li>\t<xsl:attribute name="class">\t\t<xsl:if test="$is_last = true()">jstree-last </xsl:if>\t\t<xsl:choose>\t\t\t<xsl:when test="@state = \'open\'">jstree-open </xsl:when>\t\t\t<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>\t\t\t<xsl:otherwise>jstree-leaf </xsl:otherwise>\t\t</xsl:choose>\t\t<xsl:value-of select="@class" />\t</xsl:attribute>\t<xsl:for-each select="@*">\t\t<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t</xsl:if>\t</xsl:for-each>\t<ins class="jstree-icon"><xsl:text> </xsl:text></ins>\t<xsl:for-each select="content/name">\t\t<a>\t\t<xsl:attribute name="href">\t\t\t<xsl:choose>\t\t\t<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>\t\t\t<xsl:otherwise>#</xsl:otherwise>\t\t\t</xsl:choose>\t\t</xsl:attribute>\t\t<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>\t\t<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>\t\t<xsl:for-each select="@*">\t\t\t<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">\t\t\t\t<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>\t\t\t</xsl:if>\t\t</xsl:for-each>\t\t\t<ins>\t\t\t\t<xsl:attribute name="class">jstree-icon \t\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>\t\t\t\t</xsl:attribute>\t\t\t\t<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>\t\t\t\t<xsl:text> </xsl:text>\t\t\t</ins>\t\t\t<xsl:copy-of select="./child::node()" />\t\t</a>\t</xsl:for-each>\t<xsl:if test="$children">\t\t<ul>\t\t<xsl:for-each select="//item[@parent_id=$node/attribute::id]">\t\t\t<xsl:call-template name="nodes">\t\t\t\t<xsl:with-param name="node" select="." />\t\t\t\t<xsl:with-param name="is_last" select="number(position() = last())" />\t\t\t</xsl:call-template>\t\t</xsl:for-each>\t\t</ul>\t</xsl:if>\t</li></xsl:template></xsl:stylesheet>'},
|
143
|
+
b=function(a){return a.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};c.jstree.plugin("xml_data",{defaults:{data:!1,ajax:!1,xsl:"flat",clean_node:!1,correct_state:!0,get_skip_empty:!1,get_include_preamble:!0},_fn:{load_node:function(a,b,c){var g=this;this.load_node_xml(a,function(){g.__callback({obj:g._get_node(a)});b.call(this)},c)},_is_loaded:function(a){var b=this._get_settings().xml_data,a=this._get_node(a);return a==-1||
|
144
|
+
!a||!b.ajax&&!c.isFunction(b.data)||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").size()>0},load_node_xml:function(a,b,f){var g=this.get_settings().xml_data,j=function(){},h=function(){};if((a=this._get_node(a))&&a!==-1)if(a.data("jstree_is_loading"))return;else a.data("jstree_is_loading",!0);switch(!0){case !g.data&&!g.ajax:throw"Neither data nor ajax settings supplied.";case c.isFunction(g.data):g.data.call(this,a,c.proxy(function(f){this.parse_xml(f,c.proxy(function(f){f&&
|
145
|
+
(f=f.replace(/ ?xmlns="[^"]*"/ig,""),f.length>10?(f=c(f),a===-1||!a?this.get_container().children("ul").empty().append(f.children()):(a.children("a.jstree-loading").removeClass("jstree-loading"),a.append(f),a.removeData("jstree_is_loading")),g.clean_node&&this.clean_node(a),b&&b.call(this)):a&&a!==-1?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),g.correct_state&&(this.correct_state(a),b&&b.call(this))):g.correct_state&&(this.get_container().children("ul").empty(),
|
146
|
+
b&&b.call(this)))},this))},this));break;case !!g.data&&!g.ajax||!!g.data&&!!g.ajax&&(!a||a===-1):(!a||a==-1)&&this.parse_xml(g.data,c.proxy(function(f){f?(f=f.replace(/ ?xmlns="[^"]*"/ig,""),f.length>10&&(f=c(f),this.get_container().children("ul").empty().append(f.children()),g.clean_node&&this.clean_node(a),b&&b.call(this))):g.correct_state&&(this.get_container().children("ul").empty(),b&&b.call(this))},this));break;case !g.data&&!!g.ajax||!!g.data&&!!g.ajax&&a&&a!==-1:j=function(b,c,e){var h=this.get_settings().xml_data.ajax.error;
|
147
|
+
h&&h.call(this,b,c,e);a!==-1&&a.length?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),c==="success"&&g.correct_state&&this.correct_state(a)):c==="success"&&g.correct_state&&this.get_container().children("ul").empty();f&&f.call(this)};g.ajax.context=this;g.ajax.error=j;g.ajax.success=function(f,h,m){var f=m.responseText,l=this.get_settings().xml_data.ajax.success;l&&(f=l.call(this,f,h,m)||f);if(f===""||f&&f.toString&&f.toString().replace(/^[\s\n]+$/,
|
148
|
+
"")==="")return j.call(this,m,h,"");this.parse_xml(f,c.proxy(function(f){f&&(f=f.replace(/ ?xmlns="[^"]*"/ig,""),f.length>10?(f=c(f),a===-1||!a?this.get_container().children("ul").empty().append(f.children()):(a.children("a.jstree-loading").removeClass("jstree-loading"),a.append(f),a.removeData("jstree_is_loading")),g.clean_node&&this.clean_node(a),b&&b.call(this)):a&&a!==-1?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),g.correct_state&&(this.correct_state(a),
|
149
|
+
b&&b.call(this))):g.correct_state&&(this.get_container().children("ul").empty(),b&&b.call(this)))},this))};if(!g.ajax.dataType)g.ajax.dataType="xml";if(c.isFunction(g.ajax.url))g.ajax.url=g.ajax.url.call(this,a);if(c.isFunction(g.ajax.data))g.ajax.data=g.ajax.data.call(this,a);c.ajax(g.ajax)}},parse_xml:function(b,e){var f=this._get_settings().xml_data;c.vakata.xslt(b,a[f.xsl],e)},get_xml:function(a,e,f,g,j){var h="",k=this._get_settings(),i=this,m,l,n,o,p;a||(a="flat");j||(j=0);e=this._get_node(e);
|
150
|
+
if(!e||e===-1)e=this.get_container().find("> ul > li");f=c.isArray(f)?f:["id","class"];!j&&this.data.types&&c.inArray(k.types.type_attr,f)===-1&&f.push(k.types.type_attr);g=c.isArray(g)?g:[];j||(k.xml_data.get_include_preamble&&(h+='<?xml version="1.0" encoding="UTF-8"?>'),h+="<root>");e.each(function(){h+="<item";n=c(this);c.each(f,function(a,c){var d=n.attr(c);if(!k.xml_data.get_skip_empty||typeof d!=="undefined")h+=" "+c+'="'+b((" "+(d||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,
|
151
|
+
"").replace(/ $/,""))+'"'});n.hasClass("jstree-open")&&(h+=' state="open"');n.hasClass("jstree-closed")&&(h+=' state="closed"');a==="flat"&&(h+=' parent_id="'+b(j)+'"');h+=">";h+="<content>";o=n.children("a");o.each(function(){m=c(this);p=!1;h+="<name";c.inArray("languages",k.plugins)!==-1&&c.each(k.languages,function(a,c){if(m.hasClass(c))return h+=' lang="'+b(c)+'"',p=c,!1});g.length&&c.each(g,function(a,c){var d=m.attr(c);if(!k.xml_data.get_skip_empty||typeof d!=="undefined")h+=" "+c+'="'+b((" "+
|
152
|
+
d||"").replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"'});m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length&&(h+=' icon="'+b(m.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))+'"');m.children("ins").get(0).style.backgroundImage.length&&(h+=' icon="'+b(m.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,
|
153
|
+
"").replace(/"/ig,""))+'"');h+=">";h+="<![CDATA["+i.get_text(m,p)+"]]\>";h+="</name>"});h+="</content>";l=n[0].id||!0;n=n.find("> ul > li");l=n.length?i.get_xml(a,n,f,g,l):"";a=="nest"&&(h+=l);h+="</item>";a=="flat"&&(h+=l)});j||(h+="</root>");return h}}})})(jQuery);(function(c){c.expr[":"].jstree_contains=function(a,b,c){return(a.textContent||a.innerText||"").toLowerCase().indexOf(c[3].toLowerCase())>=0};c.expr[":"].jstree_title_contains=function(a,b,c){return(a.getAttribute("title")||"").toLowerCase().indexOf(c[3].toLowerCase())>=
|
154
|
+
0};c.jstree.plugin("search",{__init:function(){this.data.search.str="";this.data.search.result=c();this._get_settings().search.show_only_matches&&this.get_container().bind("search.jstree",function(a,b){c(this).children("ul").find("li").hide().removeClass("jstree-last");b.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){c(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){c(this).children("ul").find("li").css("display",
|
155
|
+
"").end().end().jstree("clean_node",-1)})},defaults:{ajax:!1,search_method:"jstree_contains",show_only_matches:!1},_fn:{search:function(a,b){if(c.trim(a)==="")this.clear_search();else{var d=this.get_settings().search,e=this,f=function(){},f=function(){};this.data.search.str=a;if(!b&&d.ajax!==!1&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0){this.search.supress_callback=!0;d.ajax.context=this;d.ajax.error=function(){};d.ajax.success=function(a,b,c){var d=this.get_settings().search.ajax.success;
|
156
|
+
d&&(a=d.call(this,a,b,c)||a);this.data.search.to_open=a;this._search_open()};if(c.isFunction(d.ajax.url))d.ajax.url=d.ajax.url.call(this,a);if(c.isFunction(d.ajax.data))d.ajax.data=d.ajax.data.call(this,a);if(!d.ajax.data)d.ajax.data={search_string:a};if(!d.ajax.dataType||/^json/.exec(d.ajax.dataType))d.ajax.dataType="json";c.ajax(d.ajax)}else this.data.search.result.length&&this.clear_search(),this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+
|
157
|
+
d.search_method+"("+this.data.search.str+")"),this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){e.open_node(this,!1,!0)}),this.__callback({nodes:this.data.search.result,str:a})}},clear_search:function(){this.data.search.result.removeClass("jstree-search");this.__callback(this.data.search.result);this.data.search.result=c()},_search_open:function(){var a=this,b=!0,d=[],e=[];if(this.data.search.to_open.length&&(c.each(this.data.search.to_open,function(a,
|
158
|
+
b){if(b=="#")return!0;c(b).length&&c(b).is(".jstree-closed")?d.push(b):e.push(b)}),d.length))this.data.search.to_open=e,c.each(d,function(b,c){a.open_node(c,function(){a._search_open(!0)})}),b=!1;b&&this.search(this.data.search.str,!0)}}})})(jQuery);(function(c){c.vakata.context={hide_on_mouseleave:!1,cnt:c("<div id='vakata-contextmenu' />"),vis:!1,tgt:!1,par:!1,func:!1,data:!1,rtl:!1,show:function(a,b,d,e,f,g,j){c.vakata.context.rtl=!!j;if(a=c.vakata.context.parse(a)){c.vakata.context.vis=!0;c.vakata.context.tgt=
|
159
|
+
b;c.vakata.context.par=g||b||null;c.vakata.context.data=f||null;c.vakata.context.cnt.html(a).css({visibility:"hidden",display:"block",left:0,top:0});if(c.vakata.context.hide_on_mouseleave)c.vakata.context.cnt.one("mouseleave",function(){c.vakata.context.hide()});f=c.vakata.context.cnt.height();g=c.vakata.context.cnt.width();d+g>c(document).width()&&(d=c(document).width()-(g+5),c.vakata.context.cnt.find("li > ul").addClass("right"));e+f>c(document).height()&&(e-=f+b[0].offsetHeight,c.vakata.context.cnt.find("li > ul").addClass("bottom"));
|
160
|
+
c.vakata.context.cnt.css({left:d,top:e}).find("li:has(ul)").bind("mouseenter",function(){var a=c(document).width(),b=c(document).height(),d=c(this).children("ul").show();a!==c(document).width()&&d.toggleClass("right");b!==c(document).height()&&d.toggleClass("bottom")}).bind("mouseleave",function(){c(this).children("ul").hide()}).end().css({visibility:"visible"}).show();c(document).triggerHandler("context_show.vakata")}},hide:function(){c.vakata.context.vis=!1;c.vakata.context.cnt.attr("class","").css({visibility:"hidden"});
|
161
|
+
c(document).triggerHandler("context_hide.vakata")},parse:function(a,b){if(!a)return!1;var d="",e=!1,f=!0;if(!b)c.vakata.context.func={};d+="<ul>";c.each(a,function(a,b){if(!b)return!0;c.vakata.context.func[a]=b.action;!f&&b.separator_before&&(d+="<li class='vakata-separator vakata-separator-before'></li>");f=!1;d+="<li class='"+(b._class||"")+(b._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ";b.icon&&b.icon.indexOf("/")===-1&&(d+=" class='"+b.icon+"' ");b.icon&&b.icon.indexOf("/")!==-1&&(d+=
|
162
|
+
" style='background:url("+b.icon+") center center no-repeat;' ");d+="> </ins><a href='#' rel='"+a+"'>";b.submenu&&(d+="<span style='float:"+(c.vakata.context.rtl?"left":"right")+";'>»</span>");d+=b.label+"</a>";b.submenu&&(e=c.vakata.context.parse(b.submenu,!0))&&(d+=e);d+="</li>";b.separator_after&&(d+="<li class='vakata-separator vakata-separator-after'></li>",f=!0)});d=d.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");d+="</ul>";c(document).triggerHandler("context_parse.vakata");
|
163
|
+
return d.length>10?d:!1},exec:function(a){return c.isFunction(c.vakata.context.func[a])?(c.vakata.context.func[a].call(c.vakata.context.data,c.vakata.context.par),!0):!1}};c(function(){c.vakata.css.add_sheet({str:"#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ",
|
163
164
|
title:"vakata"});c.vakata.context.cnt.delegate("a","click",function(a){a.preventDefault()}).delegate("a","mouseup",function(){!c(this).parent().hasClass("jstree-contextmenu-disabled")&&c.vakata.context.exec(c(this).attr("rel"))?c.vakata.context.hide():c(this).blur()}).delegate("a","mouseover",function(){c.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body");c(document).bind("mousedown",function(a){c.vakata.context.vis&&!c.contains(c.vakata.context.cnt[0],a.target)&&
|
164
165
|
c.vakata.context.hide()});typeof c.hotkeys!=="undefined"&&c(document).bind("keydown","up",function(a){if(c.vakata.context.vis){var b=c.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();b.length||(b=c.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last());b.addClass("vakata-hover");a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","down",function(a){if(c.vakata.context.vis){var b=
|
165
166
|
c.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();b.length||(b=c.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first());b.addClass("vakata-hover");a.stopImmediatePropagation();a.preventDefault()}}).bind("keydown","right",function(a){c.vakata.context.vis&&(c.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover"),
|
@@ -172,20 +173,20 @@ this._get_settings().types;this.data.types.attach_to=[];this.get_container().bin
|
|
172
173
|
g.icon.image+"); "),d+=g.icon.position?" background-position:"+g.icon.position+"; ":" background-position:0 0; ",d+="} "});d!==""&&c.vakata.css.add_sheet({str:d,title:"jstree-types"})},this)).bind("before.jstree",c.proxy(function(a,d){var e,f;if((e=(e=this._get_settings().types.use_data?this._get_node(d.args[0]):!1)&&e!==-1&&e.length?e.data("jstree"):!1)&&e.types&&e.types[d.func]===!1)return a.stopImmediatePropagation(),!1;if(c.inArray(d.func,this.data.types.attach_to)!==-1&&d.args[0]&&(d.args[0].tagName||
|
173
174
|
d.args[0].jquery))if(e=this._get_settings().types.types,f=this._get_type(d.args[0]),(e[f]&&typeof e[f][d.func]!=="undefined"||e["default"]&&typeof e["default"][d.func]!=="undefined")&&this._check(d.func,d.args[0])===!1)return a.stopImmediatePropagation(),!1},this));o&&this.get_container().bind("load_node.jstree set_type.jstree",c.proxy(function(a,d){var e=d&&d.rslt&&d.rslt.obj&&d.rslt.obj!==-1?this._get_node(d.rslt.obj).parent():this.get_container_ul(),f=!1,g=this._get_settings().types;c.each(g.types,
|
174
175
|
function(a,b){if(b.icon&&(b.icon.image||b.icon.position))f=a==="default"?e.find("li > a > .jstree-icon"):e.find("li["+g.type_attr+"='"+a+"'] > a > .jstree-icon"),b.icon.image&&f.css("backgroundImage","url("+b.icon.image+")"),f.css("backgroundPosition",b.icon.position||"0 0")})},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:!1,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(a,b){b.type&&this._get_settings().types.use_data&&
|
175
|
-
this.set_type(b.type,a)},_get_type:function(a){a=this._get_node(a);return!a||!a.length?!1:a.attr(this._get_settings().types.type_attr)||"default"},set_type:function(a,b){var b=this._get_node(b),c=!b.length||!a?!1:b.attr(this._get_settings().types.type_attr,a);c&&this.__callback({obj:b,type:a});return c},_check:function(a,b,d){var b=this._get_node(b),e=!1,f=this._get_type(b),g=0,j=this,
|
176
|
-
!1)&&k.types&&typeof k.types[a]!=="undefined"?e=k.types[a]:
|
177
|
-
0&&(g-(b+1)<e||e<0))e=g-(b+1);if(
|
178
|
-
-2&&d!==-1&&(g=a.cr===-1?this.get_container().find("> ul > li").not(a.o).length:a.cr.find("> ul > li").not(a.o).length,g+a.o.length>d))return!1;if(b.max_depth!==-2&&e!==-1){j=0;if(e===0)return!1;if(typeof a.o.d==="undefined"){for(b=a.o;b.length>0;)b=b.find("> ul > li"),j++;a.o.d=j}if(e-a.o.d<0)return!1}return!0},create_node:function(a,b,d,e,f,g){if(!g&&(f||this._is_loaded(a))){var j=typeof b=="string"&&b.match(/^before|after$/i)&&a!==-1?this._get_parent(a):this._get_node(a),
|
179
|
-
k=this._check("max_children",j),
|
176
|
+
this.set_type(b.type,a)},_get_type:function(a){a=this._get_node(a);return!a||!a.length?!1:a.attr(this._get_settings().types.type_attr)||"default"},set_type:function(a,b){var b=this._get_node(b),c=!b.length||!a?!1:b.attr(this._get_settings().types.type_attr,a);c&&this.__callback({obj:b,type:a});return c},_check:function(a,b,d){var b=this._get_node(b),e=!1,f=this._get_type(b),g=0,j=this,h=this._get_settings().types,k=!1;if(b===-1)if(h[a])e=h[a];else return;else{if(f===!1)return;(k=h.use_data?b.data("jstree"):
|
177
|
+
!1)&&k.types&&typeof k.types[a]!=="undefined"?e=k.types[a]:h.types[f]&&typeof h.types[f][a]!=="undefined"?e=h.types[f][a]:h.types["default"]&&typeof h.types["default"][a]!=="undefined"&&(e=h.types["default"][a])}c.isFunction(e)&&(e=e.call(this,b));a==="max_depth"&&b!==-1&&d!==!1&&h.max_depth!==-2&&e!==0&&b.children("a:eq(0)").parentsUntil(".jstree","li").each(function(b){if(h.max_depth!==-1&&h.max_depth-(b+1)<=0)return e=0,!1;g=b===0?e:j._check(a,this,!1);if(g!==-1&&g-(b+1)<=0)return e=0,!1;if(g>=
|
178
|
+
0&&(g-(b+1)<e||e<0))e=g-(b+1);if(h.max_depth>=0&&(h.max_depth-(b+1)<e||e<0))e=h.max_depth-(b+1)});return e},check_move:function(){if(!this.__call_old())return!1;var a=this._get_move(),b=a.rt._get_settings().types,d=a.rt._check("max_children",a.cr),e=a.rt._check("max_depth",a.cr),f=a.rt._check("valid_children",a.cr),g=0,j=1;if(f==="none")return!1;if(c.isArray(f)&&a.ot&&a.ot._get_type&&(a.o.each(function(){if(c.inArray(a.ot._get_type(this),f)===-1)return j=!1}),j===!1))return!1;if(b.max_children!==
|
179
|
+
-2&&d!==-1&&(g=a.cr===-1?this.get_container().find("> ul > li").not(a.o).length:a.cr.find("> ul > li").not(a.o).length,g+a.o.length>d))return!1;if(b.max_depth!==-2&&e!==-1){j=0;if(e===0)return!1;if(typeof a.o.d==="undefined"){for(b=a.o;b.length>0;)b=b.find("> ul > li"),j++;a.o.d=j}if(e-a.o.d<0)return!1}return!0},create_node:function(a,b,d,e,f,g){if(!g&&(f||this._is_loaded(a))){var j=typeof b=="string"&&b.match(/^before|after$/i)&&a!==-1?this._get_parent(a):this._get_node(a),h=this._get_settings().types,
|
180
|
+
k=this._check("max_children",j),i=this._check("max_depth",j),m=this._check("valid_children",j);typeof d==="string"&&(d={data:d});d||(d={});if(m==="none")return!1;if(c.isArray(m))if(!d.attr||!d.attr[h.type_attr]){if(!d.attr)d.attr={};d.attr[h.type_attr]=m[0]}else if(c.inArray(d.attr[h.type_attr],m)===-1)return!1;if(h.max_children!==-2&&k!==-1&&(j=j===-1?this.get_container().find("> ul > li").length:j.find("> ul > li").length,j+1>k))return!1;if(h.max_depth!==-2&&i!==-1&&i-1<0)return!1}return this.__call_old(!0,
|
180
181
|
a,b,d,e,f,g)}}})})(jQuery);(function(c){c.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(!0);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:!1,ajax:!1,correct_state:!0},_fn:{load_node:function(a,b,c){var e=this;this.load_node_html(a,function(){e.__callback({obj:e._get_node(a)});b.call(this)},c)},_is_loaded:function(a){a=
|
181
|
-
this._get_node(a);return a==-1||!a||!this._get_settings().html_data.ajax&&!c.isFunction(this._get_settings().html_data.data)||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").size()>0},load_node_html:function(a,b,d){var e,f=this.get_settings().html_data,g=function(){};e=function(){};if((a=this._get_node(a))&&a!==-1)if(a.data("
|
182
|
+
this._get_node(a);return a==-1||!a||!this._get_settings().html_data.ajax&&!c.isFunction(this._get_settings().html_data.data)||a.is(".jstree-open, .jstree-leaf")||a.children("ul").children("li").size()>0},load_node_html:function(a,b,d){var e,f=this.get_settings().html_data,g=function(){};e=function(){};if((a=this._get_node(a))&&a!==-1)if(a.data("jstree_is_loading"))return;else a.data("jstree_is_loading",!0);switch(!0){case c.isFunction(f.data):f.data.call(this,a,c.proxy(function(d){d&&d!==""&&d.toString&&
|
182
183
|
d.toString().replace(/^[\s\n]+$/,"")!==""?(d=c(d),d.is("ul")||(d=c("<ul />").append(d)),a==-1||!a?this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"):(a.children("a.jstree-loading").removeClass("jstree-loading"),a.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||
|
183
|
-
!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),a.removeData("
|
184
|
+
!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),a.removeData("jstree_is_loading")),this.clean_node(a),b&&b.call(this)):a&&a!==-1?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),f.correct_state&&(this.correct_state(a),b&&b.call(this))):f.correct_state&&(this.get_container().children("ul").empty(),b&&b.call(this))},
|
184
185
|
this));break;case !f.data&&!f.ajax:if(!a||a==-1)this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node();b&&b.call(this);break;case !!f.data&&!f.ajax||!!f.data&&!!f.ajax&&(!a||a===-1):if(!a||
|
185
186
|
a==-1)e=c(f.data),e.is("ul")||(e=c("<ul />").append(e)),this.get_container().children("ul").empty().append(e.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node();b&&b.call(this);break;case !f.data&&!!f.ajax||!!f.data&&!!f.ajax&&a&&a!==-1:a=this._get_node(a);g=function(b,
|
186
|
-
c,e){var
|
187
|
+
c,e){var g=this.get_settings().html_data.ajax.error;g&&g.call(this,b,c,e);a!=-1&&a.length?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),c==="success"&&f.correct_state&&this.correct_state(a)):c==="success"&&f.correct_state&&this.get_container().children("ul").empty();d&&d.call(this)};f.ajax.context=this;f.ajax.error=g;f.ajax.success=function(d,e,k){var i=this.get_settings().html_data.ajax.success;i&&(d=i.call(this,d,e,k)||d);if(d===""||d&&d.toString&&
|
187
188
|
d.toString().replace(/^[\s\n]+$/,"")==="")return g.call(this,k,e,"");d?(d=c(d),d.is("ul")||(d=c("<ul />").append(d)),a==-1||!a?this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"):(a.children("a.jstree-loading").removeClass("jstree-loading"),
|
188
|
-
a.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),a.removeData("
|
189
|
+
a.append(d).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),a.removeData("jstree_is_loading")),this.clean_node(a),b&&b.call(this)):a&&a!==-1?(a.children("a.jstree-loading").removeClass("jstree-loading"),a.removeData("jstree_is_loading"),f.correct_state&&(this.correct_state(a),b&&
|
189
190
|
b.call(this))):f.correct_state&&(this.get_container().children("ul").empty(),b&&b.call(this))};if(!f.ajax.dataType)f.ajax.dataType="html";if(c.isFunction(f.ajax.url))f.ajax.url=f.ajax.url.call(this,a);if(c.isFunction(f.ajax.data))f.ajax.data=f.ajax.data.call(this,a);c.ajax(f.ajax)}}}});c.jstree.defaults.plugins.push("html_data")})(jQuery);(function(c){c.jstree.plugin("themeroller",{__init:function(){var a=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a",
|
190
191
|
"mouseenter.jstree",function(b){c(b.currentTarget).hasClass("jstree-loading")||c(this).addClass(a.item_h)}).delegate("a","mouseleave.jstree",function(){c(this).removeClass(a.item_h)}).bind("init.jstree",c.proxy(function(a,c){c.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");this._themeroller(c.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",c.proxy(function(a,c){this._themeroller(c.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",
|
191
192
|
c.proxy(function(){this._themeroller()},this)).bind("close_node.jstree",c.proxy(function(a,c){this._themeroller(c.rslt.obj)},this)).bind("delete_node.jstree",c.proxy(function(a,c){this._themeroller(c.rslt.parent)},this)).bind("correct_state.jstree",c.proxy(function(b,c){c.rslt.obj.children("ins.jstree-icon").removeClass(a.opened+" "+a.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return this.className.toString().replace(a.item_clsd,"").replace(a.item_open,"").replace(a.item_leaf,
|
@@ -197,23 +198,23 @@ b.item_open).addClass(b.item_clsd||"jstree-no-icon").end().end().end().end().fin
|
|
197
198
|
item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}});c(function(){c.vakata.css.add_sheet({str:".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }",title:"jstree"})})})(jQuery);(function(c){c.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",c.proxy(function(a,b){var d=[],e=!0,f;b.func=="move_node"&&b.args[4]===!0&&b.args[0].o&&b.args[0].o.length&&(b.args[0].o.children("a").each(function(){d.push(c(this).text().replace(/^\s+/g,
|
198
199
|
""))}),e=this._check_unique(d,b.args[0].np.find("> ul > li").not(b.args[0].o),"move_node"));if(b.func=="create_node"&&(b.args[4]||this._is_loaded(b.args[0]))){e=this._get_node(b.args[0]);if(b.args[1]&&(b.args[1]==="before"||b.args[1]==="after"))if(e=this._get_parent(b.args[0]),!e||e===-1)e=this.get_container();typeof b.args[2]==="string"?d.push(b.args[2]):!b.args[2]||!b.args[2].data?d.push(this._get_string("new_node")):d.push(b.args[2].data);e=this._check_unique(d,e.find("> ul > li"),"create_node")}if(b.func==
|
199
200
|
"rename_node"){d.push(b.args[1]);f=this._get_node(b.args[0]);e=this._get_parent(f);if(!e||e===-1)e=this.get_container();e=this._check_unique(d,e.find("> ul > li").not(f),"rename_node")}if(!e)return a.stopPropagation(),!1},this))},defaults:{error_callback:c.noop},_fn:{_check_unique:function(a,b,d){var e=[];b.children("a").each(function(){e.push(c(this).text().replace(/^\s+/g,""))});if(!e.length||!a.length)return!0;e=e.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,
|
200
|
-
"").split(",");
|
201
|
-
|
201
|
+
"").split(",");return e.length+a.length!=e.concat(a).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length?(this._get_settings().unique.error_callback.call(null,a,b,d),!1):!0},check_move:function(){if(!this.__call_old())return!1;var a=this._get_move(),b=[];return a.o&&a.o.length?(a.o.children("a").each(function(){b.push(c(this).text().replace(/^\s+/g,""))}),this._check_unique(b,a.np.find("> ul > li").not(a.o),"check_move")):!0}}})})(jQuery);
|
202
|
+
(function(c){c.jstree.plugin("radio",{__init:function(){this.data.radio.noui=this._get_settings().radio.override_ui;if(this.data.ui&&this.data.radio.noui)this.select_node=this.deselect_node=this.deselect_all=c.noop,this.get_selected=this.get_checked;this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",c.proxy(function(a,b){this._prepare_radios(b.rslt.obj)},this)).bind("loaded.jstree",c.proxy(function(){this._prepare_radios()},this)).delegate(this.data.ui&&
|
202
203
|
this.data.radio.noui?"a":"ins.jstree-radio","click.jstree",c.proxy(function(a){a.preventDefault();this._get_node(a.target).hasClass("jstree-checked")?this.uncheck_node(a.target):this.check_node(a.target);if(this.data.ui&&this.data.radio.noui)this.save_selected(),this.data.cookies&&this.save_cookie("select_node");else return a.stopImmediatePropagation(),!1},this))},defaults:{override_ui:!1,two_state:!1,real_radios:!1,checked_parent_open:!0,real_radios_names:function(a){return["check_"+(a[0].id||Math.ceil(Math.random()*
|
203
204
|
1E4)),1]}},__destroy:function(){this.get_container().find("input.jstree-real-radio").removeClass("jstree-real-radio").end().find("ins.jstree-radio").remove()},_fn:{_radio_notify:function(a,b){b.checked&&this.check_node(a,!1)},_prepare_radios:function(a){a=!a||a==-1?this.get_container().find("> ul > li"):this._get_node(a);if(a!==!1){var b,d=this,e,f=this._get_settings().radio.two_state,g=this._get_settings().radio.real_radios,j=this._get_settings().radio.real_radios_names;a.each(function(){e=c(this);
|
204
205
|
b=e.is("li")&&(e.hasClass("jstree-checked")||g&&e.children(":checked").length)?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var a=c(this),e;a.children("a"+(d.data.languages?"":":eq(0)")).not(":has(.jstree-radio)").prepend("<ins class='jstree-radio'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(f?"jstree-unchecked":b);g&&(a.children(":radio").length?a.children(":radio").addClass("jstree-real-radio"):(e=j.call(d,a),a.prepend("<input type='radio' class='jstree-real-radio' id='"+
|
205
|
-
e[0]+"' name='"+e[0]+"' value='"+e[1]+"' />"))
|
206
|
-
if(!a||a===-1)return!1;b=b===!1||b===!0?b:a.hasClass("jstree-checked");if(this._get_settings().radio.two_state)b?(a.removeClass("jstree-checked").addClass("jstree-unchecked"),e&&a.children(":radio").
|
207
|
-
e&&d.children(":radio").
|
208
|
-
"li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),e&&a.parentsUntil(".jstree","li").andSelf().children(":radio").
|
209
|
-
e&&a.parentsUntil(".jstree","li").andSelf().children(":radio").
|
206
|
+
e[0]+"' name='"+e[0]+"' value='"+e[1]+"' />")));f?(a.hasClass("jstree-checked")||a.children(":checked").length)&&a.addClass("jstree-checked").children(":radio").prop("checked",!0):(b==="jstree-checked"||a.hasClass("jstree-checked")||a.children(":checked").length)&&a.find("li").andSelf().addClass("jstree-checked").children(":radio").prop("checked",!0)})});f||a.find(".jstree-checked").parent().parent().each(function(){d._repair_state(this)})}},change_state:function(a,b){var a=this._get_node(a),d=!1,
|
207
|
+
e=this._get_settings().radio.real_radios;if(!a||a===-1)return!1;b=b===!1||b===!0?b:a.hasClass("jstree-checked");if(this._get_settings().radio.two_state)b?(a.removeClass("jstree-checked").addClass("jstree-unchecked"),e&&a.children(":radio").prop("checked",!1)):(a.removeClass("jstree-unchecked").addClass("jstree-checked"),e&&a.children(":radio").prop("checked",!0));else{if(b){d=a.find("li").andSelf();if(!d.filter(".jstree-checked, .jstree-undetermined").length)return!1;d.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
|
208
|
+
e&&d.children(":radio").prop("checked",!1)}else{d=a.find("li").andSelf();if(!d.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;d.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");e&&d.children(":radio").prop("checked",!0);if(this.data.ui)this.data.ui.last_selected=a;this.data.radio.last_selected=a}a.parentsUntil(".jstree","li").each(function(){var a=c(this);if(b)if(a.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return a.parentsUntil(".jstree",
|
209
|
+
"li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),e&&a.parentsUntil(".jstree","li").andSelf().children(":radio").prop("checked",!1),!1;else a.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),e&&a.children(":radio").prop("checked",!1);else if(a.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),
|
210
|
+
e&&a.parentsUntil(".jstree","li").andSelf().children(":radio").prop("checked",!1),!1;else a.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),e&&a.children(":radio").prop("checked",!0)})}if(this.data.ui&&this.data.radio.noui)this.data.ui.selected=this.get_checked();this.__callback(a);return!0},check_node:function(a){if(this.change_state(a,!1)){a=this._get_node(a);if(this._get_settings().radio.checked_parent_open){var b=this;a.parents(".jstree-closed").each(function(){b.open_node(this,
|
210
211
|
!1,!0)})}this.__callback({obj:a})}},uncheck_node:function(a){this.change_state(a,!0)&&this.__callback({obj:this._get_node(a)})},check_all:function(){var a=this;(this._get_settings().radio.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,!1)});this.__callback()},uncheck_all:function(){var a=this;(this._get_settings().radio.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li")).each(function(){a.change_state(this,
|
211
212
|
!0)});this.__callback()},is_checked:function(a){a=this._get_node(a);return a.length?a.is(".jstree-checked"):!1},get_checked:function(a,b){a=!a||a===-1?this.get_container():this._get_node(a);return b||this._get_settings().radio.two_state?a.find(".jstree-checked"):a.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(a,b){a=!a||a===-1?this.get_container():this._get_node(a);return b||this._get_settings().radio.two_state?a.find(".jstree-unchecked"):a.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},
|
212
|
-
show_radios:function(){this.get_container().children("ul").removeClass("jstree-no-radios")},hide_radios:function(){this.get_container().children("ul").addClass("jstree-no-radios")},_repair_state:function(a){a=this._get_node(a);if(a.length)
|
213
|
-
|
214
|
-
c.each(b,function(b,c){a.check_node(c)});this.__callback()}else this.__call_old()},save_loaded:function(){var a=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&a.data.core.to_load.push("#"+this.id)})}}});c(function(){c.vakata.css.add_sheet({str:".jstree .jstree-real-radio { display:none; } ",
|
215
|
-
this.data.wholerow.html=!1;this.data.wholerow.to=!1;this.get_container().bind("init.jstree",c.proxy(function(){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",c.proxy(function(a,b){this._prepare_wholerow_span(b&&b.rslt&&b.rslt.obj?b.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",
|
216
|
-
clearTimeout(this.data.to);this.data.to=setTimeout(function(a,b){return function(){a._prepare_wholerow_ul(b)}}(this,b&&b.rslt&&b.rslt.obj?b.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",c.proxy(function(){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",c.proxy(function(a,b){b.rslt.obj.each(function(){b.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+
|
213
|
+
show_radios:function(){this.get_container().children("ul").removeClass("jstree-no-radios")},hide_radios:function(){this.get_container().children("ul").addClass("jstree-no-radios")},_repair_state:function(a){a=this._get_node(a);if(a.length)if(this._get_settings().radio.two_state)a.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":radio").prop("checked",!0);else{var b=this._get_settings().radio.real_radios,c=a.find("> ul > .jstree-checked").length,
|
214
|
+
e=a.find("> ul > .jstree-undetermined").length,f=a.find("> ul > li").length;f===0?a.hasClass("jstree-undetermined")&&this.change_state(a,!1):c===0&&e===0?this.change_state(a,!0):c===f?this.change_state(a,!1):(a.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),b&&a.parentsUntil(".jstree","li").andSelf().children(":radio").prop("checked",!1))}},reselect:function(){if(this.data.ui&&this.data.radio.noui){var a=this,b=this.data.ui.to_select,
|
215
|
+
b=c.map(c.makeArray(b),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();c.each(b,function(b,c){a.check_node(c)});this.__callback()}else this.__call_old()},save_loaded:function(){var a=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&a.data.core.to_load.push("#"+this.id)})}}});c(function(){c.vakata.css.add_sheet({str:".jstree .jstree-real-radio { display:none; } ",
|
216
|
+
title:"jstree"})})})(jQuery);(function(c){c.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui)throw"jsTree wholerow: jsTree UI plugin not included.";this.data.wholerow.html=!1;this.data.wholerow.to=!1;this.get_container().bind("init.jstree",c.proxy(function(){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",c.proxy(function(a,b){this._prepare_wholerow_span(b&&b.rslt&&b.rslt.obj?b.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",
|
217
|
+
c.proxy(function(a,b){this.data.to&&clearTimeout(this.data.to);this.data.to=setTimeout(function(a,b){return function(){a._prepare_wholerow_ul(b)}}(this,b&&b.rslt&&b.rslt.obj?b.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",c.proxy(function(){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",c.proxy(function(a,b){b.rslt.obj.each(function(){b.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+
|
217
218
|
parseInt((c(this).offset().top-b.inst.get_container().offset().top+b.inst.get_container()[0].scrollTop)/b.inst.data.core.li_height,10)+")").children("a").attr("class",b.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",c.proxy(function(a,b){this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:""));a.type==="hover_node"&&this.get_container().find(" > .jstree-wholerow li:visible:eq("+
|
218
219
|
parseInt((b.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height,10)+")").children("a").attr("class",b.rslt.obj.children(".jstree-hovered").attr("class"))},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(a){var b=c(a.currentTarget);a.target.tagName==="A"||a.target.tagName==="INS"&&b.closest("li").is(".jstree-open, .jstree-closed")||(b.closest("li").children("a:visible:eq(0)").click(),a.stopImmediatePropagation())}).delegate("li",
|
219
220
|
"mouseover.jstree",c.proxy(function(a){a.stopImmediatePropagation();if(c(a.currentTarget).children(".jstree-hovered, .jstree-clicked").length)return!1;this.hover_node(a.currentTarget);return!1},this)).delegate("li","mouseleave.jstree",c.proxy(function(a){c(a.currentTarget).children("a").hasClass("jstree-hovered").length||this.dehover_node(a.currentTarget)},this));(p||o)&&c.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove();
|
@@ -3,8 +3,8 @@
|
|
3
3
|
// v 1.1.x
|
4
4
|
// Dual licensed under the MIT and GPL licenses.
|
5
5
|
// ----------------------------------------------------------------------------
|
6
|
-
// Copyright (C) 2007-
|
7
|
-
// http://
|
6
|
+
// Copyright (C) 2007-2011 Jay Salvat
|
7
|
+
// http://markitup.jaysalvat.com/
|
8
8
|
// ----------------------------------------------------------------------------
|
9
9
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
10
|
// of this software and associated documentation files (the "Software"), to deal
|
@@ -25,562 +25,569 @@
|
|
25
25
|
// THE SOFTWARE.
|
26
26
|
// ----------------------------------------------------------------------------
|
27
27
|
(function($) {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
28
|
+
$.fn.markItUp = function(settings, extraSettings) {
|
29
|
+
var options, ctrlKey, shiftKey, altKey;
|
30
|
+
ctrlKey = shiftKey = altKey = false;
|
31
|
+
|
32
|
+
options = { id: '',
|
33
|
+
nameSpace: '',
|
34
|
+
root: '',
|
35
|
+
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
|
36
|
+
previewAutoRefresh: true,
|
37
|
+
previewPosition: 'after',
|
38
|
+
previewTemplatePath: '~/templates/preview.html',
|
39
|
+
previewParser: false,
|
40
|
+
previewParserPath: '',
|
41
|
+
previewParserVar: 'data',
|
42
|
+
resizeHandle: true,
|
43
|
+
beforeInsert: '',
|
44
|
+
afterInsert: '',
|
45
|
+
onEnter: {},
|
46
|
+
onShiftEnter: {},
|
47
|
+
onCtrlEnter: {},
|
48
|
+
onTab: {},
|
49
|
+
markupSet: [ { /* set */ } ]
|
50
|
+
};
|
51
|
+
$.extend(options, settings, extraSettings);
|
52
|
+
|
53
|
+
// compute markItUp! path
|
54
|
+
if (!options.root) {
|
55
|
+
$('script').each(function(a, tag) {
|
56
|
+
miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
|
57
|
+
if (miuScript !== null) {
|
58
|
+
options.root = miuScript[1];
|
59
|
+
}
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
return this.each(function() {
|
64
|
+
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
|
65
|
+
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
|
66
|
+
$$ = $(this);
|
67
|
+
textarea = this;
|
68
|
+
levels = [];
|
69
|
+
abort = false;
|
70
|
+
scrollPosition = caretPosition = 0;
|
71
|
+
caretOffset = -1;
|
72
|
+
|
73
|
+
options.previewParserPath = localize(options.previewParserPath);
|
74
|
+
options.previewTemplatePath = localize(options.previewTemplatePath);
|
75
|
+
|
76
|
+
// apply the computed path to ~/
|
77
|
+
function localize(data, inText) {
|
78
|
+
if (inText) {
|
79
|
+
return data.replace(/("|')~\//g, "$1"+options.root);
|
80
|
+
}
|
81
|
+
return data.replace(/^~\//, options.root);
|
82
|
+
}
|
83
|
+
|
84
|
+
// init and build editor
|
85
|
+
function init() {
|
86
|
+
id = ''; nameSpace = '';
|
87
|
+
if (options.id) {
|
88
|
+
id = 'id="'+options.id+'"';
|
89
|
+
} else if ($$.attr("id")) {
|
90
|
+
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
|
91
|
+
|
92
|
+
}
|
93
|
+
if (options.nameSpace) {
|
94
|
+
nameSpace = 'class="'+options.nameSpace+'"';
|
95
|
+
}
|
96
|
+
$$.wrap('<div '+nameSpace+'></div>');
|
97
|
+
$$.wrap('<div '+id+' class="markItUp"></div>');
|
98
|
+
$$.wrap('<div class="markItUpContainer"></div>');
|
99
|
+
$$.addClass("markItUpEditor");
|
100
|
+
|
101
|
+
// add the header before the textarea
|
102
|
+
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
|
103
|
+
$(dropMenus(options.markupSet)).appendTo(header);
|
104
|
+
|
105
|
+
// add the footer after the textarea
|
106
|
+
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
|
107
|
+
|
108
|
+
// add the resize handle after textarea
|
109
|
+
if (options.resizeHandle === true && $.browser.safari !== true) {
|
110
|
+
resizeHandle = $('<div class="markItUpResizeHandle"></div>')
|
111
|
+
.insertAfter($$)
|
112
|
+
.bind("mousedown", function(e) {
|
113
|
+
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
|
114
|
+
mouseMove = function(e) {
|
115
|
+
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
|
116
|
+
return false;
|
117
|
+
};
|
118
|
+
mouseUp = function(e) {
|
119
|
+
$("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
|
120
|
+
return false;
|
121
|
+
};
|
122
|
+
$("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
|
123
|
+
});
|
124
|
+
footer.append(resizeHandle);
|
125
|
+
}
|
126
|
+
|
127
|
+
// listen key events
|
128
|
+
$$.keydown(keyPressed).keyup(keyPressed);
|
129
|
+
|
130
|
+
// bind an event to catch external calls
|
131
|
+
$$.bind("insertion", function(e, settings) {
|
132
|
+
if (settings.target !== false) {
|
133
|
+
get();
|
134
|
+
}
|
135
|
+
if (textarea === $.markItUp.focused) {
|
136
|
+
markup(settings);
|
137
|
+
}
|
138
|
+
});
|
139
|
+
|
140
|
+
// remember the last focus
|
141
|
+
$$.focus(function() {
|
142
|
+
$.markItUp.focused = this;
|
143
|
+
});
|
144
|
+
}
|
145
|
+
|
146
|
+
// recursively build header with dropMenus from markupset
|
147
|
+
function dropMenus(markupSet) {
|
148
|
+
var ul = $('<ul></ul>'), i = 0;
|
149
|
+
$('li:hover > ul', ul).css('display', 'block');
|
150
|
+
$.each(markupSet, function() {
|
151
|
+
var button = this, t = '', title, li, j;
|
152
|
+
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
|
153
|
+
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
|
154
|
+
if (button.separator) {
|
155
|
+
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
|
156
|
+
} else {
|
157
|
+
i++;
|
158
|
+
for (j = levels.length -1; j >= 0; j--) {
|
159
|
+
t += levels[j]+"-";
|
160
|
+
}
|
161
|
+
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
|
162
|
+
.bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
|
163
|
+
return false;
|
164
|
+
}).click(function() {
|
165
|
+
return false;
|
166
|
+
}).bind("focusin", function(){
|
167
|
+
$$.focus();
|
168
|
+
}).mouseup(function() {
|
169
|
+
if (button.call) {
|
170
|
+
eval(button.call)();
|
171
|
+
}
|
172
|
+
setTimeout(function() { markup(button) },1);
|
173
|
+
return false;
|
174
|
+
}).hover(function() {
|
175
|
+
$('> ul', this).show();
|
176
|
+
$(document).one('click', function() { // close dropmenu if click outside
|
177
|
+
$('ul ul', header).hide();
|
178
|
+
}
|
179
|
+
);
|
180
|
+
}, function() {
|
181
|
+
$('> ul', this).hide();
|
182
|
+
}
|
183
|
+
).appendTo(ul);
|
184
|
+
if (button.dropMenu) {
|
185
|
+
levels.push(i);
|
186
|
+
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
|
187
|
+
}
|
188
|
+
}
|
189
|
+
});
|
190
|
+
levels.pop();
|
191
|
+
return ul;
|
192
|
+
}
|
193
|
+
|
194
|
+
// markItUp! markups
|
195
|
+
function magicMarkups(string) {
|
196
|
+
if (string) {
|
197
|
+
string = string.toString();
|
198
|
+
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
|
199
|
+
function(x, a) {
|
200
|
+
var b = a.split('|!|');
|
201
|
+
if (altKey === true) {
|
202
|
+
return (b[1] !== undefined) ? b[1] : b[0];
|
203
|
+
} else {
|
204
|
+
return (b[1] === undefined) ? "" : b[0];
|
205
|
+
}
|
206
|
+
}
|
207
|
+
);
|
208
|
+
// [![prompt]!], [![prompt:!:value]!]
|
209
|
+
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
|
210
|
+
function(x, a) {
|
211
|
+
var b = a.split(':!:');
|
212
|
+
if (abort === true) {
|
213
|
+
return false;
|
214
|
+
}
|
215
|
+
value = prompt(b[0], (b[1]) ? b[1] : '');
|
216
|
+
if (value === null) {
|
217
|
+
abort = true;
|
218
|
+
}
|
219
|
+
return value;
|
220
|
+
}
|
221
|
+
);
|
222
|
+
return string;
|
223
|
+
}
|
224
|
+
return "";
|
225
|
+
}
|
226
|
+
|
227
|
+
// prepare action
|
228
|
+
function prepare(action) {
|
229
|
+
if ($.isFunction(action)) {
|
230
|
+
action = action(hash);
|
231
|
+
}
|
232
|
+
return magicMarkups(action);
|
233
|
+
}
|
234
|
+
|
235
|
+
// build block to insert
|
236
|
+
function build(string) {
|
237
|
+
var openWith = prepare(clicked.openWith);
|
238
|
+
var placeHolder = prepare(clicked.placeHolder);
|
239
|
+
var replaceWith = prepare(clicked.replaceWith);
|
240
|
+
var closeWith = prepare(clicked.closeWith);
|
241
|
+
var openBlockWith = prepare(clicked.openBlockWith);
|
242
|
+
var closeBlockWith = prepare(clicked.closeBlockWith);
|
243
|
+
var multiline = clicked.multiline;
|
244
|
+
|
245
|
+
if (replaceWith !== "") {
|
246
|
+
block = openWith + replaceWith + closeWith;
|
247
|
+
} else if (selection === '' && placeHolder !== '') {
|
248
|
+
block = openWith + placeHolder + closeWith;
|
249
|
+
} else {
|
250
|
+
string = string || selection;
|
251
|
+
|
252
|
+
var lines = selection.split(/\r?\n/), blocks = [];
|
253
|
+
|
254
|
+
for (var l=0; l < lines.length; l++) {
|
255
|
+
line = lines[l];
|
256
|
+
var trailingSpaces;
|
257
|
+
if (trailingSpaces = line.match(/ *$/)) {
|
258
|
+
blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
|
259
|
+
} else {
|
260
|
+
blocks.push(openWith + line + closeWith);
|
261
|
+
}
|
262
|
+
}
|
263
|
+
|
264
|
+
block = blocks.join("\n");
|
265
|
+
}
|
266
|
+
|
267
|
+
block = openBlockWith + block + closeBlockWith;
|
268
|
+
|
269
|
+
return { block:block,
|
270
|
+
openWith:openWith,
|
271
|
+
replaceWith:replaceWith,
|
272
|
+
placeHolder:placeHolder,
|
273
|
+
closeWith:closeWith
|
274
|
+
};
|
275
|
+
}
|
276
|
+
|
277
|
+
// define markup to insert
|
278
|
+
function markup(button) {
|
279
|
+
var len, j, n, i;
|
280
|
+
hash = clicked = button;
|
281
|
+
get();
|
282
|
+
$.extend(hash, { line:"",
|
283
|
+
root:options.root,
|
284
|
+
textarea:textarea,
|
285
|
+
selection:(selection||''),
|
286
|
+
caretPosition:caretPosition,
|
287
|
+
ctrlKey:ctrlKey,
|
288
|
+
shiftKey:shiftKey,
|
289
|
+
altKey:altKey
|
290
|
+
}
|
291
|
+
);
|
292
|
+
// callbacks before insertion
|
293
|
+
prepare(options.beforeInsert);
|
294
|
+
prepare(clicked.beforeInsert);
|
295
|
+
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
296
|
+
prepare(clicked.beforeMultiInsert);
|
297
|
+
}
|
298
|
+
$.extend(hash, { line:1 });
|
299
|
+
|
300
|
+
if ((ctrlKey === true && shiftKey === true)) {
|
301
|
+
lines = selection.split(/\r?\n/);
|
302
|
+
for (j = 0, n = lines.length, i = 0; i < n; i++) {
|
303
|
+
if ($.trim(lines[i]) !== '') {
|
304
|
+
$.extend(hash, { line:++j, selection:lines[i] } );
|
305
|
+
lines[i] = build(lines[i]).block;
|
306
|
+
} else {
|
307
|
+
lines[i] = "";
|
308
|
+
}
|
309
|
+
}
|
310
|
+
string = { block:lines.join('\n')};
|
311
|
+
start = caretPosition;
|
312
|
+
len = string.block.length + (($.browser.opera) ? n-1 : 0);
|
313
|
+
} else if (ctrlKey === true) {
|
314
|
+
string = build(selection);
|
315
|
+
start = caretPosition + string.openWith.length;
|
316
|
+
len = string.block.length - string.openWith.length - string.closeWith.length;
|
317
|
+
len = len - (string.block.match(/ $/) ? 1 : 0);
|
318
|
+
len -= fixIeBug(string.block);
|
319
|
+
} else if (shiftKey === true) {
|
320
|
+
string = build(selection);
|
321
|
+
start = caretPosition;
|
322
|
+
len = string.block.length;
|
323
|
+
len -= fixIeBug(string.block);
|
324
|
+
} else {
|
325
|
+
string = build(selection);
|
326
|
+
start = caretPosition + string.block.length ;
|
327
|
+
len = 0;
|
328
|
+
start -= fixIeBug(string.block);
|
329
|
+
}
|
330
|
+
if ((selection === '' && string.replaceWith === '')) {
|
331
|
+
caretOffset += fixOperaBug(string.block);
|
332
|
+
|
333
|
+
start = caretPosition + string.openWith.length;
|
334
|
+
len = string.block.length - string.openWith.length - string.closeWith.length;
|
335
|
+
|
336
|
+
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
|
337
|
+
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
|
338
|
+
}
|
339
|
+
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
|
340
|
+
|
341
|
+
if (string.block !== selection && abort === false) {
|
342
|
+
insert(string.block);
|
343
|
+
set(start, len);
|
344
|
+
} else {
|
345
|
+
caretOffset = -1;
|
346
|
+
}
|
347
|
+
get();
|
348
|
+
|
349
|
+
$.extend(hash, { line:'', selection:selection });
|
350
|
+
|
351
|
+
// callbacks after insertion
|
352
|
+
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
353
|
+
prepare(clicked.afterMultiInsert);
|
354
|
+
}
|
355
|
+
prepare(clicked.afterInsert);
|
356
|
+
prepare(options.afterInsert);
|
357
|
+
|
358
|
+
// refresh preview if opened
|
359
|
+
if (previewWindow && options.previewAutoRefresh) {
|
360
|
+
refreshPreview();
|
361
|
+
}
|
362
|
+
|
363
|
+
// reinit keyevent
|
364
|
+
shiftKey = altKey = ctrlKey = abort = false;
|
365
|
+
}
|
366
|
+
|
367
|
+
// Substract linefeed in Opera
|
368
|
+
function fixOperaBug(string) {
|
369
|
+
if ($.browser.opera) {
|
370
|
+
return string.length - string.replace(/\n*/g, '').length;
|
371
|
+
}
|
372
|
+
return 0;
|
373
|
+
}
|
374
|
+
// Substract linefeed in IE
|
375
|
+
function fixIeBug(string) {
|
376
|
+
if ($.browser.msie) {
|
377
|
+
return string.length - string.replace(/\r*/g, '').length;
|
378
|
+
}
|
379
|
+
return 0;
|
380
|
+
}
|
381
|
+
|
382
|
+
// add markup
|
383
|
+
function insert(block) {
|
384
|
+
if (document.selection) {
|
385
|
+
var newSelection = document.selection.createRange();
|
386
|
+
newSelection.text = block;
|
387
|
+
} else {
|
388
|
+
textarea.value = textarea.value.substring(0, caretPosition) + block + textarea.value.substring(caretPosition + selection.length, textarea.value.length);
|
389
|
+
}
|
390
|
+
}
|
391
|
+
|
392
|
+
// set a selection
|
393
|
+
function set(start, len) {
|
394
|
+
if (textarea.createTextRange){
|
395
|
+
// quick fix to make it work on Opera 9.5
|
396
|
+
if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
|
397
|
+
return false;
|
398
|
+
}
|
399
|
+
range = textarea.createTextRange();
|
400
|
+
range.collapse(true);
|
401
|
+
range.moveStart('character', start);
|
402
|
+
range.moveEnd('character', len);
|
403
|
+
range.select();
|
404
|
+
} else if (textarea.setSelectionRange ){
|
405
|
+
textarea.setSelectionRange(start, start + len);
|
406
|
+
}
|
407
|
+
textarea.scrollTop = scrollPosition;
|
408
|
+
textarea.focus();
|
409
|
+
}
|
410
|
+
|
411
|
+
// get the selection
|
412
|
+
function get() {
|
413
|
+
textarea.focus();
|
414
|
+
|
415
|
+
scrollPosition = textarea.scrollTop;
|
416
|
+
if (document.selection) {
|
417
|
+
selection = document.selection.createRange().text;
|
418
|
+
if ($.browser.msie) { // ie
|
419
|
+
var range = document.selection.createRange(), rangeCopy = range.duplicate();
|
420
|
+
rangeCopy.moveToElementText(textarea);
|
421
|
+
caretPosition = -1;
|
422
|
+
while(rangeCopy.inRange(range)) {
|
423
|
+
rangeCopy.moveStart('character');
|
424
|
+
caretPosition ++;
|
425
|
+
}
|
426
|
+
} else { // opera
|
427
|
+
caretPosition = textarea.selectionStart;
|
428
|
+
}
|
429
|
+
} else { // gecko & webkit
|
430
|
+
caretPosition = textarea.selectionStart;
|
431
|
+
|
432
|
+
selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
|
433
|
+
}
|
434
|
+
return selection;
|
435
|
+
}
|
436
|
+
|
437
|
+
// open preview window
|
438
|
+
function preview() {
|
439
|
+
if (!previewWindow || previewWindow.closed) {
|
440
|
+
if (options.previewInWindow) {
|
441
|
+
previewWindow = window.open('', 'preview', options.previewInWindow);
|
442
|
+
$(window).unload(function() {
|
443
|
+
previewWindow.close();
|
444
|
+
});
|
445
|
+
} else {
|
446
|
+
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
|
447
|
+
if (options.previewPosition == 'after') {
|
448
|
+
iFrame.insertAfter(footer);
|
449
|
+
} else {
|
450
|
+
iFrame.insertBefore(header);
|
451
|
+
}
|
452
|
+
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
|
453
|
+
}
|
454
|
+
} else if (altKey === true) {
|
455
|
+
if (iFrame) {
|
456
|
+
iFrame.remove();
|
457
|
+
} else {
|
458
|
+
previewWindow.close();
|
459
|
+
}
|
460
|
+
previewWindow = iFrame = false;
|
461
|
+
}
|
462
|
+
if (!options.previewAutoRefresh) {
|
463
|
+
refreshPreview();
|
464
|
+
}
|
465
|
+
if (options.previewInWindow) {
|
466
|
+
previewWindow.focus();
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
// refresh Preview window
|
471
|
+
function refreshPreview() {
|
472
|
+
renderPreview();
|
473
|
+
}
|
474
|
+
|
475
|
+
function renderPreview() {
|
476
|
+
var phtml;
|
477
|
+
if (options.previewParser && typeof options.previewParser === 'function') {
|
478
|
+
var data = options.previewParser( $$.val() );
|
479
|
+
writeInPreview( localize(data, 1) );
|
480
|
+
} else if (options.previewParserPath !== '') {
|
481
|
+
$.ajax({
|
482
|
+
type: 'POST',
|
483
|
+
dataType: 'text',
|
484
|
+
global: false,
|
485
|
+
url: options.previewParserPath,
|
486
|
+
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
|
487
|
+
success: function(data) {
|
488
|
+
writeInPreview( localize(data, 1) );
|
489
|
+
}
|
490
|
+
});
|
491
|
+
} else {
|
492
|
+
if (!template) {
|
493
|
+
$.ajax({
|
494
|
+
url: options.previewTemplatePath,
|
495
|
+
dataType: 'text',
|
496
|
+
global: false,
|
497
|
+
success: function(data) {
|
498
|
+
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
|
499
|
+
}
|
500
|
+
});
|
501
|
+
}
|
502
|
+
}
|
503
|
+
return false;
|
504
|
+
}
|
505
|
+
|
506
|
+
function writeInPreview(data) {
|
507
|
+
if (previewWindow.document) {
|
508
|
+
try {
|
509
|
+
sp = previewWindow.document.documentElement.scrollTop
|
510
|
+
} catch(e) {
|
511
|
+
sp = 0;
|
512
|
+
}
|
513
|
+
previewWindow.document.open();
|
514
|
+
previewWindow.document.write(data);
|
515
|
+
previewWindow.document.close();
|
516
|
+
previewWindow.document.documentElement.scrollTop = sp;
|
517
|
+
}
|
518
|
+
}
|
519
|
+
|
520
|
+
// set keys pressed
|
521
|
+
function keyPressed(e) {
|
522
|
+
shiftKey = e.shiftKey;
|
523
|
+
altKey = e.altKey;
|
524
|
+
ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;
|
525
|
+
|
526
|
+
if (e.type === 'keydown') {
|
527
|
+
if (ctrlKey === true) {
|
528
|
+
li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li');
|
529
|
+
if (li.length !== 0) {
|
530
|
+
ctrlKey = false;
|
531
|
+
setTimeout(function() {
|
532
|
+
li.triggerHandler('mouseup');
|
533
|
+
},1);
|
534
|
+
return false;
|
535
|
+
}
|
536
|
+
}
|
537
|
+
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
|
538
|
+
if (ctrlKey === true) { // Enter + Ctrl
|
539
|
+
ctrlKey = false;
|
540
|
+
markup(options.onCtrlEnter);
|
541
|
+
return options.onCtrlEnter.keepDefault;
|
542
|
+
} else if (shiftKey === true) { // Enter + Shift
|
543
|
+
shiftKey = false;
|
544
|
+
markup(options.onShiftEnter);
|
545
|
+
return options.onShiftEnter.keepDefault;
|
546
|
+
} else { // only Enter
|
547
|
+
markup(options.onEnter);
|
548
|
+
return options.onEnter.keepDefault;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
if (e.keyCode === 9) { // Tab key
|
552
|
+
if (shiftKey == true || ctrlKey == true || altKey == true) {
|
553
|
+
return false;
|
554
|
+
}
|
555
|
+
if (caretOffset !== -1) {
|
556
|
+
get();
|
557
|
+
caretOffset = $$.val().length - caretOffset;
|
558
|
+
set(caretOffset, 0);
|
559
|
+
caretOffset = -1;
|
560
|
+
return false;
|
561
|
+
} else {
|
562
|
+
markup(options.onTab);
|
563
|
+
return options.onTab.keepDefault;
|
564
|
+
}
|
565
|
+
}
|
566
|
+
}
|
567
|
+
}
|
568
|
+
|
569
|
+
init();
|
570
|
+
});
|
571
|
+
};
|
572
|
+
|
573
|
+
$.fn.markItUpRemove = function() {
|
574
|
+
return this.each(function() {
|
575
|
+
var $$ = $(this).unbind().removeClass('markItUpEditor');
|
576
|
+
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
|
577
|
+
}
|
578
|
+
);
|
579
|
+
};
|
580
|
+
|
581
|
+
$.markItUp = function(settings) {
|
582
|
+
var options = { target:false };
|
583
|
+
$.extend(options, settings);
|
584
|
+
if (options.target) {
|
585
|
+
return $(options.target).each(function() {
|
586
|
+
$(this).focus();
|
587
|
+
$(this).trigger('insertion', [options]);
|
588
|
+
});
|
589
|
+
} else {
|
590
|
+
$('textarea').trigger('insertion', [options]);
|
591
|
+
}
|
592
|
+
};
|
586
593
|
})(jQuery);
|