bgneal@312: /** bgneal@312: * editor_plugin_src.js bgneal@312: * bgneal@312: * Copyright 2009, Moxiecode Systems AB bgneal@312: * Released under LGPL License. bgneal@312: * bgneal@312: * License: http://tinymce.moxiecode.com/license bgneal@312: * Contributing: http://tinymce.moxiecode.com/contributing bgneal@312: */ bgneal@312: bgneal@312: (function() { bgneal@312: tinymce.create('tinymce.plugins.SearchReplacePlugin', { bgneal@312: init : function(ed, url) { bgneal@312: function open(m) { bgneal@442: // Keep IE from writing out the f/r character to the editor bgneal@442: // instance while initializing a new dialog. See: #3131190 bgneal@442: window.focus(); bgneal@442: bgneal@312: ed.windowManager.open({ bgneal@312: file : url + '/searchreplace.htm', bgneal@312: width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), bgneal@312: height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), bgneal@312: inline : 1, bgneal@312: auto_focus : 0 bgneal@312: }, { bgneal@312: mode : m, bgneal@312: search_string : ed.selection.getContent({format : 'text'}), bgneal@312: plugin_url : url bgneal@312: }); bgneal@312: }; bgneal@312: bgneal@312: // Register commands bgneal@312: ed.addCommand('mceSearch', function() { bgneal@312: open('search'); bgneal@312: }); bgneal@312: bgneal@312: ed.addCommand('mceReplace', function() { bgneal@312: open('replace'); bgneal@312: }); bgneal@312: bgneal@312: // Register buttons bgneal@312: ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); bgneal@312: ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); bgneal@312: bgneal@312: ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); bgneal@312: }, bgneal@312: bgneal@312: getInfo : function() { bgneal@312: return { bgneal@312: longname : 'Search/Replace', bgneal@312: author : 'Moxiecode Systems AB', bgneal@312: authorurl : 'http://tinymce.moxiecode.com', bgneal@312: infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', bgneal@312: version : tinymce.majorVersion + "." + tinymce.minorVersion bgneal@312: }; bgneal@312: } bgneal@312: }); bgneal@312: bgneal@312: // Register plugin bgneal@312: tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); bgneal@312: })();