зеркало из https://github.com/mozilla/pjs.git
merge commit for bug 440797
This commit is contained in:
Коммит
d070e1ac18
|
@ -42,6 +42,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = chrome app
|
||||
DIRS = chrome app components
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -161,3 +161,51 @@ pref("browser.search.suggest.enabled", true);
|
|||
// enable xul error pages
|
||||
pref("browser.xul.error_pages.enabled", true);
|
||||
|
||||
// Various and sundry awesomebar prefs (should remove/re-evaluate
|
||||
// these once bug 447900 is fixed)
|
||||
pref("browser.urlbar.clickSelectsAll", true);
|
||||
pref("browser.urlbar.doubleClickSelectsAll", false);
|
||||
pref("browser.urlbar.autoFill", false);
|
||||
pref("browser.urlbar.matchOnlyTyped", false);
|
||||
pref("browser.urlbar.matchBehavior", 1);
|
||||
pref("browser.urlbar.filter.javascript", true);
|
||||
pref("browser.urlbar.maxRichResults", 12);
|
||||
pref("browser.urlbar.search.chunkSize", 1000);
|
||||
pref("browser.urlbar.search.timeout", 100);
|
||||
pref("browser.urlbar.restrict.history", "^");
|
||||
pref("browser.urlbar.restrict.bookmark", "*");
|
||||
pref("browser.urlbar.restrict.tag", "+");
|
||||
pref("browser.urlbar.match.title", "#");
|
||||
pref("browser.urlbar.match.url", "@");
|
||||
pref("browser.history.grouping", "day");
|
||||
pref("browser.history.showSessions", false);
|
||||
pref("browser.sessionhistory.max_entries", 50);
|
||||
pref("browser.history_expire_days", 180);
|
||||
pref("browser.history_expire_days_min", 90);
|
||||
pref("browser.history_expire_sites", 40000);
|
||||
pref("privacy.item.history", true);
|
||||
pref("browser.places.migratePostDataAnnotations", true);
|
||||
pref("browser.places.updateRecentTagsUri", true);
|
||||
pref("places.frecency.numVisits", 10);
|
||||
pref("places.frecency.numCalcOnIdle", 50);
|
||||
pref("places.frecency.numCalcOnMigrate", 50);
|
||||
pref("places.frecency.updateIdleTime", 60000);
|
||||
pref("places.frecency.firstBucketCutoff", 4);
|
||||
pref("places.frecency.secondBucketCutoff", 14);
|
||||
pref("places.frecency.thirdBucketCutoff", 31);
|
||||
pref("places.frecency.fourthBucketCutoff", 90);
|
||||
pref("places.frecency.firstBucketWeight", 100);
|
||||
pref("places.frecency.secondBucketWeight", 70);
|
||||
pref("places.frecency.thirdBucketWeight", 50);
|
||||
pref("places.frecency.fourthBucketWeight", 30);
|
||||
pref("places.frecency.defaultBucketWeight", 10);
|
||||
pref("places.frecency.embedVisitBonus", 0);
|
||||
pref("places.frecency.linkVisitBonus", 100);
|
||||
pref("places.frecency.typedVisitBonus", 2000);
|
||||
pref("places.frecency.bookmarkVisitBonus", 150);
|
||||
pref("places.frecency.downloadVisitBonus", 0);
|
||||
pref("places.frecency.permRedirectVisitBonus", 0);
|
||||
pref("places.frecency.tempRedirectVisitBonus", 0);
|
||||
pref("places.frecency.defaultVisitBonus", 0);
|
||||
pref("places.frecency.unvisitedBookmarkBonus", 140);
|
||||
pref("places.frecency.unvisitedTypedBonus", 200);
|
||||
|
|
|
@ -39,10 +39,14 @@ const TOOLBARSTATE_LOADING = 1;
|
|||
const TOOLBARSTATE_LOADED = 2;
|
||||
const TOOLBARSTATE_INDETERMINATE = 3;
|
||||
|
||||
const PANELMODE_VIEW = 1;
|
||||
const PANELMODE_EDIT = 2;
|
||||
const PANELMODE_NONE = 0;
|
||||
const PANELMODE_URLVIEW = 1;
|
||||
const PANELMODE_URLEDIT = 2;
|
||||
const PANELMODE_BOOKMARK = 3;
|
||||
const PANELMODE_BOOKMARKLIST = 4;
|
||||
const PANELMODE_SIDEBAR = 5;
|
||||
const PANELMODE_TABLIST = 6;
|
||||
const PANELMODE_FULL = 7;
|
||||
|
||||
var BrowserUI = {
|
||||
_panel : null,
|
||||
|
@ -52,8 +56,6 @@ var BrowserUI = {
|
|||
_autocompleteNavbuttons : null,
|
||||
_favicon : null,
|
||||
_faviconAdded : false,
|
||||
_fadeoutID : null,
|
||||
_allowHide : true,
|
||||
|
||||
_titleChanged : function(aEvent) {
|
||||
if (aEvent.target != getBrowser().contentDocument)
|
||||
|
@ -147,6 +149,8 @@ var BrowserUI = {
|
|||
|
||||
getBrowser().addEventListener("DOMTitleChanged", this, true);
|
||||
getBrowser().addEventListener("DOMLinkAdded", this, true);
|
||||
Browser.content.addEventListener("overpan", this, false);
|
||||
Browser.content.addEventListener("pan", this, true);
|
||||
},
|
||||
|
||||
update : function(aState) {
|
||||
|
@ -158,7 +162,7 @@ var BrowserUI = {
|
|||
|
||||
var toolbar = document.getElementById("toolbar-main");
|
||||
if (aState == TOOLBARSTATE_LOADING) {
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
this.show(PANELMODE_URLVIEW);
|
||||
|
||||
toolbar.setAttribute("mode", "loading");
|
||||
this._throbber.setAttribute("src", "chrome://browser/skin/images/throbber.gif");
|
||||
|
@ -172,17 +176,12 @@ var BrowserUI = {
|
|||
var faviconURI = getBrowser().currentURI.prePath + "/favicon.ico";
|
||||
this._setIcon(faviconURI);
|
||||
}
|
||||
/*
|
||||
if (this._allowHide)
|
||||
this.hide(3000);
|
||||
this._allowHide = true;
|
||||
*/
|
||||
}
|
||||
},
|
||||
|
||||
/* Set the location to the current content */
|
||||
setURI : function() {
|
||||
var browser = getBrowser();
|
||||
var browser = Browser.currentBrowser;
|
||||
var back = document.getElementById("cmd_back");
|
||||
var forward = document.getElementById("cmd_forward");
|
||||
|
||||
|
@ -212,8 +211,7 @@ var BrowserUI = {
|
|||
var urlString = uri.spec;
|
||||
if (urlString == "about:blank") {
|
||||
urlString = "";
|
||||
this._showMode(PANELMODE_EDIT);
|
||||
this._allowHide = false;
|
||||
this.show(PANELMODE_URLEDIT);
|
||||
}
|
||||
|
||||
this._caption.value = urlString;
|
||||
|
@ -228,20 +226,21 @@ var BrowserUI = {
|
|||
|
||||
var flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
getBrowser().loadURIWithFlags(aURI, flags, null, null);
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
this.show(PANELMODE_URLVIEW);
|
||||
},
|
||||
|
||||
search : function() {
|
||||
var queryURI = "http://www.google.com/search?q=" + this._edit.value + "&hl=en&lr=&btnG=Search";
|
||||
getBrowser().loadURI(queryURI, null, null, false);
|
||||
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
this.show(PANELMODE_URLVIEW);
|
||||
},
|
||||
|
||||
sizeAutocompletePopup : function () {
|
||||
var rect = document.getElementById("browser-container").getBoundingClientRect();
|
||||
var toolbar = document.getElementById("toolbar-main");
|
||||
var popup = document.getElementById("popup_autocomplete");
|
||||
popup.height = rect.bottom - rect.top;
|
||||
popup.height = rect.bottom - rect.top - toolbar.boxObject.height;
|
||||
},
|
||||
|
||||
openDefaultHistory : function () {
|
||||
|
@ -296,44 +295,92 @@ var BrowserUI = {
|
|||
}
|
||||
},
|
||||
|
||||
_showMode : function(aMode) {
|
||||
if (this._fadeoutID) {
|
||||
clearTimeout(this._fadeoutID);
|
||||
this._fadeoutID = null;
|
||||
}
|
||||
mode : PANELMODE_NONE,
|
||||
show : function(aMode) {
|
||||
if (this.mode == aMode)
|
||||
return;
|
||||
this.mode = aMode;
|
||||
|
||||
var toolbar = document.getElementById("toolbar-main");
|
||||
var bookmark = document.getElementById("bookmark-container");
|
||||
var urllist = document.getElementById("urllist-container");
|
||||
if (aMode == PANELMODE_VIEW) {
|
||||
var sidebar = document.getElementById("browser-controls");
|
||||
var tablist = document.getElementById("tab-list-container");
|
||||
var container = document.getElementById("browser-container");
|
||||
|
||||
// Make sure the UI elements are sized correctly since the window size can change
|
||||
sidebar.left = toolbar.width = container.boxObject.width;
|
||||
sidebar.height = tablist.height = container.boxObject.height - toolbar.boxObject.height;
|
||||
|
||||
if (aMode == PANELMODE_URLVIEW || aMode == PANELMODE_SIDEBAR ||
|
||||
aMode == PANELMODE_TABLIST || aMode == PANELMODE_FULL)
|
||||
{
|
||||
toolbar.setAttribute("mode", "view");
|
||||
toolbar.top = 0;
|
||||
|
||||
this._edit.hidden = true;
|
||||
this._edit.reallyClosePopup();
|
||||
this._caption.hidden = false;
|
||||
bookmark.hidden = true;
|
||||
urllist.hidden = true;
|
||||
|
||||
let sidebarTo = toolbar.boxObject.width;
|
||||
let tablistTo = -tablist.boxObject.width;
|
||||
if (aMode == PANELMODE_SIDEBAR || aMode == PANELMODE_FULL)
|
||||
sidebarTo -= sidebar.boxObject.width;
|
||||
if (aMode == PANELMODE_TABLIST || aMode == PANELMODE_FULL)
|
||||
tablistTo = 0;
|
||||
sidebar.left = sidebarTo;
|
||||
tablist.left = tablistTo;
|
||||
}
|
||||
else if (aMode == PANELMODE_EDIT) {
|
||||
else if (aMode == PANELMODE_URLEDIT) {
|
||||
toolbar.setAttribute("mode", "edit");
|
||||
toolbar.top = 0;
|
||||
this._caption.hidden = true;
|
||||
this._edit.hidden = false;
|
||||
this._edit.focus();
|
||||
|
||||
bookmark.hidden = true;
|
||||
urllist.hidden = true;
|
||||
sidebar.left = toolbar.boxObject.width;
|
||||
tablist.left = -tablist.boxObject.width;
|
||||
}
|
||||
else if (aMode == PANELMODE_BOOKMARK) {
|
||||
toolbar.top = 0;
|
||||
toolbar.setAttribute("mode", "view");
|
||||
this._edit.hidden = true;
|
||||
this._edit.reallyClosePopup();
|
||||
this._caption.hidden = false;
|
||||
|
||||
urllist.hidden = true;
|
||||
sidebar.left = toolbar.boxObject.width;
|
||||
tablist.left = -tablist.boxObject.width;
|
||||
|
||||
bookmark.hidden = false;
|
||||
bookmark.width = container.boxObject.width;
|
||||
}
|
||||
else if (aMode == PANELMODE_BOOKMARKLIST) {
|
||||
toolbar.top = 0;
|
||||
toolbar.setAttribute("mode", "view");
|
||||
this._edit.hidden = true;
|
||||
this._edit.reallyClosePopup();
|
||||
this._caption.hidden = false;
|
||||
|
||||
bookmark.hidden = true;
|
||||
sidebar.left = toolbar.boxObject.width;
|
||||
tablist.left = -tablist.boxObject.width;
|
||||
|
||||
urllist.hidden = false;
|
||||
urllist.width = container.boxObject.width;
|
||||
urllist.height = container.boxObject.height - toolbar.boxObject.height;
|
||||
}
|
||||
else if (aMode == PANELMODE_NONE) {
|
||||
toolbar.top = -toolbar.boxObject.height;
|
||||
sidebar.left = toolbar.boxObject.width;
|
||||
tablist.left = -tablist.boxObject.width;
|
||||
|
||||
this._edit.reallyClosePopup();
|
||||
urllist.hidden = true;
|
||||
bookmark.hidden = true;
|
||||
}
|
||||
},
|
||||
|
@ -379,24 +426,20 @@ var BrowserUI = {
|
|||
},
|
||||
|
||||
showBookmarks : function () {
|
||||
this.show(PANELMODE_BOOKMARKLIST);
|
||||
|
||||
var bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
|
||||
this._showPlaces(this._getBookmarks([bms.bookmarksMenuFolder]));
|
||||
},
|
||||
|
||||
show : function() {
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
newTab : function() {
|
||||
Browser.content.newTab(true);
|
||||
this.show(PANELMODE_URLEDIT);
|
||||
},
|
||||
|
||||
hide : function(aFadeout) {
|
||||
if (!aFadeout) {
|
||||
//FIXME hide toolbar stuff
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
}
|
||||
else {
|
||||
//FIXME animate the close
|
||||
//var self = this;
|
||||
//this.fadeoutID = setTimeout(function() { self.hide(); }, aFadeout);
|
||||
}
|
||||
selectTab : function(aTab) {
|
||||
Browser.content.selectTab(aTab);
|
||||
this.show(PANELMODE_NONE);
|
||||
},
|
||||
|
||||
handleEvent: function (aEvent) {
|
||||
|
@ -410,7 +453,7 @@ var BrowserUI = {
|
|||
break;
|
||||
// URL textbox events
|
||||
case "click":
|
||||
this._showMode(PANELMODE_EDIT);
|
||||
this.show(PANELMODE_URLEDIT);
|
||||
this.openDefaultHistory();
|
||||
break;
|
||||
case "input":
|
||||
|
@ -422,13 +465,31 @@ var BrowserUI = {
|
|||
case "keypress":
|
||||
if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
|
||||
this._edit.reallyClosePopup();
|
||||
this._showMode(PANELMODE_VIEW);
|
||||
this.show(PANELMODE_URLVIEW);
|
||||
}
|
||||
break;
|
||||
// Favicon events
|
||||
case "error":
|
||||
this._favicon.setAttribute("src", "chrome://browser/skin/images/default-favicon.png");
|
||||
break;
|
||||
case "pan": {
|
||||
// Default to hide the controls when user pans
|
||||
let mode = PANELMODE_NONE;
|
||||
// Open the urlbar controls if browser is at top of content
|
||||
if (Browser.content.scrollY == 0)
|
||||
mode = PANELMODE_URLVIEW
|
||||
|
||||
this.show(mode);
|
||||
break;
|
||||
}
|
||||
case "overpan":
|
||||
// Open the sidebar controls if we get a right side overpan
|
||||
if (aEvent.detail == 2)
|
||||
this.show(PANELMODE_SIDEBAR);
|
||||
// Close the sidebar controls if we get a left side overpan
|
||||
else if (aEvent.detail == 1)
|
||||
this.show(PANELMODE_TABLIST);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -443,6 +504,9 @@ var BrowserUI = {
|
|||
case "cmd_go":
|
||||
case "cmd_star":
|
||||
case "cmd_bookmarks":
|
||||
case "cmd_menu":
|
||||
case "cmd_newTab":
|
||||
case "cmd_closeTab":
|
||||
isSupported = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -494,17 +558,29 @@ var BrowserUI = {
|
|||
|
||||
var fis = Cc["@mozilla.org/browser/favicon-service;1"].getService(Ci.nsIFaviconService);
|
||||
fis.setAndLoadFaviconForPage(bookmarkURI, faviconURI, true);
|
||||
|
||||
this.show(PANELMODE_NONE);
|
||||
}
|
||||
else {
|
||||
this._showMode(PANELMODE_BOOKMARK);
|
||||
this.show(PANELMODE_BOOKMARK);
|
||||
BookmarkHelper.edit(bookmarkURI);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "cmd_bookmarks":
|
||||
this._showMode(PANELMODE_BOOKMARKLIST);
|
||||
this.showBookmarks();
|
||||
break;
|
||||
case "cmd_menu":
|
||||
if (this.mode == PANELMODE_FULL)
|
||||
this.show(PANELMODE_NONE);
|
||||
else
|
||||
this.show(PANELMODE_FULL);
|
||||
break;
|
||||
case "cmd_newTab":
|
||||
this.newTab();
|
||||
break;
|
||||
case "cmd_closeTab":
|
||||
Browser.content.removeTab(Browser.content.browser);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -589,7 +665,7 @@ var BookmarkHelper = {
|
|||
close : function() {
|
||||
window.removeEventListener("keypress", this, true);
|
||||
this._item = null;
|
||||
BrowserUI.hide();
|
||||
BrowserUI.show(PANELMODE_NONE);
|
||||
},
|
||||
|
||||
handleEvent: function (aEvent) {
|
||||
|
|
|
@ -101,9 +101,9 @@ var Browser = {
|
|||
return new ProgressController(content, browser);
|
||||
};
|
||||
|
||||
this._content.tabList = document.getElementById("tab-list");
|
||||
this._content.newTab(true);
|
||||
this._content.addEventListener("DOMTitleChanged", this, true);
|
||||
this._content.addEventListener("overpan", this, false);
|
||||
this._content.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);
|
||||
BrowserUI.init();
|
||||
|
||||
|
@ -148,7 +148,8 @@ var Browser = {
|
|||
} catch (e) {}
|
||||
|
||||
if (whereURI) {
|
||||
this.currentBrowser.loadURI(whereURI, null, null, false);
|
||||
var self = this;
|
||||
setTimeout(function() { self.currentBrowser.loadURI(whereURI, null, null, false); }, 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -212,26 +213,15 @@ var Browser = {
|
|||
case "DOMTitleChanged":
|
||||
this._titleChanged(aEvent);
|
||||
break;
|
||||
case "overpan":
|
||||
// Open the sidebar controls if we get a right side overpan
|
||||
if (aEvent.detail == 2)
|
||||
document.getElementById("browser-controls").collapsed = false;
|
||||
// Close the sidebar controls if we get a left side overpan
|
||||
else if (aEvent.detail == 1)
|
||||
document.getElementById("browser-controls").collapsed = true;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
supportsCommand : function(cmd) {
|
||||
var isSupported = false;
|
||||
switch (cmd) {
|
||||
case "cmd_menu":
|
||||
case "cmd_fullscreen":
|
||||
case "cmd_addons":
|
||||
case "cmd_downloads":
|
||||
case "cmd_newTab":
|
||||
case "cmd_closeTab":
|
||||
isSupported = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -247,13 +237,8 @@ var Browser = {
|
|||
|
||||
doCommand : function(cmd) {
|
||||
var browser = this.content.browser;
|
||||
var controls = document.getElementById("browser-controls");
|
||||
|
||||
switch (cmd) {
|
||||
case "cmd_menu":
|
||||
this.content.tabListVisible = !this.content.tabListVisible;
|
||||
controls.collapsed = !controls.collapsed;
|
||||
break;
|
||||
case "cmd_fullscreen":
|
||||
window.fullScreen = !window.fullScreen;
|
||||
break;
|
||||
|
@ -285,11 +270,6 @@ var Browser = {
|
|||
case "cmd_downloads":
|
||||
Cc["@mozilla.org/download-manager-ui;1"].getService(Ci.nsIDownloadManagerUI).show(window);
|
||||
break;
|
||||
case "cmd_newTab":
|
||||
this.newTab();
|
||||
break;
|
||||
case "cmd_closeTab":
|
||||
this.content.removeTab(this.content.browser);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -297,11 +277,6 @@ var Browser = {
|
|||
return document.getElementById("notifications");
|
||||
},
|
||||
|
||||
newTab: function() {
|
||||
this.content.newTab(true);
|
||||
BrowserUI._showMode(PANELMODE_EDIT);
|
||||
},
|
||||
|
||||
findState: FINDSTATE_FIND,
|
||||
openFind: function(aState) {
|
||||
this.findState = aState;
|
||||
|
@ -326,7 +301,32 @@ var Browser = {
|
|||
findbar.onFindCommand();
|
||||
else
|
||||
findbar.onFindAgainCommand(Browser.findState == FINDSTATE_FIND_PREVIOUS);
|
||||
}
|
||||
},
|
||||
translatePhoneNumbers: function(){
|
||||
let doc = getBrowser().contentDocument;
|
||||
let textnodes = doc.evaluate("//text()",
|
||||
doc,
|
||||
null,
|
||||
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
|
||||
null);
|
||||
let s, node, lastLastIndex;
|
||||
let re = /(\+?1? ?-?\(?\d{3}\)?[ +-\.]\d{3}[ +-\.]\d{4})/
|
||||
for (var i = 0; i < textnodes.snapshotLength; i++) {
|
||||
node = textnodes.snapshotItem(i);
|
||||
s = node.data;
|
||||
if(s.match(re)){
|
||||
s = s.replace(re,"<a href='tel:$1'> $1 </a>");
|
||||
try{
|
||||
let replacement = doc.createElement("span");
|
||||
replacement.innerHTML = s;
|
||||
node.parentNode.insertBefore(replacement,node);
|
||||
node.parentNode.removeChild(node);
|
||||
}catch(e){
|
||||
//do nothing, but continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function ProgressController(aTabBrowser, aBrowser) {
|
||||
|
@ -364,6 +364,7 @@ ProgressController.prototype = {
|
|||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT) {
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||
aWebProgress.DOMWindow.focus();
|
||||
Browser.translatePhoneNumbers();
|
||||
this._tabbrowser.updateBrowser(this._browser, true);
|
||||
this._tabbrowser.updateCanvasState(true);
|
||||
//aWebProgress.DOMWindow.scrollbars.visible = false;
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
<command id="cmd_search" label="&search.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_go" label="&go.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
|
||||
<!-- tabs -->
|
||||
<command id="cmd_newTab" label="&newtab.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_closeTab" label="&closetab.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
|
||||
|
@ -102,14 +103,13 @@
|
|||
<command id="cmd_delete" label="&delete.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
<command id="cmd_selectAll" label="&selectAll.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
|
||||
<!-- find -->
|
||||
<command id="cmd_find" oncommand="Browser.openFind(FINDSTATE_FIND);"/>
|
||||
<command id="cmd_findAgain" oncommand="Browser.openFind(FINDSTATE_FIND_AGAIN);"/>
|
||||
<command id="cmd_findPrevious" oncommand="Browser.openFind(FINDSTATE_FIND_PREVIOUS);"/>
|
||||
</commandset>
|
||||
|
||||
<keyset id="mainKeyset">
|
||||
<key id="key_menu" keycode="T" modifiers="accel" command="cmd_newTab"/>
|
||||
|
||||
<!-- basic navigation -->
|
||||
<key id="key_back" keycode="VK_LEFT" command="cmd_back" modifiers="control"/>
|
||||
<key id="key_forward" keycode="VK_RIGHT" command="cmd_forward" modifiers="control"/>
|
||||
|
@ -127,6 +127,11 @@
|
|||
<key id="key_addons" key="E" command="cmd_addons" modifiers="control"/>
|
||||
<key id="key_downloads" key="J" command="cmd_downloads" modifiers="control"/>
|
||||
|
||||
<!-- tabs -->
|
||||
<key id="key_newTab" keycode="T" modifiers="accel" command="cmd_newTab"/>
|
||||
<key id="key_closeTab" keycode="W" modifiers="accel" command="cmd_closeTab"/>
|
||||
|
||||
<!-- find -->
|
||||
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
|
||||
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
|
||||
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
|
||||
|
@ -171,8 +176,28 @@
|
|||
</panel>
|
||||
</popupset>
|
||||
|
||||
<toolbox id="toolbox-main">
|
||||
<toolbar id="toolbar-main">
|
||||
<stack id="browser-container" flex="1" style="overflow: hidden;">
|
||||
<vbox id="browser">
|
||||
<notificationbox id="notifications" flex="1">
|
||||
<deckbrowser id="content" autocompletepopup="popup_autocomplete_content" flex="1"
|
||||
onnewtab="CommandUpdater.doCommand('cmd_newTab');"/>
|
||||
</notificationbox>
|
||||
</vbox>
|
||||
|
||||
<vbox id="browser-controls" style="-moz-stack-sizing: ignore; width: 80px;" top="60" left="0">
|
||||
<toolbarbutton id="tool-back" class="browser-control-button" command="cmd_back"/>
|
||||
<toolbarbutton id="tool-forward" class="browser-control-button" command="cmd_forward"/>
|
||||
<toolbarbutton id="tool-star" class="browser-control-button" command="cmd_star"/>
|
||||
<toolbarbutton id="tool-bookmarks" class="browser-control-button" command="cmd_bookmarks"/>
|
||||
<toolbarbutton id="tool-actions" class="browser-control-button" command="cmd_actions"/>
|
||||
</vbox>
|
||||
|
||||
<vbox id="tab-list-container" style="-moz-stack-sizing: ignore;" top="60" left="0">
|
||||
<richlistbox id="tab-list" onselect="BrowserUI.selectTab(this.selectedItem);"/>
|
||||
<button id="newtab-button" label="+" command="cmd_newTab"/>
|
||||
</vbox>
|
||||
|
||||
<toolbar id="toolbar-main" style="-moz-stack-sizing: ignore; height: 60px;" top="0" left="0">
|
||||
<hbox id="urlbar-container" flex="1">
|
||||
<box id="identity-box"
|
||||
onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
|
||||
|
@ -202,36 +227,14 @@
|
|||
<toolbarbutton id="tool-go" class="urlbar-icon-button" command="cmd_go"/>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<stack flex="1">
|
||||
<hbox id="browser-container" flex="1">
|
||||
<vbox id="browser" flex="1">
|
||||
<notificationbox id="notifications" flex="1">
|
||||
<deckbrowser id="content" autocompletepopup="popup_autocomplete_content" flex="1"
|
||||
onnewtab="Browser.newTab()"/>
|
||||
</notificationbox>
|
||||
</vbox>
|
||||
<vbox id="browser-controls" collapsed="true">
|
||||
<toolbarbutton id="tool-back" class="browser-control-button" command="cmd_back"/>
|
||||
<toolbarbutton id="tool-forward" class="browser-control-button" command="cmd_forward"/>
|
||||
<toolbarbutton id="tool-star" class="browser-control-button" command="cmd_star"/>
|
||||
<toolbarbutton id="tool-bookmarks" class="browser-control-button" command="cmd_bookmarks"/>
|
||||
<toolbarbutton id="tool-actions" class="browser-control-button" command="cmd_actions"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<vbox id="urllist-container" flex="1" hidden="true">
|
||||
<vbox id="urllist-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
|
||||
<hbox id="urllist-items-container" flex="1">
|
||||
<richlistbox id="urllist-items" flex="1"/>
|
||||
</hbox>
|
||||
<separator class="thin"/>
|
||||
<hbox id="urllist-search">
|
||||
<image class="tool-search"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<vbox id="bookmark-container" flex="1" hidden="true">
|
||||
<vbox id="bookmark-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
|
||||
<vbox id="bookmark-form">
|
||||
<hbox align="start">
|
||||
<image id="bookmark-image" src="chrome://browser/skin/images/starred48.png"/>
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
|
||||
<binding id="deckbrowser">
|
||||
<content>
|
||||
<xul:vbox class="tab-list-container" collapsed="true">
|
||||
<xul:richlistbox anonid="tab-list" class="tab-list"
|
||||
onselect="this.parentNode.parentNode.selectTab(this.selectedItem)"/>
|
||||
<xul:button class="newtab-button" label="+" xbl:inherits="oncommand=onnewtab"/>
|
||||
</xul:vbox>
|
||||
<xul:deck flex="1" selectedIndex="0">
|
||||
<xul:stack anonid="cstack" flex="1" style="overflow: hidden;">
|
||||
<html:canvas anonid="ccanvas"
|
||||
|
@ -88,14 +83,9 @@
|
|||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="tabList" readonly="true">
|
||||
<getter>
|
||||
return document.getAnonymousElementByAttribute(this, "anonid", "tab-list");
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="tabListVisible" onget="return !this.tabList.parentNode.collapsed"
|
||||
onset="this.tabList.parentNode.collapsed = !val; return val;"/>
|
||||
<field name="tabList">
|
||||
null
|
||||
</field>
|
||||
|
||||
<field name="progressListenerCreator"/>
|
||||
|
||||
|
@ -640,6 +630,18 @@
|
|||
]]></getter>
|
||||
</property>
|
||||
|
||||
<property name="scrollX" readonly="true">
|
||||
<getter><![CDATA[
|
||||
return this.dragData.pageX - this.dragData.dragX / this._zoomLevel;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<property name="scrollY" readonly="true">
|
||||
<getter><![CDATA[
|
||||
return this.dragData.pageY - this.dragData.dragY / this._zoomLevel;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<field name="_fireOverpan">
|
||||
0
|
||||
</field>
|
||||
|
@ -720,14 +722,19 @@
|
|||
<parameter name="aDx"/>
|
||||
<parameter name="aDy"/>
|
||||
<body><![CDATA[
|
||||
// constrain offsets to the actual scrollWidth/scrollHeight
|
||||
var [x, y] = this._constrainPanCoords(aDx, aDy);
|
||||
// Fire the panning event
|
||||
var event = document.createEvent("UIEvents");
|
||||
event.initUIEvent("pan", true, true, window, 0);
|
||||
if (this.dispatchEvent(event)) {
|
||||
// Constrain offsets to the actual scrollWidth/scrollHeight
|
||||
var [x, y] = this._constrainPanCoords(aDx, aDy);
|
||||
|
||||
// Canvas needs to move up for content to scroll down
|
||||
this.dragData.dragX = -x;
|
||||
this.dragData.dragY = -y;
|
||||
// Canvas needs to move up for content to scroll down
|
||||
this.dragData.dragX = -x;
|
||||
this.dragData.dragY = -y;
|
||||
|
||||
this._updateCanvasPosition();
|
||||
this._updateCanvasPosition();
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<!ENTITY bookmarks.tooltip "View bookmarks">
|
||||
|
||||
<!ENTITY newtab.label "New Tab">
|
||||
<!ENTITY closetab.label "Close Tab">
|
||||
<!ENTITY closetab.label "Close Tab">
|
||||
|
||||
<!ENTITY cut.label "Cut">
|
||||
<!ENTITY copy.label "Copy">
|
||||
|
|
|
@ -248,11 +248,11 @@ toolbarbutton.browser-control-button {
|
|||
|
||||
/* tab list */
|
||||
|
||||
.tab-list-container {
|
||||
#tab-list-container {
|
||||
background-color: rgb(123,125,123);
|
||||
}
|
||||
|
||||
.tab-list {
|
||||
#tab-list {
|
||||
-moz-appearance: none;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
|
@ -271,10 +271,9 @@ richlistitem[type="documenttab"][selected="true"] {
|
|||
border: 1px solid white !important;
|
||||
}
|
||||
|
||||
.newtab-button {
|
||||
#newtab-button {
|
||||
-moz-appearance: none;
|
||||
background-color: rgba(207,207,207,0.9);
|
||||
font-size: 24pt;
|
||||
}
|
||||
|
||||
/* autocomplete */
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
# ***** 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.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# the Mozilla Foundation <http://www.mozilla.org/>.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2007
|
||||
# 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 *****
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = browsercomps
|
||||
XPIDL_MODULE = browsercompsbase
|
||||
|
||||
#XPIDLSRCS = \
|
||||
# $(NULL)
|
||||
|
||||
#EXTRA_PP_COMPONENTS = \
|
||||
# $(NULL)
|
||||
|
||||
DIRS = protocols \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -0,0 +1,49 @@
|
|||
# ***** 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.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# the Mozilla Foundation <http://www.mozilla.org/>.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2008
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Brad Lassey <blassey@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 *****
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = protocols
|
||||
|
||||
EXTRA_COMPONENTS = nsTelProtocolHandler.js
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -0,0 +1,85 @@
|
|||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
|
||||
|
||||
const kSCHEME = "tel";
|
||||
const kPROTOCOL_NAME = "Tel Protocol";
|
||||
const kPROTOCOL_CONTRACTID = "@mozilla.org/network/protocol;1?name=" + kSCHEME;
|
||||
const kPROTOCOL_CID = Components.ID("d4bc06cc-fa9f-48ce-98e4-5326ca96ba28");
|
||||
|
||||
// Mozilla defined
|
||||
const kSIMPLEURI_CONTRACTID = "@mozilla.org/network/simple-uri;1";
|
||||
const kIOSERVICE_CONTRACTID = "@mozilla.org/network/io-service;1";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
|
||||
|
||||
function TelProtocol()
|
||||
{
|
||||
}
|
||||
|
||||
TelProtocol.prototype =
|
||||
{
|
||||
|
||||
classDescription: "Handler for tel URIs",
|
||||
classID: Components.ID(kPROTOCOL_CID),
|
||||
contractID: kPROTOCOL_CONTRACTID,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]),
|
||||
|
||||
|
||||
scheme: kSCHEME,
|
||||
defaultPort: -1,
|
||||
protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
|
||||
Ci.nsIProtocolHandler.URI_NOAUTH,
|
||||
|
||||
allowPort: function(port, scheme)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
newURI: function(spec, charset, baseURI)
|
||||
{
|
||||
var uri = Components.classes[kSIMPLEURI_CONTRACTID].createInstance(Ci.nsIURI);
|
||||
uri.spec = spec;
|
||||
return uri;
|
||||
},
|
||||
|
||||
|
||||
newChannel: function(aURI)
|
||||
{
|
||||
// aURI is a nsIUri, so get a string from it using .spec
|
||||
let phoneNumber = aURI.spec;
|
||||
|
||||
// strip away the kSCHEME: part
|
||||
phoneNumber = phoneNumber.substring(phoneNumber.indexOf(":") + 1, phoneNumber.length);
|
||||
phoneNumber = encodeURI(phoneNumber);
|
||||
|
||||
var ios = Components.classes[kIOSERVICE_CONTRACTID].getService(Ci.nsIIOService);
|
||||
|
||||
try {
|
||||
//try voipto:
|
||||
let channel = ios.newChannel("voipto:"+phoneNumber, null, null);
|
||||
return channel;
|
||||
} catch(e){
|
||||
//voipto not registered, try the next one
|
||||
}
|
||||
try {
|
||||
//try callto:
|
||||
let channel = ios.newChannel("callto:"+phoneNumber, null, null);
|
||||
return channel;
|
||||
} catch(e){
|
||||
//callto not registered, try the next one
|
||||
}
|
||||
//try wtai:
|
||||
//this is our last equivalent protocol, so if it fails pass the exception on
|
||||
let channel = ios.newChannel("wtai:"+phoneNumber, null, null);
|
||||
return channel;
|
||||
}
|
||||
};
|
||||
|
||||
var components = [TelProtocol];
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule(components);
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
MOZ_APP_NAME=fennec
|
||||
MOZ_APP_DISPLAYNAME=Fennec
|
||||
MOZ_APP_VERSION=0.5
|
||||
MOZ_APP_VERSION=0.6
|
||||
|
||||
MOZ_XUL_APP=1
|
||||
MOZ_UPDATER=0
|
||||
|
|
|
@ -42,6 +42,11 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
|
||||
GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
|
||||
|
||||
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
|
||||
|
||||
NO_PKG_FILES = \
|
||||
$(MOZ_APP_NAME)-config \
|
||||
$(MOZ_APP_NAME)-bin.elf \
|
||||
|
@ -68,7 +73,12 @@ include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
|
|||
DEBDESTDIR=debian/$(MOZ_APP_NAME)
|
||||
|
||||
ifeq ($(OS_TARGET),Linux)
|
||||
deb:
|
||||
debian/control: $(srcdir)/debian/control.in $(LIBXUL_DIST)/bin/platform.ini
|
||||
mkdir -p debian
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
|
||||
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
|
||||
|
||||
deb: debian/control
|
||||
rm -rf $(DEBDESTDIR)/usr/local/*
|
||||
$(NSINSTALL) -D $(DEBDESTDIR)/usr/local
|
||||
cd $(DEBDESTDIR)/usr/local; cat $(DEPTH)/../../../../dist/$(PKG_BASENAME)$(PKG_SUFFIX) | $(UNMAKE_PACKAGE)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#filter substitution
|
||||
Source: fennec
|
||||
Section: user/internet
|
||||
Priority: extra
|
||||
|
@ -7,7 +8,7 @@ Standards-Version: 3.7.2
|
|||
|
||||
Package: fennec
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, xulrunner (>=1.9pre)
|
||||
Depends: ${shlibs:Depends}, xulrunner (>=@GRE_MILESTONE@-@GRE_BUILDID@)
|
||||
Description: Mozilla's mobile browser
|
||||
This browser is the full rendering engine of Mozilla Firefox combined with a user interface designed to make browsing the web on a mobile device a rich and uncompromised experience.
|
||||
XB-Maemo-Icon-26:
|
||||
|
|
Загрузка…
Ссылка в новой задаче