PS3_Toolset/js/jstree.min.js

1 line
162 KiB
JavaScript
Raw Permalink Normal View History

(function(factory){"use strict";if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'))}else{factory(jQuery)}}(function($,undefined){"use strict";if($.jstree){return}var instance_counter=0,ccp_node=false,ccp_mode=false,ccp_inst=false,themes_loaded=[],src=$('script:last').attr('src'),document=window.document;var setImmediate=window.setImmediate;var Promise=window.Promise;if(!setImmediate&&Promise){setImmediate=function(cb,arg){Promise.resolve(arg).then(cb)}}$.jstree={version:'3.3.8',defaults:{plugins:[]},plugins:{},path:src&&src.indexOf('/')!==-1?src.replace(/\/[^\/]+$/,''):'',idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:'#'};$.jstree.create=function(el,options){var tmp=new $.jstree.core(instance_counter+=1),opt=options;options=$.extend(true,{},$.jstree.defaults,options);if(opt&&opt.plugins){options.plugins=opt.plugins}$.each(options.plugins,function(i,k){if(i!=='core'){tmp=tmp.plugin(k,options[k])}});$(el).data('jstree',tmp);tmp.init(el,options);return tmp};$.jstree.destroy=function(){$('.jstree:jstree').jstree('destroy');$(document).off('.jstree')};$.jstree.core=function(id){this._id=id;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:false,dots:false,icons:false,ellipsis:false},selected:[],last_error:{},working:false,worker_queue:[],focused:null}}};$.jstree.reference=function(needle){var tmp=null,obj=null;if(needle&&needle.id&&(!needle.tagName||!needle.nodeType)){needle=needle.id}if(!obj||!obj.length){try{obj=$(needle)}catch(ignore){}}if(!obj||!obj.length){try{obj=$('#'+needle.replace($.jstree.idregex,'\\$&'))}catch(ignore){}}if(obj&&obj.length&&(obj=obj.closest('.jstree')).length&&(obj=obj.data('jstree'))){tmp=obj}else{$('.jstree').each(function(){var inst=$(this).data('jstree');if(inst&&inst._model.data[needle]){tmp=inst;return false}})}return tmp};$.fn.jstree=function(arg){var is_method=(typeof arg==='string'),args=Array.prototype.slice.call(arguments,1),result=null;if(arg===true&&!this.length){return false}this.each(function(){var instance=$.jstree.reference(this),method=is_method&&instance?instance[arg]:null;result=is_method&&method?method.apply(instance,args):null;if(!instance&&!is_method&&(arg===undefined||$.isPlainObject(arg))){$.jstree.create(this,arg)}if((instance&&!is_method)||arg===true){result=instance||false}if(result!==null&&result!==undefined){return false}});return result!==null&&result!==undefined?result:this};$.expr.pseudos.jstree=$.expr.createPseudo(function(search){return function(a){return $(a).hasClass('jstree')&&$(a).data('jstree')!==undefined}});$.jstree.defaults.core={data:false,strings:false,check_callback:false,error:$.noop,animation:200,multiple:true,themes:{name:false,url:false,dir:false,dots:true,icons:true,ellipsis:false,stripes:false,variant:false,responsive:false},expand_selected_onload:true,worker:true,force_text:false,dblclick_toggle:true,loaded_state:false,restore_focus:true,keyboard:{'ctrl-space':function(e){e.type="click";$(e.currentTarget).trigger(e)},'enter':function(e){e.type="click";$(e.currentTarget).trigger(e)},'left':function(e){e.preventDefault();if(this.is_open(e.currentTarget)){this.close_node(e.currentTarget)}else{var o=this.get_parent(e.currentTarget);if(o&&o.id!==$.jstree.root){this.get_node(o,true).children('.jstree-anchor').focus()}}},'up':function(e){e.preventDefault();var o=this.get_prev_dom(e.currentTarget);if(o&&o.length){o.children('.jstree-anchor').focus()}},'right':function(e){e.preventDefault();if(this.is_closed(e.currentTarget)){this.open_node(e.currentTarget,function(o){this.get_node(o,true).children('.jstree-anchor').focus()})}else if(this.is_open(e.currentTarget)){var o=this.get_node(e.currentTarget,true).children('.jstree-children')[0];if(o){$(this._firstChild(o)).children('.jstree-anchor').focus()}}},'down':function(e){e.preventDefault();var o=this.get_next_dom(e.currentTarget);if(o&&o.length){o.children('.jstree-anchor').focus()}},'*':function(e){this.open_all()},'home':function(e){e.preventDefault();var o=this._firstChild(