mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
fix tinymce loading URL
This commit is contained in:
parent
615aca8040
commit
3a085a6bd5
1 changed files with 90 additions and 90 deletions
|
@ -12,103 +12,103 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
pageBody: "",
|
pageBody: "",
|
||||||
appMeta: Ember.inject.service(),
|
appMeta: Ember.inject.service(),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set('pageBody', this.get('meta.rawBody'));
|
this.set('pageBody', this.get('meta.rawBody'));
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
selector: "#rich-text-editor",
|
selector: "#rich-text-editor",
|
||||||
relative_urls: false,
|
relative_urls: false,
|
||||||
cache_suffix: "?v=430",
|
cache_suffix: "?v=430",
|
||||||
browser_spellcheck: false,
|
browser_spellcheck: false,
|
||||||
gecko_spellcheck: false,
|
gecko_spellcheck: false,
|
||||||
theme: "modern",
|
theme: "modern",
|
||||||
statusbar: false,
|
statusbar: false,
|
||||||
height: $(document).height() - $(".document-editor > .toolbar").height() - 200,
|
height: $(document).height() - $(".document-editor > .toolbar").height() - 200,
|
||||||
entity_encoding: "raw",
|
entity_encoding: "raw",
|
||||||
paste_data_images: true,
|
paste_data_images: true,
|
||||||
image_advtab: true,
|
image_advtab: true,
|
||||||
image_caption: true,
|
image_caption: true,
|
||||||
media_live_embeds: true,
|
media_live_embeds: true,
|
||||||
fontsize_formats: "8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt",
|
fontsize_formats: "8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt",
|
||||||
formats: {
|
formats: {
|
||||||
bold: {
|
bold: {
|
||||||
inline: 'b'
|
inline: 'b'
|
||||||
},
|
},
|
||||||
italic: {
|
italic: {
|
||||||
inline: 'i'
|
inline: 'i'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extended_valid_elements: "b,i,b/strong,i/em",
|
extended_valid_elements: "b,i,b/strong,i/em",
|
||||||
plugins: [
|
plugins: [
|
||||||
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
||||||
'searchreplace wordcount visualblocks visualchars code codesample fullscreen',
|
'searchreplace wordcount visualblocks visualchars code codesample fullscreen',
|
||||||
'insertdatetime media nonbreaking save table directionality',
|
'insertdatetime media nonbreaking save table directionality',
|
||||||
'emoticons template paste textcolor colorpicker textpattern imagetools'
|
'emoticons template paste textcolor colorpicker textpattern imagetools'
|
||||||
],
|
],
|
||||||
menu: {
|
menu: {
|
||||||
edit: {
|
edit: {
|
||||||
title: 'Edit',
|
title: 'Edit',
|
||||||
items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'
|
items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'
|
||||||
},
|
},
|
||||||
insert: {
|
insert: {
|
||||||
title: 'Insert',
|
title: 'Insert',
|
||||||
items: 'anchor link media | hr | charmap emoticons | blockquote'
|
items: 'anchor link media | hr | charmap emoticons | blockquote'
|
||||||
},
|
},
|
||||||
format: {
|
format: {
|
||||||
title: 'Format',
|
title: 'Format',
|
||||||
items: 'bold italic underline strikethrough superscript subscript | formats fonts | removeformat'
|
items: 'bold italic underline strikethrough superscript subscript | formats fonts | removeformat'
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
title: 'Table',
|
title: 'Table',
|
||||||
items: 'inserttable tableprops deletetable | cell row column'
|
items: 'inserttable tableprops deletetable | cell row column'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toolbar1: "formatselect fontselect fontsizeselect | bold italic underline | link unlink | image media | codesample | outdent indent | alignleft aligncenter alignright alignjustify | bullist numlist | forecolor backcolor",
|
toolbar1: "formatselect fontselect fontsizeselect | bold italic underline | link unlink | image media | codesample | outdent indent | alignleft aligncenter alignright alignjustify | bullist numlist | forecolor backcolor",
|
||||||
save_onsavecallback: function() {
|
save_onsavecallback: function () {
|
||||||
self.send('onAction');
|
self.send('onAction');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof tinymce === 'undefined') {
|
if (typeof tinymce === 'undefined') {
|
||||||
$.getScript(this.get("appMeta").getBaseUrl("tinymce/tinymce.min.js?v=430"), function() {
|
$.getScript("tinymce/tinymce.min.js?v=430", 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 {
|
||||||
tinymce.init(options);
|
tinymce.init(options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
tinymce.remove();
|
tinymce.remove();
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
isDirty() {
|
isDirty() {
|
||||||
return is.not.undefined(tinymce) && is.not.undefined(tinymce.activeEditor) && tinymce.activeEditor.isDirty();
|
return is.not.undefined(tinymce) && is.not.undefined(tinymce.activeEditor) && tinymce.activeEditor.isDirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel() {
|
onCancel() {
|
||||||
this.attrs.onCancel();
|
this.attrs.onCancel();
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction(title) {
|
onAction(title) {
|
||||||
let page = this.get('page');
|
let page = this.get('page');
|
||||||
let meta = this.get('meta');
|
let meta = this.get('meta');
|
||||||
|
|
||||||
page.set('title', title);
|
page.set('title', title);
|
||||||
meta.set('rawBody', tinymce.activeEditor.getContent());
|
meta.set('rawBody', tinymce.activeEditor.getContent());
|
||||||
|
|
||||||
this.attrs.onAction(page, meta);
|
this.attrs.onAction(page, meta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Add table
Add a link
Reference in a new issue