b=436068, r=gavin. Add and removes files

This commit is contained in:
Mark Finkle 2008-07-04 02:39:25 -04:00
parent 7cf5fbf00f
commit d93d008829
22 changed files with 108 additions and 1366 deletions

View File

@ -1,153 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Mobile Browser.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Finkle <mfinkle@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var Bookmarks = {
bookmarks : null,
panel : null,
item : null,
edit : function(aURI) {
this.bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
this.panel = document.getElementById("bookmark_edit");
this.panel.hidden = false; // was initially hidden to reduce Ts
var bookmarkIDs = this.bookmarks.getBookmarkIdsForURI(aURI, {});
if (bookmarkIDs.length > 0) {
this.item = bookmarkIDs[0];
document.getElementById("bookmark_url").value = aURI.spec;
document.getElementById("bookmark_name").value = this.bookmarks.getItemTitle(this.item);
this.panel.openPopup(document.getElementById("tool_star"), "after_end", 0, 0, false, false);
}
},
remove : function() {
if (this.item) {
this.bookmarks.removeItem(this.item);
document.getElementById("tool_star").removeAttribute("starred");
}
this.close();
},
save : function() {
if (this.panel && this.item) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var bookmarkURI = ios.newURI(document.getElementById("bookmark_url").value, null, null);
if (bookmarkURI) {
this.bookmarks.setItemTitle(this.item, document.getElementById("bookmark_name").value);
this.bookmarks.changeBookmarkURI(this.item, bookmarkURI);
}
}
this.close();
},
close : function() {
if (this.panel) {
this.item = null;
this.panel.hidePopup();
this.panel = null;
}
},
list : function() {
this.bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
this.panel = document.getElementById("bookmark_picker");
this.panel.hidden = false; // was initially hidden to reduce Ts
var list = document.getElementById("bookmark_list");
while (list.childNodes.length > 0) {
list.removeChild(list.childNodes[0]);
}
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
var items = this.getBookmarks();
if (items.length > 0) {
for (var i=0; i<items.length; i++) {
var itemId = items[i];
var listItem = document.createElement("richlistitem");
listItem.setAttribute("class", "bookmarklist-item");
var box = document.createElement("vbox");
box.setAttribute("pack", "center");
var image = document.createElement("image");
image.setAttribute("class", "bookmarklist-image");
image.setAttribute("src", fis.getFaviconImageForPage(this.bookmarks.getBookmarkURI(itemId)).spec);
box.appendChild(image);
listItem.appendChild(box);
var label = document.createElement("label");
label.setAttribute("class", "bookmarklist-text");
label.setAttribute("value", this.bookmarks.getItemTitle(itemId));
label.setAttribute("flex", "1");
label.setAttribute("crop", "end");
label.setAttribute("onclick", "Bookmarks.open(" + itemId + ");");
listItem.appendChild(label);
list.appendChild(listItem);
}
this.panel.openPopup(document.getElementById("tool_bookmarks"), "after_end", 0, 0, false, false);
}
},
open : function(aItem) {
var bookmarkURI = this.bookmarks.getBookmarkURI(aItem);
getBrowser().loadURI(bookmarkURI.spec, null, null, false);
this.close();
},
getBookmarks : function() {
var items = [];
var history = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService);
var options = history.getNewQueryOptions();
var query = history.getNewQuery();
query.setFolders([this.bookmarks.bookmarksMenuFolder], 1);
var result = history.executeQuery(query, options);
var rootNode = result.root;
rootNode.containerOpen = true;
var cc = rootNode.childCount;
for (var i=0; i<cc; ++i) {
var node = rootNode.getChild(i);
if (node.type == node.RESULT_TYPE_URI) {
items.push(node.itemId);
}
}
rootNode.containerOpen = false;
return items;
}
};

View File

@ -1,77 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Mobile Browser.
-
- The Initial Developer of the Original Code is
- Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2008
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Mark Finkle <mfinkle@mozila.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay SYSTEM "chrome://browser/locale/bookmarks.dtd">
<overlay id="bookmarks-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/bookmarks.js"/>
<popupset id="mainPopupSet">
<panel id="bookmark_edit" hidden="true">
<hbox flex="1" align="top">
<image id="bookmark_star"/>
<vbox flex="1">
<label id="bookmark_title" value="&editBookmark.title;" flex="1"/>
<button label="&removeBookmark.label;" oncommand="Bookmarks.remove();"/>
</vbox>
</hbox>
<separator/>
<vbox>
<label value="&bookmarkURL.label;" control="bookmark_url"/>
<textbox id="bookmark_url"/>
<separator class="thin"/>
<label value="&bookmarkName.label;" control="bookmark_name"/>
<textbox id="bookmark_name"/>
</vbox>
<separator/>
<hbox>
<spacer flex="1"/>
<button label="&saveBookmark.label;" oncommand="Bookmarks.save();"/>
<button label="&closeBookmark.label;" oncommand="Bookmarks.close();"/>
</hbox>
</panel>
<panel id="bookmark_picker" hidden="true">
<richlistbox id="bookmark_list" style="border: none !important;">
</richlistbox>
</panel>
</popupset>
</overlay>

View File

