PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 10ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/editors/tiny_mce_3_4_3_1/plugins/searchreplace/editor_plugin_src.js

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