silverstripe-framework/admin/client/dist/js/bundle-legacy.js

5 lines
78 KiB
JavaScript
Raw Normal View History

2016-05-01 22:51:31 +02:00
!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";require("../legacy/LeftAndMain.Layout.js"),require("../legacy/LeftAndMain.js"),require("../legacy/LeftAndMain.ActionTabSet.js"),require("../legacy/LeftAndMain.Panel.js"),require("../legacy/LeftAndMain.Tree.js"),require("../legacy/LeftAndMain.Content.js"),require("../legacy/LeftAndMain.EditForm.js"),require("../legacy/LeftAndMain.Menu.js"),require("../legacy/LeftAndMain.Preview.js"),require("../legacy/LeftAndMain.BatchActions.js"),require("../legacy/LeftAndMain.FieldHelp.js"),require("../legacy/LeftAndMain.FieldDescriptionToggle.js"),require("../legacy/LeftAndMain.TreeDropdownField.js"),require("../legacy/AddToCampaignForm.js")},{"../legacy/AddToCampaignForm.js":2,"../legacy/LeftAndMain.ActionTabSet.js":3,"../legacy/LeftAndMain.BatchActions.js":4,"../legacy/LeftAndMain.Content.js":5,"../legacy/LeftAndMain.EditForm.js":6,"../legacy/LeftAndMain.FieldDescriptionToggle.js":7,"../legacy/LeftAndMain.FieldHelp.js":8,"../legacy/LeftAndMain.Layout.js":9,"../legacy/LeftAndMain.Menu.js":10,"../legacy/LeftAndMain.Panel.js":11,"../legacy/LeftAndMain.Preview.js":12,"../legacy/LeftAndMain.Tree.js":13,"../legacy/LeftAndMain.TreeDropdownField.js":14,"../legacy/LeftAndMain.js":15}],2:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery);_jQuery2["default"].entwine("ss",function($){$(".add-to-campaign-action, #add-to-campaign__action").entwine({onclick:function(){var dialog=$("#add-to-campaign__dialog");dialog.length?dialog.open():(dialog=$('<div id="add-to-campaign__dialog" class="add-to-campaign__dialog" />'),$("body").append(dialog)),0===dialog.children().length&&dialog.addClass("loading");var form=this.closest("form"),button=this,formData=form.serializeArray();return formData.push({name:button.attr("name"),value:"1"}),$.ajax({url:form.attr("action"),data:formData,type:"POST",global:!1,complete:function(){dialog.removeClass("loading")},success:function(data,status,xhr){if(0===xhr.getResponseHeader("Content-Type").indexOf("text/plain")){var container=$('<div class="add-to-campaign__response add-to-campaign__response--good"><span></span></div>');container.find("span").text(data),dialog.append(container)}else dialog.html(data)},error:function error(xhr){var error=xhr.responseText||"Something went wrong. Please try again in a few minutes.",container=$('<div class="add-to-campaign__response add-to-campaign__response--error"><span></span></div>');container.find("span").text(error),dialog.append(container)}}),!1}}),$("#add-to-campaign__dialog").entwine({onadd:function(){this.is(".ui-dialog-content")||this.ssdialog({autoOpen:!0,minHeight:200,maxHeight:200,minWidth:200,maxWidth:500}),this._super()},open:function(){this.ssdialog("open")},close:function(){this.ssdialog("close")},onssdialogclose:function(){this.empty()},"onchosen:showing_dropdown":function(){this.css({overflow:"visible"})},"onchosen:hiding_dropdown":function(){this.css({overflow:""})}})})},{jQuery:"jQuery"}],3:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery);_jQuery2["default"].entwine("ss",function($){$(".ss-tabset.ss-ui-action-tabset").entwine({IgnoreTabState:!0,onadd:function(){this._super(),this.tabs({collapsible:!0,active:!1})},onremove:function(){var frame=$(".cms-container").find("iframe");frame.each(function(index,iframe){try{$(iframe).contents().off("click.ss-ui-action-tabset")}catch(e){console.warn
return this.parents("li:first")}}),$(".cms-menu-list li a").entwine({onclick:function(e){var isExternal=$.path.isExternal(this.attr("href"));if(!(e.which>1||isExternal)&&"_blank"!=this.attr("target")){e.preventDefault();var item=this.getMenuItem(),url=this.attr("href");isExternal||(url=$("base").attr("href")+url);var children=item.find("li");if(children.length)children.first().find("a").click();else if(!$(".cms-container").loadPanel(url))return!1;item.select()}}}),$(".cms-menu-list li .toggle-children").entwine({onclick:function(e){var li=this.closest("li");return li.toggle(),!1}}),$(".cms .profile-link").entwine({onclick:function(){return $(".cms-container").loadPanel(this.attr("href")),$(".cms-menu-list li").removeClass("current").close(),!1}}),$(".cms-menu .sticky-toggle").entwine({onadd:function(){var isSticky=!!$(".cms-menu").getPersistedStickyState();this.toggleCSS(isSticky),this.toggleIndicator(isSticky),this._super()},toggleCSS:function(isSticky){this[isSticky?"addClass":"removeClass"]("active")},toggleIndicator:function(isSticky){this.next(".sticky-status-indicator").text(isSticky?"fixed":"auto")},onclick:function(){var $menu=this.closest(".cms-menu"),persistedCollapsedState=$menu.getPersistedCollapsedState(),persistedStickyState=$menu.getPersistedStickyState(),newStickyState=void 0===persistedStickyState?!this.hasClass("active"):!persistedStickyState;void 0===persistedCollapsedState?$menu.setPersistedCollapsedState($menu.hasClass("collapsed")):void 0!==persistedCollapsedState&&newStickyState===!1&&$menu.clearPersistedCollapsedState(),$menu.setPersistedStickyState(newStickyState),this.toggleCSS(newStickyState),this.toggleIndicator(newStickyState),this._super()}})})},{jQuery:"jQuery"}],11:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery);_jQuery2["default"].entwine("ss",function($){$.entwine.warningLevel=$.entwine.WARN_LEVEL_BESTPRACTISE,$(".cms-panel").entwine({WidthExpanded:null,WidthCollapsed:null,canSetCookie:function(){return void 0!==$.cookie&&void 0!==this.attr("id")},getPersistedCollapsedState:function(){var isCollapsed,cookieValue;return this.canSetCookie()&&(cookieValue=$.cookie("cms-panel-collapsed-"+this.attr("id")),void 0!==cookieValue&&null!==cookieValue&&(isCollapsed="true"===cookieValue)),isCollapsed},setPersistedCollapsedState:function(newState){this.canSetCookie()&&$.cookie("cms-panel-collapsed-"+this.attr("id"),newState,{path:"/",expires:31})},clearPersistedCollapsedState:function(){this.canSetCookie()&&$.cookie("cms-panel-collapsed-"+this.attr("id"),"",{path:"/",expires:-1})},getInitialCollapsedState:function(){var isCollapsed=this.getPersistedCollapsedState();return void 0===isCollapsed&&(isCollapsed=this.hasClass("collapsed")),isCollapsed},onadd:function(){var collapsedContent,container;if(!this.find(".cms-panel-content").length)throw new Exception('Content panel for ".cms-panel" not found');this.find(".cms-panel-toggle").length||(container=$("<div class='cms-panel-toggle south'></div>").append('<a class="toggle-expand" href="#"><span>&raquo;</span></a>').append('<a class="toggle-collapse" href="#"><span>&laquo;</span></a>'),this.append(container)),this.setWidthExpanded(this.find(".cms-panel-content").innerWidth()),collapsedContent=this.find(".cms-panel-content-collapsed"),this.setWidthCollapsed(collapsedContent.length?collapsedContent.innerWidth():this.find(".toggle-expand").innerWidth()),this.togglePanel(!this.getInitialCollapsedState(),!0,!1),this._super()},togglePanel:function(doExpand,silent,doSaveState){var newWidth,collapsedContent;silent||(this.trigger("beforetoggle.sspanel",doExpand),this.trigger(doExpand?"beforeexpand":"beforecollapse")),this.toggleClass("collapsed",!doExpand),newWidth=doExpand?this.getWidthExpanded():this.getWidthCollapsed(),this.width(newWidth),collapsedContent=this.find(".cms-panel-content-collapsed"),collapsedContent.length&&(this.find(".cms-panel-content")[doExpand?"show":"hide"](),this.find(".cms-panel-conten
return this.setPauseState(!0),null!==lastState?_Router2["default"].show(lastState.url):_Router2["default"].back(),void this.setPauseState(!1)}if(this.setLastState(historyState),contentEls.length<fragmentsArr.length&&(fragments="Content",fragmentsArr=["Content"],contentEls=this._findFragments(fragmentsArr)),this.trigger("beforestatechange",{state:historyState,element:contentEls}),headers["X-Pjax"]=fragments,"undefined"!=typeof historyState.__forceReferer){var url=historyState.__forceReferer;try{url=decodeURI(url)}catch(e){}finally{headers["X-Backurl"]=encodeURI(url)}}contentEls.addClass("loading");var promise=$.ajax({headers:headers,url:historyState.path}).done(function(data,status,xhr){var els=self.handleAjaxResponse(data,status,xhr,historyState);self.trigger("afterstatechange",{data:data,status:status,xhr:xhr,element:els,state:historyState})}).always(function(){self.setStateChangeXHR(null),contentEls.removeClass("loading")});return this.setStateChangeXHR(promise),promise}},loadFragment:function(url,pjaxFragments){var xhr,self=this,headers={},baseUrl=$("base").attr("href"),fragmentXHR=this.getFragmentXHR();return"undefined"!=typeof fragmentXHR[pjaxFragments]&&null!==fragmentXHR[pjaxFragments]&&(fragmentXHR[pjaxFragments].abort(),fragmentXHR[pjaxFragments]=null),url=$.path.isAbsoluteUrl(url)?url:$.path.makeUrlAbsolute(url,baseUrl),headers["X-Pjax"]=pjaxFragments,xhr=$.ajax({headers:headers,url:url,success:function(data,status,xhr){var elements=self.handleAjaxResponse(data,status,xhr,null);self.trigger("afterloadfragment",{data:data,status:status,xhr:xhr,elements:elements})},error:function(xhr,status,_error){self.trigger("loadfragmenterror",{xhr:xhr,status:status,error:_error})},complete:function(){var fragmentXHR=self.getFragmentXHR();"undefined"!=typeof fragmentXHR[pjaxFragments]&&null!==fragmentXHR[pjaxFragments]&&(fragmentXHR[pjaxFragments]=null)}}),fragmentXHR[pjaxFragments]=xhr,xhr},handleAjaxResponse:function(data,status,xhr,state){var url,guessFragment,fragment,$data;if(xhr.getResponseHeader("X-Reload")&&xhr.getResponseHeader("X-ControllerURL")){var baseUrl=$("base").attr("href"),rawURL=xhr.getResponseHeader("X-ControllerURL"),url=$.path.isAbsoluteUrl(rawURL)?rawURL:$.path.makeUrlAbsolute(rawURL,baseUrl);return void(document.location.href=url)}if(data){var title=xhr.getResponseHeader("X-Title");title&&(document.title=decodeURIComponent(title.replace(/\+/g," ")));var newContentEls,newFragments={};xhr.getResponseHeader("Content-Type").match(/^((text)|(application))\/json[ \t]*;?/i)?newFragments=data:(fragment=document.createDocumentFragment(),jQuery.clean([data],document,fragment,[]),$data=$(jQuery.merge([],fragment.childNodes)),guessFragment="Content",$data.is("form")&&!$data.is("[data-pjax-fragment~=Content]")&&(guessFragment="CurrentForm"),newFragments[guessFragment]=$data),this.setRedrawSuppression(!0);try{$.each(newFragments,function(newFragment,html){var contentEl=$("[data-pjax-fragment]").filter(function(){return-1!=$.inArray(newFragment,$(this).data("pjaxFragment").split(" "))}),newContentEl=$(html);if(newContentEls?newContentEls.add(newContentEl):newContentEls=newContentEl,newContentEl.find(".cms-container").length)throw'Content loaded via ajax is not allowed to contain tags matching the ".cms-container" selector to avoid infinite loops';var origStyle=contentEl.attr("style"),origParent=contentEl.parent(),origParentLayoutApplied="undefined"!=typeof origParent.data("jlayout"),layoutClasses=["east","west","center","north","south","column-hidden"],elemClasses=contentEl.attr("class"),origLayoutClasses=[];elemClasses&&(origLayoutClasses=$.grep(elemClasses.split(" "),function(val){return $.inArray(val,layoutClasses)>=0})),newContentEl.removeClass(layoutClasses.join(" ")).addClass(origLayoutClasses.join(" ")),origStyle&&newContentEl.attr("style",origStyle);var styles=newContentEl.find("style").detach();styles.length&&$(document).find("head").append(styles),contentEl.replaceWith(newContentEl),!origParent.is(".cms-container")&&origParentLayoutApplied&&origParent.layout()});var newForm=newContentEls.filter("form");new
//# sourceMappingURL=bundle-legacy.js.map