You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.3 KiB
1 lines
2.3 KiB
define(["jquery","core/config","core/str","core/ajax","format_tiles/edit_browser_storage"],function(a,b,c,d,e){"use strict";var f,g={EDITING_COLLAPSE_SECID:"#collapse",EDITING_COLLAPSE_SEC:".collapse-section",EDITING_EXPAND_SEC:".expand-section",EDITING_EXPAND_SECID:"#expand",ACTIVITY:"li.activity",SECTION_ID:"#section-",TILE_TITLE:"li.section.main .tile_bar_text .inplaceeditable a:not(.quickeditlink)",TILE_BAR_TEXT:".tile_bar_text",SECTION:"ul.section",SECTION_MAIN:"li.section.main",DNDUPLOAD_HIDDEN:"dndupload-hidden",ACTIVITYACTION:"a.cm-edit-action",ACTIONAREA:".actions",EXPAND_ALL_BTNS:".expand-collapse-all-btns a",EXPAND_COLLAPSE_SEC:".expand-collapse-sec ",EDIT_TITLE_PENCIL:".quickeditlink",ICON_PICKER_BTN:".tileiconcontainer",TILE_BAR:".tile_bar",SECTIONACTIONMENU:".section_action_menu",MENU_ACTION:".menu-action"},h={ESCAPE:27,TAB:9,RETURN:13},i={CLICK:"click",KEYDOWN:"keydown",SCROLL:"scroll"},j={SECTION:"data-section",ORIG_TITLE:"data-original-title"},k=function(b){var c=a(g.SECTION_ID+b);a(g.SECTION_ID+b+"-content").animate({opacity:0},300),c.find(g.ACTIVITY).slideUp(500),c.find(".section-modchooser").slideUp(500),c.addClass("collapsed").removeClass("expanded"),c.find(".mod-chooser-outer").fadeOut(500),e.setSectionStatus(b,!1)};return{init:function(c,d,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){f=c,r="1"===r,require(["format_tiles/edit_icon_picker"],function(a){a.init(f,v,w,z)}),x&&require(["format_tiles/edit_course_mod"],function(a){a.init(f,n,y)}),a(document).ready(function(){if(a(g.TILE_BAR_TEXT).on(i.KEYDOWN,function(c){c.keyCode!==h.RETURN||a(c.target).hasClass("form-control")||(window.location=b.wwwroot+"/course/view.php?id="+f+"§ion="+a(c.currentTarget).parent().attr(j.SECTION))}),d&&!m){var c=window.location.search.indexOf("expanded=-1")!==-1,n=a(g.SECTION_MAIN).last().attr("data-section");e.init(t,f,l,p,r,n,c)}if(!m){var o=a("[data-toggle=tooltip]");if(0!==o.length)try{o.tooltip()}catch(q){require(["core/log"],function(a){a.debug(q)})}}a("body").on("click keypress",g.SECTION_MAIN+" "+g.SECTIONACTIONMENU+"[data-sectionid] a[data-action]",function(b){var c=a(b.target).closest(g.MENU_ACTION),d=c.closest(g.SECTION_MAIN);"hide"!==c.attr("data-action")&&"show"!==c.attr("data-action")||(k(d.attr("data-section")),d.find(g.SECTION).find(g.ACTIVITY).slideUp(300).remove())})})}}});
|