mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4645 from scott1702/insert-media
Sticky footer on insert media/link elements
This commit is contained in:
commit
ffed9a5ac2
@ -869,6 +869,7 @@ form.member-profile-form #Permissions .optionset li { float: none; width: auto;
|
||||
.ui-dialog .cms-dialog-content .ui-tabs .ui-tabs-panel { border: 0; }
|
||||
.ui-dialog .cms-dialog-content .clear { clear: both; }
|
||||
.ui-dialog.loading { background-image: url(../images/spinner.gif); background-position: 50% 50%; background-repeat: no-repeat; }
|
||||
.ui-dialog .ui-dialog-buttonpane { margin: 0; background: #E6EAED; border-top: 1px solid #D2D5D8; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
|
||||
|
||||
body.cms-dialog { overflow: auto; background: #ECEFF1; position: relative; }
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1738,6 +1738,14 @@ form.member-profile-form {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.ui-dialog-buttonpane {
|
||||
margin: 0;
|
||||
background: $color-darker-bg;
|
||||
border-top: 1px solid $color-light-separator;
|
||||
border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
body.cms-dialog {
|
||||
|
@ -260,16 +260,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
HiddenField::create('Locale', null, $this->controller->Locale)
|
||||
)
|
||||
),
|
||||
new FieldList(
|
||||
ResetFormAction::create('remove', _t('HtmlEditorField.BUTTONREMOVELINK', 'Remove link'))
|
||||
->addExtraClass('ss-ui-action-destructive')
|
||||
->setUseButtonTag(true)
|
||||
,
|
||||
FormAction::create('insert', _t('HtmlEditorField.BUTTONINSERTLINK', 'Insert link'))
|
||||
->addExtraClass('ss-ui-action-constructive')
|
||||
->setAttribute('data-icon', 'accept')
|
||||
->setUseButtonTag(true)
|
||||
)
|
||||
new FieldList()
|
||||
);
|
||||
|
||||
$headerWrap->addExtraClass('CompositeField composite cms-content-header nolabel ');
|
||||
@ -393,22 +384,11 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$allFields
|
||||
);
|
||||
|
||||
$actions = new FieldList(
|
||||
FormAction::create('insertmedia', _t('HtmlEditorField.BUTTONINSERT', 'Insert'))
|
||||
->addExtraClass('ss-ui-action-constructive media-insert')
|
||||
->setAttribute('data-icon', 'accept')
|
||||
->setUseButtonTag(true),
|
||||
FormAction::create('insertmedia', _t('HtmlEditorField.BUTTONUpdate', 'Update'))
|
||||
->addExtraClass('ss-ui-action-constructive media-update')
|
||||
->setAttribute('data-icon', 'accept')
|
||||
->setUseButtonTag(true)
|
||||
);
|
||||
|
||||
$form = new Form(
|
||||
$this->controller,
|
||||
"{$this->name}/MediaForm",
|
||||
$fields,
|
||||
$actions
|
||||
new FieldList()
|
||||
);
|
||||
|
||||
|
||||
|
@ -427,9 +427,25 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
|
||||
$('.htmleditorfield-dialog').entwine({
|
||||
onadd: function() {
|
||||
|
||||
// Create jQuery dialog
|
||||
if (!this.is('.ui-dialog-content')) {
|
||||
this.ssdialog({autoOpen: true});
|
||||
this.ssdialog({
|
||||
autoOpen: true,
|
||||
buttons: {
|
||||
'insert': {
|
||||
text: ss.i18n._t(
|
||||
'HtmlEditorField.INSERT',
|
||||
'Insert'
|
||||
),
|
||||
'data-icon': 'accept',
|
||||
class: 'ss-ui-action-constructive media-insert',
|
||||
click: function() {
|
||||
$(this).find('form').submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this._super();
|
||||
@ -1019,7 +1035,8 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
header[(hasItems) ? 'show' : 'hide']();
|
||||
|
||||
// Disable "insert" button if no files are selected
|
||||
this.find('.Actions :submit')
|
||||
this.closest('ui-dialog')
|
||||
.find('ui-dialog-buttonpane .media-insert')
|
||||
.button(hasItems ? 'enable' : 'disable')
|
||||
.toggleClass('ui-state-disabled', !hasItems);
|
||||
|
||||
@ -1035,12 +1052,20 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
this.find('.ss-uploadfield-item-actions')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.ss-uploadfield-item-name')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.ss-uploadfield-item-preview')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.Actions .media-insert')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.htmleditorfield-mediaform-heading.update')[editingSelected ? 'show' : 'hide']();
|
||||
this.find('.Actions .media-update')[editingSelected ? 'show' : 'hide']();
|
||||
this.find('.ss-uploadfield-item-editform').toggleEditForm(editingSelected);
|
||||
this.find('.htmleditorfield-from-cms .field.treedropdown').css('left', $('.htmleditorfield-mediaform-heading:visible').outerWidth());
|
||||
this.closest('.ui-dialog').addClass('ss-uploadfield-dropzone');
|
||||
this.closest('.ui-dialog')
|
||||
.find('.ui-dialog-buttonpane .media-insert .ui-button-text')
|
||||
.text([editingSelected ? ss.i18n._t(
|
||||
'HtmlEditorField.UPDATE',
|
||||
'Update'
|
||||
) : ss.i18n._t(
|
||||
'HtmlEditorField.INSERT',
|
||||
'Insert'
|
||||
)]);
|
||||
},
|
||||
resetFields: function() {
|
||||
this.find('.ss-htmleditorfield-file').remove(); // Remove any existing views
|
||||
|
@ -21,6 +21,8 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
||||
"LeftAndMain.IncompatBrowserWarning": "Your browser is not compatible with the CMS interface. Please use Internet Explorer 7+, Google Chrome 10+ or Mozilla Firefox 3.5+.",
|
||||
"GRIDFIELD.ERRORINTRANSACTION": "An error occured while fetching data from the server\n Please try again later.",
|
||||
"HtmlEditorField.SelectAnchor": "Select an anchor",
|
||||
"HtmlEditorField.UPDATE": "Update",
|
||||
"HtmlEditorField.INSERT": "Insert",
|
||||
"UploadField.ConfirmDelete": "Are you sure you want to remove this file from the server filesystem?",
|
||||
"UploadField.PHP_MAXFILESIZE": "File exceeds upload_max_filesize (php.ini directive)",
|
||||
"UploadField.HTML_MAXFILESIZE": "File exceeds MAX_FILE_SIZE (HTML form directive)",
|
||||
|
@ -16,6 +16,8 @@
|
||||
"LeftAndMain.IncompatBrowserWarning": "Your browser is not compatible with the CMS interface. Please use Internet Explorer 7+, Google Chrome 10+ or Mozilla Firefox 3.5+.",
|
||||
"GRIDFIELD.ERRORINTRANSACTION": "An error occured while fetching data from the server\n Please try again later.",
|
||||
"HtmlEditorField.SelectAnchor": "Select an anchor",
|
||||
"HtmlEditorField.UPDATE": "Update",
|
||||
"HtmlEditorField.INSERT": "Insert",
|
||||
"UploadField.ConfirmDelete": "Are you sure you want to remove this file from the server filesystem?",
|
||||
"UploadField.PHP_MAXFILESIZE": "File exceeds upload_max_filesize (php.ini directive)",
|
||||
"UploadField.HTML_MAXFILESIZE": "File exceeds MAX_FILE_SIZE (HTML form directive)",
|
||||
|
Loading…
Reference in New Issue
Block a user