Skip to content

Commit

Permalink
add menu
Browse files Browse the repository at this point in the history
  • Loading branch information
movie4 committed Aug 19, 2016
1 parent 7af1e5b commit efbd0ef
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Custom Settings
===============

* `Base Settings`_: /tinymce_4/static/tinymce_4/settings/full/setings.js
* Menu: /tinymce_4/static/tinymce_4/settings/full/menu.js
* Plugins: /tinymce_4/static/tinymce_4/settings/full/plugins.js
* `External plugin`_: /tinymce_4/static/tinymce_4/settings/full/external_plugins.js
* `Templates`_: /tinymce_4/static/tinymce_4/settings/full/templates.js
Expand Down
9 changes: 6 additions & 3 deletions tinymce_4/static/tinymce_4/settings/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
if ($ === undefined) $ = django.jQuery;

if (typeof tinySettings === 'object') {
if (typeof menu === 'object') {
tinySettings.menu = menu;
}
if (typeof plugins === 'object') {
tinySettings.plugins = plugins;
}
if (typeof externalPlugins === 'object') {
tinySettings.external_plugins = externalPlugins;
}
if (typeof templates === 'object') {
tinySettings.templates = templates;
}
if (typeof plugins === 'object') {
tinySettings.plugins = plugins;
}
tinymce.init(tinySettings);
} else {
console.warn('tinySettings is not exists');
Expand Down
22 changes: 22 additions & 0 deletions tinymce_4/static/tinymce_4/settings/full/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var menu = {
edit: {
title : 'Edit',
items : 'undo redo | cut copy paste pastetext | selectall'
},
insert : {
title : 'Insert',
items : 'link image media | template'
},
view: {
title : 'View' ,
items : 'visualaid, visualblocks'
},
format: {
title : 'Format',
items : 'bold italic underline strikethrough superscript subscript | formats | removeformat'
},
table: {
title : 'Table' ,
items : 'inserttable tableprops deletetable | cell row column'
}
}
23 changes: 0 additions & 23 deletions tinymce_4/static/tinymce_4/settings/full/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ var tinySettings = {
plugin_preview_width : '730',
plugin_preview_height : '550',

menu : {
edit: {
title : 'Edit',
items : 'undo redo | cut copy paste pastetext | selectall'
},
insert : {
title : 'Insert',
items : 'link image media | template'
},
view: {
title : 'View' ,
items : 'visualaid, visualblocks'
},
format: {
title : 'Format',
items : 'bold italic underline strikethrough superscript subscript | formats | removeformat'
},
table: {
title : 'Table' ,
items : 'inserttable tableprops deletetable | cell row column'
},
},

toolbar1: 'example, insertfile undo redo | styleselect removeformat | link image media template anchor | code | preview | image_alignment',
toolbar2: 'fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor',

Expand Down
3 changes: 2 additions & 1 deletion tinymce_4/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class Media:
js = [
'tinymce_4/settings/full/settings.js',
'tinymce_4/settings/full/external_plugins.js',
'tinymce_4/settings/full/templates.js',
'tinymce_4/settings/full/menu.js',
'tinymce_4/settings/full/plugins.js',
'tinymce_4/settings/full/templates.js',
'tinymce_4/settings/full.js',
]

Expand Down

0 comments on commit efbd0ef

Please sign in to comment.