1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Update TinyMCE cache buster

This commit is contained in:
Harvey Kandola 2018-03-13 15:02:01 +00:00
parent c7ebbff318
commit 4e32bffebe
3 changed files with 718 additions and 707 deletions

File diff suppressed because one or more lines are too long

View file

@ -12,13 +12,13 @@
import $ from 'jquery'; import $ from 'jquery';
import { computed, set } from '@ember/object'; import { computed, set } from '@ember/object';
import { schedule } from '@ember/runloop'; import { schedule } from '@ember/runloop';
import Component from '@ember/component';
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
appMeta: service(), appMeta: service(),
link: service(), link: service(),
pageBody: "", pageBody: '',
editorId: computed('page', function () { editorId: computed('page', function () {
let page = this.get('page'); let page = this.get('page');
return `wysiwyg-editor-${page.id}`; return `wysiwyg-editor-${page.id}`;
@ -38,8 +38,8 @@ export default Component.extend({
schedule('afterRender', () => { schedule('afterRender', () => {
let options = { let options = {
cache_suffix: "?v=454", cache_suffix: '?v=476',
selector: "#" + this.get('editorId'), selector: '#' + this.get('editorId'),
relative_urls: false, relative_urls: false,
browser_spellcheck: true, browser_spellcheck: true,
gecko_spellcheck: false, gecko_spellcheck: false,
@ -50,11 +50,12 @@ export default Component.extend({
image_advtab: true, image_advtab: true,
image_caption: true, image_caption: true,
media_live_embeds: true, media_live_embeds: true,
theme: "modern", theme: 'modern',
skin: 'lightgray-gradient', skin: 'lightgray-gradient',
entity_encoding: "raw", entity_encoding: 'raw',
extended_valid_elements: "b,i,b/strong,i/em", extended_valid_elements: 'b,i,b/strong,i/em',
fontsize_formats: "8px 10px 12px 14px 17px 18px 24px 36px 40px 50px 60px", fontsize_formats:
'8px 10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 34px 36px 38px 40px 42px 44px 46px 48px 50px 52px 54px 56px 58px 60px 70px 80px 90px 100px',
formats: { formats: {
bold: { bold: {
inline: 'b' inline: 'b'
@ -64,39 +65,39 @@ export default Component.extend({
} }
}, },
codesample_languages: [ codesample_languages: [
{text: 'C', value: 'c'}, { text: 'C', value: 'c' },
{text: 'C#', value: 'csharp'}, { text: 'C#', value: 'csharp' },
{text: 'C++', value: 'cpp'}, { text: 'C++', value: 'cpp' },
{text: 'CSS', value: 'css'}, { text: 'CSS', value: 'css' },
{text: 'Docker', value: 'docker'}, { text: 'Docker', value: 'docker' },
{text: 'Elixir', value: 'elixir'}, { text: 'Elixir', value: 'elixir' },
{text: 'Erlang', value: 'erlang'}, { text: 'Erlang', value: 'erlang' },
{text: 'Fsharp', value: 'fsharp'}, { text: 'Fsharp', value: 'fsharp' },
{text: 'Git', value: 'git'}, { text: 'Git', value: 'git' },
{text: 'Go', value: 'go'}, { text: 'Go', value: 'go' },
{text: 'Haskell', value: 'haskell'}, { text: 'Haskell', value: 'haskell' },
{text: 'HTML', value: 'markup'}, { text: 'HTML', value: 'markup' },
{text: 'HTTP', value: 'http'}, { text: 'HTTP', value: 'http' },
{text: 'Java', value: 'java'}, { text: 'Java', value: 'java' },
{text: 'JavaScript', value: 'javascript'}, { text: 'JavaScript', value: 'javascript' },
{text: 'JSON', value: 'json'}, { text: 'JSON', value: 'json' },
{text: 'Less', value: 'less'}, { text: 'Less', value: 'less' },
{text: 'Makefile', value: 'makefile'}, { text: 'Makefile', value: 'makefile' },
{text: 'Markdown', value: 'markdown'}, { text: 'Markdown', value: 'markdown' },
{text: 'nginx', value: 'nginx'}, { text: 'nginx', value: 'nginx' },
{text: 'Objective C', value: 'objectivec'}, { text: 'Objective C', value: 'objectivec' },
{text: 'Perl', value: 'perl'}, { text: 'Perl', value: 'perl' },
{text: 'PHP', value: 'php'}, { text: 'PHP', value: 'php' },
{text: 'Powershell', value: 'powershell'}, { text: 'Powershell', value: 'powershell' },
{text: 'Python', value: 'python'}, { text: 'Python', value: 'python' },
{text: 'Ruby', value: 'ruby'}, { text: 'Ruby', value: 'ruby' },
{text: 'Rust', value: 'rust'}, { text: 'Rust', value: 'rust' },
{text: 'Sass SCSS', value: 'scss'}, { text: 'Sass SCSS', value: 'scss' },
{text: 'SQL', value: 'sql'}, { text: 'SQL', value: 'sql' },
{text: 'Swift', value: 'swift'}, { text: 'Swift', value: 'swift' },
{text: 'TypeScript', value: 'typescript'}, { text: 'TypeScript', value: 'typescript' },
{text: 'XML', value: 'markup'}, { text: 'XML', value: 'markup' },
{text: 'YAML', value: 'yaml'}, { text: 'YAML', value: 'yaml' }
], ],
plugins: [ plugins: [
'advlist autolink lists link image charmap print hr anchor pagebreak', 'advlist autolink lists link image charmap print hr anchor pagebreak',
@ -106,18 +107,20 @@ export default Component.extend({
], ],
menu: {}, menu: {},
menubar: false, menubar: false,
toolbar1: "formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink", toolbar1:
toolbar2: "outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table image media codesample", 'formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink',
toolbar2:
'outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table image media codesample',
save_onsavecallback: function () { save_onsavecallback: function () {
Mousetrap.trigger('ctrl+s'); Mousetrap.trigger('ctrl+s');
} }
}; };
if (typeof tinymce === 'undefined') { if (typeof tinymce === 'undefined') {
$.getScript("/tinymce/tinymce.min.js?v=454", function () { $.getScript('/tinymce/tinymce.min.js?v=476', function () {
window.tinymce.dom.Event.domLoaded = true; window.tinymce.dom.Event.domLoaded = true;
tinymce.baseURL = "//" + window.location.host + "/tinymce"; tinymce.baseURL = '//' + window.location.host + '/tinymce';
tinymce.suffix = ".min"; tinymce.suffix = '.min';
tinymce.init(options); tinymce.init(options);
}); });
} else { } else {
@ -128,7 +131,11 @@ export default Component.extend({
willDestroyElement() { willDestroyElement() {
this._super(...arguments); this._super(...arguments);
tinymce.EditorManager.execCommand('mceRemoveEditor', true, this.get('editorId')); tinymce.EditorManager.execCommand(
'mceRemoveEditor',
true,
this.get('editorId')
);
}, },
actions: { actions: {
@ -148,7 +155,11 @@ export default Component.extend({
isDirty() { isDirty() {
let editor = tinymce.EditorManager.get(this.get('editorId')); let editor = tinymce.EditorManager.get(this.get('editorId'));
return is.not.undefined(tinymce) && is.not.undefined(editor) && editor.isDirty(); return (
is.not.undefined(tinymce) &&
is.not.undefined(editor) &&
editor.isDirty()
);
}, },
onCancel() { onCancel() {

View file

@ -24,7 +24,7 @@
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;
> .email { > .email {
font-size: 0.9rem; font-size: 0.9rem;
color: $color-off-black; color: $color-off-black;
margin: 0; margin: 0;