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