Bug 313149 the code of findBar.js should be protected in a prototype r=mconnor

This commit is contained in:
masayuki%d-toybox.com 2005-11-01 17:34:45 +00:00
Родитель 8b7e9ecc28
Коммит 48b90c3235
10 изменённых файлов: 900 добавлений и 807 удалений

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

@ -141,9 +141,9 @@
<command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(content.document);" observes="isImage"/>
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
<command id="cmd_find" oncommand="onFindCmd();" observes="isImage"/>
<command id="cmd_findAgain" oncommand="onFindAgainCmd();" observes="isImage"/>
<command id="cmd_findPrevious" oncommand="onFindPreviousCmd();" observes="isImage"/>
<command id="cmd_find" oncommand="gFindBar.onFindCmd();" observes="isImage"/>
<command id="cmd_findAgain" oncommand="gFindBar.onFindAgainCmd();" observes="isImage"/>
<command id="cmd_findPrevious" oncommand="gFindBar.onFindPreviousCmd();" observes="isImage"/>
<command id="Browser:AddBookmarkAs" oncommand="addBookmarkAs(document.getElementById('content'), false);"/>
<command id="Browser:BookmarkAllTabs" oncommand="addBookmarkAs(document.getElementById('content'), true);"/>
<command id="Browser:Home" oncommand="BrowserHome();"/>

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

