mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1747 from open-sausages/pulls/4.0/cms-view-fields
Fix for viewer and editor groups
This commit is contained in:
commit
bd1eadcdf6
100
client/dist/js/bundle.js
vendored
100
client/dist/js/bundle.js
vendored
@ -12,43 +12,43 @@ this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").bind("change",func
|
|||||||
|
|
||||||
},loadCachedChildren:function a(t){var e=this.getParentCache()
|
},loadCachedChildren:function a(t){var e=this.getParentCache()
|
||||||
return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function i(t,e){var n=this.getParentCache()
|
return"undefined"!=typeof e[t]?e[t]:null},saveCachedChildren:function i(t,e){var n=this.getParentCache()
|
||||||
n[t]=e,this.setParentCache(n)},updateTypeList:function s(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),a=this.find("input[name=ParentModeField]:checked").val(),i=n.data("metadata"),s=i&&"child"===a?n.getValue()||this.getParentID():null,r=i?i.ClassName:null,o=r&&"child"===a&&s?r:"Root",d="undefined"!=typeof e[o]?e[o]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[]
|
n[t]=e,this.setParentCache(n)},updateTypeList:function s(){var e=this.data("hints"),n=this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField"),a=this.find("input[name=ParentModeField]:checked").val(),i=n.data("metadata"),s=i&&"child"===a?n.getValue()||this.getParentID():null,o=i?i.ClassName:null,r=o&&"child"===a&&s?o:"Root",d="undefined"!=typeof e[r]?e[r]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[]
|
||||||
|
|
||||||
|
|
||||||
if(s){if(this.hasClass("loading"))return
|
if(s){if(this.hasClass("loading"))return
|
||||||
return this.addClass("loading"),this.setParentID(s),n.getValue()||n.setValue(s),u=this.loadCachedChildren(s),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),
|
return this.addClass("loading"),this.setParentID(s),n.getValue()||n.setValue(s),u=this.loadCachedChildren(s),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),
|
||||||
data:{ParentID:s},success:function h(t){l.saveCachedChildren(s,t),l.updateSelectionFilter(t,c)},complete:function f(){l.removeClass("loading")}}),!1)}u=d&&"undefined"!=typeof d.disallowedChildren?d.disallowedChildren:[],
|
data:{ParentID:s},success:function h(t){l.saveCachedChildren(s,t),l.updateSelectionFilter(t,c)},complete:function f(){l.removeClass("loading")}}),!1)}u=d&&"undefined"!=typeof d.disallowedChildren?d.disallowedChildren:[],
|
||||||
this.updateSelectionFilter(u,c)},updateSelectionFilter:function r(e,n){var a=null
|
this.updateSelectionFilter(u,c)},updateSelectionFilter:function o(e,n){var a=null
|
||||||
if(this.find("#Form_AddForm_PageType div.radio").each(function(){var n=t(this).find("input").val(),i=t.inArray(n,e)===-1
|
if(this.find("#Form_AddForm_PageType div.radio").each(function(){var n=t(this).find("input").val(),i=t.inArray(n,e)===-1
|
||||||
t(this).setEnabled(i),i||t(this).setSelected(!1),a=null===a?i:a&&i}),n)var i=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first")
|
t(this).setEnabled(i),i||t(this).setSelected(!1),a=null===a?i:a&&i}),n)var i=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first")
|
||||||
else var i=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first")
|
else var i=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first")
|
||||||
i.setSelected(!0),i.siblings().setSelected(!1),this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?this.find("button[name=action_doAdd]").removeAttr("disabled"):this.find("button[name=action_doAdd]").attr("disabled","disabled"),
|
i.setSelected(!0),i.siblings().setSelected(!1),this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?this.find("button[name=action_doAdd]").removeAttr("disabled"):this.find("button[name=action_doAdd]").attr("disabled","disabled"),
|
||||||
this.find(".message-restricted")[a?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function o(t){this.setSelected(!0)},setSelected:function d(t){var e=this.find("input")
|
this.find(".message-restricted")[a?"hide":"show"]()}}),t(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function r(t){this.setSelected(!0)},setSelected:function d(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 l(e){t(this).toggleClass("disabled",!e),
|
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 l(e){t(this).toggleClass("disabled",!e),
|
||||||
e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-content-addpage-button").entwine({onclick:function c(e){var n=t(".cms-tree"),a=t(".cms-list"),i=0,s
|
e?t(this).find("input").removeAttr("disabled"):t(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),t(".cms-content-addpage-button").entwine({onclick:function c(e){var n=t(".cms-tree"),a=t(".cms-list"),i=0,s
|
||||||
|
|
||||||
|
|
||||||
if(n.is(":visible")){var r=n.jstree("get_selected")
|
if(n.is(":visible")){var o=n.jstree("get_selected")
|
||||||
i=r?t(r[0]).data("id"):null}else{var o=a.find('input[name="Page[GridState]"]').val()
|
i=o?t(o[0]).data("id"):null}else{var r=a.find('input[name="Page[GridState]"]').val()
|
||||||
o&&(i=parseInt(JSON.parse(o).ParentID,10))}var d={selector:this.data("targetPanel"),pjax:this.data("pjax")},l
|
r&&(i=parseInt(JSON.parse(r).ParentID,10))}var d={selector:this.data("targetPanel"),pjax:this.data("pjax")},l
|
||||||
i?(s=this.data("extraParams")?this.data("extraParams"):"",l=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),i),s)):l=this.attr("href"),t(".cms-container").loadPanel(l,null,d),e.preventDefault(),
|
i?(s=this.data("extraParams")?this.data("extraParams"):"",l=t.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),i),s)):l=this.attr("href"),t(".cms-container").loadPanel(l,null,d),e.preventDefault(),
|
||||||
this.blur()}})})},function(t,e,n){"use strict"
|
this.blur()}})})},function(t,e,n){"use strict"
|
||||||
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),r=n(5),o=a(r)
|
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),o=n(5),r=a(o)
|
||||||
s["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function e(){alert(o["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({
|
s["default"].entwine("ss",function(t){t(".cms-edit-form :input[name=ClassName]").entwine({onchange:function e(){alert(r["default"]._t("CMSMAIN.ALERTCLASSNAME"))}}),t(".cms-edit-form input[name=Title]").entwine({
|
||||||
onmatch:function n(){var e=this
|
onmatch:function n(){var e=this
|
||||||
e.data("OrigVal",e.val())
|
e.data("OrigVal",e.val())
|
||||||
var n=e.closest("form"),a=t("input:text[name=URLSegment]",n),i=t("input[name=LiveLink]",n)
|
var n=e.closest("form"),a=t("input:text[name=URLSegment]",n),i=t("input[name=LiveLink]",n)
|
||||||
a.length>0&&(e._addActions(),this.bind("change",function(n){var s=e.data("OrigVal"),r=e.val()
|
a.length>0&&(e._addActions(),this.bind("change",function(n){var s=e.data("OrigVal"),o=e.val()
|
||||||
e.data("OrigVal",r),0===a.val().indexOf(a.data("defaultUrl"))&&""==i.val()?e.updateURLSegment(r):t(".update",e.parent()).show(),e.updateRelatedFields(r,s),e.updateBreadcrumbLabel(r)})),this._super()},onunmatch:function a(){
|
e.data("OrigVal",o),0===a.val().indexOf(a.data("defaultUrl"))&&""==i.val()?e.updateURLSegment(o):t(".update",e.parent()).show(),e.updateRelatedFields(o,s),e.updateBreadcrumbLabel(o)})),this._super()},onunmatch:function a(){
|
||||||
this._super()},updateRelatedFields:function i(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var a=t(this)
|
this._super()},updateRelatedFields:function i(e,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each(function(){var a=t(this)
|
||||||
a.val()==n&&(a.val(e),a.updatedRelatedFields&&a.updatedRelatedFields())})},updateURLSegment:function s(e){var n=t("input:text[name=URLSegment]",this.closest("form")),a=n.closest(".field.urlsegment"),i=t(".update",this.parent())
|
a.val()==n&&(a.val(e),a.updatedRelatedFields&&a.updatedRelatedFields())})},updateURLSegment:function s(e){var n=t("input:text[name=URLSegment]",this.closest("form")),a=n.closest(".field.urlsegment"),i=t(".update",this.parent())
|
||||||
|
|
||||||
|
|
||||||
a.update(e),i.is(":visible")&&i.hide()},updateBreadcrumbLabel:function r(e){var n=t(".cms-edit-form input[name=ID]").val(),a=t("span.cms-panel-link.crumb")
|
a.update(e),i.is(":visible")&&i.hide()},updateBreadcrumbLabel:function o(e){var n=t(".cms-edit-form input[name=ID]").val(),a=t("span.cms-panel-link.crumb")
|
||||||
e&&""!=e&&a.text(e)},_addActions:function d(){var e=this,n
|
e&&""!=e&&a.text(e)},_addActions:function d(){var e=this,n
|
||||||
n=t("<button />",{"class":"update ss-ui-button-small",text:o["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function a(t){t.preventDefault(),e.updateURLSegment(e.val())}}),n.insertAfter(e),n.hide()
|
n=t("<button />",{"class":"update ss-ui-button-small",text:r["default"]._t("URLSEGMENT.UpdateURL"),type:"button",click:function a(t){t.preventDefault(),e.updateURLSegment(e.val())}}),n.insertAfter(e),n.hide()
|
||||||
|
|
||||||
}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function l(){var t=this
|
}}),t(".cms-edit-form .parentTypeSelector").entwine({onmatch:function l(){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.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(),
|
||||||
@ -56,43 +56,41 @@ this._super()},onunmatch:function c(){this._super()},_toggleSelection:function u
|
|||||||
"root"==n?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),"root"!=n?a.slideDown(400,function(){t(this).css("overflow","visible")
|
"root"==n?this.find(":input[name=ParentID]").val(0):this.find(":input[name=ParentID]").val(this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue")),"root"!=n?a.slideDown(400,function(){t(this).css("overflow","visible")
|
||||||
|
|
||||||
}):a.slideUp()},_changeParentId:function h(t){var e=this.find(":input[name=ParentID]").val()
|
}):a.slideUp()},_changeParentId:function h(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 f(){
|
this.find("#Form_EditForm_ParentType_subpage").data("parentIdValue",e)}}),t('.cms-edit-form [name="CanViewType"], .cms-edit-form [name="CanEditType"], .cms-edit-form #CanCreateTopLevelType').entwine({onmatch:function f(){
|
||||||
var e
|
"OnlyTheseUsers"===this.val()&&(this.is(":checked")?this.showList(!0):this.hideList(!0))},onchange:function m(t){"OnlyTheseUsers"===t.target.value?this.showList():this.hideList()},showList:function p(t){
|
||||||
"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")),
|
var e=this.closest(".field")
|
||||||
this.find(".optionset :input").bind("change",function(n){var a=t(this).closest(".middleColumn").parent("div")
|
e.addClass("field--merge-below"),e.next().filter(".listbox")[t?"show":"slideDown"]()},hideList:function v(t){var e=this.closest(".field")
|
||||||
"OnlyTheseUsers"==n.target.value?(a.addClass("remove-splitter"),e.show()):(a.removeClass("remove-splitter"),e.hide())})
|
e.next().filter(".listbox")[t?"hide":"slideUp"](function(){e.removeClass("field--merge-below")})}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_print").entwine({onclick:function g(e){var n=t(this[0].form).attr("action").replace(/\?.*$/,"")+"/printable/"+t(":input[name=ID]",this[0].form).val()
|
||||||
var n=this.find("input[name="+this.attr("id")+"]:checked").val()
|
|
||||||
e["OnlyTheseUsers"==n?"show":"hide"](),this._super()},onunmatch:function m(){this._super()}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_print").entwine({onclick:function p(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 .btn-toolbar #Form_EditForm_action_rollback").entwine({onclick:function v(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
return"http://"!=n.substr(0,7)&&(n=t("base").attr("href")+n),window.open(n,"printable"),!1}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_rollback").entwine({onclick:function _(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
||||||
|
|
||||||
|
|
||||||
return a=n?o["default"].sprintf(o["default"]._t("CMSMain.RollbackToVersion"),n):o["default"]._t("CMSMain.ConfirmRestoreFromLive"),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_archive").entwine({
|
return a=n?r["default"].sprintf(r["default"]._t("CMSMain.RollbackToVersion"),n):r["default"]._t("CMSMain.ConfirmRestoreFromLive"),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_archive").entwine({
|
||||||
onclick:function g(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
onclick:function b(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
||||||
return a=o["default"].sprintf(o["default"]._t("CMSMain.Archive"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_restore").entwine({onclick:function _(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a="",i=this.data("toRoot")
|
return a=r["default"].sprintf(r["default"]._t("CMSMain.Archive"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_restore").entwine({onclick:function w(t){var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a="",i=this.data("toRoot")
|
||||||
|
|
||||||
|
|
||||||
return a=o["default"].sprintf(o["default"]._t(i?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_unpublish").entwine({onclick:function b(t){
|
return a=r["default"].sprintf(r["default"]._t(i?"CMSMain.RestoreToRoot":"CMSMain.Restore"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form .btn-toolbar #Form_EditForm_action_unpublish").entwine({onclick:function C(t){
|
||||||
var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
var e=this.parents("form:first"),n=e.find(":input[name=Version]").val(),a=""
|
||||||
return a=o["default"].sprintf(o["default"]._t("CMSMain.Unpublish"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form.changed").entwine({onmatch:function w(t){var e=this.find("button[name=action_save]")
|
return a=r["default"].sprintf(r["default"]._t("CMSMain.Unpublish"),n),!!confirm(a)&&this._super(t)}}),t(".cms-edit-form.changed").entwine({onmatch:function F(t){var e=this.find("button[name=action_save]")
|
||||||
|
|
||||||
|
|
||||||
e.attr("data-text-alternate")&&(e.attr("data-text-standard",e.text()),e.text(e.attr("data-text-alternate"))),e.attr("data-btn-alternate")&&(e.attr("data-btn-standard",e.attr("class")),e.attr("class",e.attr("data-btn-alternate"))),
|
e.attr("data-text-alternate")&&(e.attr("data-text-standard",e.text()),e.text(e.attr("data-text-alternate"))),e.attr("data-btn-alternate")&&(e.attr("data-btn-standard",e.attr("class")),e.attr("class",e.attr("data-btn-alternate"))),
|
||||||
e.removeClass("btn-secondary-outline").addClass("btn-primary")
|
e.removeClass("btn-secondary-outline").addClass("btn-primary")
|
||||||
var n=this.find("button[name=action_publish]")
|
var n=this.find("button[name=action_publish]")
|
||||||
n.attr("data-text-alternate")&&(n.attr("data-text-standard",n.attr("data-text-alternate")),n.text(n.attr("data-text-alternate"))),n.attr("data-btn-alternate")&&(n.attr("data-btn-standard",n.attr("class")),
|
n.attr("data-text-alternate")&&(n.attr("data-text-standard",n.attr("data-text-alternate")),n.text(n.attr("data-text-alternate"))),n.attr("data-btn-alternate")&&(n.attr("data-btn-standard",n.attr("class")),
|
||||||
n.attr("class",n.attr("data-btn-alternate"))),n.removeClass("btn-secondary-outline").addClass("btn-primary"),this._super(t)},onunmatch:function C(t){var e=this.find("button[name=action_save]")
|
n.attr("class",n.attr("data-btn-alternate"))),n.removeClass("btn-secondary-outline").addClass("btn-primary"),this._super(t)},onunmatch:function x(t){var e=this.find("button[name=action_save]")
|
||||||
e.attr("data-text-standard")&&e.text(e.attr("data-text-standard")),e.attr("data-btn-standard")&&e.attr("class",e.attr("data-btn-standard"))
|
e.attr("data-text-standard")&&e.text(e.attr("data-text-standard")),e.attr("data-btn-standard")&&e.attr("class",e.attr("data-btn-standard"))
|
||||||
var n=this.find("button[name=action_publish]")
|
var n=this.find("button[name=action_publish]")
|
||||||
n.attr("data-text-standard")&&n.text(n.attr("data-text-standard")),n.attr("data-btn-standard")&&n.attr("class",n.attr("data-btn-standard")),this._super(t)}}),t(".cms-edit-form .btn-toolbar button[name=action_publish]").entwine({
|
n.attr("data-text-standard")&&n.text(n.attr("data-text-standard")),n.attr("data-btn-standard")&&n.attr("class",n.attr("data-btn-standard")),this._super(t)}}),t(".cms-edit-form .btn-toolbar button[name=action_publish]").entwine({
|
||||||
onbuttonafterrefreshalternate:function F(){this.data("showingAlternate")?(this.addClass("btn-primary"),this.removeClass("btn-secondary")):(this.removeClass("btn-primary"),this.addClass("btn-secondary"))
|
onbuttonafterrefreshalternate:function P(){this.data("showingAlternate")?(this.addClass("btn-primary"),this.removeClass("btn-secondary")):(this.removeClass("btn-primary"),this.addClass("btn-secondary"))
|
||||||
|
|
||||||
}}),t(".cms-edit-form .btn-toolbar button[name=action_save]").entwine({onbuttonafterrefreshalternate:function x(){this.data("showingAlternate")?(this.addClass("btn-primary"),this.removeClass("btn-secondary")):(this.removeClass("btn-primary"),
|
}}),t(".cms-edit-form .btn-toolbar button[name=action_save]").entwine({onbuttonafterrefreshalternate:function T(){this.data("showingAlternate")?(this.addClass("btn-primary"),this.removeClass("btn-secondary")):(this.removeClass("btn-primary"),
|
||||||
this.addClass("btn-secondary"))}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function P(){this.redraw(),this._super()},onunmatch:function T(){this._super()
|
this.addClass("btn-secondary"))}}),t('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({onmatch:function S(){this.redraw(),this._super()},onunmatch:function y(){this._super()
|
||||||
|
|
||||||
},redraw:function y(){var e=t(".cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder")
|
},redraw:function k(){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 S(){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()
|
"Form_EditForm_ParentType_root"==t(this).attr("id")?e.slideUp():e.slideDown()},onclick:function E(){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()
|
||||||
|
|
||||||
})},function(t,e){t.exports=i18n},function(t,e,n){"use strict"
|
})},function(t,e){t.exports=i18n},function(t,e,n){"use strict"
|
||||||
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i)
|
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i)
|
||||||
@ -105,12 +103,12 @@ this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function
|
|||||||
void 0!==a&&(n.data("active",!1).removeClass("active"),t("#"+a).hide(),e.bindActionButtonEvents(n))})},onunmatch:function i(){var e=this
|
void 0!==a&&(n.data("active",!1).removeClass("active"),t("#"+a).hide(),e.bindActionButtonEvents(n))})},onunmatch:function i(){var e=this
|
||||||
this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this)
|
this._super(),t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var n=t(this)
|
||||||
e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function s(t){var e=this
|
e.unbindActionButtonEvents(n)})},bindActionButtonEvents:function s(t){var e=this
|
||||||
t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function r(t){t.off(".cmsContentToolbar")},showHideTool:function o(e){var n=e.data("active"),a=e.data("toolid"),i=t("#"+a)
|
t.on("click.cmsContentToolbar",function(n){e.showHideTool(t)})},unbindActionButtonEvents:function o(t){t.off(".cmsContentToolbar")},showHideTool:function r(e){var n=e.data("active"),a=e.data("toolid"),i=t("#"+a)
|
||||||
|
|
||||||
|
|
||||||
t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"))
|
t.each(this.find(".cms-actions-buttons-row .tool-button"),function(){var e=t(this),n=t("#"+e.data("toolid"))
|
||||||
e.data("toolid")!==a&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),i[n?"hide":"show"](),e.data("active",!n)}})})},function(t,e,n){"use strict"
|
e.data("toolid")!==a&&(n.hide(),e.data("active",!1))}),e[n?"removeClass":"addClass"]("active"),i[n?"hide":"show"](),e.data("active",!n)}})})},function(t,e,n){"use strict"
|
||||||
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),r=n(5),o=a(r)
|
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),o=n(5),r=a(o)
|
||||||
s["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function e(t){this.adjustContextClass()}},adjustContextClass:function n(){var e=t("#vakata-contextmenu").find("ul ul")
|
s["default"].entwine("ss.tree",function(t){t(".cms-tree").entwine({fromDocument:{"oncontext_show.vakata":function e(t){this.adjustContextClass()}},adjustContextClass:function n(){var e=t("#vakata-contextmenu").find("ul ul")
|
||||||
|
|
||||||
|
|
||||||
@ -118,36 +116,36 @@ e.each(function(n){var a="1",i=t(e[n]).find("li").length
|
|||||||
i>20?a="3":i>10&&(a="2"),t(e[n]).addClass("col-"+a).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function a(){var e=this,n=this._super(),a=this.getHints()
|
i>20?a="3":i>10&&(a="2"),t(e[n]).addClass("col-"+a).removeClass("right"),t(e[n]).find("li").on("mouseenter",function(e){t(this).parent("ul").removeClass("right")})})},getTreeConfig:function a(){var e=this,n=this._super(),a=this.getHints()
|
||||||
|
|
||||||
|
|
||||||
return n.plugins.push("contextmenu"),n.contextmenu={items:function i(n){var a={edit:{label:n.hasClass("edit-disabled")?o["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"):o["default"]._t("Tree.ViewPage","View page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),
|
return n.plugins.push("contextmenu"),n.contextmenu={items:function i(n){var a={edit:{label:n.hasClass("edit-disabled")?r["default"]._t("Tree.EditPage","Edit page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"):r["default"]._t("Tree.ViewPage","View page",100,"Used in the context menu when right-clicking on a page node in the CMS tree"),
|
||||||
action:function c(n){t(".cms-container").entwine(".ss").loadPanel(o["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}}
|
action:function c(n){t(".cms-container").entwine(".ss").loadPanel(r["default"].sprintf(e.data("urlEditpage"),n.data("id")))}}}
|
||||||
n.hasClass("nochildren")||(a.showaslist={label:o["default"]._t("Tree.ShowAsList"),action:function u(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{
|
n.hasClass("nochildren")||(a.showaslist={label:r["default"]._t("Tree.ShowAsList"),action:function u(n){t(".cms-container").entwine(".ss").loadPanel(e.data("urlListview")+"&ParentID="+n.data("id"),null,{
|
||||||
tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}})
|
tabState:{"pages-controller-cms-content":{tabSelector:".content-listview"}}})}})
|
||||||
var i=n.data("pagetype"),s=n.data("id"),r=n.find(">a .item").data("allowedchildren"),d={},l=!1
|
var i=n.data("pagetype"),s=n.data("id"),o=n.find(">a .item").data("allowedchildren"),d={},l=!1
|
||||||
return t.each(r,function(n,a){l=!0,d["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+a,_class:"class-"+n,action:function i(a){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(o["default"].sprintf(e.data("urlAddpage"),s,n),e.data("extraParams")))
|
return t.each(o,function(n,a){l=!0,d["allowedchildren-"+n]={label:'<span class="jstree-pageicon"></span>'+a,_class:"class-"+n,action:function i(a){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(r["default"].sprintf(e.data("urlAddpage"),s,n),e.data("extraParams")))
|
||||||
|
|
||||||
}}}),l&&(a.addsubpage={label:o["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:d}),n.hasClass("edit-disabled")||(a.duplicate={
|
}}}),l&&(a.addsubpage={label:r["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:d}),n.hasClass("edit-disabled")||(a.duplicate={
|
||||||
label:o["default"]._t("Tree.Duplicate"),submenu:[{label:o["default"]._t("Tree.ThisPageOnly"),action:function h(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(o["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))
|
label:r["default"]._t("Tree.Duplicate"),submenu:[{label:r["default"]._t("Tree.ThisPageOnly"),action:function h(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(r["default"].sprintf(e.data("urlDuplicate"),n.data("id")),e.data("extraParams")))
|
||||||
|
|
||||||
}},{label:o["default"]._t("Tree.ThisPageAndSubpages"),action:function f(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(o["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))
|
}},{label:r["default"]._t("Tree.ThisPageAndSubpages"),action:function f(n){t(".cms-container").entwine(".ss").loadPanel(t.path.addSearchParams(r["default"].sprintf(e.data("urlDuplicatewithchildren"),n.data("id")),e.data("extraParams")))
|
||||||
|
|
||||||
}}]}),a}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function i(){var t=this,e=t.parents(".cms-panel-content"),n;(t.offset().top<0||t.offset().top>e.height()-t.height())&&(n=e.scrollTop()+t.offset().top+e.height()/2,
|
}}]}),a}},n}}),t(".cms-tree a.jstree-clicked").entwine({onmatch:function i(){var t=this,e=t.parents(".cms-panel-content"),n;(t.offset().top<0||t.offset().top>e.height()-t.height())&&(n=e.scrollTop()+t.offset().top+e.height()/2,
|
||||||
e.animate({scrollTop:n},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function s(){window.location=location.protocol+"//"+location.host+location.pathname}})})},function(t,e,n){"use strict"
|
e.animate({scrollTop:n},"slow"))}}),t(".cms-tree-filtered .clear-filter").entwine({onclick:function s(){window.location=location.protocol+"//"+location.host+location.pathname}})})},function(t,e,n){"use strict"
|
||||||
|
|
||||||
|
|
||||||
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),r=n(5),o=a(r)
|
function a(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),s=a(i),o=n(5),r=a(o)
|
||||||
s["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function e(){this._super()},onunmatch:function n(){this._super()},onsubmit:function a(e,n){e.preventDefault()
|
s["default"].entwine("ss",function(t){t("#Form_VersionsForm").entwine({onmatch:function e(){this._super()},onunmatch:function n(){this._super()},onsubmit:function a(e,n){e.preventDefault()
|
||||||
var a,i=this
|
var a,i=this
|
||||||
if(a=this.find(":input[name=ID]").val(),!a)return!1
|
if(a=this.find(":input[name=ID]").val(),!a)return!1
|
||||||
var s,r,d,l,c,u,h
|
var s,o,d,l,c,u,h
|
||||||
if(u=this.find(":input[name=CompareMode]").is(":checked"),d=this.find("table input[type=checkbox]").filter(":checked"),u){if(2!=d.length)return!1
|
if(u=this.find(":input[name=CompareMode]").is(":checked"),d=this.find("table input[type=checkbox]").filter(":checked"),u){if(2!=d.length)return!1
|
||||||
l=d.eq(0).val(),c=d.eq(1).val(),s=this.find(":submit[name=action_doCompare]"),r=o["default"].sprintf(this.data("linkTmplCompare"),a,c,l)}else l=d.eq(0).val(),s=this.find(":submit[name=action_doShowVersion]"),
|
l=d.eq(0).val(),c=d.eq(1).val(),s=this.find(":submit[name=action_doCompare]"),o=r["default"].sprintf(this.data("linkTmplCompare"),a,c,l)}else l=d.eq(0).val(),s=this.find(":submit[name=action_doShowVersion]"),
|
||||||
r=o["default"].sprintf(this.data("linkTmplShow"),a,l)
|
o=r["default"].sprintf(this.data("linkTmplShow"),a,l)
|
||||||
t(".cms-container").loadPanel(r,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function i(){this.toggle(),this._super()},onunmatch:function s(){this._super()
|
t(".cms-container").loadPanel(o,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function i(){this.toggle(),this._super()},onunmatch:function s(){this._super()
|
||||||
|
|
||||||
},onchange:function r(){this.toggle()},toggle:function d(){var e=t(this),n=e.parents("form")
|
},onchange:function o(){this.toggle()},toggle:function d(){var e=t(this),n=e.parents("form")
|
||||||
e.attr("checked")?n.find("tr[data-published=false]").css("display",""):n.find("tr[data-published=false]").css("display","none")._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function l(t){
|
e.attr("checked")?n.find("tr[data-published=false]").css("display",""):n.find("tr[data-published=false]").css("display","none")._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function l(t){
|
||||||
var e,n
|
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(o["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(),
|
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(r["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 c(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)
|
void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function c(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1)
|
||||||
|
|
||||||
},_select:function u(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},function(t,e,n){"use strict"
|
},_select:function u(){this.addClass("active"),this.find(":input[type=checkbox]").attr("checked",!0)}})})},function(t,e,n){"use strict"
|
||||||
@ -165,12 +163,12 @@ this.find(".preview-holder")[t?"hide":"show"](),this.find(".edit-holder")[t?"sho
|
|||||||
|
|
||||||
n!=i?(this.addClass("loading"),this.suggest(i,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function s(){
|
n!=i?(this.addClass("loading"),this.suggest(i,function(n){e.val(decodeURIComponent(n.value)),t.toggleEdit(!1),t.removeClass("loading"),t.redraw()})):(this.toggleEdit(!1),this.redraw())},cancel:function s(){
|
||||||
var t=this.find(":text")
|
var t=this.find(":text")
|
||||||
t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function r(e,n){var a=this,i=a.find(":text"),s=t.path.parseUrl(a.closest("form").attr("action")),r=s.hrefNoSearch+"/field/"+i.attr("name")+"/suggest/?value="+encodeURIComponent(e)
|
t.val(t.data("origval")),this.toggleEdit(!1)},suggest:function o(e,n){var a=this,i=a.find(":text"),s=t.path.parseUrl(a.closest("form").attr("action")),o=s.hrefNoSearch+"/field/"+i.attr("name")+"/suggest/?value="+encodeURIComponent(e)
|
||||||
|
|
||||||
|
|
||||||
s.search&&(r+="&"+s.search.replace(/^\?/,"")),t.ajax({url:r,success:function o(t){n.apply(this,arguments)},error:function d(t,e){t.statusText=t.responseText},complete:function l(){a.removeClass("loading")
|
s.search&&(o+="&"+s.search.replace(/^\?/,"")),t.ajax({url:o,success:function r(t){n.apply(this,arguments)},error:function d(t,e){t.statusText=t.responseText},complete:function l(){a.removeClass("loading")
|
||||||
|
|
||||||
}})}}),t(".field.urlsegment .edit").entwine({onclick:function o(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function d(t){t.preventDefault(),
|
}})}}),t(".field.urlsegment .edit").entwine({onclick:function r(t){t.preventDefault(),this.closest(".field").toggleEdit(!0)}}),t(".field.urlsegment .update").entwine({onclick:function d(t){t.preventDefault(),
|
||||||
this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function l(t){t.preventDefault(),this.closest(".field").cancel()}})})},function(t,e){}])
|
this.closest(".field").update()}}),t(".field.urlsegment .cancel").entwine({onclick:function l(t){t.preventDefault(),this.closest(".field").cancel()}})})},function(t,e){}])
|
||||||
|
|
||||||
//# sourceMappingURL=bundle.js.map
|
//# sourceMappingURL=bundle.js.map
|
@ -202,35 +202,37 @@ $.entwine('ss', function($){
|
|||||||
* Toggle display of group dropdown in "access" tab,
|
* Toggle display of group dropdown in "access" tab,
|
||||||
* based on selection of radiobuttons.
|
* based on selection of radiobuttons.
|
||||||
*/
|
*/
|
||||||
$('.cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType').entwine({
|
$('.cms-edit-form [name="CanViewType"], ' +
|
||||||
// Constructor: onmatch
|
'.cms-edit-form [name="CanEditType"], ' +
|
||||||
onmatch: function() {
|
'.cms-edit-form #CanCreateTopLevelType').entwine({
|
||||||
// TODO Decouple
|
onmatch: function () {
|
||||||
var dropdown;
|
if (this.val() === 'OnlyTheseUsers') {
|
||||||
if(this.attr('id') == 'CanViewType') dropdown = $('#Form_EditForm_ViewerGroups_Holder');
|
if (this.is(':checked')) {
|
||||||
else if(this.attr('id') == 'CanEditType') dropdown = $('#Form_EditForm_EditorGroups_Holder');
|
this.showList(true);
|
||||||
else if(this.attr('id') == 'CanCreateTopLevelType') dropdown = $('#Form_EditForm_CreateTopLevelGroups_Holder');
|
} else {
|
||||||
|
this.hideList(true);
|
||||||
this.find('.optionset :input').bind('change', function(e) {
|
|
||||||
var wrapper = $(this).closest('.middleColumn').parent('div');
|
|
||||||
if(e.target.value == 'OnlyTheseUsers') {
|
|
||||||
wrapper.addClass('remove-splitter');
|
|
||||||
dropdown['show']();
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
wrapper.removeClass('remove-splitter');
|
|
||||||
dropdown['hide']();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// initial state
|
|
||||||
var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val();
|
|
||||||
dropdown[currentVal == 'OnlyTheseUsers' ? 'show' : 'hide']();
|
|
||||||
|
|
||||||
this._super();
|
|
||||||
},
|
},
|
||||||
onunmatch: function() {
|
onchange: function (e) {
|
||||||
this._super();
|
if (e.target.value === 'OnlyTheseUsers') {
|
||||||
|
this.showList();
|
||||||
|
} else {
|
||||||
|
this.hideList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showList: function (instant) {
|
||||||
|
let holder = this.closest('.field');
|
||||||
|
|
||||||
|
holder.addClass('field--merge-below');
|
||||||
|
holder.next().filter('.listbox')[instant ? 'show' : 'slideDown']();
|
||||||
|
},
|
||||||
|
hideList: function (instant) {
|
||||||
|
let holder = this.closest('.field');
|
||||||
|
|
||||||
|
holder.next().filter('.listbox')[instant ? 'hide' : 'slideUp'](() => {
|
||||||
|
holder.removeClass('field--merge-below');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
"node": "4.x"
|
"node": "4.x"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build": "webpack --progress",
|
||||||
"watch": "webpack -w",
|
"watch": "webpack -w --progress",
|
||||||
"lock": "npm-shrinkwrap --dev",
|
"lock": "npm-shrinkwrap --dev",
|
||||||
"lint": "eslint client/src & sass-lint -v"
|
"lint": "eslint client/src && sass-lint -v"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user