From 2f8d29d1d5e09344ca75015f50b1fcd5a0d7fb67 Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Thu, 12 Jan 2006 19:53:26 +0000 Subject: [PATCH] clean up. git-svn-id: svn://10.0.0.236/trunk@187502 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/minimo/chrome/content/minimo.js | 90 +++++++++++-------- mozilla/minimo/chrome/content/minimo.xul | 25 ++++-- mozilla/minimo/chrome/locale/en-US/minimo.dtd | 6 +- .../minimo/components/ssr/nsSSRSupport.cpp | 5 ++ 4 files changed, 79 insertions(+), 47 deletions(-) diff --git a/mozilla/minimo/chrome/content/minimo.js b/mozilla/minimo/chrome/content/minimo.js index 77542e5dd47..0732cb3b5ce 100755 --- a/mozilla/minimo/chrome/content/minimo.js +++ b/mozilla/minimo/chrome/content/minimo.js @@ -117,7 +117,12 @@ nsBrowserStatusHandler.prototype = catch(e) {} document.getElementById("statusbar").hidden=false; - + + + // document.getElementById("menu_NavPopup"). + + + if(aRequest && aWebProgress.DOMWindow == content) { this.startDocumentLoad(aRequest); } @@ -568,10 +573,10 @@ function BrowserOpenTab() } catch (e) { alert(e); } - // if (gURLBar) setTimeout(function() { gURLBar.focus(); }, 0); - + // if (gURLBar) setTimeout(function() { gURLBar.focus(); }, 0); } + /* * Used by the Context Menu - Open link as Tab */ @@ -684,46 +689,56 @@ function BrowserResetZoomMinus() { } -/* - We want to intercept before it shows, - to evaluate when the selected content area is a phone number, - thus mutate the popup menu to the right make call item -*/ +function MenuMainPopupShowing () { + try { + var pref = Components.classes["@mozilla.org/preferences-service;1"].getService(nsCI.nsIPrefBranch); + if (pref.getBoolPref("snav.enabled")) + { + document.getElementById("snav_toggle").label = "Enable arrow key scrolling"; + } + else + { + document.getElementById("snav_toggle").label = "Enable jump to links"; + } - - -function BrowserPopupShowing () { - - /* - * Open Link as New Tab - */ - - if(document.commandDispatcher.focusedElement && document.commandDispatcher.focusedElement.href) { - gFocusedElementHREFContextMenu=document.commandDispatcher.focusedElement.href; - document.getElementById("link_as_new_tab").hidden=false; - - document.getElementById("item-backbutton").hidden=true; - document.getElementById("item-forwardbutton").hidden=true; - document.getElementById("item-reloadbutton").hidden=true; - - } else { - document.getElementById("link_as_new_tab").hidden=true; - - document.getElementById("item-backbutton").hidden=false; - document.getElementById("item-forwardbutton").hidden=false; - document.getElementById("item-reloadbutton").hidden=false; - + if (pref.getBoolPref("ssr.enabled")) + { + document.getElementById("ssr_toggle").label = "Desktop layout"; + } + else + { + document.getElementById("ssr_toggle").label = "Single column layout"; + } } + catch(ex) { alert(ex); } +} + +function MenuNavPopupShowing () { + + /* + command_back + command_forward + command_go + command_reload + + command_stop + */ + +} + + +function BrowserContentAreaPopupShowing () { + var selectedRange=gBrowser.selectedBrowser.contentDocument.getSelection(); /* Enable Copy */ if(selectedRange.toString()) { - document.getElementById("item-copy").style.display="block"; + document.getElementById("item-copy").disabled=false; } else { - document.getElementById("item-copy").style.display="none"; + document.getElementById("item-copy").disabled=true; } /* Enable Paste - Can paste only if the focused element has a value attribute. :) @@ -732,9 +747,9 @@ function BrowserPopupShowing () { if (document.commandDispatcher.focusedElement) { if(document.commandDispatcher.focusedElement.nodeName=="INPUT"||document.commandDispatcher.focusedElement.nodeName=="TEXTAREA") { if(DoClipCheckPaste()) { - document.getElementById("item-paste").style.display="block"; + document.getElementById("item-paste").disabled=false; } else { - document.getElementById("item-paste").style.display="none"; + document.getElementById("item-paste").disabled=true; } } } @@ -754,6 +769,8 @@ function BrowserBookmarkThis() { storeBookmarks(); refreshBookmarks(); + + alert("Bookmark Saved."); } function BrowserBookmark() { @@ -922,9 +939,6 @@ function DoFullScreen() } window.fullScreen = gFullScreen; - - document.getElementById("nav-bar-contextual").hidden = !gFullScreen; - } /* diff --git a/mozilla/minimo/chrome/content/minimo.xul b/mozilla/minimo/chrome/content/minimo.xul index 440e0a9beb5..ec9b644a488 100755 --- a/mozilla/minimo/chrome/content/minimo.xul +++ b/mozilla/minimo/chrome/content/minimo.xul @@ -104,6 +104,7 @@ + @@ -161,6 +162,7 @@ enablehistory="true" autocompletesearch="history" completeselectedindex="true" + maxrows="14" autocompletepopup="PopupAutoComplete" ontextentered="return URLBarEntered();" onfocus="URLBarFocusHandler(event, this);" @@ -188,7 +190,7 @@ - + - + + - + + + - + - diff --git a/mozilla/minimo/chrome/locale/en-US/minimo.dtd b/mozilla/minimo/chrome/locale/en-US/minimo.dtd index f0eeb496e9f..e047e621bf6 100755 --- a/mozilla/minimo/chrome/locale/en-US/minimo.dtd +++ b/mozilla/minimo/chrome/locale/en-US/minimo.dtd @@ -18,7 +18,11 @@ - + + + + + diff --git a/mozilla/minimo/components/ssr/nsSSRSupport.cpp b/mozilla/minimo/components/ssr/nsSSRSupport.cpp index 03733813c44..6461e52595d 100755 --- a/mozilla/minimo/components/ssr/nsSSRSupport.cpp +++ b/mozilla/minimo/components/ssr/nsSSRSupport.cpp @@ -149,6 +149,7 @@ nsSSRSupport::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar if (!strcmp(pref, "ssr.enabled")) { prefBranch->GetBoolPref(pref, &mUsingSSR); + return NS_OK; } } @@ -156,7 +157,11 @@ nsSSRSupport::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar if (!strcmp(aTopic, "loading-domain")) { if (!mUsingSSR) + { + SetSSREnabled(PR_FALSE); + SetSiteSSREnabled(PR_FALSE); return NS_OK; + } const char* domain = NS_ConvertUCS2toUTF8(aData).get();