Merge pull request #1383 from open-sausages/pulls/4.0/module-loader

Correctly require thirdparty JavaScript modules
This commit is contained in:
Damian Mooyman 2016-02-02 15:05:41 +13:00
commit 3d99ee07b7
19 changed files with 32 additions and 32 deletions

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.AssetAdmin', ['../../../framework/javascript/dist/jQuery', '../../../framework/javascript/dist/i18n'], factory);
define('ss.AssetAdmin', ['jQuery', 'i18n'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'), require('../../../framework/javascript/dist/i18n'));
factory(require('jQuery'), require('i18n'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.CMSMain.AddForm', ['../../../framework/javascript/dist/jQuery'], factory);
define('ss.CMSMain.AddForm', ['jQuery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'));
factory(require('jQuery'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.CMSMain.EditForm', ['../../../framework/javascript/dist/jQuery', '../../../framework/javascript/dist/i18n'], factory);
define('ss.CMSMain.EditForm', ['jQuery', 'i18n'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'), require('../../../framework/javascript/dist/i18n'));
factory(require('jQuery'), require('i18n'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.CMSMain.Tree', ['../../../framework/javascript/dist/jQuery', '../../../framework/javascript/dist/i18n'], factory);
define('ss.CMSMain.Tree', ['jQuery', 'i18n'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'), require('../../../framework/javascript/dist/i18n'));
factory(require('jQuery'), require('i18n'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.CMSMain', ['../../../framework/javascript/dist/jQuery'], factory);
define('ss.CMSMain', ['jQuery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'));
factory(require('jQuery'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.CMSPageHistoryController', ['../../../framework/javascript/dist/jQuery', '../../../framework/javascript/dist/i18n'], factory);
define('ss.CMSPageHistoryController', ['jQuery', 'i18n'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'), require('../../../framework/javascript/dist/i18n'));
factory(require('jQuery'), require('i18n'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.RedirectorPage', ['../../../framework/javascript/dist/jQuery'], factory);
define('ss.RedirectorPage', ['jQuery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'));
factory(require('jQuery'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.SilverStripeNavigator', ['../../../framework/javascript/dist/jQuery'], factory);
define('ss.SilverStripeNavigator', ['jQuery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'));
factory(require('jQuery'));
} else {
var mod = {
exports: {}

View File

@ -1,8 +1,8 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define('ss.SiteTreeURLSegmentField', ['../../../framework/javascript/dist/jQuery'], factory);
define('ss.SiteTreeURLSegmentField', ['jQuery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('../../../framework/javascript/dist/jQuery'));
factory(require('jQuery'));
} else {
var mod = {
exports: {}

View File

@ -1 +1 @@
!function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return a(n?n:t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".cms-add-form .parent-mode :input").entwine({onclick:function(t){if("top"==this.val()){var e=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");e.setValue(""),e.setTitle("")}}}),t(".cms-add-form").entwine({ParentID:0,ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",function(){t.updateTypeList()}),this.find(".SelectionGroup.parent-mode").bind("change",function(){t.updateTypeList()}),this.updateTypeList()},loadCachedChildren:function(t){var e=this.getParentCache();return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function(t,e){var n=this.getParentCache();n[t]=e,this.setParentCache(n)},updateTypeList:function(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),i=this.find("input[name=ParentModeField]:checked").val(),a=n.data("metadata"),r=a&&"child"===i?n.getValue()||this.getParentID():null,o=a?a.ClassName:null,s=o&&"child"===i?o:"Root",l="undefined"!=typeof e[s]?e[s]:null,d=this,c=l&&"undefined"!=typeof l.defaultChild?l.defaultChild:null,u=[];if(r){if(this.hasClass("loading"))return;return this.addClass("loading"),this.setParentID(r),n.getValue()||n.setValue(r),u=this.loadCachedChildren(r),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:d.data("childfilter"),data:{ParentID:r},success:function(t){d.saveCachedChildren(r,t),d.updateSelectionFilter(t,c)},complete:function(){d.removeClass("loading")}}),!1)}u=l&&"undefined"!=typeof l.disallowedChildren?l.disallowedChildren:[],this.updateSelectionFilter(u,c)},updateSelectionFilter:function(e,n){var i=null;if(this.find("#Form_AddForm_PageType li").each(function(){var n=t(this).find("input").val(),a=-1===t.inArray(n,e);t(this).setEnabled(a),a||t(this).setSelected(!1),i=null===i?a:i&&a}),n)var a=this.find("#Form_AddForm_PageType li input[value="+n+"]").parents("li:first");else var a=this.find("#Form_AddForm_PageType li:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1);var r=this.find("#Form_AddForm_PageType li:not(.disabled)").length?"enable":"disable";this.find("button[name=action_doAdd]").button(r),this.find(".message-restricted")[i?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType li").entwine({onclick:function(t){this.setSelected(!0)},setSelected:function(t){var e=this.find("input");t&&!e.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),e.prop("checked",!0)):(this.toggleClass("selected",!1),e.prop("checked",!1))},setEnabled:function(e){t(this).toggleClass("disabled",!e),e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-page-add-button").entwine({onclick:function(e){var n=t(".cms-tree"),i=t(".cms-list"),a=0;if(n.is(":visible")){var r=n.jstree("get_selected");a=r?t(r[0]).data("id"):null}else{var o=i.find('input[name="Page[GridState]"]').val();o&&(a=parseInt(JSON.parse(o).ParentID,10))}var s,l={selector:this.data("targetPanel"),pjax:this.data("pjax")};a?(extraParams=this.data("extraParams")?this.data("extraParams"):"",s=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),a),extraParams)):s=this.attr("href"),t(".cms-container").loadPanel(s,null,l),e.preventDefault(),this.blur()}})})},{"../../../framework/javascript/dist/jQuery":11}],2:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a),o=t("../../../framework/javascript/dist/i18n"),s=i(o);r["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function(){alert(s["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var e=this;e.data("OrigVal",e.val());var n=e.closest("form"),i=t("input:text[name=URLSegment]",n),a=t("input[name=LiveLink]",n);i.length>0&&(e._addActions(),this.bind("change",function(n){var r=e.data("OrigVal"),o=e.val();e.data("OrigVal",o),0===i.val().indexOf(i.data("defaultUrl"))&&""==a.val()?e.updateURLSegment(o):t(".update",e.parent()).show(),e.updateRelatedFields(o,r),e.updateBreadcrumbLabel(o)})),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var i=t(this);i.val()==n&&(i.val(e),i.updatedRelatedFields&&i.updatedRelatedFields())})},updateURLSegment:function(e){var n=t("input:text[name=URLSegment]",this.closest("form")),i=n.closest(".field.urlsegment"),a=t(".update",this.parent());i.update(e),a.is(":visible")&&a.hide()},updateBreadcrumbLabel:function(e){var n=(t(".cms-edit-form input[name=ID]").val(),t("span.cms-panel-link.crumb"));e&&""!=e&&n.text(e)},_addActions:function(){var e,n=this;e=t("<button />",{"class":"update ss-ui-button-small",text:s["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function(t){t.preventDefault(),n.updateURLSegment(n.val())}}),e.insertAfter(n),e.hide()}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function(){var t=this;this.find(":input[name=ParentType]").bind("click",function(e){t._toggleSelection(e)}),this.find(".TreeDropdownField").bind("change",function(e){t._changeParentId(e)}),this._changeParentId(),this._toggleSelection(),this._super()},onunmatch:function(){this._super()},_toggleSelection:function(t){var e=this.find(":input[name=ParentType]:checked").val();"root"==e?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),this.find("#Form_EditForm_ParentID_Holder").toggle("root"!=e)},_changeParentId:function(t){var e=this.find(":input[name=ParentID]").val();this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue",e)}}),t(".cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType").entwine({onmatch:function(){var e;"CanViewType"==this.attr("id")?e=t("#Form_EditForm_ViewerGroups_Holder"):"CanEditType"==this.attr("id")?e=t("#Form_EditForm_EditorGroups_Holder"):"CanCreateTopLevelType"==this.attr("id")&&(e=t("#Form_EditForm_CreateTopLevelGroups_Holder")),this.find(".optionset :input").bind("change",function(n){var i=t(this).closest(".middleColumn").parent("div");"OnlyTheseUsers"==n.target.value?(i.addClass("remove-splitter"),e.show()):(i.removeClass("remove-splitter"),e.hide())});var n=this.find("input[name="+this.attr("id")+"]:checked").val();e["OnlyTheseUsers"==n?"show":"hide"](),this._super()},onunmatch:function(){this._super()}}),t(".cms-edit-form .Actions #Form_EditForm_action_print").entwine({onclick:function(e){var n=t(this[0].form).attr("action").replace(/\?.*$/,"")+"/printable/"+t(":input[name=ID]",this[0].form).val();return"http://"!=n.substr(0,7)&&(n=t("base").attr("href")+n),window.open(n,"printable"),!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_rollback").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=n?s["default"].sprintf(s["default"]._t("CMSMain.RollbackToVersion"),n):s["default"]._t("CMSMain.ConfirmRestoreFromLive"),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_archive").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Archive"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_restore").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="",a=this.data("toRoot");return i=s["default"].sprintf(s["default"]._t(a?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_delete").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.DeleteFromDraft"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_unpublish").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Unpublish"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form.changed").entwine({onmatch:function(t){this.find("button[name=action_save]").button("option","showingAlternate",!0),this.find("button[name=action_publish]").button("option","showingAlternate",!0),this._super(t)},onunmatch:function(t){var e=this.find("button[name=action_save]");e.data("button")&&e.button("option","showingAlternate",!1);var n=this.find("button[name=action_publish]");n.data("button")&&n.button("option","showingAlternate",!1),this._super(t)}}),t(".cms-edit-form .Actions button[name=action_publish]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t(".cms-edit-form .Actions button[name=action_save]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function(){this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder");"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()})},{"../../../framework/javascript/dist/i18n":10,"../../../framework/javascript/dist/jQuery":11}],3:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a),o=t("../../../framework/javascript/dist/i18n"),s=i(o);r["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function(t){this.adjustContextClass()}},adjustContextClass:function(){var e=t("#vakata-contextmenu").find("ul ul");e.each(function(n){var i="1",a=t(e[n]).find("li").length;a>20?i="3":a>10&&(i="2"),t(e[n]).addClass("col-"+i).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function(){var e=this,n=this._super();this.getHints();return n.plugins.push("contextmenu"),n.contextmenu={items:function(n){var i={edit:{label:s["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(s["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}};n.hasClass("nochildren")||(i.showaslist={label:s["default"]._t("Tree.ShowAsList"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}});var a=(n.data("pagetype"),n.data("id")),r=n.find(">a .item").data("allowedchildren"),o={},l=!1;return t.each(r,function(n,i){l=!0,o["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+i,_class:"class-"+n,action:function(i){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlAddpage"),a,n),e.data("extraParams")))}}}),l&&(i.addsubpage={label:s["default"]._t("Tree.AddSubPage","Add page under this page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),submenu:o}),i.duplicate={label:s["default"]._t("Tree.Duplicate"),submenu:[{label:s["default"]._t("Tree.ThisPageOnly"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))}},{label:s["default"]._t("Tree.ThisPageAndSubpages"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))}}]},i}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function(){var t,e=this,n=e.parents(".cms-panel-content");(e.offset().top<0||e.offset().top>n.height()-e.height())&&(t=n.scrollTop()+e.offset().top+n.height()/2,n.animate({scrollTop:t},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function(){window.location=location.protocol+"//"+location.host+location.pathname}}),t(".cms-tree-filtered").entwine({onmatch:function(){var e=this,n=function(){var n=t(".cms-content-tools .cms-panel-content").height()-e.parent().siblings(".cms-content-toolbar").outerHeight(!0);e.css("height",n+"px")};n(),t(window).on("resize",window.ss.debounce(n,300))}})})},{"../../../framework/javascript/dist/i18n":10,"../../../framework/javascript/dist/jQuery":11}],4:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".cms-content-header-info").entwine({"from .cms-panel":{ontoggle:function(t){var e=this.closest(".cms-content").find(t.target);0!==e.length&&this.parent()[e.hasClass("collapsed")?"addClass":"removeClass"]("collapsed")}}}),t(".cms-content-toolbar").entwine({onmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this),i=n.data("toolid");n.hasClass("active");void 0!==i&&(n.data("active",!1).removeClass("active"),t("#"+i).hide(),e.bindActionButtonEvents(n))})},onunmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this);e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function(t){var e=this;t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function(t){t.off(".cmsContentToolbar")},showHideTool:function(e){var n=e.data("active"),i=e.data("toolid"),a=t("#"+i);t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"));e.data("toolid")!==i&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),a[n?"hide":"show"](),e.data("active",!n)}})})},{"../../../framework/javascript/dist/jQuery":11}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a),o=t("../../../framework/javascript/dist/i18n"),s=i(o);r["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function(){this._super()},onunmatch:function(){this._super()},onsubmit:function(e,n){e.preventDefault();var i;if(i=this.find(":input[name=ID]").val(),!i)return!1;var a,r,o,l,d,c;if(c=this.find(":input[name=CompareMode]").is(":checked"),o=this.find("table input[type=checkbox]").filter(":checked"),c){if(2!=o.length)return!1;l=o.eq(0).val(),d=o.eq(1).val(),a=this.find(":submit[name=action_doCompare]"),r=s["default"].sprintf(this.data("linkTmplCompare"),i,d,l)}else l=o.eq(0).val(),a=this.find(":submit[name=action_doShowVersion]"),r=s["default"].sprintf(this.data("linkTmplShow"),i,l);t(".cms-container").loadPanel(r,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function(){this.toggle(),this._super()},onunmatch:function(){this._super()},onchange:function(){this.toggle()},toggle:function(){var e=t(this),n=e.parents("form");e.attr("checked")?n.find("tr[data-published=false]").show():n.find("tr[data-published=false]").hide()._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function(t){var e,n;return e=this.parents("form").find(":input[name=CompareMode]").attr("checked"),n=this.siblings(".active"),e&&this.hasClass("active")?void this._unselect():e?n.length>1?alert(s["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(),void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)},_select:function(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},{"../../../framework/javascript/dist/i18n":10,"../../../framework/javascript/dist/jQuery":11}],6:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a);r["default"].entwine("ss",function(t){t("#Form_EditForm_RedirectionType input").entwine({onmatch:function(){var e=t(this);e.attr("checked")&&this.toggle(),this._super()},onunmatch:function(){this._super()},onclick:function(){this.toggle()},toggle:function(){"Internal"==t(this).attr("value")?(t("#Form_EditForm_ExternalURL_Holder").hide(),t("#Form_EditForm_LinkToID_Holder").show()):(t("#Form_EditForm_ExternalURL_Holder").show(),t("#Form_EditForm_LinkToID_Holder").hide())}})})},{"../../../framework/javascript/dist/jQuery":11}],7:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(t){var e=document.getElementsByTagName("base")[0].href.replace("http://","").replace(/\//g,"_").replace(/\./g,"_");return e+t}var r=t("../../../framework/javascript/dist/jQuery"),o=i(r);(0,o["default"])(document).ready(function(){(0,o["default"])("#switchView a.newWindow").on("click",function(t){var e=window.open(this.href,a(this.target));return e.focus(),!1}),(0,o["default"])("#SilverStripeNavigatorLink").on("click",function(t){return(0,o["default"])("#SilverStripeNavigatorLinkPopup").toggle(),!1}),(0,o["default"])("#SilverStripeNavigatorLinkPopup a.close").on("click",function(t){return(0,o["default"])("#SilverStripeNavigatorLinkPopup").hide(),!1}),(0,o["default"])("#SilverStripeNavigatorLinkPopup input").on("focus",function(t){this.select()})})},{"../../../framework/javascript/dist/jQuery":11}],8:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("../../../framework/javascript/dist/jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".field.urlsegment:not(.readonly)").entwine({MaxPreviewLength:55,Ellipsis:"...",onmatch:function(){this.find(":text").length&&this.toggleEdit(!1),this.redraw(),this._super()},redraw:function(){var t=this.find(":text"),e=decodeURI(t.data("prefix")+t.val()),n=e;e.length>this.getMaxPreviewLength()&&(n=this.getEllipsis()+e.substr(e.length-this.getMaxPreviewLength(),e.length)),this.find(".preview").attr("href",encodeURI(e+t.data("suffix"))).text(n)},toggleEdit:function(t){var e=this.find(":text");this.find(".preview-holder")[t?"hide":"show"](),this.find(".edit-holder")[t?"show":"hide"](),t&&(e.data("origval",e.val()),e.focus())},update:function(){var t=this,e=this.find(":text"),n=e.data("origval"),i=arguments[0],a=i&&""!==i?i:e.val();n!=a?(this.addClass("loading"),this.suggest(a,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function(){var t=this.find(":text");t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function(e,n){var i=this,a=i.find(":text"),r=t.path.parseUrl(i.closest("form").attr("action")),o=r.hrefNoSearch+"/field/"+a.attr("name")+"/suggest/?value="+encodeURIComponent(e);r.search&&(o+="&"+r.search.replace(/^\?/,"")),t.ajax({url:o,success:function(t){n.apply(this,arguments)},error:function(t,e){t.statusText=t.responseText},complete:function(){i.removeClass("loading")}})}}),t(".field.urlsegment .edit").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").cancel()}})})},{"../../../framework/javascript/dist/jQuery":11}],9:[function(t,e,n){"use strict";t("../../src/CMSMain.AddForm.js"),t("../../src/CMSMain.EditForm.js"),t("../../src/CMSMain.js"),t("../../src/CMSMain.Tree.js"),t("../../src/CMSPageHistoryController.js"),t("../../src/RedirectorPage.js"),t("../../src/SilverStripeNavigator.js"),t("../../src/SiteTreeURLSegmentField.js")},{"../../src/CMSMain.AddForm.js":1,"../../src/CMSMain.EditForm.js":2,"../../src/CMSMain.Tree.js":3,"../../src/CMSMain.js":4,"../../src/CMSPageHistoryController.js":5,"../../src/RedirectorPage.js":6,"../../src/SilverStripeNavigator.js":7,"../../src/SiteTreeURLSegmentField.js":8}],10:[function(t,e,n){"use strict";!function(t,e){if("function"==typeof define&&define.amd)define("ss.i18n",["exports"],e);else if("undefined"!=typeof n)e(n);else{var i={exports:{}};e(i.exports),t.ssI18n=i.exports}}(void 0,function(t){function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),i=function(){function t(){e(this,t),this.currentLocale=null,this.defaultLocale="en_US",this.lang={}}return n(t,[{key:"setLocale",value:function(t){this.currentLocale=t}},{key:"getLocale",value:function(){return null!==this.currentLocale?this.currentLocale:this.defaultLocale}},{key:"_t",value:function(t,e,n,i){var a=this.getLocale().replace(/_[\w]+/i,""),r=this.defaultLocale.replace(/_[\w]+/i,"");return this.lang&&this.lang[this.getLocale()]&&this.lang[this.getLocale()][t]?this.lang[this.getLocale()][t]:this.lang&&this.lang[a]&&this.lang[a][t]?this.lang[a][t]:this.lang&&this.lang[this.defaultLocale]&&this.lang[this.defaultLocale][t]?this.lang[this.defaultLocale][t]:this.lang&&this.lang[r]&&this.lang[r][t]?this.lang[r][t]:e?e:""}},{key:"addDictionary",value:function(t,e){"undefined"==typeof this.lang[t]&&(this.lang[t]={});for(var n in e)this.lang[t][n]=e[n]}},{key:"getDictionary",value:function(t){return this.lang[t]}},{key:"stripStr",value:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}},{key:"stripStrML",value:function(t){for(var e=t.split("\n"),n=0;n<e.length;n+=1)e[n]=stripStr(e[n]);return stripStr(e.join(" "))}},{key:"sprintf",value:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];if(0===n.length)return t;var a=new RegExp("(.?)(%s)","g"),r=0;return t.replace(a,function(t,e,i,a,o){return"%"===e?t:e+n[r+=1]})}},{key:"inject",value:function(t,e){var n=new RegExp("{([A-Za-z0-9_]*)}","g");return t.replace(n,function(t,n,i,a){return e[n]?e[n]:t})}},{key:"detectLocale",value:function(){var e,n;if(e=jQuery("body").attr("lang"),!e)for(var i=document.getElementsByTagName("meta"),a=0;a<i.length;a++)i[a].attributes["http-equiv"]&&"content-language"==i[a].attributes["http-equiv"].nodeValue.toLowerCase()&&(e=i[a].attributes.content.nodeValue);e||(e=this.defaultLocale);var r=e.match(/([^-|_]*)[-|_](.*)/);if(2==e.length){for(var o in t.lang)if(o.substr(0,2).toLowerCase()==e.toLowerCase()){n=o;break}}else r&&(n=r[1].toLowerCase()+"_"+r[2].toUpperCase());return n}},{key:"addEvent",value:function(t,e,n,i){return t.addEventListener?(t.addEventListener(e,n,i),!0):t.attachEvent?t.attachEvent("on"+e,n):void console.log("Handler could not be attached")}}]),t}(),a=new i;window.ss="undefined"!=typeof window.ss?window.ss:{},window.ss.i18n=window.i18n=a,t["default"]=a})},{}],11:[function(t,e,n){"use strict";!function(t,e){if("function"==typeof define&&define.amd)define("ss.jQuery",["exports"],e);else if("undefined"!=typeof n)e(n);else{var i={exports:{}};e(i.exports),t.ssJQuery=i.exports}}(void 0,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e="undefined"!=typeof window.jQuery?window.jQuery:null;t["default"]=e})},{}]},{},[9]);
!function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var d="function"==typeof require&&require;if(!s&&d)return d(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return a(n?n:t)},c,c.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".cms-add-form .parent-mode :input").entwine({onclick:function(t){if("top"==this.val()){var e=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");e.setValue(""),e.setTitle("")}}}),t(".cms-add-form").entwine({ParentID:0,ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",function(){t.updateTypeList()}),this.find(".SelectionGroup.parent-mode").bind("change",function(){t.updateTypeList()}),this.updateTypeList()},loadCachedChildren:function(t){var e=this.getParentCache();return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function(t,e){var n=this.getParentCache();n[t]=e,this.setParentCache(n)},updateTypeList:function(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),i=this.find("input[name=ParentModeField]:checked").val(),a=n.data("metadata"),r=a&&"child"===i?n.getValue()||this.getParentID():null,o=a?a.ClassName:null,s=o&&"child"===i?o:"Root",d="undefined"!=typeof e[s]?e[s]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[];if(r){if(this.hasClass("loading"))return;return this.addClass("loading"),this.setParentID(r),n.getValue()||n.setValue(r),u=this.loadCachedChildren(r),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),data:{ParentID:r},success:function(t){l.saveCachedChildren(r,t),l.updateSelectionFilter(t,c)},complete:function(){l.removeClass("loading")}}),!1)}u=d&&"undefined"!=typeof d.disallowedChildren?d.disallowedChildren:[],this.updateSelectionFilter(u,c)},updateSelectionFilter:function(e,n){var i=null;if(this.find("#Form_AddForm_PageType li").each(function(){var n=t(this).find("input").val(),a=-1===t.inArray(n,e);t(this).setEnabled(a),a||t(this).setSelected(!1),i=null===i?a:i&&a}),n)var a=this.find("#Form_AddForm_PageType li input[value="+n+"]").parents("li:first");else var a=this.find("#Form_AddForm_PageType li:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1);var r=this.find("#Form_AddForm_PageType li:not(.disabled)").length?"enable":"disable";this.find("button[name=action_doAdd]").button(r),this.find(".message-restricted")[i?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType li").entwine({onclick:function(t){this.setSelected(!0)},setSelected:function(t){var e=this.find("input");t&&!e.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),e.prop("checked",!0)):(this.toggleClass("selected",!1),e.prop("checked",!1))},setEnabled:function(e){t(this).toggleClass("disabled",!e),e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-page-add-button").entwine({onclick:function(e){var n=t(".cms-tree"),i=t(".cms-list"),a=0;if(n.is(":visible")){var r=n.jstree("get_selected");a=r?t(r[0]).data("id"):null}else{var o=i.find('input[name="Page[GridState]"]').val();o&&(a=parseInt(JSON.parse(o).ParentID,10))}var s,d={selector:this.data("targetPanel"),pjax:this.data("pjax")};a?(extraParams=this.data("extraParams")?this.data("extraParams"):"",s=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),a),extraParams)):s=this.attr("href"),t(".cms-container").loadPanel(s,null,d),e.preventDefault(),this.blur()}})})},{jQuery:"jQuery"}],2:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a),o=t("i18n"),s=i(o);r["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function(){alert(s["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var e=this;e.data("OrigVal",e.val());var n=e.closest("form"),i=t("input:text[name=URLSegment]",n),a=t("input[name=LiveLink]",n);i.length>0&&(e._addActions(),this.bind("change",function(n){var r=e.data("OrigVal"),o=e.val();e.data("OrigVal",o),0===i.val().indexOf(i.data("defaultUrl"))&&""==a.val()?e.updateURLSegment(o):t(".update",e.parent()).show(),e.updateRelatedFields(o,r),e.updateBreadcrumbLabel(o)})),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var i=t(this);i.val()==n&&(i.val(e),i.updatedRelatedFields&&i.updatedRelatedFields())})},updateURLSegment:function(e){var n=t("input:text[name=URLSegment]",this.closest("form")),i=n.closest(".field.urlsegment"),a=t(".update",this.parent());i.update(e),a.is(":visible")&&a.hide()},updateBreadcrumbLabel:function(e){var n=(t(".cms-edit-form input[name=ID]").val(),t("span.cms-panel-link.crumb"));e&&""!=e&&n.text(e)},_addActions:function(){var e,n=this;e=t("<button />",{"class":"update ss-ui-button-small",text:s["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function(t){t.preventDefault(),n.updateURLSegment(n.val())}}),e.insertAfter(n),e.hide()}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function(){var t=this;this.find(":input[name=ParentType]").bind("click",function(e){t._toggleSelection(e)}),this.find(".TreeDropdownField").bind("change",function(e){t._changeParentId(e)}),this._changeParentId(),this._toggleSelection(),this._super()},onunmatch:function(){this._super()},_toggleSelection:function(t){var e=this.find(":input[name=ParentType]:checked").val();"root"==e?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),this.find("#Form_EditForm_ParentID_Holder").toggle("root"!=e)},_changeParentId:function(t){var e=this.find(":input[name=ParentID]").val();this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue",e)}}),t(".cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType").entwine({onmatch:function(){var e;"CanViewType"==this.attr("id")?e=t("#Form_EditForm_ViewerGroups_Holder"):"CanEditType"==this.attr("id")?e=t("#Form_EditForm_EditorGroups_Holder"):"CanCreateTopLevelType"==this.attr("id")&&(e=t("#Form_EditForm_CreateTopLevelGroups_Holder")),this.find(".optionset :input").bind("change",function(n){var i=t(this).closest(".middleColumn").parent("div");"OnlyTheseUsers"==n.target.value?(i.addClass("remove-splitter"),e.show()):(i.removeClass("remove-splitter"),e.hide())});var n=this.find("input[name="+this.attr("id")+"]:checked").val();e["OnlyTheseUsers"==n?"show":"hide"](),this._super()},onunmatch:function(){this._super()}}),t(".cms-edit-form .Actions #Form_EditForm_action_print").entwine({onclick:function(e){var n=t(this[0].form).attr("action").replace(/\?.*$/,"")+"/printable/"+t(":input[name=ID]",this[0].form).val();return"http://"!=n.substr(0,7)&&(n=t("base").attr("href")+n),window.open(n,"printable"),!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_rollback").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=n?s["default"].sprintf(s["default"]._t("CMSMain.RollbackToVersion"),n):s["default"]._t("CMSMain.ConfirmRestoreFromLive"),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_archive").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Archive"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_restore").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="",a=this.data("toRoot");return i=s["default"].sprintf(s["default"]._t(a?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_delete").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.DeleteFromDraft"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form .Actions #Form_EditForm_action_unpublish").entwine({onclick:function(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),i="";return i=s["default"].sprintf(s["default"]._t("CMSMain.Unpublish"),n),confirm(i)?this._super(t):!1}}),t(".cms-edit-form.changed").entwine({onmatch:function(t){this.find("button[name=action_save]").button("option","showingAlternate",!0),this.find("button[name=action_publish]").button("option","showingAlternate",!0),this._super(t)},onunmatch:function(t){var e=this.find("button[name=action_save]");e.data("button")&&e.button("option","showingAlternate",!1);var n=this.find("button[name=action_publish]");n.data("button")&&n.button("option","showingAlternate",!1),this._super(t)}}),t(".cms-edit-form .Actions button[name=action_publish]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t(".cms-edit-form .Actions button[name=action_save]").entwine({onbuttonafterrefreshalternate:function(){this.button("option","showingAlternate")?this.addClass("ss-ui-action-constructive"):this.removeClass("ss-ui-action-constructive")}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function(){this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder");"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function(){this.redraw()}}),"Form_EditForm_ParentType_root"==t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr("id")&&t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder").hide()})},{i18n:"i18n",jQuery:"jQuery"}],3:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a),o=t("i18n"),s=i(o);r["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function(t){this.adjustContextClass()}},adjustContextClass:function(){var e=t("#vakata-contextmenu").find("ul ul");e.each(function(n){var i="1",a=t(e[n]).find("li").length;a>20?i="3":a>10&&(i="2"),t(e[n]).addClass("col-"+i).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function(){var e=this,n=this._super();this.getHints();return n.plugins.push("contextmenu"),n.contextmenu={items:function(n){var i={edit:{label:s["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(s["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}};n.hasClass("nochildren")||(i.showaslist={label:s["default"]._t("Tree.ShowAsList"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}});var a=(n.data("pagetype"),n.data("id")),r=n.find(">a .item").data("allowedchildren"),o={},d=!1;return t.each(r,function(n,i){d=!0,o["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+i,_class:"class-"+n,action:function(i){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlAddpage"),a,n),e.data("extraParams")))}}}),d&&(i.addsubpage={label:s["default"]._t("Tree.AddSubPage","Add page under this page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),submenu:o}),i.duplicate={label:s["default"]._t("Tree.Duplicate"),submenu:[{label:s["default"]._t("Tree.ThisPageOnly"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))}},{label:s["default"]._t("Tree.ThisPageAndSubpages"),action:function(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(s["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))}}]},i}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function(){var t,e=this,n=e.parents(".cms-panel-content");(e.offset().top<0||e.offset().top>n.height()-e.height())&&(t=n.scrollTop()+e.offset().top+n.height()/2,n.animate({scrollTop:t},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function(){window.location=location.protocol+"//"+location.host+location.pathname}}),t(".cms-tree-filtered").entwine({onmatch:function(){var e=this,n=function(){var n=t(".cms-content-tools .cms-panel-content").height()-e.parent().siblings(".cms-content-toolbar").outerHeight(!0);e.css("height",n+"px")};n(),t(window).on("resize",window.ss.debounce(n,300))}})})},{i18n:"i18n",jQuery:"jQuery"}],4:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".cms-content-header-info").entwine({"from .cms-panel":{ontoggle:function(t){var e=this.closest(".cms-content").find(t.target);0!==e.length&&this.parent()[e.hasClass("collapsed")?"addClass":"removeClass"]("collapsed")}}}),t(".cms-content-toolbar").entwine({onmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this),i=n.data("toolid");n.hasClass("active");void 0!==i&&(n.data("active",!1).removeClass("active"),t("#"+i).hide(),e.bindActionButtonEvents(n))})},onunmatch:function(){var e=this;this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this);e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function(t){var e=this;t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function(t){t.off(".cmsContentToolbar")},showHideTool:function(e){var n=e.data("active"),i=e.data("toolid"),a=t("#"+i);t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"));e.data("toolid")!==i&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),a[n?"hide":"show"](),e.data("active",!n)}})})},{jQuery:"jQuery"}],5:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a),o=t("i18n"),s=i(o);r["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function(){this._super()},onunmatch:function(){this._super()},onsubmit:function(e,n){e.preventDefault();var i;if(i=this.find(":input[name=ID]").val(),!i)return!1;var a,r,o,d,l,c;if(c=this.find(":input[name=CompareMode]").is(":checked"),o=this.find("table input[type=checkbox]").filter(":checked"),c){if(2!=o.length)return!1;d=o.eq(0).val(),l=o.eq(1).val(),a=this.find(":submit[name=action_doCompare]"),r=s["default"].sprintf(this.data("linkTmplCompare"),i,l,d)}else d=o.eq(0).val(),a=this.find(":submit[name=action_doShowVersion]"),r=s["default"].sprintf(this.data("linkTmplShow"),i,d);t(".cms-container").loadPanel(r,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function(){this.toggle(),this._super()},onunmatch:function(){this._super()},onchange:function(){this.toggle()},toggle:function(){var e=t(this),n=e.parents("form");e.attr("checked")?n.find("tr[data-published=false]").show():n.find("tr[data-published=false]").hide()._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function(t){var e,n;return e=this.parents("form").find(":input[name=CompareMode]").attr("checked"),n=this.siblings(".active"),e&&this.hasClass("active")?void this._unselect():e?n.length>1?alert(s["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(),void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)},_select:function(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},{i18n:"i18n",jQuery:"jQuery"}],6:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a);r["default"].entwine("ss",function(t){t("#Form_EditForm_RedirectionType input").entwine({onmatch:function(){var e=t(this);e.attr("checked")&&this.toggle(),this._super()},onunmatch:function(){this._super()},onclick:function(){this.toggle()},toggle:function(){"Internal"==t(this).attr("value")?(t("#Form_EditForm_ExternalURL_Holder").hide(),t("#Form_EditForm_LinkToID_Holder").show()):(t("#Form_EditForm_ExternalURL_Holder").show(),t("#Form_EditForm_LinkToID_Holder").hide())}})})},{jQuery:"jQuery"}],7:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(t){var e=document.getElementsByTagName("base")[0].href.replace("http://","").replace(/\//g,"_").replace(/\./g,"_");return e+t}var r=t("jQuery"),o=i(r);(0,o["default"])(document).ready(function(){(0,o["default"])("#switchView a.newWindow").on("click",function(t){var e=window.open(this.href,a(this.target));return e.focus(),!1}),(0,o["default"])("#SilverStripeNavigatorLink").on("click",function(t){return(0,o["default"])("#SilverStripeNavigatorLinkPopup").toggle(),!1}),(0,o["default"])("#SilverStripeNavigatorLinkPopup a.close").on("click",function(t){return(0,o["default"])("#SilverStripeNavigatorLinkPopup").hide(),!1}),(0,o["default"])("#SilverStripeNavigatorLinkPopup input").on("focus",function(t){this.select()})})},{jQuery:"jQuery"}],8:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),r=i(a);r["default"].entwine("ss",function(t){t(".field.urlsegment:not(.readonly)").entwine({MaxPreviewLength:55,Ellipsis:"...",onmatch:function(){this.find(":text").length&&this.toggleEdit(!1),this.redraw(),this._super()},redraw:function(){var t=this.find(":text"),e=decodeURI(t.data("prefix")+t.val()),n=e;e.length>this.getMaxPreviewLength()&&(n=this.getEllipsis()+e.substr(e.length-this.getMaxPreviewLength(),e.length)),this.find(".preview").attr("href",encodeURI(e+t.data("suffix"))).text(n)},toggleEdit:function(t){var e=this.find(":text");this.find(".preview-holder")[t?"hide":"show"](),this.find(".edit-holder")[t?"show":"hide"](),t&&(e.data("origval",e.val()),e.focus())},update:function(){var t=this,e=this.find(":text"),n=e.data("origval"),i=arguments[0],a=i&&""!==i?i:e.val();n!=a?(this.addClass("loading"),this.suggest(a,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function(){var t=this.find(":text");t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function(e,n){var i=this,a=i.find(":text"),r=t.path.parseUrl(i.closest("form").attr("action")),o=r.hrefNoSearch+"/field/"+a.attr("name")+"/suggest/?value="+encodeURIComponent(e);r.search&&(o+="&"+r.search.replace(/^\?/,"")),t.ajax({url:o,success:function(t){n.apply(this,arguments)},error:function(t,e){t.statusText=t.responseText},complete:function(){i.removeClass("loading")}})}}),t(".field.urlsegment .edit").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function(t){t.preventDefault(),this.closest(".field").cancel()}})})},{jQuery:"jQuery"}],9:[function(t,e,n){"use strict";t("../../src/CMSMain.AddForm.js"),t("../../src/CMSMain.EditForm.js"),t("../../src/CMSMain.js"),t("../../src/CMSMain.Tree.js"),t("../../src/CMSPageHistoryController.js"),t("../../src/RedirectorPage.js"),t("../../src/SilverStripeNavigator.js"),t("../../src/SiteTreeURLSegmentField.js")},{"../../src/CMSMain.AddForm.js":1,"../../src/CMSMain.EditForm.js":2,"../../src/CMSMain.Tree.js":3,"../../src/CMSMain.js":4,"../../src/CMSPageHistoryController.js":5,"../../src/RedirectorPage.js":6,"../../src/SilverStripeNavigator.js":7,"../../src/SiteTreeURLSegmentField.js":8}]},{},[9]);

View File

@ -2,8 +2,8 @@
* File: AssetAdmin.js
*/
import $ from '../../../framework/javascript/dist/jQuery';
import i18n from '../../../framework/javascript/dist/i18n';
import $ from 'jQuery';
import i18n from 'i18n';
$.entwine('ss', function($){
/**

View File

@ -1,4 +1,4 @@
import $ from '../../../framework/javascript/dist/jQuery';
import $ from 'jQuery';
$.entwine('ss', function($){
/**

View File

@ -2,8 +2,8 @@
/**
* File: CMSMain.EditForm.js
*/
import $ from '../../../framework/javascript/dist/jQuery';
import i18n from '../../../framework/javascript/dist/i18n';
import $ from 'jQuery';
import i18n from 'i18n';
$.entwine('ss', function($){
/**

View File

@ -1,5 +1,5 @@
import $ from '../../../framework/javascript/dist/jQuery';
import i18n from '../../../framework/javascript/dist/i18n';
import $ from 'jQuery';
import i18n from 'i18n';
$.entwine('ss.tree', function($){
$('.cms-tree').entwine({

View File

@ -1,4 +1,4 @@
import $ from '../../../framework/javascript/dist/jQuery';
import $ from 'jQuery';
/**
* Behaviour for the CMS Content Toolbar.

View File

@ -1,5 +1,5 @@
import $ from '../../../framework/javascript/dist/jQuery';
import i18n from '../../../framework/javascript/dist/i18n';
import $ from 'jQuery';
import i18n from 'i18n';
/**
* File: CMSPageHistoryController.js

View File

@ -1,4 +1,4 @@
import $ from '../../../framework/javascript/dist/jQuery';
import $ from 'jQuery';
$.entwine('ss', function($){
$('#Form_EditForm_RedirectionType input').entwine({

View File

@ -1,4 +1,4 @@
import $ from '../../../framework/javascript/dist/jQuery';
import $ from 'jQuery';
function windowName(suffix) {
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');

View File

@ -1,4 +1,4 @@
import $ from '../../../framework/javascript/dist/jQuery';
import $ from 'jQuery';
$.entwine('ss', function($) {
/**