mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Send user to new area when inserting url
This commit is contained in:
parent
1f64631bfc
commit
9f9d0089df
@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": ";;;;;;;;;AAqBA,kBAAmB,GAClB,gBAAgB,EC2BM,OAAO;AD1B7B,iCAAiB,GAChB,gBAAgB,EAAC,OAAkC;AAEpD,4CAA4B,GAC3B,gBAAgB,EC4BU,OAAO;AD3BjC,2DAAiB,GAChB,gBAAgB,EAAC,OAAuC;AAG1D,6CAA4B,GAE3B,UAAU,EAAC,oEAAkD;;AAK/D,4FAEoC,GACnC,gBAAgB,EAAC,IAAI;;AAItB,wCAAyC,GACxC,UAAU,EAAE,2DAAyE,EACrF,MAAM,EAAC,IAAI;AACX,2DAAqB,GACpB,gBAAgB,EAAE,OAAmB,EACrC,mBAAmB,EAAE,SAAS,EAC9B,MAAM,EAAC,IAAI;AAEZ,oDAAc,GACb,gBAAgB,EAAG,OAAO,EAC1B,mBAAmB,EAAE,SAAS,EAC9B,MAAM,EAAC,IAAI;;AAIb,uCAAwC,GACvC,UAAU,EAAE,yDAAuE,EACnF,MAAM,EAAC,IAAI;AACX,sDAAiB,GAChB,UAAU,EAAE,wDAA6E,EACzF,MAAM,EAAC,IAAI;AAEZ,uDAAkB,GACjB,UAAU,EAAE,2DAAyF,EACrG,MAAM,EAAC,IAAI;;AAOX,mCAAG,GACF,YAAY,EAAE,iBAA+C;AAE9D,mCAAG,GACF,YAAY,EAAE,iBAA+C;AAC7D,wCAAO,GACN,UAAU,EAAE,iBAA+C,EAC3D,aAAa,EAAE,IAAI;AAEpB,yCAAQ,GACP,UAAU,EAAE,iBAA+C,EAC3D,aAAa,EAAC,IAAI;AAIrB,0FAA+B,GAC9B,WAAW,EAAE,iBAA+C;;AAO5D,2DAAO,GACN,MAAM,EAAC,CAAC,EACR,UAAU,EAAC,IAAI;;AAOjB,0DAAqB,GACpB,WAAW,EAA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C,KAAK;;AAQb,sBAAG,GACF,KAAK,EAAE,IAAI;AACX,oCAAc,GACb,OAAO,EAAE,IAAI;AAIf,4CAAyB,GACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,CAAC;;AAKT,wCAA4B,GAC3B,MAAM,EAAC,eAAe;;AAIvB,qDAA+B,GAC9B,OAAO,EAAC,eAAe;;AAGzB,wCAAwC,GACvC,OAAO,EAAC,KAAK;;AJ3Rb,4BAA6B,GAC5B,QAAQ,EAAC,QAAQ,EACjB,KAAK,EAAE,IAAI;AAEV,kGAAmB,GAClB,IAAI,EAAE,CAAC,EACP,QAAQ,EAAC,QAAQ,EACjB,GAAG,EAAC,IAAI,EACR,KAAK,EAAC,IAAI,EACV,YAAY,EAAE,KAAK,EACnB,KAAK,EAAC,KAAK,EACX,OAAO,EAAC,IAAI;;AIsRhB,oEAAqE,GACpE,KAAK,EAAE,KAAK;AAEX,oGAAgB,GACf,UAAU,EAAE,mFAAmF;AAC/F,0GAAQ,GACP,UAAU,EAAE,kFAAkF;AAGhG,qHAAkC,GACjC,UAAU,EAAE,iFAAiF;AAC7F,2HAAQ,GACP,UAAU,EAAE,gFAAgF;AAI/F,uGAAmC,GAC/B,KAAK,EAAE,KAAK;;;AAMjB,mBAAoB,GACnB,OAAO,EAAE,MAAM;;AAKd,2CAAM,GACL,KAAK,EAAC,IAAI,EACV,KAAK,EAAC,KAAK;AAEZ,4DAAuB,GACtB,WAAW,EAAC,IAAI",
|
||||
"sources": ["../scss/_ieShared.scss","../scss/themes/_default.scss","../../../../../../../../Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets/compass/utilities/sprites/_base.scss","../scss/_sprites.scss","../scss/ie7.scss"],
|
||||
"sources": ["../scss/_ieShared.scss","../scss/themes/_default.scss","../../../../../../Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/utilities/sprites/_base.scss","../scss/_sprites.scss","../scss/ie7.scss"],
|
||||
"names": [],
|
||||
"file": "ie7.css"
|
||||
}
|
@ -883,8 +883,9 @@ body.cms-dialog { overflow: auto; background: #ECEFF1; position: relative; }
|
||||
|
||||
/** -------------------------------------------- "Insert X" forms -------------------------------------------- */
|
||||
.htmleditorfield-dialog.ui-dialog-content { padding: 0; position: relative; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web { display: none; text-align: center; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web { text-align: center; margin-bottom: 8px; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web.CompositeField { overflow: hidden; *zoom: 1; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web .url-description { text-align: left; margin-bottom: 12px; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web div.remoteurl { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; width: 80%; width: calc(100% - 80px); position: relative; display: inline-block; padding: 0; margin: 0; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web div.remoteurl label { position: absolute; left: 8px; top: 0; font-weight: normal; color: #888; width: 35px; padding-right: 0; z-index: 1; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web div.remoteurl .middleColumn { margin-left: 0; max-width: none; }
|
||||
@ -895,6 +896,8 @@ body.cms-dialog { overflow: auto; background: #ECEFF1; position: relative; }
|
||||
.htmleditorfield-dialog .htmleditorfield-from-web.loading button.add-url::before { content: ''; background: url(../images/throbber.gif) no-repeat center center; padding: 8px; }
|
||||
.htmleditorfield-dialog .cms-content-header { padding: 0; width: 100%; height: 53px; }
|
||||
.htmleditorfield-dialog .cms-content-header h3 { padding: 12px 0 12px 16px; margin: 0; line-height: 28px; display: inline-block; font-weight: normal; }
|
||||
.htmleditorfield-dialog .cms-content-header h3.insert .back-button { margin: 0; padding: 0; cursor: pointer; }
|
||||
.htmleditorfield-dialog .cms-content-header h3.insert .back-button::before { margin-right: 4px; font-size: 18px; vertical-align: text-bottom; }
|
||||
.htmleditorfield-dialog .ss-insert-media, .htmleditorfield-dialog .ss-insert-link { padding: 12px 16px; }
|
||||
.htmleditorfield-dialog .ss-insert-media .ui-tabs-panel, .htmleditorfield-dialog .ss-insert-link .ui-tabs-panel { padding: 0; }
|
||||
.htmleditorfield-dialog .Actions { padding: 8px 16px; }
|
||||
|
File diff suppressed because one or more lines are too long
@ -1769,13 +1769,18 @@ body.cms-dialog {
|
||||
}
|
||||
|
||||
.htmleditorfield-from-web {
|
||||
display: none;
|
||||
text-align: center;
|
||||
margin-bottom: $grid-y;
|
||||
|
||||
&.CompositeField{
|
||||
@include clearfix;
|
||||
}
|
||||
|
||||
.url-description {
|
||||
text-align: left;
|
||||
margin-bottom: $grid-y*1.5;
|
||||
}
|
||||
|
||||
div.remoteurl{
|
||||
border:none;
|
||||
@include box-shadow-none;
|
||||
@ -1844,6 +1849,20 @@ body.cms-dialog {
|
||||
line-height: 28px;
|
||||
display: inline-block;
|
||||
font-weight: normal;
|
||||
|
||||
&.insert {
|
||||
.back-button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&::before {
|
||||
margin-right: 4px;
|
||||
font-size: 18px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,9 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$select->addExtraClass('content-select');
|
||||
|
||||
|
||||
$URLDescription = _t('HtmlEditorField.URLDESCRIPTION', 'Insert videos and images from the web into your page simply by entering the URL of the file. Make sure you have the rights or permissions before sharing media directly from the web.<br /><br />Please note that files are not added to the file store of the CMS but embeds the file from its original location, if for some reason the file is no longer available in its original location it will no longer be viewable on this page.');
|
||||
$fromWeb = new CompositeField(
|
||||
$description = new LiteralField('URLDescription', '<div class="url-description">' . $URLDescription . '</div>'),
|
||||
$remoteURL = new TextField('RemoteURL', 'http://'),
|
||||
new LiteralField('addURLImage',
|
||||
'<button class="action ui-action-constructive ui-button field font-icon-plus add-url">' .
|
||||
@ -328,11 +330,22 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$computerUploadField->removeExtraClass('ss-uploadfield');
|
||||
$computerUploadField->setTemplate('HtmlEditorField_UploadField');
|
||||
$computerUploadField->setFolderName(Config::inst()->get('Upload', 'uploads_folder'));
|
||||
|
||||
$defaultPanel = new CompositeField(
|
||||
$computerUploadField,
|
||||
$fromCMS
|
||||
);
|
||||
|
||||
$fromWebPanel = new CompositeField(
|
||||
$fromWeb
|
||||
);
|
||||
|
||||
$defaultPanel->addExtraClass('htmleditorfield-default-panel');
|
||||
$fromWebPanel->addExtraClass('htmleditorfield-web-panel');
|
||||
|
||||
$allFields = new CompositeField(
|
||||
$computerUploadField,
|
||||
$fromWeb,
|
||||
$fromCMS,
|
||||
$defaultPanel,
|
||||
$fromWebPanel,
|
||||
$editComposite = new CompositeField(
|
||||
new LiteralField('contentEdit', '<div class="content-edit ss-uploadfield-files files"></div>')
|
||||
)
|
||||
|
@ -1029,6 +1029,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
var node = this.getSelection(),
|
||||
hasItems = Boolean(this.find('.ss-htmleditorfield-file').length),
|
||||
editingSelected = node.is('img'),
|
||||
insertingURL = this.hasClass('insertingURL'),
|
||||
header = this.find('.header-edit');
|
||||
|
||||
// Only show second step if files are selected
|
||||
@ -1041,18 +1042,35 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
.toggleClass('ui-state-disabled', !hasItems);
|
||||
|
||||
// Hide file selection and step labels when editing an existing file
|
||||
this.find('.htmleditorfield-from-computer')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.htmleditorfield-from-cms')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.htmleditorfield-default-panel')[editingSelected || insertingURL ? 'hide' : 'show']();
|
||||
this.find('.htmleditorfield-web-panel')[editingSelected || !insertingURL ? 'hide' : 'show']();
|
||||
|
||||
var mediaFormHeading = this.find('.htmleditorfield-mediaform-heading.insert');
|
||||
|
||||
if (editingSelected) {
|
||||
this.find('.htmleditorfield-from-web').hide();
|
||||
//When editing details of a file
|
||||
mediaFormHeading.hide();
|
||||
} else if (insertingURL) {
|
||||
//When inserting an image from a URL
|
||||
mediaFormHeading
|
||||
.show()
|
||||
.text(ss.i18n._t("HtmlEditorField.INSERTURL"))
|
||||
.prepend('<button class="back-button font-icon-left-open no-text" title="' + ss.i18n._t("HtmlEditorField.BACK") + '"></button>');
|
||||
|
||||
this.find('.htmleditorfield-web-panel input.remoteurl').focus();
|
||||
} else {
|
||||
//Default view when modal is opened
|
||||
mediaFormHeading
|
||||
.show()
|
||||
.text(ss.i18n._t("HtmlEditorField.INSERTFROM"))
|
||||
.find('.back-button').remove();
|
||||
}
|
||||
|
||||
// TODO Way too much knowledge on UploadField internals, use viewfile URL directly instead
|
||||
this.find('.htmleditorfield-mediaform-heading.insert')[editingSelected ? 'hide' : 'show']();
|
||||
this.find('.htmleditorfield-mediaform-heading.update')[editingSelected ? 'show' : 'hide']();
|
||||
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('.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());
|
||||
@ -1104,6 +1122,26 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
||||
}
|
||||
});
|
||||
|
||||
//When 'Insert from URL' button is clicked
|
||||
$('form.htmleditorfield-mediaform div.ss-upload .upload-url').entwine({
|
||||
onclick: function () {
|
||||
var form = this.closest('form');
|
||||
|
||||
form.addClass('insertingURL');
|
||||
form.redraw();
|
||||
}
|
||||
});
|
||||
|
||||
//When back button is clicked while inserting URL
|
||||
$('form.htmleditorfield-mediaform .htmleditorfield-mediaform-heading .back-button').entwine({
|
||||
onclick: function() {
|
||||
var form = this.closest('form');
|
||||
|
||||
form.removeClass('insertingURL');
|
||||
form.redraw();
|
||||
}
|
||||
});
|
||||
|
||||
$('form.htmleditorfield-mediaform .ss-gridfield-items').entwine({
|
||||
onselectableselected: function(e, ui) {
|
||||
var form = this.closest('form'), item = $(ui.selected);
|
||||
|
@ -356,12 +356,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('div.ss-upload .upload-url').entwine({
|
||||
onclick: function () {
|
||||
$('.htmleditorfield-from-web').slideToggle(150, 'linear').find('input.remoteurl').focus();
|
||||
}
|
||||
});
|
||||
|
||||
$('div.ss-upload .ss-uploadfield-item-remove:not(.ui-state-disabled), .ss-uploadfield-item-delete:not(.ui-state-disabled)').entwine({
|
||||
onclick: function(e) {
|
||||
var field = this.closest('div.ss-upload'),
|
||||
|
@ -23,6 +23,9 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
||||
"HtmlEditorField.SelectAnchor": "Select an anchor",
|
||||
"HtmlEditorField.UPDATE": "Update",
|
||||
"HtmlEditorField.INSERT": "Insert",
|
||||
"HtmlEditorField.BACK": "Back",
|
||||
"HtmlEditorField.INSERTFROM": "Insert media from",
|
||||
"HtmlEditorField.INSERTURL": "Insert media from URL",
|
||||
"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)",
|
||||
|
@ -18,6 +18,9 @@
|
||||
"HtmlEditorField.SelectAnchor": "Select an anchor",
|
||||
"HtmlEditorField.UPDATE": "Update",
|
||||
"HtmlEditorField.INSERT": "Insert",
|
||||
"HtmlEditorField.BACK": "Back",
|
||||
"HtmlEditorField.INSERTFROM": "Insert media from",
|
||||
"HtmlEditorField.INSERTURL": "Insert media from URL",
|
||||
"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