@ -40,11 +40,11 @@ const TOOLBARSTATE_LOADED = 2;
const TOOLBARSTATE_INDETERMINATE = 3;
const PANELMODE_VIEW = 1;
const PANELMODE_VIEWMENU = 2;
const PANELMODE_EDIT = 3;
const PANELMODE_BOOKMARK = 4;
const PANELMODE_EDIT = 2;
const PANELMODE_BOOKMARK = 3;
const PANELMODE_BOOKMARKLIST = 4;
var HUDBar = {
var BrowserUI = {
_panel : null,
_caption : null,
_edit : null,
@ -58,15 +58,15 @@ var HUDBar = {
if (aEvent.target != getBrowser().contentDocument)
return;
this._caption.value = aEvent.target.title;
this._caption.value = aEvent.target.title;
},
_linkAdded : function(aEvent) {
var link = aEvent.originalTarget;
var rel = link.rel && link.rel.toLowerCase();
if (!link || !link.ownerDocument || !rel || !link.href)
if (!link || !link.ownerDocument || !link.href)
return;
var rel = link.rel && link.rel.toLowerCase();
var rels = rel.split(/\s+/);
if (rels.indexOf("icon") != -1) {
this._throbber.setAttribute("src", "");
@ -77,6 +77,8 @@ var HUDBar = {
_setIcon : function(aURI) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var faviconURI = ios.newURI(aURI, null, null);
if (faviconURI.schemeIs("javascript"))
return;
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
if (fis.isFailedFavicon(faviconURI))
@ -131,21 +133,18 @@ var HUDBar = {
},
init : function() {
this._panel = document.getElementById("hud-ui");
this._panel.addEventListener("popuphiding", this, false);
this._caption = document.getElementById("hudbar-caption");
this._caption = document.getElementById("urlbar-caption");
this._caption.addEventListener("click", this, false);
this._edit = document.getElementById("hudbar-edit");
this._edit = document.getElementById("urlbar-edit");
this._edit.addEventListener("focus", this, false);
this._edit.addEventListener("blur", this, false);
this._edit.addEventListener("keypress", this, false);
this._throbber = document.getElementById("hudbar-throbber");
this._favicon = document.getElementById("hudbar-favicon");
this._throbber = document.getElementById("urlbar-throbber");
this._favicon = document.getElementById("urlbar-favicon");
this._favicon.addEventListener("error", this, false);
this._menu = document.getElementById("hudmenu");
Browser.content.addEventListener("DOMTitleChanged", this, true);
Browser.content.addEventListener("DOMLinkAdded", this, true);
getBrowser().addEventListener("DOMTitleChanged", this, true);
getBrowser().addEventListener("DOMLinkAdded", this, true);
},
update : function(aState) {
@ -155,26 +154,27 @@ var HUDBar = {
this.setURI();
}
var hudbar = document.getElementById("hudbar-container");
var toolbar = document.getElementById("toolbar-main");
if (aState == TOOLBARSTATE_LOADING) {
this._showMode(PANELMODE_VIEW);
hudbar.setAttribute("mode", "loading");
toolbar.setAttribute("mode", "loading");
this._throbber.setAttribute("src", "chrome://browser/skin/images/throbber.gif");
this._favicon.setAttribute("src", "");
this._faviconAdded = false;
}
else if (aState == TOOLBARSTATE_LOADED) {
hudbar.setAttribute("mode", "view");
toolbar.setAttribute("mode", "view");
this._throbber.setAttribute("src", "");
if (this._faviconAdded == false) {
var faviconURI = getBrowser().currentURI.prePath + "/favicon.ico";
this._setIcon(faviconURI);
}
/*
if (this._allowHide)
this.hide(3000);
this._allowHide = true;
*/
}
},
@ -188,44 +188,49 @@ var HUDBar = {
forward.setAttribute("disabled", !browser.canGoForward);
// Check for a bookmarked page
var star = document.getElementById("hudbar-star");
star.removeAttribute("starred");
var star = document.getElementById("tool-star");
var bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
var bookmarks = bms.getBookmarkIdsForURI(browser.currentURI, {});
if (bookmarks.length > 0) {
star.setAttribute("starred", "true");
}
else {
star.removeAttribute("starred");
}
var uri = browser.currentURI.spec;
if (uri == "about:blank") {
uri = "";
var uri = browser.currentURI;
if (!this._URIFixup)
this._URIFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
try {
uri = this._URIFixup.createExposableURI(uri);
} catch (ex) {}
var urlString = uri.spec;
if (urlString == "about:blank") {
urlString = "";
this._showMode(PANELMODE_EDIT);
this._allowHide = false;
}
this._caption.value = uri;
this._edit.value = uri;
this._caption.value = urlString;
this._edit.value = urlString;
},
goToURI : function(aURI) {
if (!aURI)
aURI = this._edit.value;
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
if (ios.newURI(aURI, null, null) == null)
this.search();
else
getBrowser().loadURI(aURI, null, null, false);
if (this._panel.state == "open")
this._showMode(PANELMODE_VIEW);
getBrowser().loadURI(aURI.spec, null, null, false);
this._showMode(PANELMODE_VIEW);
},
search : function() {
var queryURI = "http://www.google.com/search?q=" + this._edit.value + "&hl=en&lr=&btnG=Search";
getBrowser().loadURI(queryURI, null, null, false);
if (this._panel.state == "open")
this._showMode(PANELMODE_VIEW);
this._showMode(PANELMODE_VIEW);
},
_showMode : function(aMode) {
@ -234,80 +239,76 @@ var HUDBar = {
this._fadeoutID = null;
}
var hudbar = document.getElementById("hudbar-container");
var hudbmk = document.getElementById("hudbookmark-container");
var hudexpand = document.getElementById("hudexpand-container");
if (aMode == PANELMODE_VIEW || aMode == PANELMODE_VIEWMENU) {
hudbar.setAttribute("mode", "view");
var toolbar = document.getElementById("toolbar-main");
var bookmark = document.getElementById("bookmark-container");
var urllist = document.getElementById("urllist-container");
if (aMode == PANELMODE_VIEW) {
toolbar.setAttribute("mode", "view");
this._edit.hidden = true;
this._caption.hidden = false;
hudbmk.hidden = true;
hudexpand.hidden = true;
if (aMode == PANELMODE_VIEWMENU) {
this._menu.hidden = false;
this._menu.openPopupAtScreen((window.innerWidth - this._menu.boxObject.width) / 2, (window.innerHeight - this._menu.boxObject.height) / 2);
}
bookmark.hidden = true;
urllist.hidden = true;
}
else if (aMode == PANELMODE_EDIT) {
hudbar.setAttribute("mode", "edit");
toolbar.setAttribute("mode", "edit");
this._caption.hidden = true;
this._edit.hidden = false;
this._edit.focus();
this._menu.hidePopup();
this.showHistory();
hudbmk.hidden = true;
//hudexpand.style.height = window.innerHeight - (30 + hudbar.boxObject.height);
hudexpand.hidden = false;
bookmark.hidden = true;
urllist.hidden = false;
}
else if (aMode == PANELMODE_BOOKMARK) {
hudbar.setAttribute("mode", "view");
toolbar.setAttribute("mode", "view");
this._edit.hidden = true;
this._caption.hidden = false;
this._menu.hidePopup();
urllist.hidden = true;
bookmark.hidden = false;
}
else if (aMode == PANELMODE_BOOKMARKLIST) {
toolbar.setAttribute("mode", "view");
this._edit.hidden = true;
this._caption.hidden = false;
hudexpand.hidden = true;
hudbmk.hidden = false;
urllist.hidden = false;
bookmark.hidden = true;
}
},
_showPlaces : function(aItems) {
var list = document.getElementById("hudlist-items");
while (list.childNodes.length > 0) {
list.removeChild(list.childNodes[0]);
var list = document.getElementById("urllist-items");
while (list.firstChild) {
list.removeChild(list.firstChild);
}
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
if (aItems.length > 0) {
for (var i=0; i<aItems.length; i++) {
let node = aItems[i];
let listItem = document.createElement("richlistitem");
listItem.setAttribute("class", "hudlist-item");
for (var i=0; i<aItems.length; i++) {
let node = aItems[i];
let listItem = document.createElement("richlistitem");
listItem.setAttribute("class", "urllist-item");
let box = document.createElement("vbox");
box.setAttribute("pack", "center");
let image = document.createElement("image");
image.setAttribute("class", "hudlist-image");
let icon = node.icon ? node.icon.spec : fis.getFaviconImageForPage(ios.newURI(node.uri, null, null)).spec
image.setAttribute("src", icon);
box.appendChild(image);
listItem.appendChild(box);
let box = document.createElement("vbox");
box.setAttribute("pack", "center");
let image = document.createElement("image");
image.setAttribute("class", "urllist-image");
let icon = node.icon ? node.icon.spec : fis.getFaviconImageForPage(ios.newURI(node.uri, null, null)).spec
image.setAttribute("src", icon);
box.appendChild(image);
listItem.appendChild(box);
let label = document.createElement("label");
label.setAttribute("class", "hudlist-text");
label.setAttribute("value", node.title);
label.setAttribute("flex", "1");
label.setAttribute("crop", "end");
listItem.appendChild(label);
list.appendChild(listItem);
listItem.addEventListener("click", function() { HUDBar.goToURI(node.uri); }, true);
}
let label = document.createElement("label");
label.setAttribute("class", "urllist-text");
label.setAttribute("value", node.title);
label.setAttribute("flex", "1");
label.setAttribute("crop", "end");
listItem.appendChild(label);
list.appendChild(listItem);
listItem.addEventListener("click", function() { BrowserUI.goToURI(node.uri); }, true);
}
list.focus();
@ -323,38 +324,31 @@ var HUDBar = {
},
show : function() {
this._panel.hidden = false; // was initially hidden to reduce Ts
this._panel.width = window.innerWidth - 20;
this._showMode(PANELMODE_VIEWMENU);
this._panel.openPopup(null, "", 10, 5, false, false);
this._allowHide = false;
this._showMode(PANELMODE_VIEW);
},
hide : function(aFadeout) {
if (!aFadeout) {
if (this._allowHide) {
this._menu.hidePopup();
this._panel.hidePopup();
}
this._allowHide = true;
//FIXME hide toolbar stuff
this._showMode(PANELMODE_VIEW);
}
else {
var self = this;
this.fadeoutID = setTimeout(function() { self.hide(); }, aFadeout);
//FIXME animate the close
//var self = this;
//this.fadeoutID = setTimeout(function() { self.hide(); }, aFadeout);
}
},
handleEvent: function (aEvent) {
switch (aEvent.type) {
// Browser events
case "DOMTitleChanged":
this._titleChanged(aEvent);
break;
case "DOMLinkAdded":
this._linkAdded(aEvent);
break;
case "popuphiding":
this._showMode(PANELMODE_VIEW);
break;
// URL textbox events
case "click":
this._showMode(PANELMODE_EDIT);
break;
@ -362,9 +356,12 @@ var HUDBar = {
setTimeout(function() { aEvent.target.select(); }, 0);
break;
case "keypress":
if (aEvent.keyCode == 13)
if (aEvent.keyCode == aEvent.DOM_VK_RETURN)
this.goToURI();
if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE)
this._showMode(PANELMODE_VIEW);
break;
// Favicon events
case "error":
this._favicon.setAttribute("src", "chrome://browser/skin/images/default-favicon.png");
break;
@ -382,13 +379,6 @@ var HUDBar = {
case "cmd_go":
case "cmd_star":
case "cmd_bookmarks":
case "cmd_newTab":
case "cmd_closeTab":
case "cmd_switchTab":
case "cmd_menu":
case "cmd_fullscreen":
case "cmd_addons":
case "cmd_downloads":
isSupported = true;
break;
default:
@ -407,11 +397,9 @@ var HUDBar = {
switch (cmd) {
case "cmd_back":
browser.stop();
browser.goBack();
break;
case "cmd_forward":
browser.stop();
browser.goForward();
break;
case "cmd_reload":
@ -434,10 +422,10 @@ var HUDBar = {
var bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
if (bookmarks.getBookmarkIdsForURI(bookmarkURI, {}).length == 0) {
var bookmarkId = bookmarks.insertBookmark(bookmarks.bookmarksMenuFolder, bookmarkURI, bookmarks.DEFAULT_INDEX, bookmarkTitle);
document.getElementById("hudbar-star").setAttribute("starred", "true");
document.getElementById("tool-star").setAttribute("starred", "true");
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var favicon = document.getElementById("hudbar-favicon");
var favicon = document.getElementById("urlbar-favicon");
var faviconURI = ios.newURI(favicon.src, null, null);
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
@ -450,35 +438,9 @@ var HUDBar = {
break;
}
case "cmd_bookmarks":
Bookmarks.list();
this._showMode(PANELMODE_BOOKMARKLIST);
this.showBookmarks();
break;
case "cmd_addons":
{
const EMTYPE = "Extension:Manager";
var aOpenMode = "extensions";
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var needToOpen = true;
var windowType = EMTYPE + "-" + aOpenMode;
var windows = wm.getEnumerator(windowType);
while (windows.hasMoreElements()) {
var theEM = windows.getNext().QueryInterface(Ci.nsIDOMWindowInternal);
if (theEM.document.documentElement.getAttribute("windowtype") == windowType) {
theEM.focus();
needToOpen = false;
break;
}
}
if (needToOpen) {
const EMURL = "chrome://mozapps/content/extensions/extensions.xul?type=" + aOpenMode;
const EMFEATURES = "chrome,dialog=no,resizable=yes";
window.openDialog(EMURL, "", EMFEATURES);
}
break;
}
case "cmd_downloads":
Cc["@mozilla.org/download-manager-ui;1"].getService(Ci.nsIDownloadManagerUI).show(window);
}
}
};
@ -497,16 +459,16 @@ var BookmarkHelper = {
var bookmarkIDs = this._bmksvc.getBookmarkIdsForURI(this._uri, {});
if (bookmarkIDs.length > 0) {
this._item = bookmarkIDs[0];
document.getElementById("hudbookmark-name").value = this._bmksvc.getItemTitle(this._item);
document.getElementById("bookmark-name").value = this._bmksvc.getItemTitle(this._item);
var currentTags = this._tagsvc.getTagsForURI(this._uri, {});
document.getElementById("hudbookmark-tags").value = currentTags.join(" ");
document.getElementById("bookmark-tags").value = currentTags.join(" ");
}
},
remove : function() {
if (this._item) {
this._bmksvc.removeItem(this._item);
document.getElementById("hudbar-star").removeAttribute("starred");
document.getElementById("tool-star").removeAttribute("starred");
}
this.close();
},
@ -514,12 +476,12 @@ var BookmarkHelper = {
save : function() {
if (this._item) {
// Update the name
this._bmksvc.setItemTitle(this._item, document.getElementById("hudbookmark-name").value);
this._bmksvc.setItemTitle(this._item, document.getElementById("bookmark-name").value);
// Update the tags
var taglist = document.getElementById("hudbookmark-tags").value;
var currentTags = this._tagsvc.getTagsForURI(this._uri, {});
var tags = taglist.split(" ");;
var tags = taglist.split(" ");
if (tags.length > 0 || currentTags.length > 0) {
var tagsToRemove = [];
var tagsToAdd = [];
@ -545,6 +507,6 @@ var BookmarkHelper = {
close : function() {
this._item = null;
HUDBar.hide();
BrowserUI.hide();
}
};

View File

@ -1,156 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Mobile Browser.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Finkle <mfinkle@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var DownloadMonitor = {
_dlmgr : null,
_panel : null,
_activeStr : null,
_pausedStr : null,
_lastTime : Infinity,
_listening : false,
init : function DM_init() {
// Load the modules to help display strings
Cu.import("resource://gre/modules/DownloadUtils.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm");
// Initialize "private" member variables
this._dlmgr = Cc["@mozilla.org/download-manager;1"].getService(Ci.nsIDownloadManager);
this._panel = document.getElementById("download-monitor");
this._status = document.getElementById("download-monitor-status");
this._time = document.getElementById("download-monitor-time");
// Cache the status strings
/*
let (bundle = document.getElementById("bundle_browser")) {
this._activeStr = bundle.getString("activeDownloads");
this._pausedStr = bundle.getString("pausedDownloads");
}
*/
this._activeStr = "1 active download (#2);#1 active downloads (#2)";
this._pausedStr = "1 paused download;#1 paused downloads";
this._dlmgr.addListener(this);
this._listening = true;
this.updateStatus();
},
uninit: function DM_uninit() {
if (this._listening)
this._dlmgr.removeListener(this);
},
/**
* Update status based on the number of active and paused downloads
*/
updateStatus: function DM_updateStatus() {
let numActive = this._dlmgr.activeDownloadCount;
// Hide the panel and reset the "last time" if there's no downloads
if (numActive == 0) {
this._panel.hidePopup();
this._lastTime = Infinity;
return;
}
// Find the download with the longest remaining time
let numPaused = 0;
let maxTime = -Infinity;
let dls = this._dlmgr.activeDownloads;
while (dls.hasMoreElements()) {
let dl = dls.getNext().QueryInterface(Ci.nsIDownload);
if (dl.state == this._dlmgr.DOWNLOAD_DOWNLOADING) {
// Figure out if this download takes longer
if (dl.speed > 0 && dl.size > 0)
maxTime = Math.max(maxTime, (dl.size - dl.amountTransferred) / dl.speed);
else
maxTime = -1;
}
else if (dl.state == this._dlmgr.DOWNLOAD_PAUSED)
numPaused++;
}
// Get the remaining time string and last sec for time estimation
let timeLeft;
[timeLeft, this._lastTime] = DownloadUtils.getTimeLeft(maxTime, this._lastTime);
// Figure out how many downloads are currently downloading
let numDls = numActive - numPaused;
let status = this._activeStr;
// If all downloads are paused, show the paused message instead
if (numDls == 0) {
numDls = numPaused;
status = this._pausedStr;
}
// Get the correct plural form and insert the number of downloads and time
// left message if necessary
status = PluralForm.get(numDls, status);
status = status.replace("#1", numDls);
// Update the panel and show it
this._status.value = status;
this._time.value = timeLeft;
this._panel.hidden = false;
this._panel.openPopup(null, "", 60, 50, false, false);
},
onProgressChange: function() {
this.updateStatus();
},
onDownloadStateChange: function() {
this.updateStatus();
},
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus, aDownload) {
},
onSecurityChange: function(aWebProgress, aRequest, aState, aDownload) {
},
QueryInterface : function(aIID) {
if (aIID.equals(Components.interfaces.nsIDownloadProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
}
};

View File

@ -1,61 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Mobile Browser.
-
- The Initial Developer of the Original Code is
- Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2008
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Mark Finkle <mfinkle@mozila.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<overlay id="downloads-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/downloads.js"/>
<popupset id="mainPopupSet">
<panel id="download-monitor" hidden="true">
<hbox>
<vbox>
<image id="download-monitor-progress"/>
</vbox>
<vbox>
<description id="download-monitor-status"/>
<description id="download-monitor-time"/>
</vbox>
<vbox>
<image id="download-monitor-close"/>
</vbox>
</hbox>
</panel>
</popupset>
</overlay>

View File

@ -1,149 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Mobile Browser.
-
- The Initial Developer of the Original Code is
- Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2008
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Mark Finkle <mfinkle@mozila.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://browser/skin/hud.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://browser/locale/hud.dtd">
<overlay id="hud-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/hud.js"/>
<commandset id="cmdset_main">
<command id="cmd_back" label="&back.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_forward" label="&forward.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_reload" label="&reload.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_stop" label="&stop.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_search" label="&search.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_go" label="&go.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_star" label="&star.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_bookmarks" label="&bookmarks.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
</commandset>
<popupset id="mainPopupSet">
<panel id="hud-ui">
<vbox flex="1">
<hbox id="hudbar-container">
<stack id="hudbar-image-stack">
<image id="hudbar-throbber" src=""/>
<image id="hudbar-favicon" src=""/>
</stack>
<description id="hudbar-caption" crop="end" flex="1"/>
<textbox id="hudbar-edit" flex="1" hidden="true"/>
<hbox id="hudbar-icons">
<toolbarbutton id="hudbar-reload" command="cmd_reload"/>
<toolbarbutton id="hudbar-stop" command="cmd_stop"/>
<toolbarbutton id="hudbar-star" command="cmd_star"/>
<toolbarbutton id="hudbar-search" command="cmd_search"/>
<toolbarbutton id="hudbar-go" command="cmd_go"/>
</hbox>
</hbox>
<vbox id="hudbookmark-container" hidden="true">
<hbox flex="1">
<vbox>
<image id="hudbookmark-image" src="chrome://browser/skin/images/starred48.png"/>
</vbox>
<grid id="hudbookmark-grid" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<label value="Name:" for="hudbookmark-name"/>
<textbox id="hudbookmark-name"/>
</row>
<row>
<label value="Folder:" for="hudbookmark-folder"/>
<textbox id="hudbookmark-folder"/>
</row>
<row>
<label value="Tags:" for="hudbookmark-tags"/>
<textbox id="hudbookmark-tags"/>
</row>
</rows>
</grid>
</hbox>
<separator />
<hbox>
<button label="Remove Bookmark" oncommand="BookmarkHelper.remove()"/>
<spacer flex="1"/>
<button label="Cancel" oncommand="BookmarkHelper.close()"/>
<button label="Done" oncommand="BookmarkHelper.save()"/>
</hbox>
</vbox>
<vbox id="hudexpand-container" hidden="true">
<hbox id="hudlist-container" flex="1">
<richlistbox id="hudlist-items" flex="1"/>
</hbox>
<separator class="thin"/>
<hbox id="hudbuttons" flex="1">
<button id="hudbuttons-bookmarks" label="Bookmarks" oncommand="HUDBar.showBookmarks()"/>
<spacer flex="1"/>
<hbox>
<image id="hudbuttons-close" onclick="HUDBar.hide()"/>
</hbox>
</hbox>
</vbox>
</vbox>
</panel>
<panel id="hudmenu" hidden="true">
<vbox id="hudmenu-container">
<grid id="hudmenu-grid">
<columns>
<column flex="1"/>
<column flex="1"/>
</columns>
<rows>
<row>
<button command="cmd_back"/>
<button command="cmd_forward"/>
</row>
<row>
<button command="cmd_newTab"/>
<button command="cmd_switchTab"/>
</row>
</rows>
</grid>
</vbox>
</panel>
</popupset>
</overlay>

View File

@ -1,287 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Mobile Browser.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Finkle <mfinkle@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const TOOLBARSTATE_LOADING = 1;
const TOOLBARSTATE_LOADED = 2;
const TOOLBARSTATE_TYPING = 3;
const TOOLBARSTATE_INDETERMINATE = 4;
var LocationBar = {
_urlbar : null,
_throbber : null,
_favicon : null,
_faviconAdded : false,
_linkAdded : function(aEvent) {
var link = aEvent.originalTarget;
var rel = link.rel && link.rel.toLowerCase();
if (!link || !link.ownerDocument || !rel || !link.href)
return;
var rels = rel.split(/\s+/);
if (rels.indexOf("icon") != -1) {
this._favicon.setAttribute("src", link.href);
this._throbber.setAttribute("src", "");
this._faviconAdded = true;
}
},
init : function() {
this._urlbar = document.getElementById("urlbar");
this._urlbar.addEventListener("focus", this, false);
this._urlbar.addEventListener("input", this, false);
this._throbber = document.getElementById("urlbar-throbber");
this._favicon = document.getElementById("urlbar-favicon");
this._favicon.addEventListener("error", this, false);
Browser.content.addEventListener("DOMLinkAdded", this, true);
},
update : function(aState) {
var go = document.getElementById("cmd_go");
var search = document.getElementById("cmd_search");
var reload = document.getElementById("cmd_reload");
var stop = document.getElementById("cmd_stop");
if (aState == TOOLBARSTATE_INDETERMINATE) {
this._faviconAdded = false;
aState = TOOLBARSTATE_LOADED;
this.setURI();
}
if (aState == TOOLBARSTATE_LOADING) {
go.collapsed = true;
search.collapsed = true;
reload.collapsed = true;
stop.collapsed = false;
this._throbber.setAttribute("src", "chrome://browser/skin/images/throbber.gif");
this._favicon.setAttribute("src", "");
this._faviconAdded = false;
}
else if (aState == TOOLBARSTATE_LOADED) {
go.collapsed = true;
search.collapsed = true;
reload.collapsed = false;
stop.collapsed = true;
this._throbber.setAttribute("src", "");
if (this._faviconAdded == false) {
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var faviconURI = ios.newURI(Browser.content.browser.currentURI.prePath + "/favicon.ico", null, null);
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
if (fis.isFailedFavicon(faviconURI))
faviconURI = ios.newURI("chrome://browser/skin/images/default-favicon.png", null, null);
this._favicon.setAttribute("src", faviconURI.spec);
this._faviconAdded = true;
}
}
else if (aState == TOOLBARSTATE_TYPING) {
reload.collapsed = true;
stop.collapsed = true;
go.collapsed = false;
search.collapsed = false;
this._throbber.setAttribute("src", "chrome://browser/skin/images/throbber.png");
this._favicon.setAttribute("src", "");
}
},
_URIFixup: null,
/* Set the location to the current content */
setURI : function() {
// Update UI for history
var browser = Browser.content.browser;
var back = document.getElementById("cmd_back");
var forward = document.getElementById("cmd_forward");
back.setAttribute("disabled", !browser.canGoBack);
forward.setAttribute("disabled", !browser.canGoForward);
// Check for a bookmarked page
var star = document.getElementById("tool_star");
star.removeAttribute("starred");
var bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
var bookmarks = bms.getBookmarkIdsForURI(browser.currentURI, {});
if (bookmarks.length > 0) {
star.setAttribute("starred", "true");
}
var uri = browser.currentURI;
if (!this._URIFixup)
this._URIFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
try {
uri = this._URIFixup.createExposableURI(uri);
} catch (ex) {}
var urlString = uri.spec;
if (urlString == "about:blank") {
urlString = "";
this._urlbar.focus();
}
this._urlbar.value = urlString;
},
revertURI : function() {
// Reset the current URI from the browser if the histroy list is not open
if (this._urlbar.popupOpen == false)
this.setURI();
// If the value isn't empty and the urlbar has focus, select the value.
if (this._urlbar.value && this._urlbar.hasAttribute("focused"))
this._urlbar.select();
return (this._urlbar.popupOpen == false);
},
goToURI : function() {
getBrowser().loadURI(this._urlbar.value, null, null, false);
},
search : function() {
var queryURI = "http://www.google.com/search?q=" + this._urlbar.value + "&hl=en&lr=&btnG=Search";
getBrowser().loadURI(queryURI, null, null, false);
},
getURLBar : function() {
return this._urlbar;
},
handleEvent: function (aEvent) {
switch (aEvent.type) {
case "DOMLinkAdded":
this._linkAdded(aEvent);
break;
case "focus":
setTimeout(function() { aEvent.target.select(); }, 0);
break;
case "input":
this.update(TOOLBARSTATE_TYPING);
break;
case "error":
this._favicon.setAttribute("src", "chrome://browser/skin/images/default-favicon.png");
break;
}
},
supportsCommand : function(cmd) {
var isSupported = false;
switch (cmd) {
case "cmd_back":
case "cmd_forward":
case "cmd_reload":
case "cmd_stop":
case "cmd_search":
case "cmd_go":
case "cmd_star":
case "cmd_bookmarks":
isSupported = true;
break;
default:
isSupported = false;
break;
}
return isSupported;
},
isCommandEnabled : function(cmd) {
return true;
},
doCommand : function(cmd) {
var browser = Browser.content.browser;
switch (cmd) {
case "cmd_back":
browser.stop();
browser.goBack();
break;
case "cmd_forward":
browser.stop();
browser.goForward();
break;
case "cmd_reload":
browser.reload();
break;
case "cmd_stop":
browser.stop();
break;
case "cmd_search":
{
this.search();
break;
}
case "cmd_go":
{
this.goToURI();
break;
}
case "cmd_star":
{
var bookmarkURI = browser.currentURI;
var bookmarkTitle = browser.contentDocument.title;
var bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
if (bookmarks.getBookmarkIdsForURI(bookmarkURI, {}).length == 0) {
var bookmarkId = bookmarks.insertBookmark(bookmarks.bookmarksMenuFolder, bookmarkURI, bookmarks.DEFAULT_INDEX, bookmarkTitle);
document.getElementById("tool_star").setAttribute("starred", "true");
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
var favicon = document.getElementById("urlbar-favicon");
var faviconURI = ios.newURI(favicon.src, null, null);
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
fis.setAndLoadFaviconForPage(bookmarkURI, faviconURI, true);
}
else {
Bookmarks.edit(bookmarkURI);
}
break;
}
case "cmd_bookmarks":
Bookmarks.list();
break;
}
}
};

View File

@ -1,111 +0,0 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Mobile Browser.
-
- The Initial Developer of the Original Code is
- Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2008
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Mark Finkle <mfinkle@mozila.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay SYSTEM "chrome://browser/locale/toolbar.dtd">
<overlay id="toolbar-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/toolbar.js"/>
<commandset id="cmdset_main">
<command id="cmd_back" label="&back.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_forward" label="&forward.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_reload" label="&reload.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_stop" label="&stop.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_search" label="&search.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_go" label="&go.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_star" label="&star.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_bookmarks" label="&bookmarks.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
</commandset>
<popupset id="mainPopupSet">
<!-- Popup for site identity information -->
<panel id="identity-popup" position="after_start" hidden="true" noautofocus="true"
norestorefocus="true">
<hbox id="identity-popup-container" align="top">
<image id="identity-popup-icon"/>
<vbox id="identity-popup-content-box">
<label id="identity-popup-connectedToLabel" value="&identity.connectedTo;"/>
<label id="identity-popup-connectedToLabel2"
value="&identity.unverifiedsite2;"/>
<description id="identity-popup-content-host"/>
<label id="identity-popup-runByLabel" value="&identity.runBy;"/>
<description id="identity-popup-content-owner"/>
<description id="identity-popup-content-supplemental"/>
<description id="identity-popup-content-verifier"/>
<hbox id="identity-popup-encryption" flex="1">
<vbox>
<image id="identity-popup-encryption-icon"/>
<spacer flex="1"/>
</vbox>
<description id="identity-popup-encryption-label" flex="1"/>
</hbox>
</vbox>
</hbox>
</panel>
</popupset>
<toolbox insertbefore="browser">
<toolbar id="toolbar_main" mode="icons">
<toolbarbutton id="tool_back" command="cmd_back"/>
<toolbarbutton id="tool_forward" command="cmd_forward"/>
<toolbaritem id="urlbar-container" flex="1">
<box id="identity-box"
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
<stack id="urlbar-image-stack">
<image id="urlbar-throbber" src="throbber.png"/>
<image id="urlbar-favicon" src=""/>
</stack>
</box>
<textbox id="urlbar" type="autocomplete" autocompletesearch="history" enablehistory="false" maxrows="6" completeselectedindex="true" flex="1"
ontextentered="LocationBar.goToURI();" ontextreverted="LocationBar.revertURI();"/>
<hbox id="urlbar-icons">
<toolbarbutton id="tool_search" command="cmd_search"/>
<toolbarbutton id="tool_go" command="cmd_go"/>
<toolbarbutton id="tool_reload" command="cmd_reload"/>
<toolbarbutton id="tool_stop" command="cmd_stop"/>
</hbox>
</toolbaritem>
<toolbarbutton id="tool_star" command="cmd_star"/>
<toolbarbutton id="tool_bookmarks" command="cmd_bookmarks"/>
</toolbar>
</toolbox>
</overlay>

View File

@ -1,6 +0,0 @@
<!ENTITY editBookmark.title "Edit Bookmark">
<!ENTITY bookmarkURL.label "Address:">
<!ENTITY bookmarkName.label "Name:">
<!ENTITY removeBookmark.label "Remove Bookmark">
<!ENTITY saveBookmark.label "Done">
<!ENTITY closeBookmark.label "Cancel">

View File

@ -1,16 +0,0 @@
<!ENTITY back.label "Back">
<!ENTITY back.tooltip "Back">
<!ENTITY forward.label "Forward">
<!ENTITY forward.tooltip "Forward">
<!ENTITY reload.label "Reload">
<!ENTITY reload.tooltip "Reload">
<!ENTITY stop.label "Stop">
<!ENTITY stop.tooltip "Stop">
<!ENTITY search.label "Search">
<!ENTITY search.tooltip "Search">
<!ENTITY go.label "Go">
<!ENTITY go.tooltip "Go">
<!ENTITY star.label "Star">
<!ENTITY star.tooltip "Bookmark this page">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY bookmarks.tooltip "View bookmarks">

View File

@ -1,31 +0,0 @@
<!ENTITY back.label "Back">
<!ENTITY back.tooltip "Back">
<!ENTITY forward.label "Forward">
<!ENTITY forward.tooltip "Forward">
<!ENTITY reload.label "Reload">
<!ENTITY reload.tooltip "Reload">
<!ENTITY stop.label "Stop">
<!ENTITY stop.tooltip "Stop">
<!ENTITY search.label "Search">
<!ENTITY search.tooltip "Search">
<!ENTITY go.label "Go">
<!ENTITY go.tooltip "Go">
<!ENTITY star.label "Star">
<!ENTITY star.tooltip "Bookmark this page">
<!ENTITY bookmarks.label "Bookmarks">
<!ENTITY bookmarks.tooltip "View bookmarks">
<!ENTITY identity.unverifiedsite2 "This web site does not supply identity information.">
<!ENTITY identity.connectedTo "You are connected to">
<!-- Localization note (identity.runBy) : This string appears between a
domain name (above) and an organization name (below). E.g.
example.com
which is run by
Example Enterprises, Inc.
The layout of the identity dialog prevents combining this into a single string with
substitution variables. If it is difficult to translate the sense of the string
with that structure, consider a translation which ignores the preceding domain and
just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY identity.runBy "which is run by">

View File

@ -1,173 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Mobile Browser.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Finkle <mfinkle@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#hud-ui, #hudmenu {
-moz-appearance: none;
padding: 8px !important;
background-color: rgba(68,68,68,0.9);
border: 1px solid rgba(255,255,255,0.25);
-moz-border-radius: 14px;
color: #ffffff;
}
#hudbar-container toolbarbutton {
-moz-appearance: none !important;
-moz-box-orient: vertical;
min-width: 0px;
padding: 5px !important;
margin: 0px !important;
-moz-margin-end: 0px;
list-style-image: url("chrome://browser/skin/images/mono-toolbar.png");
}
/*
toolbarbutton .toolbarbutton-text {
display: none !important;
}
toolbarbutton:hover,
toolbarbutton:hover:active,
toolbarbutton[open="true"] {
border-color: transparent;
}
*/
#hudbar-reload {
-moz-image-region: rect(0px 108px 36px 72px);
}
#hudbar-stop {
-moz-image-region: rect(0px 216px 36px 180px);
}
#hudbar-star {
-moz-image-region: rect(0px 144px 36px 108px);
}
#hudbar-star[starred="true"] {
-moz-image-region: rect(0px 180px 36px 144px);
}
#hudbar-search {
-moz-image-region: rect(0px 36px 36px 0px);
}
#hudbar-go {
-moz-image-region: rect(0px 72px 36px 36px);
}
#hudbar-container[mode="loading"] > #hudbar-icons > #hudbar-go,
#hudbar-container[mode="loading"] > #hudbar-icons > #hudbar-search,
#hudbar-container[mode="loading"] > #hudbar-icons > #hudbar-reload,
#hudbar-container[mode="loading"] > #hudbar-icons > #hudbar-star {
visibility: collapse;
}
#hudbar-container[mode="view"] > #hudbar-icons > #hudbar-go,
#hudbar-container[mode="view"] > #hudbar-icons > #hudbar-search,
#hudbar-container[mode="view"] > #hudbar-icons > #hudbar-stop {
visibility: collapse;
}
#hudbar-container[mode="edit"] > #hudbar-icons > #hudbar-reload,
#hudbar-container[mode="edit"] > #hudbar-icons > #hudbar-star,
#hudbar-container[mode="edit"] > #hudbar-icons > #hudbar-stop {
visibility: collapse;
}
#hudbar-container {
-moz-box-align: center;
border: 1px solid transparent;
-moz-border-radius: 14px;
}
#hudbar-container[mode="edit"] {
-moz-box-orient: horizontal;
-moz-box-align: center;
background-color: #fff;
border-color: #000;
}
#hudbar-caption {
margin: 2px 8px 2px 8px;
}
#hudbar-edit {
-moz-appearance: none !important;
padding: 0px !important;
border: none !important;
}
#hudlist-items {
-moz-appearance: none !important;
background-color: transparent;
border: 2px solid #fff !important;
-moz-border-radius: 14px;
margin-top: 12px
}
.hudlist-item {
-moz-appearance: none !important;
margin: 8px;
color: #fff;
}
.hudlist-image {
width: 24px;
height: 24px;
}
/* favicon images are 16x16 */
#hudbar-image-stack {
width: 36px;
height: 36px;
margin: 2px 2px 2px 12px;
}
/* urlbar toolbuttons images are 36x36 */
#hudbar-icons {
height: 36px;
-moz-box-align: center;
-moz-padding-end: 2px;
}
#hudbuttons-close {
list-style-image: url(chrome://browser/skin/images/close-small.png);
}
#hudbookmark-grid row {
-moz-box-align: center;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB