Remove references to ss-ui

This commit is contained in:
Will Rossiter 2016-12-01 09:31:15 +13:00 committed by Damian Mooyman
parent 03a17029ef
commit 5bb430ef43
7 changed files with 32 additions and 26 deletions

View File

@ -137,10 +137,11 @@ $.entwine('ss', function($){
selectedEl.siblings().setSelected(false);
// Disable the "Create" button if none of the pagetypes are available
var buttonState = this.find('#Form_AddForm_PageType div.radio:not(.disabled)').length
? 'enable'
: 'disable';
this.find('button[name=action_doAdd]').button(buttonState);
if(this.find('#Form_AddForm_PageType div.radio:not(.disabled)').length) {
this.find('button[name=action_doAdd]').removeAttr('disabled');
} else {
this.find('button[name=action_doAdd]').addAttr('disabled');
}
this.find('.message-restricted')[allAllowed ? 'hide' : 'show']();
}

View File

@ -379,15 +379,15 @@ $.entwine('ss', function($){
*/
$('.cms-edit-form.changed').entwine({
onmatch: function(e) {
this.find('button[name=action_save]').button('option', 'showingAlternate', true);
this.find('button[name=action_publish]').button('option', 'showingAlternate', true);
this.find('button[name=action_save]').attr('data-showingAlternate', true);
this.find('button[name=action_publish]').attr('data-showingAlternate', true);
this._super(e);
},
onunmatch: function(e) {
var saveButton = this.find('button[name=action_save]');
if(saveButton.data('button')) saveButton.button('option', 'showingAlternate', false);
if(saveButton.data('button')) saveButton.attr('data-showingAlternate', false);
var publishButton = this.find('button[name=action_publish]');
if(publishButton.data('button')) publishButton.button('option', 'showingAlternate', false);
if(publishButton.data('button')) publishButton.attr('data-showingAlternate', false);
this._super(e);
}
});
@ -397,11 +397,13 @@ $.entwine('ss', function($){
* Bind to ssui.button event to trigger stylistic changes.
*/
onbuttonafterrefreshalternate: function() {
if (this.button('option', 'showingAlternate')) {
this.addClass('ss-ui-action-constructive');
if (this.data('showingAlternate')) {
this.addClass('btn-primary');
this.removeClass('btn-secondary');
}
else {
this.removeClass('ss-ui-action-constructive');
this.removeClass('btn-primary');
this.addClass('btn-secondary');
}
}
});
@ -411,11 +413,13 @@ $.entwine('ss', function($){
* Bind to ssui.button event to trigger stylistic changes.
*/
onbuttonafterrefreshalternate: function() {
if (this.button('option', 'showingAlternate')) {
this.addClass('ss-ui-action-constructive');
if (this.data('showingAlternate')) {
this.addClass('btn-primary');
this.removeClass('btn-secondary');
}
else {
this.removeClass('ss-ui-action-constructive');
this.removeClass('btn-primary');
this.addClass('btn-secondary');
}
}
});

View File

@ -450,8 +450,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
// Create the Search and Reset action
$actions = new FieldList(
FormAction::create('doSearch', _t('CMSMain_left_ss.APPLY_FILTER', 'Search'))
->addExtraClass('ss-ui-action-constructive'),
->addExtraClass('btn btn-primary'),
ResetFormAction::create('clear', _t('CMSMain_left_ss.CLEAR_FILTER', 'Clear'))
->addExtraClass('btn btn-secondary')
);
// Use <button> to allow full jQuery UI styling on the all of the Actions

View File

@ -132,10 +132,10 @@ class CMSPageAddController extends CMSPageEditController {
$actions = new FieldList(
FormAction::create("doAdd", _t('CMSMain.Create',"Create"))
->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')
->addExtraClass('btn-primary font-icon-plus-circled')
->setUseButtonTag(true),
FormAction::create("doCancel", _t('CMSMain.Cancel',"Cancel"))
->addExtraClass('ss-ui-action-destructive ss-ui-action-cancel')
->addExtraClass('btn-secondary')
->setUseButtonTag(true)
);

View File

@ -2322,7 +2322,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
: _t('CMSMain.ARCHIVE', 'Archive');
$moreOptions->push(
FormAction::create('archive', $title)
->addExtraClass('delete ss-ui-action-destructive')
->addExtraClass('delete btn btn-secondary')
->setDescription(_t(
'SiteTree.BUTTONDELETEDESC',
'Remove from draft/live and send to archive'
@ -2334,8 +2334,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if ($canEdit && $isOnDraft) {
$majorActions->push(
FormAction::create('save', _t('SiteTree.BUTTONSAVED', 'Saved'))
->setAttribute('data-icon', 'accept')
->setAttribute('data-icon-alternate', 'addpage')
->addExtraClass('btn-primary font-icon-check-mark')
->setUseButtonTag(true)
->setAttribute('data-text-alternate', _t('CMSMain.SAVEDRAFT','Save draft'))
);
}
@ -2344,14 +2344,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// "publish", as with "save", it supports an alternate state to show when action is needed.
$majorActions->push(
$publish = FormAction::create('publish', _t('SiteTree.BUTTONPUBLISHED', 'Published'))
->setAttribute('data-icon', 'accept')
->setAttribute('data-icon-alternate', 'disk')
->addExtraClass('font-icon-check-mark-2')
->setUseButtonTag(true)
->setAttribute('data-text-alternate', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & publish'))
);
// Set up the initial state of the button to reflect the state of the underlying SiteTree object.
if($stagesDiffer) {
$publish->addExtraClass('ss-ui-alternate');
$publish->addExtraClass('btn-primary');
}
}

View File

@ -1,5 +1,5 @@
<div class="view-controls">
<button id="filters-button" class="icon-button font-icon-search no-text" title="<% _t('CMSPagesController_Tools_ss.FILTER', 'Filter') %>"></button>
<button id="filters-button" class="btn btn-secondary icon-button font-icon-search no-text" title="<% _t('CMSPagesController_Tools_ss.FILTER', 'Filter') %>"></button>
<div class="icon-button-group">
<%-- Change to data-pjax-target="Content-PageList" to enable in-edit listview --%>
<a class="cms-panel-link icon-button font-icon-tree page-view-link <% if $ViewState == 'treeview' %>active<% end_if %>"

View File

@ -1,9 +1,9 @@
<div class="toolbar toolbar--content cms-content-toolbar">
<div class="cms-actions-buttons-row">
<a class="ss-ui-button cms-content-addpage-button tool-button font-icon-plus" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('', 'ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
<a class="btn btn-primary cms-content-addpage-button tool-button font-icon-plus" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('', 'ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
<% if $View == 'Tree' %>
<button type="button" class="cms-content-batchactions-button tool-button font-icon-check-mark-2" data-toolid="batch-actions">
<button type="button" class="cms-content-batchactions-button btn btn-secondary tool-button font-icon-check-mark-2" data-toolid="batch-actions">
<% _t("CMSPagesController_ContentToolbar_ss.MULTISELECT","Batch actions") %>
</button>
<% end_if %>