芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/blocks/timeline/amd/build/view_courses.min.js
define(["jquery","core/notification","core/custom_interaction_events","core/str","core/templates","block_timeline/event_list","core_course/repository","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g,h){var i={MORE_COURSES_BUTTON:'[data-action="more-courses"]',MORE_COURSES_BUTTON_CONTAINER:'[data-region="more-courses-button-container"]',NO_COURSES_EMPTY_MESSAGE:'[data-region="no-courses-empty-message"]',COURSES_LIST:'[data-region="courses-list"]',COURSE_ITEMS_LOADING_PLACEHOLDER:'[data-region="course-items-loading-placeholder"]',COURSE_EVENTS_CONTAINER:'[data-region="course-events-container"]',COURSE_NAME:'[data-region="course-name"]',LOADING_ICON:".loading-icon"},j={COURSE_ITEMS:"block_timeline/course-items",LOADING_ICON:"core/loading"},k="inprogress",l="fullname asc",m=5,n=2,o=86400,p=function(a){a.find(i.COURSE_ITEMS_LOADING_PLACEHOLDER).addClass("hidden")},q=function(a){a.find(i.MORE_COURSES_BUTTON_CONTAINER).addClass("hidden")},r=function(a){a.find(i.MORE_COURSES_BUTTON_CONTAINER).removeClass("hidden")},s=function(a){var b=a.find(i.MORE_COURSES_BUTTON);b.prop("disabled",!0),e.render(j.LOADING_ICON,{}).then(function(a){return b.append(a),a})["catch"](function(){return!1})},t=function(a){var b=a.find(i.MORE_COURSES_BUTTON);b.prop("disabled",!1),b.find(i.LOADING_ICON).remove()},u=function(a){a.find(i.NO_COURSES_EMPTY_MESSAGE).removeClass("hidden")},v=function(a,b){var c=a.find(i.COURSES_LIST);e.appendNodeContents(c,b,"")},w=function(a){return a.find(i.COURSE_EVENTS_CONTAINER).length>0},x=function(a){return parseInt(a.attr("data-offset"),10)},y=function(a,b){a.attr("data-offset",b)},z=function(a){return parseInt(a.attr("data-limit"),10)},A=function(a){return parseInt(a.attr("data-days-offset"),10)},B=function(a){var b=a.attr("data-days-limit");return void 0!=b?parseInt(b,10):void 0},C=function(a){return parseInt(a.attr("data-midnight"),10)},D=function(a){var b=C(a),c=A(a);return b+c*o},E=function(a){var b=C(a),c=B(a);return void 0!=c&&b+c*o},F=function(a,b,c,d){var e={courseids:a,starttime:b,limit:c};return d&&(e.endtime=d),h.queryByCourses(e)},G=function(a){return a.data("last-event-load-time")},H=function(a,b){a.data("last-event-load-time",b)},I=function(a,b){return G(a)>b},J=function(a,b,c){var d=a.map(function(a){return a.id});return F(d,b,m+1,c)},K=function(a,b,c,d,f,g){return e.render(j.COURSE_ITEMS,{courses:a,midnight:c,hasdaysoffset:!0,hasdayslimit:void 0!=f,daysoffset:d,dayslimit:f,nodayslimit:void 0==f,urls:{noevents:g}}).then(function(a){return p(b),a?v(b,a):w(b)||u(b),a}).then(function(c){return a.length