PageRenderTime 49ms CodeModel.GetById 13ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  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. (function() {
  11. tinymce.create('tinymce.plugins.SearchReplacePlugin', {
  12. init : function(ed, url) {
  13. function open(m) {
  14. // Keep IE from writing out the f/r character to the editor
  15. // instance while initializing a new dialog. See: #3131190
  16. window.focus();
  17. ed.windowManager.open({
  18. file : url + '/searchreplace.htm',
  19. width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
  20. height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
  21. inline : 1,
  22. auto_focus : 0
  23. }, {
  24. mode : m,
  25. search_string : ed.selection.getContent({format : 'text'}),
  26. plugin_url : url
  27. });
  28. };
  29. // Register commands
  30. ed.addCommand('mceSearch', function() {
  31. open('search');
  32. });
  33. ed.addCommand('mceReplace', function() {
  34. open('replace');
  35. });
  36. // Register buttons
  37. ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
  38. ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
  39. ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
  40. },
  41. getInfo : function() {
  42. return {
  43. longname : 'Search/Replace',
  44. author : 'Moxiecode Systems AB',
  45. authorurl : 'http://tinymce.moxiecode.com',
  46. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
  47. version : tinymce.majorVersion + "." + tinymce.minorVersion
  48. };
  49. }
  50. });
  51. // Register plugin
  52. tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
  53. })();