annotate WebContent/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @ 6:5bb7cc86069c

restlet.jar
author dwinter
date Wed, 14 Mar 2012 16:21:45 +0100
parents 0be9d53a6967
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 /**
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2 * editor_plugin_src.js
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 * Copyright 2009, Moxiecode Systems AB
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 * Released under LGPL License.
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 * License: http://tinymce.moxiecode.com/license
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 * Contributing: http://tinymce.moxiecode.com/contributing
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 */
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 (function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 tinymce.create('tinymce.plugins.SearchReplacePlugin', {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13 init : function(ed, url) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 function open(m) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 // Keep IE from writing out the f/r character to the editor
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 // instance while initializing a new dialog. See: #3131190
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 window.focus();
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 ed.windowManager.open({
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20 file : url + '/searchreplace.htm',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22 height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 inline : 1,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 auto_focus : 0
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 }, {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 mode : m,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 search_string : ed.selection.getContent({format : 'text'}),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 plugin_url : url
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 // Register commands
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 ed.addCommand('mceSearch', function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34 open('search');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37 ed.addCommand('mceReplace', function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 open('replace');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 // Register buttons
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 getInfo : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 longname : 'Search/Replace',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 author : 'Moxiecode Systems AB',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 authorurl : 'http://tinymce.moxiecode.com',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54 version : tinymce.majorVersion + "." + tinymce.minorVersion
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
58
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
59 // Register plugin
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
60 tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
61 })();