@ -619,10 +619,10 @@ function BrowserStartup()
var sidebarSplitter;
if (window.opener && !window.opener.closed) {
if (window.opener.gFindMode == FIND_NORMAL) {
if (window.opener.gFindBar.mFindMode == FIND_NORMAL) {
var openerFindBar = window.opener.document.getElementById("FindToolbar");
if (openerFindBar && !openerFindBar.hidden)
openFindBar();
gFindBar.openFindBar();
}
var openerSidebarBox = window.opener.document.getElementById("sidebar-box");
@ -822,7 +822,7 @@ function delayedStartup()
sidebar.setAttribute("src", sidebarBox.getAttribute("src"));
}
initFindBar();
gFindBar.initFindBar();
// add bookmark options to context menu for tabs
addBookmarkMenuitems();
@ -984,7 +984,7 @@ function BrowserShutdown()
BrowserOffline.uninit();
uninitFindBar();
gFindBar.uninitFindBar();
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator);
@ -2405,7 +2405,7 @@ function toggleAffectedChrome(aHide)
var findBar = document.getElementById("FindToolbar");
gChromeState.findOpen = !findBar.hidden;
closeFindBar();
gFindBar.closeFindBar();
}
else {
if (gChromeState.messageOpen) {
@ -2419,7 +2419,7 @@ function toggleAffectedChrome(aHide)
}
if (gChromeState.findOpen)
openFindBar();
gFindBar.openFindBar();
}
if (gChromeState.sidebarOpen)
@ -3538,10 +3538,9 @@ nsBrowserStatusHandler.prototype =
}
}
UpdateBackForwardButtons();
if (findField && gFindMode != FIND_NORMAL) {
if (findField && gFindBar.mFindMode != FIND_NORMAL) {
// Close the Find toolbar if we're in old-style TAF mode
closeFindBar();
gBackProtectBuffer = 0;
gFindBar.closeFindBar();
}
//fix bug 253793 - turn off highlight when page changes

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

@ -144,7 +144,7 @@ function init() {
strBundle = document.getElementById("bundle_help");
emptySearchText = strBundle.getString("emptySearchText");
initFindBar();
gFindBar.initFindBar();
// Get the content pack, base URL, and help topic
var helpTopic = defaultTopic;

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

@ -70,7 +70,7 @@
persist="width height screenX screenY"
#endif
onload="init();"
onunload="uninitFindBar(); window.XULBrowserWindow.destroy();">
onunload="gFindBar.uninitFindBar(); window.XULBrowserWindow.destroy();">
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
@ -102,9 +102,9 @@
<command id="cmd_closeWindow" oncommand="close();"/>
<command id="cmd_textZoomReduce" oncommand="ZoomManager.prototype.getInstance().reduce();"/>
<command id="cmd_textZoomEnlarge" oncommand="ZoomManager.prototype.getInstance().enlarge();"/>
<command id="cmd_find" oncommand="onFindCmd();"/>
<command id="cmd_findAgain" oncommand="onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="onFindPreviousCmd();"/>
<command id="cmd_find" oncommand="gFindBar.onFindCmd();"/>
<command id="cmd_findAgain" oncommand="gFindBar.onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="gFindBar.onFindPreviousCmd();"/>
<command id="cmd_copy" oncommand="goDoCommand('cmd_copy')" disabled="true"/>
<command id="cmd_selectAll" oncommand="goDoCommand('cmd_selectAll')"/>
</commandset>

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

@ -1,13 +1,14 @@
<toolbar id="FindToolbar" hidden="true" align="center" fullscreentoolbar="true">
<toolbarbutton id="find-closebutton" tooltiptext="&findCloseButton.tooltip;"
oncommand="closeFindBar();"/>
oncommand="gFindBar.closeFindBar();"/>
<label control="find-field" value="&find.label;"/>
<hbox id="find-field-container">
<textbox id="find-field" oninput="find(this.value);"
onkeypress="onFindBarKeyPress(event);" onblur="onFindBarBlur();"
oncompositionstart="onFindBarCompositionStart(event);"
oncompositionend="onFindBarCompositionEnd(event);"/>
<textbox id="find-field" oninput="gFindBar.find(this.value);"
onkeypress="gFindBar.onFindBarKeyPress(event);"
onblur="gFindBar.onFindBarBlur();"
oncompositionstart="gFindBar.onFindBarCompositionStart(event);"
oncompositionend="gFindBar.onFindBarCompositionEnd(event);"/>
</hbox>
<toolbarbutton id="find-next" label="&findNext.label;" tooltiptext="&findNext.tooltip;"
command="cmd_findAgain" disabled="true" accesskey="&findNext.accesskey;"/>
@ -20,11 +21,13 @@
#else
tooltiptext="&highlight.tooltip;"
#endif
oncommand="toggleHighlight(!this.checked);
if (gFindMode != FIND_NORMAL) setFindCloseTimeout();"
oncommand="gFindBar.toggleHighlight(!this.checked);
if (gFindBar.mFindMode != FIND_NORMAL)
gFindBar.setFindCloseTimeout();"
type="checkbox" disabled="true"
accesskey="&highlight.accesskey;"/>
<checkbox id="find-case-sensitive" oncommand="toggleCaseSensitivity(this.checked);"
<checkbox id="find-case-sensitive"
oncommand="gFindBar.toggleCaseSensitivity(this.checked);"
label="&caseSensitiveCheckbox.label;" accesskey="&caseSensitiveCheckbox.accesskey;"/>
<image id="find-status-icon"/>
<label id="find-status"/>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -76,7 +76,7 @@ function onLoadViewPartialSource()
document.getElementById("menu_highlightSyntax").setAttribute("hidden", "true");
}
initFindBar();
gFindBar.initFindBar();
if (window.arguments[3] == 'selection')
viewPartialSourceForSelection(window.arguments[2]);
@ -88,7 +88,7 @@ function onLoadViewPartialSource()
function onUnloadViewPartialSource()
{
uninitFindBar();
gFindBar.uninitFindBar();
}
////////////////////////////////////////////////////////////////////////////////

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

@ -89,9 +89,9 @@
<command id="cmd_pagesetup" oncommand="PrintUtils.showPageSetup();"/>
<command id="cmd_close" oncommand="window.close();"/>
<commandset id="editMenuCommands"/>
<command id="cmd_find" oncommand="onFindCmd();"/>
<command id="cmd_findAgain" oncommand="onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="onFindPreviousCmd();"/>
<command id="cmd_find" oncommand="gFindBar.onFindCmd();"/>
<command id="cmd_findAgain" oncommand="gFindBar.onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="gFindBar.onFindPreviousCmd();"/>
<command id="cmd_goToLine" oncommand="ViewSourceGoToLine();" disabled="true"/>
<command id="cmd_highlightSyntax" oncommand="highlightSyntax();"/>
<command id="cmd_wrapLongLines" oncommand="wrapLongLines()"/>

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

@ -69,14 +69,14 @@ function onLoadViewSource()
viewSource(window.arguments[0]);
document.commandDispatcher.focusedWindow = content;
#ifdef MOZ_PHOENIX
initFindBar();
gFindBar.initFindBar();
#endif
}
function onUnloadViewSource()
{
#ifdef MOZ_PHOENIX
uninitFindBar();
gFindBar.uninitFindBar();
#endif
}

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

@ -105,9 +105,9 @@
<command id="cmd_close" oncommand="window.close();"/>
<commandset id="editMenuCommands"/>
#ifdef USE_FIND_TOOLBAR
<command id="cmd_find" oncommand="onFindCmd();"/>
<command id="cmd_findAgain" oncommand="onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="onFindPreviousCmd();"/>
<command id="cmd_find" oncommand="gFindBar.onFindCmd();"/>
<command id="cmd_findAgain" oncommand="gFindBar.onFindAgainCmd();"/>
<command id="cmd_findPrevious" oncommand="gFindBar.onFindPreviousCmd();"/>
#else
<command id="cmd_find" oncommand="getBrowser().find();"/>
<command id="cmd_findAgain" oncommand="getBrowser().findAgain()"/>