mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge remote-tracking branch 'origin/3'
This commit is contained in:
commit
b4c4c636f2
78
javascript/dist/AssetAdmin.js
vendored
78
javascript/dist/AssetAdmin.js
vendored
@ -23,17 +23,45 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* File: AssetAdmin.js
|
||||
*/
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
/**
|
||||
* Delete selected folders through "batch actions" tab.
|
||||
*/
|
||||
/* assets don't currently have batch actions; disabling for now
|
||||
$(document).ready(function() {
|
||||
$('#Form_BatchActionsForm').entwine('.ss.tree').register(
|
||||
// TODO Hardcoding of base URL
|
||||
'admin/assets/batchactions/delete',
|
||||
function(ids) {
|
||||
var confirmed = confirm(
|
||||
i18n.sprintf(
|
||||
i18n._t('AssetAdmin.BATCHACTIONSDELETECONFIRM'),
|
||||
ids.length
|
||||
)
|
||||
);
|
||||
return (confirmed) ? ids : false;
|
||||
}
|
||||
);
|
||||
});
|
||||
*/
|
||||
|
||||
/**
|
||||
* Load folder detail view via controller methods
|
||||
* rather than built-in GridField view (which is only geared towards showing files).
|
||||
*/
|
||||
$('.AssetAdmin.cms-edit-form .ss-gridfield-item').entwine({
|
||||
onclick: function onclick(e) {
|
||||
// Let actions do their own thing
|
||||
if ($(e.target).closest('.action').length) {
|
||||
this._super(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var grid = this.closest('.ss-gridfield');
|
||||
|
||||
if (this.data('class') == 'Folder') {
|
||||
var url = grid.data('urlFolderTemplate').replace('%s', this.data('id'));
|
||||
$('.cms-container').loadPanel(url);
|
||||
@ -43,41 +71,56 @@
|
||||
this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form .ss-gridfield .col-buttons .action.gridfield-button-delete, .AssetAdmin.cms-edit-form .Actions button.action.action-delete').entwine({
|
||||
onclick: function onclick(e) {
|
||||
var msg;
|
||||
|
||||
if (this.closest('.ss-gridfield-item').data('class') == 'Folder') {
|
||||
msg = _i18n2.default._t('AssetAdmin.ConfirmDelete');
|
||||
} else {
|
||||
msg = _i18n2.default._t('TABLEFIELD.DELETECONFIRMMESSAGE');
|
||||
}
|
||||
|
||||
if (!confirm(msg)) return false;
|
||||
this.getGridField().reload({
|
||||
data: [{
|
||||
name: this.attr('name'),
|
||||
value: this.val()
|
||||
}]
|
||||
});
|
||||
|
||||
this.getGridField().reload({ data: [{ name: this.attr('name'), value: this.val() }] });
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin.cms-edit-form :submit[name=action_delete]').entwine({
|
||||
onclick: function onclick(e) {
|
||||
if (!confirm(_i18n2.default._t('AssetAdmin.ConfirmDelete'))) return false;else this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Prompt for a new foldername, rather than using dedicated form.
|
||||
* Better usability, but less flexibility in terms of inputs and validation.
|
||||
* Mainly necessary because AssetAdmin->AddForm() returns don't play nicely
|
||||
* with the nested AssetAdmin->EditForm() DOM structures.
|
||||
*/
|
||||
$('.AssetAdmin .cms-add-folder-link').entwine({
|
||||
onclick: function onclick(e) {
|
||||
var name = prompt(_i18n2.default._t('Folder.Name'));
|
||||
if (!name) return false;
|
||||
|
||||
this.closest('.cms-container').loadPanel(this.data('url') + '&Name=' + name);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: #Form_SyncForm
|
||||
*/
|
||||
$('#Form_SyncForm').entwine({
|
||||
|
||||
/**
|
||||
* Function: onsubmit
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onsubmit: function onsubmit(e) {
|
||||
var button = jQuery(this).find(':submit:first');
|
||||
button.addClass('loading');
|
||||
@ -86,27 +129,32 @@
|
||||
data: this.serializeArray(),
|
||||
success: function success() {
|
||||
button.removeClass('loading');
|
||||
// reload current form and tree
|
||||
var currNode = $('.cms-tree')[0].firstSelected();
|
||||
|
||||
if (currNode) {
|
||||
var url = $(currNode).find('a').attr('href');
|
||||
$('.cms-content').loadPanel(url);
|
||||
}
|
||||
|
||||
$('.cms-tree')[0].setCustomURL('admin/assets/getsubtree');
|
||||
$('.cms-tree')[0].reload({
|
||||
onSuccess: function onSuccess() {}
|
||||
});
|
||||
$('.cms-tree')[0].reload({ onSuccess: function onSuccess() {
|
||||
// TODO Reset current tree node
|
||||
} });
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Reload the gridfield to show the user the file has been added
|
||||
*/
|
||||
$('.AssetAdmin.cms-edit-form .ss-uploadfield-item-progress').entwine({
|
||||
onunmatch: function onunmatch() {
|
||||
$('.AssetAdmin.cms-edit-form .ss-gridfield').reload();
|
||||
}
|
||||
});
|
||||
|
||||
$('.AssetAdmin .grid-levelup').entwine({
|
||||
onmatch: function onmatch() {
|
||||
this.closest('.ui-tabs-panel').find('.cms-actions-row').prepend(this);
|
||||
|
58
javascript/dist/CMSMain.AddForm.js
vendored
58
javascript/dist/CMSMain.AddForm.js
vendored
@ -22,6 +22,10 @@
|
||||
}
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
/**
|
||||
* Reset the parent node selection if the type is
|
||||
* set back to "toplevel page", to avoid submitting inconsistent state.
|
||||
*/
|
||||
$(".cms-add-form .parent-mode :input").entwine({
|
||||
onclick: function onclick(e) {
|
||||
if (this.val() == 'top') {
|
||||
@ -31,9 +35,10 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(".cms-add-form").entwine({
|
||||
ParentID: 0,
|
||||
ParentCache: {},
|
||||
ParentID: 0, // Last selected parentID
|
||||
ParentCache: {}, // Cache allowed children for each selected page
|
||||
onadd: function onadd() {
|
||||
var self = this;
|
||||
this.find('#Form_AddForm_ParentID_Holder .TreeDropdownField').bind('change', function () {
|
||||
@ -53,6 +58,12 @@
|
||||
cache[parentID] = children;
|
||||
this.setParentCache(cache);
|
||||
},
|
||||
/**
|
||||
* Limit page type selection based on parent selection.
|
||||
* Select of root classes is pre-computed, but selections with a given parent
|
||||
* are updated on-demand.
|
||||
* Similar implementation to LeftAndMain.Tree.js.
|
||||
*/
|
||||
updateTypeList: function updateTypeList() {
|
||||
var hints = this.data('hints'),
|
||||
parentTree = this.find('#Form_AddForm_ParentID_Holder .TreeDropdownField'),
|
||||
@ -67,24 +78,26 @@
|
||||
disallowedChildren = [];
|
||||
|
||||
if (id) {
|
||||
// Prevent interface operations
|
||||
if (this.hasClass('loading')) return;
|
||||
this.addClass('loading');
|
||||
|
||||
// Enable last parent ID to be re-selected from memory
|
||||
this.setParentID(id);
|
||||
if (!parentTree.getValue()) parentTree.setValue(id);
|
||||
disallowedChildren = this.loadCachedChildren(id);
|
||||
|
||||
// Use cached data if available
|
||||
disallowedChildren = this.loadCachedChildren(id);
|
||||
if (disallowedChildren !== null) {
|
||||
this.updateSelectionFilter(disallowedChildren, defaultChildClass);
|
||||
this.removeClass('loading');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: self.data('childfilter'),
|
||||
data: {
|
||||
'ParentID': id
|
||||
},
|
||||
data: { 'ParentID': id },
|
||||
success: function success(data) {
|
||||
// reload current form and tree
|
||||
self.saveCachedChildren(id, data);
|
||||
self.updateSelectionFilter(data, defaultChildClass);
|
||||
},
|
||||
@ -92,41 +105,53 @@
|
||||
self.removeClass('loading');
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
} else {
|
||||
disallowedChildren = hint && typeof hint.disallowedChildren !== 'undefined' ? hint.disallowedChildren : [], this.updateSelectionFilter(disallowedChildren, defaultChildClass);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Update the selection filter with the given blacklist and default selection
|
||||
*
|
||||
* @param array disallowedChildren
|
||||
* @param string defaultChildClass
|
||||
*/
|
||||
updateSelectionFilter: function updateSelectionFilter(disallowedChildren, defaultChildClass) {
|
||||
var allAllowed = null;
|
||||
// Limit selection
|
||||
var allAllowed = null; // troolian
|
||||
this.find('#Form_AddForm_PageType li').each(function () {
|
||||
var className = $(this).find('input').val(),
|
||||
isAllowed = $.inArray(className, disallowedChildren) === -1;
|
||||
|
||||
$(this).setEnabled(isAllowed);
|
||||
if (!isAllowed) $(this).setSelected(false);
|
||||
if (allAllowed === null) allAllowed = isAllowed;else allAllowed = allAllowed && isAllowed;
|
||||
});
|
||||
|
||||
// Set default child selection, or fall back to first available option
|
||||
if (defaultChildClass) {
|
||||
var selectedEl = this.find('#Form_AddForm_PageType li input[value=' + defaultChildClass + ']').parents('li:first');
|
||||
} else {
|
||||
var selectedEl = this.find('#Form_AddForm_PageType li:not(.disabled):first');
|
||||
}
|
||||
|
||||
selectedEl.setSelected(true);
|
||||
selectedEl.siblings().setSelected(false);
|
||||
|
||||
// Disable the "Create" button if none of the pagetypes are available
|
||||
var buttonState = this.find('#Form_AddForm_PageType li:not(.disabled)').length ? 'enable' : 'disable';
|
||||
this.find('button[name=action_doAdd]').button(buttonState);
|
||||
|
||||
this.find('.message-restricted')[allAllowed ? 'hide' : 'show']();
|
||||
}
|
||||
});
|
||||
|
||||
$(".cms-add-form #Form_AddForm_PageType li").entwine({
|
||||
onclick: function onclick(e) {
|
||||
this.setSelected(true);
|
||||
},
|
||||
setSelected: function setSelected(bool) {
|
||||
var input = this.find('input');
|
||||
|
||||
if (bool && !input.is(':disabled')) {
|
||||
this.siblings().setSelected(false);
|
||||
this.toggleClass('selected', true);
|
||||
@ -141,12 +166,14 @@
|
||||
if (!bool) $(this).find('input').attr('disabled', 'disabled').removeAttr('checked');else $(this).find('input').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$(".cms-page-add-button").entwine({
|
||||
onclick: function onclick(e) {
|
||||
var tree = $('.cms-tree'),
|
||||
list = $('.cms-list'),
|
||||
parentId = 0;
|
||||
|
||||
// Choose parent ID either from tree or list view, depending which is visible
|
||||
if (tree.is(':visible')) {
|
||||
var selected = tree.jstree('get_selected');
|
||||
parentId = selected ? $(selected[0]).data('id') : null;
|
||||
@ -155,12 +182,8 @@
|
||||
if (state) parentId = parseInt(JSON.parse(state).ParentID, 10);
|
||||
}
|
||||
|
||||
var data = {
|
||||
selector: this.data('targetPanel'),
|
||||
pjax: this.data('pjax')
|
||||
},
|
||||
var data = { selector: this.data('targetPanel'), pjax: this.data('pjax') },
|
||||
url;
|
||||
|
||||
if (parentId) {
|
||||
extraParams = this.data('extraParams') ? this.data('extraParams') : '';
|
||||
url = $.path.addSearchParams(i18n.sprintf(this.data('urlAddpage'), parentId), extraParams);
|
||||
@ -170,7 +193,12 @@
|
||||
|
||||
$('.cms-container').loadPanel(url, null, data);
|
||||
e.preventDefault();
|
||||
|
||||
// Remove focussed state from button
|
||||
this.blur();
|
||||
|
||||
// $('.cms-page-add-form-dialog').dialog('open');
|
||||
// e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
214
javascript/dist/CMSMain.EditForm.js
vendored
214
javascript/dist/CMSMain.EditForm.js
vendored
@ -23,28 +23,48 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* File: CMSMain.EditForm.js
|
||||
*/
|
||||
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
/**
|
||||
* Class: .cms-edit-form :input[name=ClassName]
|
||||
* Alert the user on change of page-type. This might have implications
|
||||
* on the available form fields etc.
|
||||
*/
|
||||
$('.cms-edit-form :input[name=ClassName]').entwine({
|
||||
// Function: onchange
|
||||
onchange: function onchange() {
|
||||
alert(_i18n2.default._t('CMSMAIN.ALERTCLASSNAME'));
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form input[name=Title]
|
||||
*
|
||||
* Input validation on the Title field
|
||||
*/
|
||||
$('.cms-edit-form input[name=Title]').entwine({
|
||||
// Constructor: onmatch
|
||||
onmatch: function onmatch() {
|
||||
var self = this;
|
||||
|
||||
self.data('OrigVal', self.val());
|
||||
|
||||
var form = self.closest('form');
|
||||
var urlSegmentInput = $('input:text[name=URLSegment]', form);
|
||||
var liveLinkInput = $('input[name=LiveLink]', form);
|
||||
|
||||
if (urlSegmentInput.length > 0) {
|
||||
self._addActions();
|
||||
|
||||
this.bind('change', function (e) {
|
||||
var origTitle = self.data('OrigVal');
|
||||
var title = self.val();
|
||||
self.data('OrigVal', title);
|
||||
|
||||
// Criteria for defining a "new" page
|
||||
if (urlSegmentInput.val().indexOf(urlSegmentInput.data('defaultUrl')) === 0 && liveLinkInput.val() == '') {
|
||||
self.updateURLSegment(title);
|
||||
} else {
|
||||
@ -61,37 +81,67 @@
|
||||
onunmatch: function onunmatch() {
|
||||
this._super();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: updateRelatedFields
|
||||
*
|
||||
* Update the related fields if appropriate
|
||||
* (String) title The new title
|
||||
* (Stirng) origTitle The original title
|
||||
*/
|
||||
updateRelatedFields: function updateRelatedFields(title, origTitle) {
|
||||
// Update these fields only if their value was originally the same as the title
|
||||
this.parents('form').find('input[name=MetaTitle], input[name=MenuTitle]').each(function () {
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.val() == origTitle) {
|
||||
$this.val(title);
|
||||
// Onchange bubbling didn't work in IE8, so .trigger('change') couldn't be used
|
||||
if ($this.updatedRelatedFields) $this.updatedRelatedFields();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: updateURLSegment
|
||||
*
|
||||
* Update the URLSegment
|
||||
* (String) title
|
||||
*/
|
||||
updateURLSegment: function updateURLSegment(title) {
|
||||
var urlSegmentInput = $('input:text[name=URLSegment]', this.closest('form'));
|
||||
var urlSegmentField = urlSegmentInput.closest('.field.urlsegment');
|
||||
var updateURLFromTitle = $('.update', this.parent());
|
||||
urlSegmentField.update(title);
|
||||
|
||||
if (updateURLFromTitle.is(':visible')) {
|
||||
updateURLFromTitle.hide();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: updateBreadcrumbLabel
|
||||
*
|
||||
* Update the breadcrumb
|
||||
* (String) title
|
||||
*/
|
||||
updateBreadcrumbLabel: function updateBreadcrumbLabel(title) {
|
||||
var pageID = $('.cms-edit-form input[name=ID]').val();
|
||||
var panelCrumb = $('span.cms-panel-link.crumb');
|
||||
|
||||
if (title && title != "") {
|
||||
panelCrumb.text(title);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _addActions
|
||||
*
|
||||
* Utility to add update from title action
|
||||
*
|
||||
*/
|
||||
_addActions: function _addActions() {
|
||||
var self = this;
|
||||
var updateURLFromTitle;
|
||||
|
||||
// update button
|
||||
updateURLFromTitle = $('<button />', {
|
||||
'class': 'update ss-ui-button-small',
|
||||
'text': _i18n2.default._t('URLSEGMENT.UpdateURL'),
|
||||
@ -101,11 +151,21 @@
|
||||
self.updateURLSegment(self.val());
|
||||
}
|
||||
});
|
||||
|
||||
// insert elements
|
||||
updateURLFromTitle.insertAfter(self);
|
||||
updateURLFromTitle.hide();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .parentTypeSelector
|
||||
*
|
||||
* ParentID field combination - mostly toggling between
|
||||
* the two radiobuttons and setting the hidden "ParentID" field
|
||||
*/
|
||||
$('.cms-edit-form .parentTypeSelector').entwine({
|
||||
// Constructor: onmatch
|
||||
onmatch: function onmatch() {
|
||||
var self = this;
|
||||
this.find(':input[name=ParentType]').bind('click', function (e) {
|
||||
@ -116,7 +176,6 @@
|
||||
});
|
||||
|
||||
this._changeParentId();
|
||||
|
||||
this._toggleSelection();
|
||||
|
||||
this._super();
|
||||
@ -124,23 +183,51 @@
|
||||
onunmatch: function onunmatch() {
|
||||
this._super();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _toggleSelection
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
_toggleSelection: function _toggleSelection(e) {
|
||||
var selected = this.find(':input[name=ParentType]:checked').val();
|
||||
if (selected == 'root') this.find(':input[name=ParentID]').val(0);else this.find(':input[name=ParentID]').val(this.find('#Form_EditForm_ParentType_subpage').data('parentIdValue'));
|
||||
// reset parent id if 'root' radiobutton is selected
|
||||
if (selected == 'root') this.find(':input[name=ParentID]').val(0);
|
||||
// otherwise use the old value
|
||||
else this.find(':input[name=ParentID]').val(this.find('#Form_EditForm_ParentType_subpage').data('parentIdValue'));
|
||||
// toggle tree dropdown based on selection
|
||||
this.find('#Form_EditForm_ParentID_Holder').toggle(selected != 'root');
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _changeParentId
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
_changeParentId: function _changeParentId(e) {
|
||||
var value = this.find(':input[name=ParentID]').val();
|
||||
// set a data attribute so we know what to use in _toggleSelection
|
||||
this.find('#Form_EditForm_ParentType_subpage').data('parentIdValue', value);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form #CanViewType, .cms-edit-form #CanEditType
|
||||
*
|
||||
* Toggle display of group dropdown in "access" tab,
|
||||
* based on selection of radiobuttons.
|
||||
*/
|
||||
$('.cms-edit-form #CanViewType, .cms-edit-form #CanEditType, .cms-edit-form #CanCreateTopLevelType').entwine({
|
||||
// Constructor: onmatch
|
||||
onmatch: function onmatch() {
|
||||
// TODO Decouple
|
||||
var dropdown;
|
||||
if (this.attr('id') == 'CanViewType') dropdown = $('#Form_EditForm_ViewerGroups_Holder');else if (this.attr('id') == 'CanEditType') dropdown = $('#Form_EditForm_EditorGroups_Holder');else if (this.attr('id') == 'CanCreateTopLevelType') dropdown = $('#Form_EditForm_CreateTopLevelGroups_Holder');
|
||||
|
||||
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']();
|
||||
@ -149,6 +236,8 @@
|
||||
dropdown['hide']();
|
||||
}
|
||||
});
|
||||
|
||||
// initial state
|
||||
var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val();
|
||||
dropdown[currentVal == 'OnlyTheseUsers' ? 'show' : 'hide']();
|
||||
|
||||
@ -158,26 +247,52 @@
|
||||
this._super();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_print
|
||||
*
|
||||
* Open a printable representation of the form in a new window.
|
||||
* Used for readonly older versions of a specific page.
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_print').entwine({
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var printURL = $(this[0].form).attr('action').replace(/\?.*$/, '') + '/printable/' + $(':input[name=ID]', this[0].form).val();
|
||||
if (printURL.substr(0, 7) != 'http://') printURL = $('base').attr('href') + printURL;
|
||||
|
||||
window.open(printURL, 'printable');
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_rollback
|
||||
*
|
||||
* A "rollback" to a specific version needs user confirmation.
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_rollback').entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var form = this.parents('form:first'),
|
||||
version = form.find(':input[name=Version]').val(),
|
||||
message = '';
|
||||
|
||||
if (version) {
|
||||
message = _i18n2.default.sprintf(_i18n2.default._t('CMSMain.RollbackToVersion'), version);
|
||||
} else {
|
||||
message = _i18n2.default._t('CMSMain.ConfirmRestoreFromLive');
|
||||
}
|
||||
|
||||
if (confirm(message)) {
|
||||
return this._super(e);
|
||||
} else {
|
||||
@ -185,13 +300,25 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_archive
|
||||
*
|
||||
* Informing the user about the archive action while requiring confirmation
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_archive').entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var form = this.parents('form:first'),
|
||||
version = form.find(':input[name=Version]').val(),
|
||||
message = '';
|
||||
message = _i18n2.default.sprintf(_i18n2.default._t('CMSMain.Archive'), version);
|
||||
|
||||
if (confirm(message)) {
|
||||
return this._super(e);
|
||||
} else {
|
||||
@ -199,14 +326,26 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_restore
|
||||
*
|
||||
* Informing the user about the archive action while requiring confirmation
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_restore').entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var form = this.parents('form:first'),
|
||||
version = form.find(':input[name=Version]').val(),
|
||||
message = '',
|
||||
toRoot = this.data('toRoot');
|
||||
message = _i18n2.default.sprintf(_i18n2.default._t(toRoot ? 'CMSMain.RestoreToRoot' : 'CMSMain.Restore'), version);
|
||||
|
||||
if (confirm(message)) {
|
||||
return this._super(e);
|
||||
} else {
|
||||
@ -214,13 +353,25 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_delete
|
||||
*
|
||||
* Informing the user about the delete from draft action while requiring confirmation
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_delete').entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var form = this.parents('form:first'),
|
||||
version = form.find(':input[name=Version]').val(),
|
||||
message = '';
|
||||
message = _i18n2.default.sprintf(_i18n2.default._t('CMSMain.DeleteFromDraft'), version);
|
||||
|
||||
if (confirm(message)) {
|
||||
return this._super(e);
|
||||
} else {
|
||||
@ -228,13 +379,24 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .Actions #Form_EditForm_action_unpublish
|
||||
* Informing the user about the unpublish action while requiring confirmation
|
||||
*/
|
||||
$('.cms-edit-form .Actions #Form_EditForm_action_unpublish').entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Parameters:
|
||||
* (Event) e
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var form = this.parents('form:first'),
|
||||
version = form.find(':input[name=Version]').val(),
|
||||
message = '';
|
||||
message = _i18n2.default.sprintf(_i18n2.default._t('CMSMain.Unpublish'), version);
|
||||
|
||||
if (confirm(message)) {
|
||||
return this._super(e);
|
||||
} else {
|
||||
@ -242,11 +404,15 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Enable save buttons upon detecting changes to content.
|
||||
* "changed" class is added by jQuery.changetracker.
|
||||
*/
|
||||
$('.cms-edit-form.changed').entwine({
|
||||
onmatch: function onmatch(e) {
|
||||
this.find('button[name=action_save]').button('option', 'showingAlternate', true);
|
||||
this.find('button[name=action_publish]').button('option', 'showingAlternate', true);
|
||||
|
||||
this._super(e);
|
||||
},
|
||||
onunmatch: function onunmatch(e) {
|
||||
@ -254,11 +420,14 @@
|
||||
if (saveButton.data('button')) saveButton.button('option', 'showingAlternate', false);
|
||||
var publishButton = this.find('button[name=action_publish]');
|
||||
if (publishButton.data('button')) publishButton.button('option', 'showingAlternate', false);
|
||||
|
||||
this._super(e);
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-edit-form .Actions button[name=action_publish]').entwine({
|
||||
/**
|
||||
* Bind to ssui.button event to trigger stylistic changes.
|
||||
*/
|
||||
onbuttonafterrefreshalternate: function onbuttonafterrefreshalternate() {
|
||||
if (this.button('option', 'showingAlternate')) {
|
||||
this.addClass('ss-ui-action-constructive');
|
||||
@ -267,7 +436,11 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-edit-form .Actions button[name=action_save]').entwine({
|
||||
/**
|
||||
* Bind to ssui.button event to trigger stylistic changes.
|
||||
*/
|
||||
onbuttonafterrefreshalternate: function onbuttonafterrefreshalternate() {
|
||||
if (this.button('option', 'showingAlternate')) {
|
||||
this.addClass('ss-ui-action-constructive');
|
||||
@ -276,10 +449,16 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked
|
||||
*
|
||||
* Showing the "Page location" "Parent page" chooser only when the "Sub-page underneath a parent page"
|
||||
* radio button is selected
|
||||
*/
|
||||
$('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({
|
||||
onmatch: function onmatch() {
|
||||
this.redraw();
|
||||
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function onunmatch() {
|
||||
@ -294,8 +473,9 @@
|
||||
}
|
||||
});
|
||||
|
||||
//trigger an initial change event to do the initial hiding of the element, if necessary
|
||||
if ($('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr('id') == 'Form_EditForm_ParentType_root') {
|
||||
$('.cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder').hide();
|
||||
$('.cms-edit-form.CMSPageSettingsController #Form_EditForm_ParentID_Holder').hide(); //quick hide on first run
|
||||
}
|
||||
});
|
||||
});
|
34
javascript/dist/CMSMain.Tree.js
vendored
34
javascript/dist/CMSMain.Tree.js
vendored
@ -30,12 +30,18 @@
|
||||
this.adjustContextClass();
|
||||
}
|
||||
},
|
||||
/*
|
||||
* Add and remove classes from context menus to allow for
|
||||
* adjusting the display
|
||||
*/
|
||||
adjustContextClass: function adjustContextClass() {
|
||||
var menus = $('#vakata-contextmenu').find("ul ul");
|
||||
|
||||
menus.each(function (i) {
|
||||
var col = "1",
|
||||
count = $(menus[i]).find('li').length;
|
||||
|
||||
//Assign columns to menus over 10 items long
|
||||
if (count > 20) {
|
||||
col = "3";
|
||||
} else if (count > 10) {
|
||||
@ -43,6 +49,8 @@
|
||||
}
|
||||
|
||||
$(menus[i]).addClass('col-' + col).removeClass('right');
|
||||
|
||||
//Remove "right" class that jstree adds on mouseenter
|
||||
$(menus[i]).find('li').on("mouseenter", function (e) {
|
||||
$(this).parent('ul').removeClass("right");
|
||||
});
|
||||
@ -52,10 +60,10 @@
|
||||
var self = this,
|
||||
config = this._super(),
|
||||
hints = this.getHints();
|
||||
|
||||
config.plugins.push('contextmenu');
|
||||
config.contextmenu = {
|
||||
'items': function items(node) {
|
||||
|
||||
var menuitems = {
|
||||
'edit': {
|
||||
'label': _i18n2.default._t('Tree.EditPage', 'Edit page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree'),
|
||||
@ -65,26 +73,26 @@
|
||||
}
|
||||
};
|
||||
|
||||
// Add "show as list"
|
||||
if (!node.hasClass('nochildren')) {
|
||||
menuitems['showaslist'] = {
|
||||
'label': _i18n2.default._t('Tree.ShowAsList'),
|
||||
'action': function action(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(self.data('urlListview') + '&ParentID=' + obj.data('id'), null, {
|
||||
tabState: {
|
||||
'pages-controller-cms-content': {
|
||||
'tabSelector': '.content-listview'
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.cms-container').entwine('.ss').loadPanel(self.data('urlListview') + '&ParentID=' + obj.data('id'), null,
|
||||
// Default to list view tab
|
||||
{ tabState: { 'pages-controller-cms-content': { 'tabSelector': '.content-listview' } } });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Build a list for allowed children as submenu entries
|
||||
var pagetype = node.data('pagetype'),
|
||||
id = node.data('id'),
|
||||
allowedChildren = node.find('>a .item').data('allowedchildren'),
|
||||
menuAllowedChildren = {},
|
||||
hasAllowedChildren = false;
|
||||
|
||||
// Convert to menu entries
|
||||
$.each(allowedChildren, function (klass, title) {
|
||||
hasAllowedChildren = true;
|
||||
menuAllowedChildren["allowedchildren-" + klass] = {
|
||||
@ -117,12 +125,16 @@
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
return menuitems;
|
||||
}
|
||||
};
|
||||
return config;
|
||||
}
|
||||
});
|
||||
|
||||
// Scroll tree down to context of the current page, if it isn't
|
||||
// already visible
|
||||
$('.cms-tree a.jstree-clicked').entwine({
|
||||
onmatch: function onmatch() {
|
||||
var self = this,
|
||||
@ -130,18 +142,24 @@
|
||||
scrollTo;
|
||||
|
||||
if (self.offset().top < 0 || self.offset().top > panel.height() - self.height()) {
|
||||
// Current scroll top + our current offset top is our
|
||||
// position in the panel
|
||||
scrollTo = panel.scrollTop() + self.offset().top + panel.height() / 2;
|
||||
|
||||
panel.animate({
|
||||
scrollTop: scrollTo
|
||||
}, 'slow');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Clear filters button
|
||||
$('.cms-tree-filtered .clear-filter').entwine({
|
||||
onclick: function onclick() {
|
||||
window.location = location.protocol + '//' + location.host + location.pathname;
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-tree-filtered').entwine({
|
||||
onmatch: function onmatch() {
|
||||
var self = this,
|
||||
|
39
javascript/dist/CMSMain.js
vendored
39
javascript/dist/CMSMain.js
vendored
@ -21,9 +21,18 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Behaviour for the CMS Content Toolbar.
|
||||
* Applies to tools on top-level views i.e. '/admin/pages' and '/admin/assets' and
|
||||
* their corresponding tools in the SiteTree panel.
|
||||
* An example is 'bulk actions' on the Pages view.
|
||||
*/
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
|
||||
// Faux three column layout
|
||||
$('.cms-content-header-info').entwine({
|
||||
'from .cms-panel': {
|
||||
// Keep the header info's width synced with the TreeView panel's width.
|
||||
ontoggle: function ontoggle(e) {
|
||||
var $treeViewPanel = this.closest('.cms-content').find(e.target);
|
||||
|
||||
@ -35,24 +44,31 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-content-toolbar').entwine({
|
||||
|
||||
onmatch: function onmatch() {
|
||||
var self = this;
|
||||
|
||||
this._super();
|
||||
|
||||
// Initialise the buttons
|
||||
$.each(this.find('.cms-actions-buttons-row .tool-button'), function () {
|
||||
var $button = $(this),
|
||||
toolId = $button.data('toolid'),
|
||||
isActive = $button.hasClass('active');
|
||||
|
||||
// We don't care about tools that don't have a related 'action'.
|
||||
if (toolId !== void 0) {
|
||||
// Set the tool to its closed state.
|
||||
$button.data('active', false).removeClass('active');
|
||||
$('#' + toolId).hide();
|
||||
|
||||
self.bindActionButtonEvents($button);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onunmatch: function onunmatch() {
|
||||
var self = this;
|
||||
|
||||
@ -63,19 +79,41 @@
|
||||
self.unbindActionButtonEvents($button);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @func bindActionButtonEvents
|
||||
* @param {object} $button
|
||||
* @desc Add event handlers in the '.cmsContentToolbar' namespace.
|
||||
*/
|
||||
bindActionButtonEvents: function bindActionButtonEvents($button) {
|
||||
var self = this;
|
||||
|
||||
$button.on('click.cmsContentToolbar', function (e) {
|
||||
self.showHideTool($button);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @func unbindActionButtonEvents
|
||||
* @param {object} $button
|
||||
* @desc Remove all event handlers in the '.cmsContentToolbar' namespace.
|
||||
*/
|
||||
unbindActionButtonEvents: function unbindActionButtonEvents($button) {
|
||||
$button.off('.cmsContentToolbar');
|
||||
},
|
||||
|
||||
/**
|
||||
* @func showTool
|
||||
* @param {object} $button
|
||||
* @desc Show a tool in the tools row. Hides all other tools.
|
||||
*/
|
||||
showHideTool: function showHideTool($button) {
|
||||
var isActive = $button.data('active'),
|
||||
toolId = $button.data('toolid'),
|
||||
$action = $('#' + toolId);
|
||||
|
||||
// Hide all tools except the one passed as a param,
|
||||
// which gets handled separately.
|
||||
$.each(this.find('.cms-actions-buttons-row .tool-button'), function () {
|
||||
var $currentButton = $(this),
|
||||
$currentAction = $('#' + $currentButton.data('toolid'));
|
||||
@ -85,6 +123,7 @@
|
||||
$currentButton.data('active', false);
|
||||
}
|
||||
});
|
||||
|
||||
$button[isActive ? 'removeClass' : 'addClass']('active');
|
||||
$action[isActive ? 'hide' : 'show']();
|
||||
$button.data('active', !isActive);
|
||||
|
85
javascript/dist/CMSPageHistoryController.js
vendored
85
javascript/dist/CMSPageHistoryController.js
vendored
@ -23,26 +23,59 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* File: CMSPageHistoryController.js
|
||||
*
|
||||
* Handles related interactions between the version selection form on the
|
||||
* left hand side of the panel and the version displaying on the right
|
||||
* hand side.
|
||||
*/
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
|
||||
/**
|
||||
* Class: #Form_VersionsForm
|
||||
*
|
||||
* The left hand side version selection form is the main interface for
|
||||
* users to select a version to view, or to compare two versions
|
||||
*/
|
||||
$('#Form_VersionsForm').entwine({
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
onmatch: function onmatch() {
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function onunmatch() {
|
||||
this._super();
|
||||
},
|
||||
/**
|
||||
* Function: submit.
|
||||
*
|
||||
* Submits either the compare versions form or the view single form
|
||||
* display based on whether we have two or 1 option selected
|
||||
*
|
||||
* Todo:
|
||||
* Handle coupling to admin url
|
||||
*/
|
||||
onsubmit: function onsubmit(e, d) {
|
||||
e.preventDefault();
|
||||
|
||||
var id,
|
||||
self = this;
|
||||
|
||||
id = this.find(':input[name=ID]').val();
|
||||
|
||||
if (!id) return false;
|
||||
|
||||
var button, url, selected, to, from, compare, data;
|
||||
|
||||
compare = this.find(":input[name=CompareMode]").is(":checked");
|
||||
selected = this.find("table input[type=checkbox]").filter(":checked");
|
||||
|
||||
if (compare) {
|
||||
if (selected.length != 2) return false;
|
||||
|
||||
to = selected.eq(0).val();
|
||||
from = selected.eq(1).val();
|
||||
button = this.find(':submit[name=action_doCompare]');
|
||||
@ -53,20 +86,30 @@
|
||||
url = _i18n2.default.sprintf(this.data('linkTmplShow'), id, to);
|
||||
}
|
||||
|
||||
$('.cms-container').loadPanel(url, '', {
|
||||
pjax: 'CurrentForm'
|
||||
});
|
||||
$('.cms-container').loadPanel(url, '', { pjax: 'CurrentForm' });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: :input[name=ShowUnpublished]
|
||||
*
|
||||
* Used for toggling whether to show or hide unpublished versions.
|
||||
*/
|
||||
$('#Form_VersionsForm input[name=ShowUnpublished]').entwine({
|
||||
onmatch: function onmatch() {
|
||||
this.toggle();
|
||||
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function onunmatch() {
|
||||
this._super();
|
||||
},
|
||||
/**
|
||||
* Event: :input[name=ShowUnpublished] change
|
||||
*
|
||||
* Changing the show unpublished checkbox toggles whether to show
|
||||
* or hide the unpublished versions. Because those rows may be being
|
||||
* compared this also ensures those rows are unselected.
|
||||
*/
|
||||
onchange: function onchange() {
|
||||
this.toggle();
|
||||
},
|
||||
@ -81,9 +124,27 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: #Form_VersionsForm tr
|
||||
*
|
||||
* An individual row in the versions form. Selecting the row updates
|
||||
* the edit form depending on whether we're showing individual version
|
||||
* information or displaying comparsion.
|
||||
*/
|
||||
$("#Form_VersionsForm tbody tr").entwine({
|
||||
|
||||
/**
|
||||
* Function: onclick
|
||||
*
|
||||
* Selects or deselects the row (if in compare mode). Will trigger
|
||||
* an update of the edit form if either selected (in single mode)
|
||||
* or if this is the second row selected (in compare mode)
|
||||
*/
|
||||
onclick: function onclick(e) {
|
||||
var compare, selected;
|
||||
|
||||
// compare mode
|
||||
compare = this.parents("form").find(':input[name=CompareMode]').attr("checked");
|
||||
selected = this.siblings(".active");
|
||||
|
||||
@ -92,12 +153,14 @@
|
||||
|
||||
return;
|
||||
} else if (compare) {
|
||||
// check if we have already selected more than two.
|
||||
if (selected.length > 1) {
|
||||
return alert(_i18n2.default._t('ONLYSELECTTWO', 'You can only compare two versions at this time.'));
|
||||
}
|
||||
|
||||
this._select();
|
||||
|
||||
// if this is the second selected then we can compare.
|
||||
if (selected.length == 1) {
|
||||
this.parents('form').submit();
|
||||
}
|
||||
@ -105,20 +168,32 @@
|
||||
return;
|
||||
} else {
|
||||
this._select();
|
||||
|
||||
selected._unselect();
|
||||
|
||||
this.parents("form").submit();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _unselect()
|
||||
*
|
||||
* Unselects the row from the form selection.
|
||||
*/
|
||||
_unselect: function _unselect() {
|
||||
this.removeClass('active');
|
||||
this.find(":input[type=checkbox]").attr("checked", false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _select()
|
||||
*
|
||||
* Selects the currently matched row in the form selection
|
||||
*/
|
||||
_select: function _select() {
|
||||
this.addClass('active');
|
||||
this.find(":input[type=checkbox]").attr("checked", true);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
1
javascript/dist/RedirectorPage.js
vendored
1
javascript/dist/RedirectorPage.js
vendored
@ -26,7 +26,6 @@
|
||||
onmatch: function onmatch() {
|
||||
var self = $(this);
|
||||
if (self.attr('checked')) this.toggle();
|
||||
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function onunmatch() {
|
||||
|
3
javascript/dist/SilverStripeNavigator.js
vendored
3
javascript/dist/SilverStripeNavigator.js
vendored
@ -32,14 +32,17 @@
|
||||
w.focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
(0, _jQuery2.default)('#SilverStripeNavigatorLink').on('click', function (e) {
|
||||
(0, _jQuery2.default)('#SilverStripeNavigatorLinkPopup').toggle();
|
||||
return false;
|
||||
});
|
||||
|
||||
(0, _jQuery2.default)('#SilverStripeNavigatorLinkPopup a.close').on('click', function (e) {
|
||||
(0, _jQuery2.default)('#SilverStripeNavigatorLinkPopup').hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
(0, _jQuery2.default)('#SilverStripeNavigatorLinkPopup input').on('focus', function (e) {
|
||||
this.select();
|
||||
});
|
||||
|
42
javascript/dist/SiteTreeURLSegmentField.js
vendored
42
javascript/dist/SiteTreeURLSegmentField.js
vendored
@ -22,36 +22,61 @@
|
||||
}
|
||||
|
||||
_jQuery2.default.entwine('ss', function ($) {
|
||||
/**
|
||||
* Class: .field.urlsegment
|
||||
*
|
||||
* Provides enhanced functionality (read-only/edit switch) and
|
||||
* input validation on the URLSegment field
|
||||
*/
|
||||
$('.field.urlsegment:not(.readonly)').entwine({
|
||||
|
||||
// Roughly matches the field width including edit button
|
||||
MaxPreviewLength: 55,
|
||||
|
||||
Ellipsis: '...',
|
||||
|
||||
onmatch: function onmatch() {
|
||||
// Only initialize the field if it contains an editable field.
|
||||
// This ensures we don't get bogus previews on readonly fields.
|
||||
if (this.find(':text').length) this.toggleEdit(false);
|
||||
this.redraw();
|
||||
|
||||
this._super();
|
||||
},
|
||||
|
||||
redraw: function redraw() {
|
||||
var field = this.find(':text'),
|
||||
url = decodeURI(field.data('prefix') + field.val()),
|
||||
previewUrl = url;
|
||||
|
||||
// Truncate URL if required (ignoring the suffix, retaining the full value)
|
||||
if (url.length > this.getMaxPreviewLength()) {
|
||||
previewUrl = this.getEllipsis() + url.substr(url.length - this.getMaxPreviewLength(), url.length);
|
||||
}
|
||||
|
||||
// Transfer current value to holder
|
||||
this.find('.preview').attr('href', encodeURI(url + field.data('suffix'))).text(previewUrl);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param Boolean
|
||||
*/
|
||||
toggleEdit: function toggleEdit(toggle) {
|
||||
var field = this.find(':text');
|
||||
|
||||
this.find('.preview-holder')[toggle ? 'hide' : 'show']();
|
||||
this.find('.edit-holder')[toggle ? 'show' : 'hide']();
|
||||
|
||||
if (toggle) {
|
||||
field.data("origval", field.val());
|
||||
field.data("origval", field.val()); //retain current value for cancel
|
||||
field.focus();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Commits the change of the URLSegment to the field
|
||||
* Optional: pass in (String) to update the URLSegment
|
||||
*/
|
||||
update: function update() {
|
||||
var self = this,
|
||||
field = this.find(':text'),
|
||||
@ -72,17 +97,29 @@
|
||||
this.redraw();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Cancels any changes to the field
|
||||
*/
|
||||
cancel: function cancel() {
|
||||
var field = this.find(':text');
|
||||
field.val(field.data("origval"));
|
||||
this.toggleEdit(false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Return a value matching the criteria.
|
||||
*
|
||||
* @param (String)
|
||||
* @param (Function)
|
||||
*/
|
||||
suggest: function suggest(val, callback) {
|
||||
var self = this,
|
||||
field = self.find(':text'),
|
||||
urlParts = $.path.parseUrl(self.closest('form').attr('action')),
|
||||
url = urlParts.hrefNoSearch + '/field/' + field.attr('name') + '/suggest/?value=' + encodeURIComponent(val);
|
||||
if (urlParts.search) url += '&' + urlParts.search.replace(/^\?/, '');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
success: function success(data) {
|
||||
@ -97,18 +134,21 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.field.urlsegment .edit').entwine({
|
||||
onclick: function onclick(e) {
|
||||
e.preventDefault();
|
||||
this.closest('.field').toggleEdit(true);
|
||||
}
|
||||
});
|
||||
|
||||
$('.field.urlsegment .update').entwine({
|
||||
onclick: function onclick(e) {
|
||||
e.preventDefault();
|
||||
this.closest('.field').update();
|
||||
}
|
||||
});
|
||||
|
||||
$('.field.urlsegment .cancel').entwine({
|
||||
onclick: function onclick(e) {
|
||||
e.preventDefault();
|
||||
|
2
javascript/dist/bundle-lib.js
vendored
2
javascript/dist/bundle-lib.js
vendored
@ -1 +1 @@
|
||||
!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]);
|
||||
!function t(e,n,i){function a(r,s){if(!n[r]){if(!e[r]){var d="function"==typeof require&&require;if(!s&&d)return d(r,!0);if(o)return o(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[r]={exports:{}};e[r][0].call(c.exports,function(t){var n=e[r][1][t];return a(n?n:t)},c,c.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)a(i[r]);return a}({1:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var a=t("jQuery"),o=i(a);o["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"),o=a&&"child"===i?n.getValue()||this.getParentID():null,r=a?a.ClassName:null,s=r&&"child"===i?r:"Root",d="undefined"!=typeof e[s]?e[s]:null,l=this,c=d&&"undefined"!=typeof d.defaultChild?d.defaultChild:null,u=[];if(o){if(this.hasClass("loading"))return;return this.addClass("loading"),this.setParentID(o),n.getValue()||n.setValue(o),u=this.loadCachedChildren(o),null!==u?(this.updateSelectionFilter(u,c),void this.removeClass("loading")):(t.ajax({url:l.data("childfilter"),data:{ParentID:o},success:function(t){l.saveCachedChildren(o,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 o=this.find("#Form_AddForm_PageType li:not(.disabled)").length?"enable":"disable";this.find("button[name=action_doAdd]").button(o),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 o=n.jstree("get_selected");a=o?t(o[0]).data("id"):null}else{var r=i.find('input[name="Page[GridState]"]').val();r&&(a=parseInt(JSON.parse(r).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"),o=i(a),r=t("i18n"),s=i(r);o["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 o=e.data("OrigVal"),r=e.val();e.data("OrigVal",r),0===i.val().indexOf(i.data("defaultUrl"))&&""==a.val()?e.updateURLSegment(r):t(".update",e.parent()).show(),e.updateRelatedFields(r,o),e.updateBreadcrumbLabel(r)})),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"),o=i(a),r=t("i18n"),s=i(r);o["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")),o=n.find(">a .item").data("allowedchildren"),r={},d=!1;return t.each(o,function(n,i){d=!0,r["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:r}),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"),o=i(a);o["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"),o=i(a),r=t("i18n"),s=i(r);o["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,o,r,d,l,c;if(c=this.find(":input[name=CompareMode]").is(":checked"),r=this.find("table input[type=checkbox]").filter(":checked"),c){if(2!=r.length)return!1;d=r.eq(0).val(),l=r.eq(1).val(),a=this.find(":submit[name=action_doCompare]"),o=s["default"].sprintf(this.data("linkTmplCompare"),i,l,d)}else d=r.eq(0).val(),a=this.find(":submit[name=action_doShowVersion]"),o=s["default"].sprintf(this.data("linkTmplShow"),i,d);t(".cms-container").loadPanel(o,"",{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"),o=i(a);o["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 o=t("jQuery"),r=i(o);(0,r["default"])(document).ready(function(){(0,r["default"])("#switchView a.newWindow").on("click",function(t){var e=window.open(this.href,a(this.target));return e.focus(),!1}),(0,r["default"])("#SilverStripeNavigatorLink").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").toggle(),!1}),(0,r["default"])("#SilverStripeNavigatorLinkPopup a.close").on("click",function(t){return(0,r["default"])("#SilverStripeNavigatorLinkPopup").hide(),!1}),(0,r["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"),o=i(a);o["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"),o=t.path.parseUrl(i.closest("form").attr("action")),r=o.hrefNoSearch+"/field/"+a.attr("name")+"/suggest/?value="+encodeURIComponent(e);o.search&&(r+="&"+o.search.replace(/^\?/,"")),t.ajax({url:r,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]);
|
20
lang/cs.yml
20
lang/cs.yml
@ -71,8 +71,8 @@ cs:
|
||||
PUBLISH_PAGES: Zveřejnit
|
||||
RESTORE: Obnovit
|
||||
RESTORED_PAGES: 'Obnoveno %d stránek'
|
||||
UNPUBLISHED_PAGES: 'Nezveřejněné %d stránky'
|
||||
UNPUBLISH_PAGES: Nezveřejnit
|
||||
UNPUBLISHED_PAGES: 'Nezveřejněných %d stránek'
|
||||
UNPUBLISH_PAGES: Nezveřejňovat
|
||||
CMSFileAddController:
|
||||
MENUTITLE: Soubory
|
||||
CMSMain:
|
||||
@ -94,11 +94,11 @@ cs:
|
||||
DUPLICATEDWITHCHILDREN: 'Duplikováno ''{title}'' a potomci úspěšně'
|
||||
EMAIL: E-mail
|
||||
EditTree: 'Upravit strom'
|
||||
ListFiltered: 'Filtrovaný seznam.'
|
||||
ListFiltered: 'Zobrazení výsledků vyhledávání.'
|
||||
MENUTITLE: 'Upravit stránku'
|
||||
NEWPAGE: 'Nová {pagetype}'
|
||||
PAGENOTEXISTS: 'Tato stránka neexistuje'
|
||||
PAGES: Stránky
|
||||
PAGES: 'Stav stránky'
|
||||
PAGETYPEANYOPT: Jakékoliv
|
||||
PAGETYPEOPT: 'Typ stránky'
|
||||
PUBALLCONFIRM: 'Prosím zveřejněte veškeré stránky z úschovny'
|
||||
@ -122,11 +122,11 @@ cs:
|
||||
TabContent: Obsah
|
||||
TabHistory: Historie
|
||||
TabSettings: Nastavení
|
||||
TreeFiltered: 'Fltrovaná struktura.'
|
||||
TreeFilteredClear: 'Vyčistit filtr'
|
||||
TreeFiltered: 'Zobrazení výsledků vyhledávání.'
|
||||
TreeFilteredClear: Vyčistit
|
||||
CMSMain_left_ss:
|
||||
APPLY_FILTER: 'Použít filtr'
|
||||
CLEAR_FILTER: 'Vyčistit filtr'
|
||||
APPLY_FILTER: Hledat
|
||||
CLEAR_FILTER: Vyčistit
|
||||
RESET: Resetovat
|
||||
CMSPageAddController:
|
||||
MENUTITLE: 'Přidat stránku'
|
||||
@ -159,7 +159,7 @@ cs:
|
||||
MENUTITLE: Stránky
|
||||
TreeView: 'Pohled strom'
|
||||
CMSPagesController_ContentToolbar_ss:
|
||||
MULTISELECT: Multi-výběr
|
||||
MULTISELECT: 'Dávkové akce'
|
||||
CMSPagesController_Tools_ss:
|
||||
FILTER: Filtr
|
||||
CMSSIteTreeFilter_PublishedPages:
|
||||
@ -168,7 +168,7 @@ cs:
|
||||
FILTERDATEFROM: Od
|
||||
FILTERDATEHEADING: Datum
|
||||
FILTERDATETO: Do
|
||||
FILTERLABELTEXT: Obsah
|
||||
FILTERLABELTEXT: Hledat
|
||||
PAGEFILTERDATEHEADING: 'Poslední změna'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Možnosti
|
||||
|
25
lang/fi.yml
25
lang/fi.yml
@ -71,6 +71,8 @@ fi:
|
||||
PUBLISH_PAGES: Julkaise
|
||||
RESTORE: Palauta
|
||||
RESTORED_PAGES: 'Palautettu %d sivua'
|
||||
UNPUBLISHED_PAGES: 'Poistettiin %d sivua julkaisusta'
|
||||
UNPUBLISH_PAGES: Piilota julkaisu
|
||||
CMSFileAddController:
|
||||
MENUTITLE: Tiedostot
|
||||
CMSMain:
|
||||
@ -92,10 +94,13 @@ fi:
|
||||
DUPLICATEDWITHCHILDREN: '''{title}'' ja alasivu monistettiin onnistuneesti'
|
||||
EMAIL: Sähköposti
|
||||
EditTree: 'Muokkaa rakennepuuta'
|
||||
ListFiltered: 'Näytetään hakutulokset.'
|
||||
MENUTITLE: 'Muokkaa sivua'
|
||||
NEWPAGE: 'Uusi {pagetype}'
|
||||
PAGENOTEXISTS: 'Tätä sivua ei ole olemassa'
|
||||
PAGES: 'Sivun tila'
|
||||
PAGETYPEANYOPT: Mikä tahansa
|
||||
PAGETYPEOPT: 'Sivutyyppi'
|
||||
PUBALLCONFIRM: 'Julkaise jokainen sivu tällä sivustolla kopioiden luonnosten sisältö julkiselle sivustolle'
|
||||
PUBALLFUN: 'Julkaise kaikki -toiminto'
|
||||
PUBALLFUN2: "Painamalla tätä nappia, tekee se saman kuin kävisit painamassa joka sivulla \"julkaise\". Se on käytännöllinen, jos on tehnyt isoja muutoksia sisältöön, esim. kun sivusto luotiin."
|
||||
@ -104,6 +109,7 @@ fi:
|
||||
REMOVED: 'Poista ''{title}''{description} näkyvältä sivustolta'
|
||||
REMOVEDPAGE: '''{title}'' poistettiin julkaistulta sivustolta'
|
||||
REMOVEDPAGEFROMDRAFT: 'Poistettu ''%s'' luonnossivustolta'
|
||||
RESTORE: 'Palauta luonnos'
|
||||
RESTORED: '''{title}'' palautettiin onnistuneesti'
|
||||
RESTORE_DESC: 'Palauta arkistoitu versio luonnokseksi'
|
||||
RESTORE_TO_ROOT: 'Palauta luonnos päätasolle'
|
||||
@ -116,7 +122,11 @@ fi:
|
||||
TabContent: Sisältö
|
||||
TabHistory: Historia
|
||||
TabSettings: Asetukset
|
||||
TreeFiltered: 'Näytetään haun tulokset.'
|
||||
TreeFilteredClear: Tyhjennä
|
||||
CMSMain_left_ss:
|
||||
APPLY_FILTER: Hae
|
||||
CLEAR_FILTER: Tyhjennä
|
||||
RESET: Nollaa
|
||||
CMSPageAddController:
|
||||
MENUTITLE: 'Lisää sivu'
|
||||
@ -148,6 +158,8 @@ fi:
|
||||
ListView: 'Listanäkymä'
|
||||
MENUTITLE: Sivut
|
||||
TreeView: 'Puunäkymä'
|
||||
CMSPagesController_ContentToolbar_ss:
|
||||
MULTISELECT: 'Sarjatehtävät'
|
||||
CMSPagesController_Tools_ss:
|
||||
FILTER: Suodata
|
||||
CMSSIteTreeFilter_PublishedPages:
|
||||
@ -156,11 +168,20 @@ fi:
|
||||
FILTERDATEFROM: Alkaen
|
||||
FILTERDATEHEADING: Pvm
|
||||
FILTERDATETO: Päättyen
|
||||
FILTERLABELTEXT: Haku
|
||||
PAGEFILTERDATEHEADING: 'Viimeksi muokattu'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Asetukset
|
||||
CMSSiteTreeFilter_ChangedPages:
|
||||
Title: 'Muokatut sivut'
|
||||
CMSSiteTreeFilter_DeletedPages:
|
||||
Title: 'Kaikki sivut, mukaan lukien arkistoidut'
|
||||
CMSSiteTreeFilter_Search:
|
||||
Title: 'Kaikki sivut'
|
||||
CMSSiteTreeFilter_StatusDeletedPages:
|
||||
Title: 'Arkistoidut sivut'
|
||||
CMSSiteTreeFilter_StatusDraftPages:
|
||||
Title: 'Luonnossivut'
|
||||
CMSSiteTreeFilter_StatusRemovedFromDraftPages:
|
||||
Title: 'Näkyvillä, mutta poistettu luonnoksista'
|
||||
ContentControl:
|
||||
@ -221,6 +242,7 @@ fi:
|
||||
DEFAULTSERVERERRORPAGETITLE: 'Palvelinvirhe'
|
||||
DESCRIPTION: 'Omat virheilmoitukset (sivuille, kuten "Sivua ei löytynyt")'
|
||||
ERRORFILEPROBLEM: 'Virhe avattaessa tiedostoa "{filename}" palvelimelle tallentamista varten. Tarkista tiedoston kirjoitusoikeudet.'
|
||||
PLURALNAME: 'Virhesivut'
|
||||
SINGULARNAME: 'Virhesivu'
|
||||
File:
|
||||
Title: Nimi
|
||||
@ -245,6 +267,7 @@ fi:
|
||||
HASBEENSETUP: 'Sivu, joka ohjaa käyttäjän toiselle sivulle on valmis, mutta sivua, jolle käyttäjä ohjataan, ei ole.'
|
||||
HEADER: 'Tämä sivu ohjaa käyttäjän toiselle sivulle'
|
||||
OTHERURL: 'Toisen verkkosivuston URL-osoite'
|
||||
PLURALNAME: 'Uudelleenohjaavat sivut'
|
||||
REDIRECTTO: 'Minne ohjataan?'
|
||||
REDIRECTTOEXTERNAL: 'Muu verkkosivusto'
|
||||
REDIRECTTOPAGE: 'Sivu verkkosivustollasi'
|
||||
@ -278,6 +301,7 @@ fi:
|
||||
SilverStripeNavigator:
|
||||
ARCHIVED: Arkistoitu
|
||||
SilverStripeNavigatorLink:
|
||||
ShareInstructions: 'Jaa tämä sivu kopioimalla ja liittämällä alapuolella oleva linkki.'
|
||||
ShareLink: 'Jaa linkki'
|
||||
SilverStripeNavigatorLinkl:
|
||||
CloseLink: Sulje
|
||||
@ -412,5 +436,6 @@ fi:
|
||||
EditLink: muokkaa
|
||||
HEADER: 'Tämä on virtuaalisivu'
|
||||
HEADERWITHLINK: 'Tämä on virtuaalisivu, joka kopioi sisällön kohteesta "{title}" ({link})'
|
||||
PLURALNAME: 'Virtuaalisivut'
|
||||
PageTypNotAllowedOnRoot: 'Alkuperäinen sivutyyppi "{type}" ei ole sallittu tämän virtuaalisen sivun päätasolla'
|
||||
SINGULARNAME: 'Virtuaalisivu'
|
||||
|
@ -156,6 +156,7 @@ it:
|
||||
FILTERDATEFROM: Da
|
||||
FILTERDATEHEADING: Data
|
||||
FILTERDATETO: A
|
||||
PAGEFILTERDATEHEADING: 'Ultima modifica'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Impostazioni
|
||||
CMSSiteTreeFilter_Search:
|
||||
@ -220,7 +221,10 @@ it:
|
||||
DEFAULTSERVERERRORPAGETITLE: 'Errore server'
|
||||
DESCRIPTION: 'Contenuto personalizzato per differenti casi di errore (es. "Pagina non trovata")'
|
||||
ERRORFILEPROBLEM: 'Errore nell''apertura del file "{filename}" per la scrittura. Controlla i permessi del file.'
|
||||
PLURALNAME: 'Pagine di errore'
|
||||
SINGULARNAME: 'Pagine errore'
|
||||
File:
|
||||
Title: Titolo
|
||||
Folder:
|
||||
AddFolderButton: 'Aggiungi cartella'
|
||||
DELETEUNUSEDTHUMBNAILS: 'Elimina anteprime inutilizzate'
|
||||
@ -242,6 +246,7 @@ it:
|
||||
HASBEENSETUP: 'Una pagina di redirezione è stata configurata nonostante non vi sia alcun indirizzo a cui farla puntare'
|
||||
HEADER: 'Questa pagina redirigerà gli utenti su un''altra'
|
||||
OTHERURL: 'Altro indirizzo del sito web'
|
||||
PLURALNAME: 'Pagine di redirezione'
|
||||
REDIRECTTO: 'Redirigi a'
|
||||
REDIRECTTOEXTERNAL: 'Un altro sito web'
|
||||
REDIRECTTOPAGE: 'Una pagina sul tuo sito web'
|
||||
@ -409,5 +414,6 @@ it:
|
||||
EditLink: modifica
|
||||
HEADER: 'Questa è una pagina virtuale'
|
||||
HEADERWITHLINK: 'Questa è una pagina virtuale copiata da "{title}" ({link})'
|
||||
PLURALNAME: 'Pagine virtuali'
|
||||
PageTypNotAllowedOnRoot: 'Il tipo di pagina originale "{type}" non è consentito al primo livello per questa pagina virtuale'
|
||||
SINGULARNAME: 'Pagina virtuale'
|
||||
|
21
lang/lt.yml
21
lang/lt.yml
@ -71,6 +71,8 @@ lt:
|
||||
PUBLISH_PAGES: Publikuoti
|
||||
RESTORE: Atstatyti
|
||||
RESTORED_PAGES: 'Atstatyti %d puslapiai'
|
||||
UNPUBLISHED_PAGES: 'Nebepublikuojami %d puslapiai'
|
||||
UNPUBLISH_PAGES: Nepublikuoti
|
||||
CMSFileAddController:
|
||||
MENUTITLE: Bylos
|
||||
CMSMain:
|
||||
@ -96,7 +98,7 @@ lt:
|
||||
MENUTITLE: 'Redaguoti puslapį'
|
||||
NEWPAGE: 'Naujas {pagetype}'
|
||||
PAGENOTEXISTS: 'Šis puslapis neegzistuoja'
|
||||
PAGES: Puslapiai
|
||||
PAGES: 'Puslapio būsena'
|
||||
PAGETYPEANYOPT: Bet koks
|
||||
PAGETYPEOPT: 'Puslapio tipas'
|
||||
PUBALLCONFIRM: 'Prašome publikuoti kiekvieną svetainės puslapį, kopijuojant turinį į svetainę'
|
||||
@ -121,10 +123,10 @@ lt:
|
||||
TabHistory: Istorija
|
||||
TabSettings: Nustatymai
|
||||
TreeFiltered: 'Rodomi paieškos rezultatai'
|
||||
TreeFilteredClear: 'Išvalyti filtrą'
|
||||
TreeFilteredClear: Išvalyti filtrą
|
||||
CMSMain_left_ss:
|
||||
APPLY_FILTER: 'Ieškoti'
|
||||
CLEAR_FILTER: 'Išvalyti filtrą'
|
||||
APPLY_FILTER: Ieškoti
|
||||
CLEAR_FILTER: Išvalyti filtrą
|
||||
RESET: Atstatyti
|
||||
CMSPageAddController:
|
||||
MENUTITLE: 'Pridėti puslapį'
|
||||
@ -157,7 +159,7 @@ lt:
|
||||
MENUTITLE: Puslapiai
|
||||
TreeView: 'Medžio rodinys'
|
||||
CMSPagesController_ContentToolbar_ss:
|
||||
MULTISELECT: Daugybinis pasirinkimas
|
||||
MULTISELECT: 'Daugybinis pasirinkimas'
|
||||
CMSPagesController_Tools_ss:
|
||||
FILTER: Filtras
|
||||
CMSSIteTreeFilter_PublishedPages:
|
||||
@ -170,8 +172,16 @@ lt:
|
||||
PAGEFILTERDATEHEADING: 'Redaguota'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Nustatymai
|
||||
CMSSiteTreeFilter_ChangedPages:
|
||||
Title: 'Pakeisti puslapiai'
|
||||
CMSSiteTreeFilter_DeletedPages:
|
||||
Title: 'Visi puslapiai, taip pat ir archyvuoti'
|
||||
CMSSiteTreeFilter_Search:
|
||||
Title: 'Visi puslapiai'
|
||||
CMSSiteTreeFilter_StatusDeletedPages:
|
||||
Title: 'Archyvuoti puslapiai'
|
||||
CMSSiteTreeFilter_StatusDraftPages:
|
||||
Title: 'Juodraštiniai puslapiai'
|
||||
CMSSiteTreeFilter_StatusRemovedFromDraftPages:
|
||||
Title: 'Publikuotas, bet pašalintas iš juodraščių'
|
||||
ContentControl:
|
||||
@ -291,6 +301,7 @@ lt:
|
||||
SilverStripeNavigator:
|
||||
ARCHIVED: Archyvuota
|
||||
SilverStripeNavigatorLink:
|
||||
ShareInstructions: 'Norėdami pasidalinti šiuo puslapiu, kopijuokite žemiau esančią nuorodą.'
|
||||
ShareLink: 'Dalintis nuoroda'
|
||||
SilverStripeNavigatorLinkl:
|
||||
CloseLink: Uždaryti
|
||||
|
@ -94,9 +94,7 @@ pl:
|
||||
MENUTITLE: 'Edytuj stronę'
|
||||
NEWPAGE: 'Nowa {pagetype}'
|
||||
PAGENOTEXISTS: 'Ta strona nie istnieje'
|
||||
PAGES: Strony
|
||||
PAGETYPEANYOPT: Jakikolwiek
|
||||
PAGETYPEOPT: 'Rodzaj strony'
|
||||
PUBALLCONFIRM: 'Opublikuj każdą stronę w witrynie'
|
||||
PUBALLFUN: '"Opublikuj wszystko"'
|
||||
PUBALLFUN2: "Naciśnięcie tego przycisku spowoduje przejście po wszystkich stronach i opublikowanie ich. Zazwyczaj używa się tego, gdy w witrynie było bardzo dużo zmian, na przykład gdy witryna została utworzona."
|
||||
@ -116,10 +114,7 @@ pl:
|
||||
TabContent: Zawartość
|
||||
TabHistory: Historia
|
||||
TabSettings: Opcje
|
||||
TreeFilteredClear: 'Usuń filtr'
|
||||
CMSMain_left_ss:
|
||||
APPLY_FILTER: 'Zastosuj filtr'
|
||||
CLEAR_FILTER: 'Usuń filtr'
|
||||
RESET: Resetuj
|
||||
CMSPageAddController:
|
||||
MENUTITLE: 'Dodaj stronę'
|
||||
@ -151,8 +146,6 @@ pl:
|
||||
ListView: 'Widok listy'
|
||||
MENUTITLE: Strony
|
||||
TreeView: 'Widok drzewa'
|
||||
CMSPagesController_ContentToolbar_ss:
|
||||
MULTISELECT: Multi wybór
|
||||
CMSPagesController_Tools_ss:
|
||||
FILTER: Filtr
|
||||
CMSSIteTreeFilter_PublishedPages:
|
||||
@ -161,7 +154,6 @@ pl:
|
||||
FILTERDATEFROM: Od
|
||||
FILTERDATEHEADING: Data
|
||||
FILTERDATETO: Do
|
||||
FILTERLABELTEXT: Zawartość
|
||||
PAGEFILTERDATEHEADING: 'Ostatnio edytowane'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Ustawienia
|
||||
|
20
lang/sk.yml
20
lang/sk.yml
@ -94,13 +94,13 @@ sk:
|
||||
DUPLICATEDWITHCHILDREN: 'Duplikované ''{title}'' a potomkovia úspešne'
|
||||
EMAIL: Pošli e-mailom
|
||||
EditTree: 'Editovať strom'
|
||||
ListFiltered: 'Filtrovaný zoznam.'
|
||||
ListFiltered: 'Zobrazenie výsledkov vyhľadávania.'
|
||||
MENUTITLE: 'Upraviť stránku'
|
||||
NEWPAGE: 'Nová {pagetype}'
|
||||
PAGENOTEXISTS: 'Táto stránka neexistuje.'
|
||||
PAGES: Stránky
|
||||
PAGES: 'Stav stránky'
|
||||
PAGETYPEANYOPT: Akákoľvek
|
||||
PAGETYPEOPT: 'Typ stránky'
|
||||
PAGETYPEOPT: 'Typ stránky:'
|
||||
PUBALLCONFIRM: 'Prosím, zverejnite všetky stránky webu, zkopírovaním obsahu na verejné'
|
||||
PUBALLFUN: 'Funkcia "Publikovať všetko"'
|
||||
PUBALLFUN2: "Stlačením tohto tlačidla vykonáte to isté ako keby ste navštívili každú stránku a stlačili \"publikuj\". Je určené na použite po rozsiahlych zmenách obsahu, napríklad keď bol web prvýkrát vytvorený."
|
||||
@ -122,11 +122,11 @@ sk:
|
||||
TabContent: Obsah
|
||||
TabHistory: História
|
||||
TabSettings: Nastavenia
|
||||
TreeFiltered: 'Filtrované štruktúra.'
|
||||
TreeFilteredClear: 'Vyčistiť filter'
|
||||
TreeFiltered: 'Zobrazenie výsledkov vyhľadávania.'
|
||||
TreeFilteredClear: Vyčistiť
|
||||
CMSMain_left_ss:
|
||||
APPLY_FILTER: 'Použiť filter'
|
||||
CLEAR_FILTER: 'Vyčistiť filter'
|
||||
APPLY_FILTER: Hľadať
|
||||
CLEAR_FILTER: Vyčistiť
|
||||
RESET: Reset
|
||||
CMSPageAddController:
|
||||
MENUTITLE: 'Pridať stránku'
|
||||
@ -159,7 +159,7 @@ sk:
|
||||
MENUTITLE: Stránky
|
||||
TreeView: 'Zobraziť strom'
|
||||
CMSPagesController_ContentToolbar_ss:
|
||||
MULTISELECT: Multi-výber
|
||||
MULTISELECT: 'Dávkové akcie'
|
||||
CMSPagesController_Tools_ss:
|
||||
FILTER: Filtrovať
|
||||
CMSSIteTreeFilter_PublishedPages:
|
||||
@ -168,7 +168,7 @@ sk:
|
||||
FILTERDATEFROM: Od
|
||||
FILTERDATEHEADING: Dátum
|
||||
FILTERDATETO: Do
|
||||
FILTERLABELTEXT: Obsah
|
||||
FILTERLABELTEXT: Hľadať
|
||||
PAGEFILTERDATEHEADING: 'Posledne zmenené'
|
||||
CMSSettingsController:
|
||||
MENUTITLE: Nastavenia
|
||||
@ -301,7 +301,7 @@ sk:
|
||||
SilverStripeNavigator:
|
||||
ARCHIVED: Archivované
|
||||
SilverStripeNavigatorLink:
|
||||
ShareInstructions: 'K zdielaniu tejto stránky, zkopírujte a prilepte odkaz dolu.'
|
||||
ShareInstructions: 'K zdielaniu tejto stránky, zkopírujte a vložte odkaz dolu.'
|
||||
ShareLink: 'Zdieľať odkaz'
|
||||
SilverStripeNavigatorLinkl:
|
||||
CloseLink: Zavrieť
|
||||
|
Loading…
Reference in New Issue
Block a user