[geeklog-cvs] Geeklog-2.x/public_html/assets/plugins/content/javascript/tiny_mce/plugins/searchreplace editor_plugin.js, NONE, 1.1 editor_plugin_src.js, NONE, 1.1 readme.txt, NONE, 1.1 searchreplace.htm, NONE, 1.1

Damien Hodgkin dhodgkin at qs1489.pair.com
Thu Aug 16 13:30:43 EDT 2007


Update of /cvsroot/geeklog2/Geeklog-2.x/public_html/assets/plugins/content/javascript/tiny_mce/plugins/searchreplace
In directory qs1489.pair.com:/tmp/cvs-serv82707/public_html/assets/plugins/content/javascript/tiny_mce/plugins/searchreplace

Added Files:
	editor_plugin.js editor_plugin_src.js readme.txt 
	searchreplace.htm 
Log Message:
initial commit

--- NEW FILE: editor_plugin.js ---
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[ke
 y])=="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,val
 ue)}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);
--- NEW FILE: editor_plugin_src.js ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: readme.txt ---
Check the TinyMCE documentation for details on this plugin.

--- NEW FILE: searchreplace.htm ---
<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>




More information about the geeklog-cvs mailing list