summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib/summernote/src/js/settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/lib/summernote/src/js/settings.js')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/settings.js131
1 files changed, 121 insertions, 10 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/settings.js b/addons/web_editor/static/lib/summernote/src/js/settings.js
index 25d1bdf809a..f7b0c0c6379 100644
--- a/addons/web_editor/static/lib/summernote/src/js/settings.js
+++ b/addons/web_editor/static/lib/summernote/src/js/settings.js
@@ -1,10 +1,36 @@
-define('summernote/settings', function () {
- var settings = {
- // version
+define('summernote/defaults', function () {
+ /**
+ * @class defaults
+ *
+ * @singleton
+ */
+ var defaults = {
+ /** @property */
version: '@VERSION',
/**
- * options
+ *
+ * for event options, reference to EventHandler.attach
+ *
+ * @property {Object} options
+ * @property {String/Number} [options.width=null] set editor width
+ * @property {String/Number} [options.height=null] set editor height, ex) 300
+ * @property {String/Number} options.minHeight set minimum height of editor
+ * @property {String/Number} options.maxHeight
+ * @property {String/Number} options.focus
+ * @property {Number} options.tabsize
+ * @property {Boolean} options.styleWithSpan
+ * @property {Object} options.codemirror
+ * @property {Object} [options.codemirror.mode='text/html']
+ * @property {Object} [options.codemirror.htmlMode=true]
+ * @property {Object} [options.codemirror.lineNumbers=true]
+ * @property {String} [options.lang=en-US] language 'en-US', 'ko-KR', ...
+ * @property {String} [options.direction=null] text direction, ex) 'rtl'
+ * @property {Array} [options.toolbar]
+ * @property {Boolean} [options.airMode=false]
+ * @property {Array} [options.airPopover]
+ * @property {Fucntion} [options.onInit] initialize
+ * @property {Fucntion} [options.onsubmit]
*/
options: {
width: null, // set editor width
@@ -21,10 +47,84 @@ define('summernote/settings', function () {
disableLinkTarget: false, // hide link Target Checkbox
disableDragAndDrop: false, // disable drag and drop event
disableResizeEditor: false, // disable resizing editor
+ disableResizeImage: false, // disable resizing image
shortcuts: true, // enable keyboard shortcuts
+ textareaAutoSync: true, // enable textarea auto sync
+
placeholder: false, // enable placeholder text
+ prettifyHtml: true, // enable prettifying html while toggling codeview
+
+ iconPrefix: 'fa fa-', // prefix for css icon classes
+
+ icons: {
+ font: {
+ bold: 'bold',
+ italic: 'italic',
+ underline: 'underline',
+ clear: 'eraser',
+ height: 'text-height',
+ strikethrough: 'strikethrough',
+ superscript: 'superscript',
+ subscript: 'subscript'
+ },
+ image: {
+ image: 'picture-o',
+ floatLeft: 'align-left',
+ floatRight: 'align-right',
+ floatNone: 'align-justify',
+ shapeRounded: 'square',
+ shapeCircle: 'circle-o',
+ shapeThumbnail: 'picture-o',
+ shapeNone: 'times',
+ remove: 'trash-o'
+ },
+ link: {
+ link: 'link',
+ unlink: 'unlink',
+ edit: 'edit'
+ },
+ table: {
+ table: 'table'
+ },
+ hr: {
+ insert: 'minus'
+ },
+ style: {
+ style: 'magic'
+ },
+ lists: {
+ unordered: 'list-ul',
+ ordered: 'list-ol'
+ },
+ options: {
+ help: 'question',
+ fullscreen: 'arrows-alt',
+ codeview: 'code'
+ },
+ paragraph: {
+ paragraph: 'align-left',
+ outdent: 'outdent',
+ indent: 'indent',
+ left: 'align-left',
+ center: 'align-center',
+ right: 'align-right',
+ justify: 'align-justify'
+ },
+ color: {
+ recent: 'font'
+ },
+ history: {
+ undo: 'undo',
+ redo: 'repeat'
+ },
+ misc: {
+ check: 'check'
+ }
+ },
+
+ dialogsInBody: false, // false will add dialogs into editor
codemirror: { // codemirror options
mode: 'text/html',
@@ -40,7 +140,9 @@ define('summernote/settings', function () {
toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']],
+ // ['font', ['bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'clear']],
['fontname', ['fontname']],
+ ['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
@@ -50,6 +152,8 @@ define('summernote/settings', function () {
['help', ['help']]
],
+ plugin : { },
+
// air mode: inline editor
airMode: false,
// airPopover: [
@@ -80,9 +184,12 @@ define('summernote/settings', function () {
// fontName
fontNames: [
'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',
- 'Helvetica Neue', 'Impact', 'Lucida Grande',
+ 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',
'Tahoma', 'Times New Roman', 'Verdana'
],
+ fontNamesIgnoreCheck: [],
+
+ fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],
// pallete colors(n x n)
colors: [
@@ -117,6 +224,7 @@ define('summernote/settings', function () {
onkeydown: null, // keydown
onImageUpload: null, // imageUpload
onImageUploadError: null, // imageUploadError
+ onMediaDelete: null, // media delete
onToolbarClick: null,
onsubmit: null,
@@ -128,8 +236,6 @@ define('summernote/settings', function () {
onCreateLink: function (sLinkUrl) {
if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) {
sLinkUrl = 'mailto:' + sLinkUrl;
- } else if (sLinkUrl.indexOf('://') === -1) {
- sLinkUrl = 'http://' + sLinkUrl;
}
return sLinkUrl;
@@ -207,7 +313,11 @@ define('summernote/settings', function () {
underline: 'Underline',
clear: 'Remove Font Style',
height: 'Line Height',
- name: 'Font Family'
+ name: 'Font Family',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
+ superscript: 'Superscript',
+ size: 'Font Size'
},
image: {
image: 'Picture',
@@ -291,7 +401,8 @@ define('summernote/settings', function () {
textFormatting: 'Text formatting',
action: 'Action',
paragraphFormatting: 'Paragraph formatting',
- documentStyle: 'Document Style'
+ documentStyle: 'Document Style',
+ extraKeys: 'Extra keys'
},
history: {
undo: 'Undo',
@@ -301,5 +412,5 @@ define('summernote/settings', function () {
}
};
- return settings;
+ return defaults;
});