]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/debian/missing-sources/framework/Web/Javascripts/source/tinymce-405/plugins/code/plugin.js
baculum: Add missing-sources directory in debian metadata structure
[bacula/bacula] / gui / baculum / debian / missing-sources / framework / Web / Javascripts / source / tinymce-405 / plugins / code / plugin.js
1 /**
2  * plugin.js
3  *
4  * Copyright, Moxiecode Systems AB
5  * Released under LGPL License.
6  *
7  * License: http://www.tinymce.com/license
8  * Contributing: http://www.tinymce.com/contributing
9  */
10
11 /*global tinymce:true */
12
13 tinymce.PluginManager.add('code', function(editor) {
14         function showDialog() {
15                 editor.windowManager.open({
16                         title: "Source code",
17                         body: {
18                                 type: 'textbox',
19                                 name: 'code',
20                                 multiline: true,
21                                 minWidth: editor.getParam("code_dialog_width", 600),
22                                 minHeight: editor.getParam("code_dialog_height", 500),
23                                 value: editor.getContent({source_view: true}),
24                                 spellcheck: false
25                         },
26                         onSubmit: function(e) {
27                                 editor.undoManager.transact(function() {
28                                         editor.setContent(e.data.code);
29                                 });
30         
31                                 editor.nodeChanged();
32                         }
33                 });
34         }
35
36         editor.addCommand("mceCodeEditor", showDialog);
37
38         editor.addButton('code', {
39                 icon: 'code',
40                 tooltip: 'Source code',
41                 onclick: showDialog
42         });
43
44         editor.addMenuItem('code', {
45                 icon: 'code',
46                 text: 'Source code',
47                 context: 'tools',
48                 onclick: showDialog
49         });
50 });