-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrate ckeditor #46
Changes from 1 commit
d84d84d
d77c035
6fa9f09
2b88d67
251578b
0e1858f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.DS_Store | ||
/vendor/ | ||
Resources/public/vendor/hallo | ||
vendor/ | ||
Resources/public/vendor/hallo | ||
Resources/public/vendor/ckeditor |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
jQuery(document).ready(function() { | ||
jQuery('body').midgardCreate({ | ||
url: function() { | ||
if (this.id) { | ||
if (this.id.charAt(0) == "<") { | ||
return cmfCreatePutDocument + this.id.substring(1, this.id.length - 1); | ||
} | ||
return cmfCreatePutDocument + "/" + this.id; | ||
} | ||
return cmfCreatePutDocument; | ||
}, | ||
stanbolUrl: cmfCreateStanbolUrl, | ||
tags: true, | ||
editorWidgets: { | ||
'default': 'ckeditor', | ||
'dcterms:description': null | ||
}, | ||
editorOptions: { | ||
ckeditor: { | ||
widget: 'ckeditorWidget' | ||
} | ||
}, | ||
collectionWidgets: { | ||
'default': null, | ||
'feature': 'midgardCollectionAdd' | ||
} | ||
}); | ||
|
||
window.CKEDITOR.basePath = "/bundles/symfonycmfcreate/vendor/ckeditor/"; | ||
window.CKEDITOR.plugins.basePath = "/bundles/symfonycmfcreate/vendor/ckeditor/plugins/"; | ||
window.CKEDITOR.config.skin = "moono,/bundles/symfonycmfcreate/vendor/ckeditor/skins/moono/"; | ||
window.CKEDITOR.config.customConfig = "/bundles/symfonycmfcreate/vendor/ckeditor/config.js"; | ||
window.CKEDITOR.config.removePlugins = 'smiley,flash,horizontalrule,magicline,pagebreak,iframe,wsc'; | ||
window.CKEDITOR.config.toolbarGroups = [ | ||
{ name: 'clipboard' }, | ||
{ name: 'undo' }, | ||
{ name: 'links' }, | ||
{ name: 'insert' }, | ||
'/', | ||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, | ||
{ name: 'paragraph', groups: [ 'list', 'indent', 'align' ] }, | ||
'/', | ||
{ name: 'styles' }, | ||
{ name: 'colors' } | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the doc will explain that you can overwrite these configuration options in a javascript loaded afterwards. i think this is good enough so we don't want to expose any configuration options to symfony for this but have people change those variables (particularly the config.customConfig path to use a non-default config.js) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes it's better ;) |
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% include "SymfonyCmfCreateBundle::includejsfiles-create.html.twig" %} | ||
|
||
<script>window.CKEDITOR_BASEPATH = "/bundles/symfonycmfcreate/vendor/ckeditor/";</script> | ||
{% javascripts output="/js/ckeditor.js" | ||
'@SymfonyCmfCreateBundle/Resources/public/js/init-create-ckeditor.js' | ||
'@SymfonyCmfCreateBundle/Resources/public/vendor/ckeditor/ckeditor.js' | ||
%} | ||
<script src="{{ asset_url }}"></script> | ||
{% endjavascripts %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the editorWidgets section should be done in userland, or not? we do not do it in the corresponding script of the hallo editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok