芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/calendar/amd/build/month_view_drag_drop.min.js
define(["jquery","core/notification","core/str","core_calendar/events","core_calendar/drag_drop_data_store"],function(a,b,c,d,e){var f={ROOT:"[data-region='calendar']",DRAGGABLE:'[draggable="true"][data-region="event-item"]',DROP_ZONE:'[data-drop-zone="month-view-day"]',WEEK:'[data-region="month-view-week"]'},g="bg-faded",h="bg-danger text-white",i="bg-primary text-white",j=g+" "+h+" "+i,k=!1,l=function(b){var c=a(b.target).closest(f.DROP_ZONE);return c.length?c:null},m=function(a){var b=a.attr("data-day-timestamp"),c=e.getMinTimestart(),d=e.getMaxTimestart();return!(c&&c>b)&&!(d&&d
b?e.getMinError():d&&d
0){var k=a.next();if(!k.length){var l=a.closest(f.WEEK).next();l.length&&(k=l.children(f.DROP_ZONE).first())}k.length&&p(k,b,c)}},q=function(){a(f.ROOT).find(f.DROP_ZONE).each(function(b,c){c=a(c),m(c)||p(c,!1)})},r=function(b){var c=a(b.target),d=c.closest(f.DRAGGABLE);if(d.length){var g=d.find("[data-event-id]"),h=g.attr("data-event-id"),i=d.attr("data-min-day-timestamp"),j=d.attr("data-max-day-timestamp"),k=d.attr("data-min-day-error"),l=d.attr("data-max-day-error"),m=f.ROOT+' [data-event-id="'+h+'"]',n=a(m).length;e.setEventId(h),e.setDurationDays(n),i&&e.setMinTimestart(i),j&&e.setMaxTimestart(j),k&&e.setMinError(k),l&&e.setMaxError(l),b.dataTransfer.effectAllowed="move",b.dataTransfer.dropEffect="move",b.dataTransfer.setData("text/plain",h),b.dropEffect="move",q()}},s=function(a){if(e.hasEventId()){a.preventDefault();var b=l(a);b&&p(b,!0)}},t=function(a){if(e.hasEventId()){var b=l(a);b&&(p(b,!1),a.preventDefault())}},u=function(g){if(e.hasEventId()){var h=l(g);if(!h)return e.clearAll(),void o();if(m(h)){var i=e.getEventId(),j=f.ROOT+' [data-event-id="'+i+'"]',k=a(j),p=null;k.length&&(p=k.closest(f.DROP_ZONE)),a("body").trigger(d.moveEvent,[i,p,h])}else{var q=n(h);c.get_string("errorinvaliddate","calendar").then(function(a){b.exception({name:a,message:q||a})})}e.clearAll(),o(),g.preventDefault()}},v=function(){e.clearAll(),o()},w=function(){q()};return{init:function(){k||(document.addEventListener("dragstart",r,!1),document.addEventListener("dragover",s,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("drop",u,!1),document.addEventListener("dragend",v,!1),a("body").on(d.monthChanged,w),k=!0)}}});