
typeof defaultRegistry!='undefined'?defaultRegistry.addEntry({fileName:'jquery.3rdparty.isortables.js',url:'/ccf/plugins/js/jquery.3rdparty.isortables.js',plugins:[{"parameter":["obj"],"name":"Sortable","alias":"Sortable"}]}):true;jQuery.iSort={changed:[],collected:{},helper:false,inFrontOf:null,start:function(){if(jQuery.iDrag.dragged==null){return;}var shs,margins,c,cs;jQuery.iSort.helper.get(0).className=jQuery.iDrag.dragged.dragCfg.hpc;shs=jQuery.iSort.helper.get(0).style;shs.display='block';jQuery.iSort.helper.oC=jQuery.extend(jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0)),jQuery.iUtil.getSize(jQuery.iSort.helper.get(0)));shs.width=jQuery.iDrag.dragged.dragCfg.oC.wb+'px';shs.height=jQuery.iDrag.dragged.dragCfg.oC.hb+'px';margins=jQuery.iUtil.getMargins(jQuery.iDrag.dragged);shs.marginTop=margins.t;shs.marginRight=margins.r;shs.marginBottom=margins.b;shs.marginLeft=margins.l;if(jQuery.iDrag.dragged.dragCfg.ghosting==true){c=jQuery.iDrag.dragged.cloneNode(true);cs=c.style;cs.marginTop='0px';cs.marginRight='0px';cs.marginBottom='0px';cs.marginLeft='0px';cs.display='block';jQuery.iSort.helper.empty().append(c);}jQuery(jQuery.iDrag.dragged).after(jQuery.iSort.helper.get(0));jQuery.iDrag.dragged.style.display='none';},check:function(e){if(!e.dragCfg.so&&jQuery.iDrop.overzone.sortable){if(e.dragCfg.onStop)e.dragCfg.onStop.apply(dragged);jQuery(e).css('position',e.dragCfg.initialPosition||e.dragCfg.oP);jQuery(e).DraggableDestroy();jQuery(jQuery.iDrop.overzone).SortableAddItem(e);}jQuery.iSort.helper.removeClass(e.dragCfg.hpc).html('&nbsp;');jQuery.iSort.inFrontOf=null;var shs=jQuery.iSort.helper.get(0).style;shs.display='none';jQuery.iSort.helper.after(e);if(e.dragCfg.fx>0){jQuery(e).fadeIn(e.dragCfg.fx);}jQuery('body').append(jQuery.iSort.helper.get(0));var ts=[];var fnc=false;for(var i=0;i<jQuery.iSort.changed.length;i++){var iEL=jQuery.iDrop.zones[jQuery.iSort.changed[i]].get(0);var id=jQuery.attr(iEL,'id');var ser=jQuery.iSort.serialize(id);if(iEL.dropCfg.os!=ser.hash){iEL.dropCfg.os=ser.hash;if(fnc==false&&iEL.dropCfg.onChange){fnc=iEL.dropCfg.onChange;}ser.id=id;ts[ts.length]=ser;}}jQuery.iSort.changed=[];if(fnc!=false&&ts.length>0){fnc(ts);}},checkhover:function(e,o){if(!jQuery.iDrag.dragged)return;var cur=false;var i=0;if(e.dropCfg.el.size()>0){for(i=e.dropCfg.el.size();i>0;i--){if(e.dropCfg.el.get(i-1)!=jQuery.iDrag.dragged){if(!e.sortCfg.floats){if((e.dropCfg.el.get(i-1).pos.y+e.dropCfg.el.get(i-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){cur=e.dropCfg.el.get(i-1);}else{break;}}else{if((e.dropCfg.el.get(i-1).pos.x+e.dropCfg.el.get(i-1).pos.wb/2)>jQuery.iDrag.dragged.dragCfg.nx&&(e.dropCfg.el.get(i-1).pos.y+e.dropCfg.el.get(i-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){cur=e.dropCfg.el.get(i-1);}}}}}if(cur&&jQuery.iSort.inFrontOf!=cur){jQuery.iSort.inFrontOf=cur;jQuery(cur).before(jQuery.iSort.helper.get(0));}else if(!cur&&(jQuery.iSort.inFrontOf!=null||jQuery.iSort.helper.get(0).parentNode!=e)){jQuery.iSort.inFrontOf=null;jQuery(e).append(jQuery.iSort.helper.get(0));}jQuery.iSort.helper.get(0).style.display='block';},measure:function(e){if(jQuery.iDrag.dragged==null){return;}e.dropCfg.el.each(function(){this.pos=jQuery.extend(jQuery.iUtil.getSizeLite(this),jQuery.iUtil.getPosition(this));});},serialize:function(s){var i;var h='';var o={};if(s){if(jQuery.iSort.collected[s]){o[s]=[];jQuery('#'+s+' .'+jQuery.iSort.collected[s]).each(function(){if(h.length>0){h+='&';}h+=s+'[]='+jQuery.attr(this,'id');o[s][o[s].length]=jQuery.attr(this,'id');});}else{for(a in s){if(jQuery.iSort.collected[s[a]]){o[s[a]]=[];jQuery('#'+s[a]+' .'+jQuery.iSort.collected[s[a]]).each(function(){if(h.length>0){h+='&';}h+=s[a]+'[]='+jQuery.attr(this,'id');o[s[a]][o[s[a]].length]=jQuery.attr(this,'id');});}}}}else{for(i in jQuery.iSort.collected){o[i]=[];jQuery('#'+i+' .'+jQuery.iSort.collected[i]).each(function(){if(h.length>0){h+='&';}h+=i+'[]='+jQuery.attr(this,'id');o[i][o[i].length]=jQuery.attr(this,'id');});}}return{hash:h,o:o};},addItem:function(e){if(!e.childNodes){return;}return this.each(function(){if(!this.sortCfg||!jQuery(e).is('.'+this.sortCfg.accept))jQuery(e).addClass(this.sortCfg.accept);jQuery(e).Draggable(this.sortCfg.dragCfg);});},destroy:function(){return this.each(function(){jQuery('.'+this.sortCfg.accept).DraggableDestroy();jQuery(this).DroppableDestroy();this.sortCfg=null;this.isSortable=null;});},build:function(o){if(o.accept&&jQuery.iUtil&&jQuery.iDrag&&jQuery.iDrop){if(!jQuery.iSort.helper){jQuery('body',document).append('<div id="sortHelper">&nbsp;</div>');jQuery.iSort.helper=jQuery('#sortHelper');jQuery.iSort.helper.get(0).style.display='none';}this.Droppable({accept:o.accept,activeclass:o.activeclass?o.activeclass:false,hoverclass:o.hoverclass?o.hoverclass:false,helperclass:o.helperclass?o.helperclass:false,onHover:o.onHover||o.onhover,onOut:o.onOut||o.onout,sortable:true,onChange:o.onChange||o.onchange,fx:o.fx?o.fx:false,ghosting:o.ghosting?true:false,tolerance:o.tolerance?o.tolerance:'intersect'});return this.each(function(){var dragCfg={revert:o.revert?true:false,zindex:3000,opacity:o.opacity?parseFloat(o.opacity):false,hpc:o.helperclass?o.helperclass:false,fx:o.fx?o.fx:false,so:true,ghosting:o.ghosting?true:false,handle:o.handle?o.handle:null,containment:o.containment?o.containment:null,onStart:o.onStart&&o.onStart.constructor==Function?o.onStart:false,onDrag:o.onDrag&&o.onDrag.constructor==Function?o.onDrag:false,onStop:o.onStop&&o.onStop.constructor==Function?o.onStop:false,axis:/vertically|horizontally/.test(o.axis)?o.axis:false,snapDistance:o.snapDistance?parseInt(o.snapDistance)||0:false,cursorAt:o.cursorAt?o.cursorAt:false};jQuery('.'+o.accept,this).Draggable(dragCfg);this.isSortable=true;this.sortCfg={accept:o.accept,revert:o.revert?true:false,zindex:3000,opacity:o.opacity?parseFloat(o.opacity):false,hpc:o.helperclass?o.helperclass:false,fx:o.fx?o.fx:false,so:true,ghosting:o.ghosting?true:false,handle:o.handle?o.handle:null,containment:o.containment?o.containment:null,floats:o.floats?true:false,dragCfg:dragCfg};});}}};jQuery.fn.extend({Sortable:jQuery.iSort.build,SortableAddItem:jQuery.iSort.addItem,SortableDestroy:jQuery.iSort.destroy});jQuery.SortSerialize=jQuery.iSort.serialize;
