mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-26 15:05:39 +08:00
Merge pull request #2687 from aignatov-bio/ai-sci-4775-small-improvments-for-tinymce-tables
Add tables to TinyMce and small table improvements [SCI-4775]
This commit is contained in:
commit
bde548227b
4 changed files with 18 additions and 18 deletions
29
app/assets/javascripts/sitewide/tiny_mce.js
vendored
29
app/assets/javascripts/sitewide/tiny_mce.js
vendored
|
@ -65,17 +65,18 @@ var TinyMCE = (function() {
|
|||
|
||||
function initImageToolBar(editor) {
|
||||
var editorIframe = $('#' + editor.id).prev().find('.mce-edit-area iframe');
|
||||
editorIframe.contents().find('head').append('<style type="text/css">'
|
||||
+ 'img::-moz-selection{background:0 0}'
|
||||
+ 'img::selection{background:0 0}'
|
||||
+ '.mce-content-body img[data-mce-selected]{outline:2px solid #37a0d9}'
|
||||
+ '.mce-content-body div.mce-resizehandle{background:transparent;border-color:transparent;box-sizing:border-box;height:10px;width:10px}'
|
||||
+ '.mce-content-body div.mce-resizehandle:hover{background:transparent}'
|
||||
+ '.mce-content-body div#mceResizeHandlenw{border-left: 2px solid #37a0d9; border-top: 2px solid #37a0d9}'
|
||||
+ '.mce-content-body div#mceResizeHandlene{border-right: 2px solid #37a0d9; border-top: 2px solid #37a0d9}'
|
||||
+ '.mce-content-body div#mceResizeHandlesw{border-left: 2px solid #37a0d9; border-bottom: 2px solid #37a0d9}'
|
||||
+ '.mce-content-body div#mceResizeHandlese{border-right: 2px solid #37a0d9; border-bottom: 2px solid #37a0d9}'
|
||||
+ '</style>');
|
||||
var primaryColor = '#104da9';
|
||||
editorIframe.contents().find('head').append(`<style type="text/css">
|
||||
img::-moz-selection{background:0 0}
|
||||
img::selection{background:0 0}
|
||||
.mce-content-body img[data-mce-selected]{outline:2px solid ${primaryColor}}
|
||||
.mce-content-body div.mce-resizehandle{background:transparent;border-color:transparent;box-sizing:border-box;height:10px;width:10px}
|
||||
.mce-content-body div.mce-resizehandle:hover{background:transparent}
|
||||
.mce-content-body div#mceResizeHandlenw{border-left: 2px solid ${primaryColor}; border-top: 2px solid ${primaryColor}}
|
||||
.mce-content-body div#mceResizeHandlene{border-right: 2px solid ${primaryColor}; border-top: 2px solid ${primaryColor}}
|
||||
.mce-content-body div#mceResizeHandlesw{border-left: 2px solid ${primaryColor}; border-bottom: 2px solid ${primaryColor}}
|
||||
.mce-content-body div#mceResizeHandlese{border-right: 2px solid ${primaryColor}; border-bottom: 2px solid ${primaryColor}}
|
||||
</style>`);
|
||||
}
|
||||
|
||||
function makeItDirty(editor) {
|
||||
|
@ -117,7 +118,7 @@ var TinyMCE = (function() {
|
|||
$(selector).closest('.form-group')
|
||||
.before('<div class="tinymce-placeholder" style="height:' + tinyMceInitSize + 'px"></div>');
|
||||
tinyMceContainer.addClass('hidden');
|
||||
plugins = 'custom_image_toolbar autosave autoresize customimageuploader link advlist codesample autolink lists charmap hr anchor searchreplace wordcount visualblocks visualchars insertdatetime nonbreaking save directionality paste textcolor colorpicker textpattern placeholder';
|
||||
plugins = 'custom_image_toolbar table autosave autoresize customimageuploader link advlist codesample autolink lists charmap hr anchor searchreplace wordcount visualblocks visualchars insertdatetime nonbreaking save directionality paste textcolor colorpicker textpattern placeholder';
|
||||
if (typeof (MarvinJsEditor) !== 'undefined') plugins += ' marvinjsplugin';
|
||||
|
||||
if (textAreaObject.data('objectType') === 'step'
|
||||
|
@ -129,8 +130,8 @@ var TinyMCE = (function() {
|
|||
cache_suffix: '?v=4.9.10', // This suffix should be changed any time library is updated
|
||||
selector: selector,
|
||||
convert_urls: false,
|
||||
menubar: 'file edit view insert format',
|
||||
toolbar: 'undo redo restoredraft | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | forecolor backcolor | customimageuploader marvinjsplugin | codesample',
|
||||
menubar: 'file edit view insert format table',
|
||||
toolbar: 'undo redo restoredraft | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table | link | forecolor backcolor | customimageuploader marvinjsplugin | codesample',
|
||||
plugins: plugins,
|
||||
autoresize_bottom_margin: 20,
|
||||
codesample_languages: [
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
}
|
||||
|
||||
.mce-widget.mce-btn {
|
||||
border-color: $color-white !important;
|
||||
border-color: transparent !important;
|
||||
|
||||
&:not(.mce-active):hover,
|
||||
&:not(.mce-active):active {
|
||||
|
|
|
@ -149,9 +149,8 @@
|
|||
|
||||
.mce-container-body.mce-abs-layout {
|
||||
background: $brand-primary;
|
||||
border-radius: 5px 5px 0 0;
|
||||
position: relative;
|
||||
top: -45px;
|
||||
top: -10px;
|
||||
|
||||
.mce-container,
|
||||
.mce-widget {
|
||||
|
|
|
@ -299,7 +299,7 @@ class Constants
|
|||
|
||||
WHITELISTED_ATTRIBUTES = [
|
||||
'href', 'src', 'width', 'height', 'alt', 'cite', 'datetime', 'title',
|
||||
'class', 'name', 'xml:lang', 'abbr', 'style', 'target', :data
|
||||
'class', 'name', 'xml:lang', 'abbr', 'style', 'target', :data, 'border'
|
||||
].freeze
|
||||
|
||||
WHITELISTED_CSS_ATTRIBUTES = {
|
||||
|
|
Loading…
Add table
Reference in a new issue