From c59a2a69fb38b92b6c45bcf7431d2b1a3c5dce3c Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 23 Oct 2010 19:46:20 -0400 Subject: added grappelli, filebrowser, chunks and tagging to lcal repo --- .../plugins/searchreplace/css/searchreplace.css | 6 + .../plugins/searchreplace/editor_plugin.js | 1 + .../plugins/searchreplace/editor_plugin_src.js | 54 +++++++++ .../plugins/searchreplace/js/searchreplace.js | 126 +++++++++++++++++++++ .../tiny_mce/plugins/searchreplace/langs/de_dlg.js | 16 +++ .../tiny_mce/plugins/searchreplace/langs/en_dlg.js | 16 +++ .../plugins/searchreplace/searchreplace.htm | 87 ++++++++++++++ 7 files changed, 306 insertions(+) create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js create mode 100644 lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm (limited to 'lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace') diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css new file mode 100644 index 0000000..3e2eaf3 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js new file mode 100644 index 0000000..f9d14a5 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:480+parseInt(ed.getLang('searchreplace.delta_width',0)),height:270+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})(); \ No newline at end of file diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js new file mode 100644 index 0000000..0781286 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js new file mode 100644 index 0000000..e555a3f --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -0,0 +1,126 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + this.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + if (tinymce.isIE) + ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE + else + ed.getDoc().execCommand('InsertHTML', false, rs); + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js new file mode 100644 index 0000000..52c0b06 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{ +searchnext_desc:"Weitersuchen", +notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.", +search_title:"Suchen", +replace_title:"Suchen/Ersetzen", +allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.", +findwhat:"Zu suchender Text", +replacewith:"Ersetzen durch", +direction:"Suchrichtung", +up:"Aufw\u00E4rts", +down:"Abw\u00E4rts", +mcase:"Gro\u00DF-/Kleinschreibung beachten", +findnext:"Weitersuchen", +replace:"Ersetzen", +replaceall:"Alle ersetzen" +}); \ No newline at end of file diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js new file mode 100644 index 0000000..3dd3453 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm new file mode 100644 index 0000000..334b734 --- /dev/null +++ b/lib/grappelli/media/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,87 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
+ + +
+
+
+
+
+
+
+
+
+
+
    +
  • +
  • +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+ + +
+
+
+
+ +
+
+
    +
  • +
  • +
  • +
  • +
+
+
+ + -- cgit v1.2.3-70-g09d2