1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Merge pull request #31 from documize/tinymce-loading

Tinymce loading
This commit is contained in:
Harvey Kandola 2016-08-02 14:41:25 +01:00 committed by GitHub
commit 0a9e9ec2cb
4 changed files with 93 additions and 13313 deletions

2
.gitignore vendored
View file

@ -61,3 +61,5 @@ debug
Dockerfile
container.sh
make.sh
embed/bindata_assetfs.go

View file

@ -12,103 +12,103 @@
import Ember from 'ember';
export default Ember.Component.extend({
pageBody: "",
appMeta: Ember.inject.service(),
pageBody: "",
appMeta: Ember.inject.service(),
didReceiveAttrs() {
this.set('pageBody', this.get('meta.rawBody'));
},
didReceiveAttrs() {
this.set('pageBody', this.get('meta.rawBody'));
},
didInsertElement() {
let self = this;
didInsertElement() {
let self = this;
let options = {
selector: "#rich-text-editor",
relative_urls: false,
cache_suffix: "?v=430",
browser_spellcheck: false,
gecko_spellcheck: false,
theme: "modern",
statusbar: false,
height: $(document).height() - $(".document-editor > .toolbar").height() - 200,
entity_encoding: "raw",
paste_data_images: true,
image_advtab: true,
image_caption: true,
media_live_embeds: true,
fontsize_formats: "8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt",
formats: {
bold: {
inline: 'b'
},
italic: {
inline: 'i'
}
},
extended_valid_elements: "b,i,b/strong,i/em",
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code codesample fullscreen',
'insertdatetime media nonbreaking save table directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools'
],
menu: {
edit: {
title: 'Edit',
items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'
},
insert: {
title: 'Insert',
items: 'anchor link media | hr | charmap emoticons | blockquote'
},
format: {
title: 'Format',
items: 'bold italic underline strikethrough superscript subscript | formats fonts | removeformat'
},
table: {
title: 'Table',
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",
save_onsavecallback: function() {
self.send('onAction');
}
};
let options = {
selector: "#rich-text-editor",
relative_urls: false,
cache_suffix: "?v=430",
browser_spellcheck: false,
gecko_spellcheck: false,
theme: "modern",
statusbar: false,
height: $(document).height() - $(".document-editor > .toolbar").height() - 200,
entity_encoding: "raw",
paste_data_images: true,
image_advtab: true,
image_caption: true,
media_live_embeds: true,
fontsize_formats: "8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt",
formats: {
bold: {
inline: 'b'
},
italic: {
inline: 'i'
}
},
extended_valid_elements: "b,i,b/strong,i/em",
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code codesample fullscreen',
'insertdatetime media nonbreaking save table directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools'
],
menu: {
edit: {
title: 'Edit',
items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'
},
insert: {
title: 'Insert',
items: 'anchor link media | hr | charmap emoticons | blockquote'
},
format: {
title: 'Format',
items: 'bold italic underline strikethrough superscript subscript | formats fonts | removeformat'
},
table: {
title: 'Table',
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",
save_onsavecallback: function () {
self.send('onAction');
}
};
if (typeof tinymce === 'undefined') {
$.getScript(this.get("appMeta").getBaseUrl("tinymce/tinymce.min.js?v=430"), function() {
window.tinymce.dom.Event.domLoaded = true;
tinymce.baseURL = "//" + window.location.host + "/tinymce";
tinymce.suffix = ".min";
tinymce.init(options);
});
} else {
tinymce.init(options);
}
},
if (typeof tinymce === 'undefined') {
$.getScript("tinymce/tinymce.min.js?v=430", function () {
window.tinymce.dom.Event.domLoaded = true;
tinymce.baseURL = "//" + window.location.host + "/tinymce";
tinymce.suffix = ".min";
tinymce.init(options);
});
} else {
tinymce.init(options);
}
},
willDestroyElement() {
tinymce.remove();
},
willDestroyElement() {
tinymce.remove();
},
actions: {
isDirty() {
return is.not.undefined(tinymce) && is.not.undefined(tinymce.activeEditor) && tinymce.activeEditor.isDirty();
},
actions: {
isDirty() {
return is.not.undefined(tinymce) && is.not.undefined(tinymce.activeEditor) && tinymce.activeEditor.isDirty();
},
onCancel() {
this.attrs.onCancel();
},
onCancel() {
this.attrs.onCancel();
},
onAction(title) {
let page = this.get('page');
let meta = this.get('meta');
onAction(title) {
let page = this.get('page');
let meta = this.get('meta');
page.set('title', title);
meta.set('rawBody', tinymce.activeEditor.getContent());
page.set('title', title);
meta.set('rawBody', tinymce.activeEditor.getContent());
this.attrs.onAction(page, meta);
}
}
});
this.attrs.onAction(page, meta);
}
}
});

View file

@ -27,7 +27,7 @@ type ProdInfo struct {
func Product() (p ProdInfo) {
p.Major = "0"
p.Minor = "16"
p.Patch = "0"
p.Patch = "1"
p.Version = fmt.Sprintf("%s.%s.%s", p.Major, p.Minor, p.Patch)
p.Edition = "Community"
p.Title = fmt.Sprintf("%s Edition", p.Edition)

File diff suppressed because one or more lines are too long