Bug 241442 - Add find dialog and find-again.

ChatZilla only.
r=silver@warwickcompsoc.co.uk
p=dmcorry@seanet.com (David Corry)
This commit is contained in:
silver%warwickcompsoc.co.uk 2005-01-03 19:41:26 +00:00
Родитель 3a23ac3a17
Коммит bca2e8d662
7 изменённых файлов: 42 добавлений и 2 удалений

Просмотреть файл

@ -55,10 +55,13 @@
orient="vertical" onload="onLoad();" onunload="onUnload();"
onclose="return onClose();" onmouseover="onMouseOver(event);"
persist="width height screenX screenY sizemode" windowtype="irc:chatzilla">
<overlaytarget id="scripts-overlay-target"/>
<overlaytarget id="popup-overlay-target"/>
<overlaytarget id="menu-overlay-target"/>
<stringbundleset id="chatzilla-stringbundle">
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
</stringbundleset>
<vbox id="outer-box" flex="1">
<vbox id="upper-box" flex="1">

Просмотреть файл

@ -95,6 +95,8 @@ function initCommands()
["echo", cmdEcho, CMD_CONSOLE],
["enable-plugin", cmdAblePlugin, CMD_CONSOLE],
["eval", cmdEval, CMD_CONSOLE],
["find", cmdFind, 0],
["find-again", cmdFindAgain, 0],
["focus-input", cmdFocusInput, CMD_CONSOLE],
["font-family", cmdFont, CMD_CONSOLE],
["font-family-other", cmdFont, 0],
@ -3423,6 +3425,17 @@ function cmdInputTextDirection(e)
return true;
}
function cmdFind(e)
{
findInPage(getFindData(e));
}
function cmdFindAgain(e)
{
if (canFindAgainInPage())
findAgainInPage(getFindData(e));
}
function cmdURLs(e)
{
if (client.prefs["urls.list"].length == 0)

Просмотреть файл

@ -4,5 +4,6 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/findUtils.js"/>
</overlay>

Просмотреть файл

@ -150,6 +150,9 @@ function initMenus()
["cmd-delete", {enabledif: "getCommandEnabled('cmd_delete')"}],
["-"],
["cmd-selectall", {enabledif: "getCommandEnabled('cmd_selectAll')"}],
["-"],
["find"],
["find-again", {enabledif: "canFindAgainInPage()"}],
["-", {visibleif: Mozilla}],
["cmd-mozilla-prefs", {visibleif: Mozilla}],
["cmd-chatzilla-prefs", {visibleif: Mozilla}],

Просмотреть файл

@ -5,5 +5,6 @@
<script src="chrome://communicator/content/contentAreaUtils.js"/>
<script src="chrome://communicator/content/contentAreaDD.js"/>
<script src="chrome://communicator/content/findUtils.js"/>
</overlay>

Просмотреть файл

@ -420,6 +420,15 @@ function initIcons()
}
}
function getFindData(e)
{
var findData = new nsFindInstData();
findData.browser = e.sourceObject.frame;
findData.rootSearchWindow = e.sourceObject.frame.contentWindow;
findData.currentSearchWindow = e.sourceObject.frame.contentWindow;
return findData;
}
function importFromFrame(method)
{
client.__defineGetter__(method, import_wrapper);

Просмотреть файл

@ -227,6 +227,16 @@ cmd.exit.help = Disconnects from all active servers and networks, providing t
cmd.exit-mozilla.label = E&xit
cmd.exit-mozilla.help = Exit Mozilla.
cmd.find.label = &Find...
cmd.find.key = accel F
cmd.find.params =
cmd.find.help = Finds text in the current view.
cmd.find-again.label = Find A&gain
cmd.find-again.key = accel G
cmd.find-again.params =
cmd.find-again.help = Finds the next instance of your previously searched word.
cmd.focus-input.key = VK_ESCAPE
cmd.focus-input.help = Force keyboard focus to the input box.