mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-18 06:40:18 +08:00
Merge pull request #4972 from artoscinote/ma_SCI_7883
Enable Lato font in TinyMCE iframe [SCI-7883]
This commit is contained in:
commit
90e2833866
2 changed files with 4 additions and 3 deletions
5
app/javascript/packs/tiny_mce.js
vendored
5
app/javascript/packs/tiny_mce.js
vendored
|
|
@ -124,7 +124,7 @@ window.TinyMCE = (() => {
|
||||||
setTimeout(() => { tinyMCE.activeEditor.execCommand('mceAutoResize') }, 500);
|
setTimeout(() => { tinyMCE.activeEditor.execCommand('mceAutoResize') }, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initImageToolBar(editor) {
|
function initCssOverrides(editor) {
|
||||||
const editorIframe = $(`#${editor.id}`).next().find('.tox-edit-area iframe');
|
const editorIframe = $(`#${editor.id}`).next().find('.tox-edit-area iframe');
|
||||||
const primaryColor = '#104da9';
|
const primaryColor = '#104da9';
|
||||||
editorIframe.contents().find('head').append(`<style type="text/css">
|
editorIframe.contents().find('head').append(`<style type="text/css">
|
||||||
|
|
@ -141,6 +141,7 @@ window.TinyMCE = (() => {
|
||||||
h2 {font-size: 18px !important }
|
h2 {font-size: 18px !important }
|
||||||
h3 {font-size: 16px !important }
|
h3 {font-size: 16px !important }
|
||||||
</style>`);
|
</style>`);
|
||||||
|
editorIframe.contents().find('head').append($('#font-css-pack').clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
function draftLocation() {
|
function draftLocation() {
|
||||||
|
|
@ -316,7 +317,7 @@ window.TinyMCE = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init image toolbar
|
// Init image toolbar
|
||||||
initImageToolBar(editor);
|
initCssOverrides(editor);
|
||||||
|
|
||||||
// Init save/cancel button wrapper
|
// Init save/cancel button wrapper
|
||||||
$('<div class="tinymce-save-controls"></div>').appendTo(menuBar);
|
$('<div class="tinymce-save-controls"></div>').appendTo(menuBar);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
<%= favicon_link_tag "favicon-16.png", type: "image/png", size: "16x16" %>
|
<%= favicon_link_tag "favicon-16.png", type: "image/png", size: "16x16" %>
|
||||||
<%= favicon_link_tag "favicon-32.png", type: "image/png", size: "32x32" %>
|
<%= favicon_link_tag "favicon-32.png", type: "image/png", size: "32x32" %>
|
||||||
<%= favicon_link_tag "favicon-48.png", type: "image/png", size: "48x48" %>
|
<%= favicon_link_tag "favicon-48.png", type: "image/png", size: "48x48" %>
|
||||||
<%= stylesheet_pack_tag 'fonts' %>
|
<%= stylesheet_pack_tag 'fonts', id: 'font-css-pack' %>
|
||||||
<%= stylesheet_pack_tag 'fontawesome' %>
|
<%= stylesheet_pack_tag 'fontawesome' %>
|
||||||
|
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue