Subversion Repositories Sites.tela-botanica.org

Compare Revisions

No changes between revisions

Ignore whitespace Rev 609 → Rev 610

/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/readme.txt
New file
0,0 → 1,0
Check the TinyMCE documentation for details on this plugin.
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js
New file
0,0 → 1,0
tinyMCE.importPluginLanguagePack('searchreplace');var TinyMCE_SearchReplacePlugin={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}},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),selectedText=inst.selection.getSelectedText(),rng;function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key]}function replaceSel(search_str,str,back){if(!inst.selection.isCollapsed()){if(tinyMCE.isRealIE)inst.selection.getRng().duplicate().pasteHTML(str);else inst.execCommand('mceInsertContent',false,str)}}if(!value)value=[];defValue("editor_id",editor_id);defValue("searchstring",selectedText);defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");defValue("resizable","no");switch(command){case"mceSearch":if(user_interface){var template=new Array();template['file']='../../plugins/searchreplace/searchreplace.htm';template['width']=380;template['height']=155+(tinyMCE.isNS7?20:0)+(tinyMCE.isMSIE?15:0);template['width']+=tinyMCE.getLang('lang_searchreplace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_delta_height',0);inst.selection.collapse(true);tinyMCE.openWindow(template,value)}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;var awin=value.win,found;if(body.innerHTML==""){awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";}inst.selection.collapse(value['backwards']);if(tinyMCE.isMSIE){var rng=inst.selection.getRng();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){awin.alert('This operation is currently not supported by this browser.');return true}if(value['replacemode']=="all"){found=false;while(rng.findText(value['string'],value['backwards']?-1:1,flags)){found=true;rng.scrollIntoView();rng.select();replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select()}else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}else{if(value['replacemode']=="all"){found=false;while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false)){found=true;replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}return false}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js
New file
0,0 → 1,86
function init() {
tinyMCEPopup.resizeToInnerSize();
 
// start with appropiate tab
var task = (tinyMCE.getWindowArg("replacestring") != null) ? "replace" : "search";
mcTabs.displayTab(task + '_tab', task +'_panel');
manageReplaceButtons();
var formObj = document.forms[0];
 
formObj[task + "_panel_searchstring"].value = tinyMCE.getWindowArg("searchstring");
formObj["replace_panel_replacestring"].value = (tinyMCE.getWindowArg("replacestring") != null) ? tinyMCE.getWindowArg("replacestring") : "";
formObj[task + "_panel_casesensitivebox"].checked = tinyMCE.getWindowArg("casesensitive");
formObj[task + "_panel_backwardsu"].checked = tinyMCE.getWindowArg("backwards");
formObj[task + "_panel_backwardsd"].checked = !tinyMCE.getWindowArg("backwards");
}
 
function searchNext(replacemode) {
// "search" or "replace" mode of operation?
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
 
var formObj = document.forms[0];
 
if (task == "replace") {
// Whats the point?
if (formObj[task + "_panel_searchstring"].value == "" || formObj[task + "_panel_searchstring"].value == formObj[task + "_panel_replacestring"].value)
return false;
}
 
// Do search
tinyMCEPopup.execCommand('mceSearch', false, {
string : formObj[task + "_panel_searchstring"].value,
replacestring : formObj["replace_panel_replacestring"].value,
replacemode : replacemode,
casesensitive : formObj[task + "_panel_casesensitivebox"].checked,
backwards : formObj[task + "_panel_backwardsu"].checked,
win : window
}, false);
 
window.focus();
 
return false;
}
 
function cancelAction() {
tinyMCEPopup.close();
}
 
function manageReplaceButtons() {
// "search" or "replace" mode of operation?
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
document.getElementById("replace_buttons").style.visibility = (task == "replace") ? "visible" : "hidden";
}
 
function copyValues(link) {
// check if tab is already active
var tab = link;
while (tab.tagName && tab.tagName.toLowerCase() != "li") tab = tab.parentNode;
if (tab.className) return false; // tab is already active -> no need to copy any values!
 
// copy values from one panel to the other (if they exist there)
var from_panel_name = tab.id.match(/^search/i) ? "replace_panel" : "search_panel";
var to_panel_name = (from_panel_name == "search_panel") ? "replace_panel" : "search_panel";
 
// find all elements with IDs to copy their values
var elms = document.getElementById(from_panel_name).getElementsByTagName("*");
for (var i = 0; i < elms.length; i++) {
if (elms[i].id && elms[i].id != "") {
var checked = "undefined";
if (elms[i].type.toLowerCase() == "checkbox" || elms[i].type.toLowerCase() == "radio")
checked = elms[i].checked;
 
// copy values if element exists in other panel
var to_elm_name = to_panel_name + elms[i].id.substring(from_panel_name.length, elms[i].id.length);
var to_elm = document.getElementById(to_elm_name);
if (to_elm) {
if (checked != "undefined")
to_elm.checked = checked;
else
to_elm.value = elms[i].value;
}
}
}
 
return false;
}
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/langs/en.js
New file
0,0 → 1,21
// UK lang variables
 
tinyMCE.addToLang('',{
searchreplace_search_desc : 'Find',
searchreplace_searchnext_desc : 'Find again',
searchreplace_replace_desc : 'Find/Replace',
searchreplace_notfound : 'The search has been completed. The search string could not be found.',
searchreplace_search_title : 'Find',
searchreplace_replace_title : 'Find/Replace',
searchreplace_allreplaced : 'All occurrences of the search string were replaced.',
searchreplace_findwhat : 'Find what',
searchreplace_replacewith : 'Replace with',
searchreplace_direction : 'Direction',
searchreplace_up : 'Up',
searchreplace_down : 'Down',
searchreplace_case : 'Match case',
searchreplace_findnext : 'Find&nbsp;next',
searchreplace_replace : 'Replace',
searchreplace_replaceall : 'Replace&nbsp;all',
searchreplace_cancel : 'Cancel'
});
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/langs/fr.js
New file
0,0 → 1,22
// FR lang variables
// Modified by keyko-web.net, last updated 2007-03-08, based on the work of Motte
 
tinyMCE.addToLang('',{
searchreplace_search_desc : 'Rechercher',
searchreplace_searchnext_desc : 'Rechercher suivant',
searchreplace_replace_desc : 'Rechercher/Remplacer',
searchreplace_notfound : 'Recherche compl&eacute;t&eacute;e. La fin du document a &eacute;t&eacute; atteinte.',
searchreplace_search_title : 'Rechercher',
searchreplace_replace_title : 'Rechercher/Remplacer',
searchreplace_allreplaced : 'Action termin&eacute;e avec succ&egrave;s. Les remplacements\nont &eacute;t&eacute; faits dans l\'ensemble du document.',
searchreplace_findwhat : 'Trouver le mot',
searchreplace_replacewith : 'Remplacer par',
searchreplace_direction : 'Direction',
searchreplace_up : 'Vers le haut',
searchreplace_down : 'Vers le bas',
searchreplace_case : 'Respecter la casse',
searchreplace_findnext : 'Suivant',
searchreplace_replace : 'Remplacer',
searchreplace_replaceall : 'Remplacer tout',
searchreplace_cancel : 'Annuler'
});
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/search.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/search.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
New file
0,0 → 1,173
/**
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
*/
 
tinyMCE.importPluginLanguagePack('searchreplace');
 
var TinyMCE_SearchReplacePlugin = {
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
};
},
 
initInstance : function (inst) {
inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
// No CTRL+R for "replace" because browsers will reload page instead of executing plugin
},
 
getControlHTML : function (cn) {
switch (cn) {
case "search" :
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif','mceSearch', true);
 
case "replace" :
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
}
 
return "";
},
 
execCommand : function (editor_id, element, command, user_interface, value) {
var inst = tinyMCE.getInstanceById(editor_id), selectedText = inst.selection.getSelectedText(), rng;
 
function defValue(key, default_value) {
value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
}
 
function replaceSel(search_str, str, back) {
if (!inst.selection.isCollapsed()) {
if (tinyMCE.isRealIE)
inst.selection.getRng().duplicate().pasteHTML(str); // Needs to be duplicated due to selection bug in IE
else
inst.execCommand('mceInsertContent', false, str);
}
}
 
if (!value)
value = [];
 
defValue("editor_id", editor_id);
defValue("searchstring", selectedText);
defValue("replacestring", null);
defValue("replacemode", "none");
defValue("casesensitive", false);
defValue("backwards", false);
defValue("wrap", false);
defValue("wholeword", false);
defValue("inline", "yes");
defValue("resizable", "no");
 
switch (command) {
case "mceSearch" :
if (user_interface) {
var template = new Array();
 
template['file'] = '../../plugins/searchreplace/searchreplace.htm';
template['width'] = 380;
template['height'] = 155 + (tinyMCE.isNS7 ? 20 : 0) + (tinyMCE.isMSIE ? 15 : 0);
template['width'] += tinyMCE.getLang('lang_searchreplace_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_searchreplace_delta_height', 0);
 
inst.selection.collapse(true);
 
tinyMCE.openWindow(template, value);
} else {
var win = tinyMCE.getInstanceById(editor_id).contentWindow;
var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
var awin = value.win, found;
 
if (body.innerHTML == "") {
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
 
if (value['replacemode'] == "current") {
replaceSel(value['string'], value['replacestring'], value['backwards']);
value['replacemode'] = "none";
//tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value);
//return true;
}
 
inst.selection.collapse(value['backwards']);
 
if (tinyMCE.isMSIE) {
var rng = inst.selection.getRng();
var flags = 0;
if (value['wholeword'])
flags = flags | 2;
 
if (value['casesensitive'])
flags = flags | 4;
 
if (!rng.findText) {
awin.alert('This operation is currently not supported by this browser.');
return true;
}
 
if (value['replacemode'] == "all") {
found = false;
 
while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
found = true;
rng.scrollIntoView();
rng.select();
replaceSel(value['string'], value['replacestring'], value['backwards']);
}
 
if (found)
awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
 
return true;
}
 
if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
rng.scrollIntoView();
rng.select();
} else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
} else {
if (value['replacemode'] == "all") {
found = false;
 
while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) {
found = true;
replaceSel(value['string'], value['replacestring'], value['backwards']);
}
 
if (found)
awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
 
return true;
}
 
if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
}
}
 
return true;
 
case "mceSearchReplace" :
value['replacestring'] = "";
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
return true;
}
 
return false;
}
};
 
tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css
New file
0,0 → 1,20
/* stylesheet for advsearchreplace plugin*/
 
.panel_wrapper { height: 85px; }
.panel_wrapper div.current { height: 85px; }
 
/* MS IE only styles */
* html .panel_wrapper { height: 100px; }
* html .panel_wrapper div.current { height: 100px; }
 
#replaceBtn, #replaceAllBtn {
padding-bottom: 2px;
font-weight: bold;
width: 90px;
height: 21px;
border: 0;
cursor: pointer;
}
 
#replaceBtn { background: url(../images/replace_button_bg.gif); }
#replaceAllBtn { background: url(../images/replace_all_button_bg.gif); }
/branches/v4.0/wikini/maj_wikini/tools/templates/themes/default/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm
New file
0,0 → 1,107
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_searchreplace_replace_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/searchreplace.js"></script>
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
<form onsubmit="return false;" action="#">
<div class="tabs">
<ul>
<li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_search_desc}</a></span></li>
<li id="replace_tab"><span><a href="javascript:mcTabs.displayTab('replace_tab','replace_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_replace}</a></span></li>
</ul>
</div>
 
<div class="panel_wrapper">
 
<div id="search_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><label for="search_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
<td><label>{$lang_searchreplace_direction}</label></td>
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
<td><label for="search_panel_backwardsu">{$lang_searchreplace_up}</label></td>
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" /></td>
<td><label for="search_panel_backwardsd">{$lang_searchreplace_down}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
<td><label for="search_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
 
<div id="replace_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><label for="replace_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
<td><label for="replace_panel_replacestring">{$lang_searchreplace_replacewith}</label></td>
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
<td><label>{$lang_searchreplace_direction}</label></td>
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
<td><label for="replace_panel_backwardsu">{$lang_searchreplace_up}</label></td>
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" /></td>
<td><label for="replace_panel_backwardsd">{$lang_searchreplace_down}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
<td><label for="replace_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
 
</div>
 
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" />
<span id="replace_buttons">
<input type="button" id="replaceBtn" name="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" />
<input type="button" id="replaceAllBtn" name="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');;" />
</span>
</div>
 
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_searchreplace_cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>
</body>
</html>