blob: 3a0fc097a76fea7f8fd61faba2a745d510209a77 [file] [log] [blame]
<html>
<head>
<title>Find and Replace</title>
<!--
/*---------------------------------------*\
Find and Replace Plugin for HTMLArea-3.0
-----------------------------------------
author: Cau guanabara
e-mail: caugb@ibest.com.br
\*---------------------------------------*/
-->
<script type="text/javascript" src="../fr_engine.js"></script>
<script type="text/javascript" src="../../../popups/popup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
<script type="text/javascript">
window.resizeTo(335, 250);
var accepted = {
'fr_pattern' : true,
'fr_replacement' : true,
'fr_words' : true,
'fr_matchcase' : true,
'fr_replaceall' : true
};
function Init() {
__dlg_translate('FindReplace');
__dlg_init();
disab("fr_undo,fr_clear,fr_hiliteall",true);
var params = window.dialogArguments;
if(params) {
document.getElementById('fr_pattern').value = params["fr_pattern"];
document.getElementById('fr_replacement').focus();
} else {
document.getElementById('fr_pattern').focus();
}
document.body.onkeypress = __dlg_key_press;
}
function onCancel() {
clearDoc();
__dlg_close(null);
return false;
}
function onOK() {
var required = {'fr_pattern' : _lc("Enter the text you want to find")};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required[i]);
el.focus();
return false;
}
}
var param = {};
for (var i in accepted) {
var el = document.getElementById(i);
param[i] = el.type == 'checkbox' ? el.checked : el.value;
}
execSearch(param);
return false;
}
function __dlg_key_press(ev) {
ev || (ev = window.event);
switch(ev.keyCode) {
case 13:
document.getElementById('fr_go').click();
document.getElementById('fr_pattern').focus();
break;
case 27:
clearDoc();
window.close();
return false;
}
return true;
}
</script>
<style type="text/css">
table .label { text-align: right; width: 12em; }
.title {
background: #ddf;
color: #000;
font-weight: bold;
font-size: 120%;
padding: 3px 10px;
margin-bottom: 10px;
border-bottom: 1px solid black;
letter-spacing: 2px;
}
.buttons { border-top: 1px solid #999; padding: 2px; text-align: right; }
.hrstyle { border-width: 1px; border-color: #666; width: 95%; padding: 2px; }
</style>
</head>
<body class="dialog" onload="Init()">
<div class="title">Find and Replace</div>
<form action="" method="get">
<table border="0" style="width: 100%; padding: 2px;"><!---->
<tbody>
<tr>
<td width="29%" style="text-align: right; vertical-align: bottom;">Search for:</td>
<td width="71%" colspan="2" style="vertical-align: bottom;">
<input id="fr_pattern" type="text" style="width: 200px" onFocus="this.select();">
</td>
</tr>
<tr>
<td style="text-align: right;">Replace with:</td>
<td colspan="2">
<input id="fr_replacement" type="text" style="width: 200px" onFocus="this.select();">
</td>
</tr>
<tr>
<td colspan="3"><table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td width="78%" style="padding: 2px">
<FIELDSET style="width:90%; padding: 5px">
<LEGEND><span>Options</span></LEGEND>
<input id="fr_words" type="checkbox" checked onClick="clearDoc();" value="on">
<span onClick="e = document.getElementById('fr_words');
e.click(); e.focus();" style="cursor:default">
<span>Whole words only</span></span><br />
<input id="fr_matchcase" type="checkbox" onClick="clearDoc();" value="on">
<span onClick="e = document.getElementById('fr_matchcase');
e.click(); e.focus();" style="cursor:default">
<span>Case sensitive search</span></span><br />
<input id="fr_replaceall" type="checkbox" onClick="
if(document.getElementById('fr_replacement').value == '') {
alert(_lc('Inform a replacement word'));
return false;
}
clearDoc();" value="on">
<span onClick="e = document.getElementById('fr_replaceall');
e.click(); e.focus();" style="cursor:default">
<span>Substitute all occurrences</span></span>
</FIELDSET></td>
<td width="22%" style="vertical-align: bottom; text-align: right; padding: 4px">
<button type="button" id="fr_clear" onClick="clearMarks()">Clear</button>
<div class="space"></div>
<button type="button" id="fr_hiliteall" onClick="hiliteAll()">Highlight</button>
<div class="space"></div>
<button type="button" id="fr_undo" onClick="resetContents();">Undo</button>
</td>
</tr>
</table></td>
</tr>
</tbody>
</table>
<div style="border-top: 1px solid #999; padding: 2px; padding: 5px; text-align: right; height: 20px"><button type="button" id="fr_go" onclick="return onOK();">Next</button>
<button type="button" name="cancel" onclick="return onCancel();">Done</button>
</div>
</form>
</body>
</html>