<\/div>").hide().prependTo($(this.divTree).parent())),r==="after"||r==="before"||r==="over"){o=f.offset();switch(r){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-before");o.top-=8;break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-after");o.top+=8;break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before");this.$dndMarker.addClass("dynatree-drop-over");f.addClass("dynatree-drop-target");o.left+=8}this.$dndMarker.css({left:o.left,top:o.top,"z-index":1e3}).show()}else f.removeClass("dynatree-drop-target"),this.$dndMarker.hide();r==="after"?f.addClass("dynatree-drop-after"):f.removeClass("dynatree-drop-after");r==="before"?f.addClass("dynatree-drop-before"):f.removeClass("dynatree-drop-before");u===!0?(e&&e.addClass("dynatree-drop-accept"),f.addClass("dynatree-drop-accept"),i.addClass("dynatree-drop-accept")):(e&&e.removeClass("dynatree-drop-accept"),f.removeClass("dynatree-drop-accept"),i.removeClass("dynatree-drop-accept"));u===!1?(e&&e.addClass("dynatree-drop-reject"),f.addClass("dynatree-drop-reject"),i.addClass("dynatree-drop-reject")):(e&&e.removeClass("dynatree-drop-reject"),f.removeClass("dynatree-drop-reject"),i.removeClass("dynatree-drop-reject"))},_onDragEvent:function(n,t,i,r,u,f){var w=this.options,s=this.options.dnd,e=null,c=$(t.span),o,h,l,p;switch(n){case"helper":l=$("
<\/div>").append($(r.target).closest("a").clone());$("ul.dynatree-container",t.tree.divTree).append(l);l.data("dtSourceNode",t);e=l;break;case"start":t.isStatusNode()?e=!1:s.onDragStart&&(e=s.onDragStart(t));e===!1?(this.logDebug("tree.onDragStart() cancelled"),u.helper.trigger("mouseup"),u.helper.hide()):c.addClass("dynatree-drag-source");break;case"enter":e=s.onDragEnter?s.onDragEnter(t,i):null;e={over:e!==!1&&(e===!0||e==="over"||$.inArray("over",e)>=0),before:e!==!1&&(e===!0||e==="before"||$.inArray("before",e)>=0),after:e!==!1&&(e===!0||e==="after"||$.inArray("after",e)>=0)};u.helper.data("enterResponse",e);break;case"over":if(h=u.helper.data("enterResponse"),o=null,h===!1)break;else if(typeof h=="string")o=h;else{var v=c.offset(),y={x:r.pageX-v.left,y:r.pageY-v.top},a={x:y.x/c.width(),y:y.y/c.height()};h.after&&a.y>.75?o="after":!h.over&&h.after&&a.y>.5?o="after":h.before&&a.y<=.25?o="before":!h.over&&h.before&&a.y<=.5?o="before":h.over&&(o="over");s.preventVoidMoves&&(t===i?o=null:o==="before"&&i&&t===i.getNextSibling()?o=null:o==="after"&&i&&t===i.getPrevSibling()?o=null:o==="over"&&i&&i.parent===t&&i.isLastSibling()&&(o=null));u.helper.data("hitMode",o)}o==="over"&&s.autoExpandMS&&t.hasChildren()!==!1&&!t.bExpanded&&t.scheduleAction("expand",s.autoExpandMS);o&&s.onDragOver&&(e=s.onDragOver(t,i,o));this._setDndStatus(i,t,u.helper,o,e!==!1);break;case"drop":if(p=u.helper.hasClass("dynatree-drop-reject"),o=u.helper.data("hitMode"),o&&s.onDrop&&!p)s.onDrop(t,i,o,u,f);break;case"leave":if(t.scheduleAction("cancel"),u.helper.data("enterResponse",null),u.helper.data("hitMode",null),this._setDndStatus(i,t,u.helper,"out",undefined),s.onDragLeave)s.onDragLeave(t,i);break;case"stop":if(c.removeClass("dynatree-drag-source"),s.onDragStop)s.onDragStop(t);break;default:throw"Unsupported drag event: "+n;}return e},cancelDrag:function(){var n=$.ui.ddmanager.current;n&&n.cancel()},lastentry:undefined};$.widget("ui.dynatree",{_init:function(){if(parseFloat($.ui.version)<1.8)return this.options.debugLevel>=0&&_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."),this._create();this.options.debugLevel>=2&&_log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){var n=this.options,t;n.debugLevel>=1&&logMsg("Dynatree._create(): version='%s', debugLevel=%o.",$.ui.dynatree.version,this.options.debugLevel);this.options.event+=".dynatree";t=this.element.get(0);this.tree=new i(this);this.tree._load();this.tree.logDebug("Dynatree._init(): done.")},bind:function(){function i(n){n=$.event.fix(n||window.event);var t=$.ui.dynatree.getNode(n.target);return t?t._onFocus(n):!1}var t,n;this.unbind();t="click.dynatree dblclick.dynatree";this.options.keyboard&&(t+=" keypress.dynatree keydown.dynatree");this.element.bind(t,function(n){var t=$.ui.dynatree.getNode(n.target),i,r,u,e;if(!t)return!0;i=t.tree;r=i.options;i.logDebug("event(%s): dtnode: %s",n.type,t);u=i.phase;i.phase="userEvent";try{switch(n.type){case"click":return r.onClick&&r.onClick.call(i,t,n)===!1?!1:t._onClick(n);case"dblclick":return r.onDblClick&&r.onDblClick.call(i,t,n)===!1?!1:t._onDblClick(n);case"keydown":return r.onKeydown&&r.onKeydown.call(i,t,n)===!1?!1:t._onKeydown(n);case"keypress":return r.onKeypress&&r.onKeypress.call(i,t,n)===!1?!1:t._onKeypress(n)}}catch(f){e=null;i.logWarning("bind(%o): dtnode: %o, error: %o",n,t,f)}finally{i.phase=u}});n=this.tree.divTree;n.addEventListener?(n.addEventListener("focus",i,!0),n.addEventListener("blur",i,!0)):n.onfocusin=n.onfocusout=i},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind();$.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind();$.Widget.prototype.disable.apply(this,arguments)},getTree:function(){return this.tree},getRoot:function(){return this.tree.getRoot()},getActiveNode:function(){return this.tree.getActiveNode()},getSelectedNodes:function(){return this.tree.getSelectedNodes()},lastentry:undefined});parseFloat($.ui.version)<1.8&&($.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes");$.ui.dynatree.version="$Version: 1.2.1$";$.ui.dynatree.getNode=function(n){if(n instanceof t)return n;for(n.selector!==undefined&&(n=n[0]);n;){if(n.dtnode)return n.dtnode;n=n.parentNode}return null};$.ui.dynatree.getPersistData=n._getTreePersistData;$.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:!0,keyboard:!0,persist:!1,autoCollapse:!1,clickFolderMode:3,activeVisible:!0,checkbox:!1,selectMode:2,fx:null,noLink:!1,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,onCustomRender:null,onCreate:null,onRender:null,postProcess:null,dnd:{onDragStart:null,onDragStop:null,autoExpandMS:1e3,preventVoidMoves:!0,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:!1,timeout:0,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},generateIds:!1,idPrefix:"dynatree-id-",keyPathSeparator:"/",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",nodeLoading:"dynatree-loading",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:1,lastentry:undefined};parseFloat($.ui.version)<1.8&&($.ui.dynatree.defaults=$.ui.dynatree.prototype.options);$.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:!1,isLazy:!1,tooltip:null,href:null,icon:null,addClass:null,noLink:!1,activate:!1,focus:!1,expand:!1,select:!1,hideCheckbox:!1,unselectable:!1,children:null,lastentry:undefined};u=!1;e=function(){u||($.ui.plugin.add("draggable","connectToDynatree",{start:function(n,t){var i=$(this).data("draggable"),r=t.helper.data("dtSourceNode")||null;if(r)return i.offset.click.top=-2,i.offset.click.left=16,r.tree._onDragEvent("start",r,null,n,t,i)},drag:function(n,t){var u=$(this).data("draggable"),e=t.helper.data("dtSourceNode")||null,r=t.helper.data("dtTargetNode")||null,i=$.ui.dynatree.getNode(n.target),o;n.target&&!i&&(o=$(n.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0,o)||(t.helper.data("dtTargetNode",i),r&&r!==i&&r.tree._onDragEvent("leave",r,e,n,t,u),i&&(i.tree.options.dnd.onDrop?i===r?i.tree._onDragEvent("over",i,e,n,t,u):i.tree._onDragEvent("enter",i,e,n,t,u):f()))},stop:function(n,t){var u=$(this).data("draggable"),i=t.helper.data("dtSourceNode")||null,r=t.helper.data("dtTargetNode")||null,o=u._mouseDownEvent,e=n.type,f=e=="mouseup"&&n.which==1;f||logMsg("Drag was cancelled");r&&(f&&r.tree._onDragEvent("drop",r,i,n,t,u),r.tree._onDragEvent("leave",r,i,n,t,u));i&&i.tree._onDragEvent("stop",i,null,n,t,u)}}),u=!0)}})(jQuery);
//# sourceMappingURL=jQueryUI-DynaTree.min.js.map