зеркало из https://github.com/mozilla/gecko-dev.git
Merge mobile-browser to mobile2
This commit is contained in:
Коммит
1d9d59a5e8
|
@ -42,6 +42,8 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = profile/extensions
|
||||
|
||||
PREF_JS_EXPORTS = $(srcdir)/mobile.js
|
||||
DIST_FILES = application.ini
|
||||
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
# ***** 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) 2010
|
||||
# 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
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifeq (beta,$(MOZ_UPDATE_CHANNEL))
|
||||
EXTENSIONS = \
|
||||
feedback@mobile.mozilla.org \
|
||||
$(NULL)
|
||||
|
||||
define _INSTALL_EXTENSIONS
|
||||
$(PYTHON) $(topsrcdir)/config/nsinstall.py $(wildcard $(srcdir)/$(dir)/*) $(DIST)/bin/extensions/$(dir)
|
||||
|
||||
endef # do not remove the blank line!
|
||||
|
||||
libs::
|
||||
$(foreach dir,$(EXTENSIONS),$(_INSTALL_EXTENSIONS))
|
||||
endif
|
|
@ -0,0 +1,5 @@
|
|||
content feedback content/
|
||||
skin feedback classic/1.0 skin/
|
||||
locale feedback en-US locale/en-US/
|
||||
|
||||
overlay chrome://browser/content/browser.xul chrome://feedback/content/overlay.xul
|
|
@ -0,0 +1,84 @@
|
|||
/* ***** 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 Feedback.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mark Finkle <mark.finkle@gmail.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 Feedback = {
|
||||
init: function(aEvent) {
|
||||
let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
|
||||
document.getElementById("feedback-about").setAttribute("desc", appInfo.version);
|
||||
},
|
||||
|
||||
openReadme: function() {
|
||||
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
|
||||
let url = formatter.formatURLPref("app.releaseNotesURL");
|
||||
BrowserUI.newTab(url);
|
||||
},
|
||||
|
||||
updateRestart: function updateRestart() {
|
||||
let msg = document.getElementById("feedback-messages");
|
||||
if (msg) {
|
||||
let strings = Elements.browserBundle;
|
||||
|
||||
let value = "restart-app";
|
||||
let notification = msg.getNotificationWithValue(value);
|
||||
if (notification)
|
||||
return;
|
||||
|
||||
let restartCallback = function(aNotification, aDescription) {
|
||||
// Notify all windows that an application quit has been requested
|
||||
var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
||||
|
||||
// If nothing aborted, quit the app
|
||||
if (cancelQuit.data == false) {
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
|
||||
appStartup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
|
||||
}
|
||||
};
|
||||
|
||||
let buttons = [ {
|
||||
label: strings.getString("notificationRestart.button"),
|
||||
accessKey: "",
|
||||
callback: restartCallback
|
||||
} ];
|
||||
|
||||
let message = strings.getString("notificationRestart.normal");
|
||||
msg.appendNotification(message, value, "", msg.PRIORITY_WARNING_LOW, buttons);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("load", Feedback.init, false);
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- ***** 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 Feedback.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Mozilla Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2010
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Mark Finkle <mark.finkle@gmail.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://feedback/skin/overlay.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % feedbackDTD SYSTEM "chrome://feedback/locale/overlay.dtd">
|
||||
%feedbackDTD;
|
||||
]>
|
||||
|
||||
<overlay id="feedback-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript" src="chrome://feedback/content/overlay.js"/>
|
||||
|
||||
<box id="panel-controls">
|
||||
<toolbarbutton id="tool-feedback" autocheck="true" type="radio" group="1" class="panel-button button-dark" linkedpanel="feedback-container" insertbefore="tool-addons"/>
|
||||
</box>
|
||||
|
||||
<deck id="panel-items">
|
||||
<vbox id="feedback-container" flex="1">
|
||||
<hbox id="feedback-header" class="panel-header">
|
||||
<label value="&feedbackHeader.label;" flex="1"/>
|
||||
</hbox>
|
||||
<notificationbox id="feedback-messages" flex="1">
|
||||
<richlistbox id="feedback-list" flex="1" onselect="this.ensureSelectedElementIsVisible()">
|
||||
<settings id="feedback-communicate" label="&feedback.communicate.title;">
|
||||
<setting title="&feedback.feedback.title;" type="control">
|
||||
<button id="feedback-feedback-happy" class="button-dark" oncommand="BrowserUI.newTab('http://m.input.mozilla.com/en-US/happy');"/>
|
||||
<button id="feedback-feedback-sad" class="button-dark" oncommand="BrowserUI.newTab('http://m.input.mozilla.com/en-US/sad');"/>
|
||||
</setting>
|
||||
</settings>
|
||||
<settings id="feedback-information" label="&feedback.information.title;">
|
||||
<setting id="feedback-about" title="&feedback.about.title;" type="control">
|
||||
<button id="feedback-about-button" label="&feedback.about.button;" oncommand="Feedback.openReadme();"/>
|
||||
</setting>
|
||||
</settings>
|
||||
<settings id="feedback-tools" label="&feedback.tools.title;">
|
||||
<setting pref="extensions.checkCompatibility.2.0b" title="&feedback.forceCompat.title;" type="bool" inverted="true" oninputchanged="Feedback.updateRestart();"/>
|
||||
<setting pref="browser.console.showInPanel" title="&feedback.errorConsole.title;" type="bool" oninputchanged="Feedback.updateRestart();"/>
|
||||
</settings>
|
||||
</richlistbox>
|
||||
</notificationbox>
|
||||
</vbox>
|
||||
</deck>
|
||||
</overlay>
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>feedback@mobile.mozilla.org</em:id>
|
||||
<em:version>1.0.0</em:version>
|
||||
<em:type>2</em:type>
|
||||
|
||||
<!-- Target Application this extension can install into,
|
||||
with minimum and maximum supported versions. -->
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
|
||||
<em:minVersion>2.0b1pre</em:minVersion>
|
||||
<em:maxVersion>2.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
|
||||
<!-- Front End MetaData -->
|
||||
<em:name>Beta Tester Tools</em:name>
|
||||
<em:description>Help make Firefox better by giving feedback.</em:description>
|
||||
<em:creator>Mozilla Corporation</em:creator>
|
||||
<em:iconURL>chrome://feedback/skin/dino-32.png</em:iconURL>
|
||||
</Description>
|
||||
</RDF>
|
|
@ -0,0 +1,14 @@
|
|||
<!ENTITY feedbackHeader.label "Beta Tester Tools">
|
||||
|
||||
<!ENTITY feedback.communicate.title "Communicate to Us!">
|
||||
<!ENTITY feedback.feedback.title "Give feedback">
|
||||
<!ENTITY feedback.feedback.good "Good">
|
||||
<!ENTITY feedback.feedback.bad "Bad">
|
||||
|
||||
<!ENTITY feedback.information.title "More Information">
|
||||
<!ENTITY feedback.about.title "About this Beta">
|
||||
<!ENTITY feedback.about.button "Go to Page">
|
||||
|
||||
<!ENTITY feedback.tools.title "Tools">
|
||||
<!ENTITY feedback.forceCompat.title "Force add-ons compatibility">
|
||||
<!ENTITY feedback.errorConsole.title "Enable the Error Console">
|
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/beta-32.png
Normal file
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/beta-32.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 453 B |
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/dino-32.png
Normal file
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/dino-32.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 1.5 KiB |
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/happy-32.png
Normal file
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/happy-32.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.4 KiB |
|
@ -0,0 +1,16 @@
|
|||
#tool-feedback {
|
||||
list-style-image: url("chrome://feedback/skin/beta-32.png");
|
||||
}
|
||||
|
||||
#tool-feedback[checked="true"] {
|
||||
-moz-border-image: url("chrome://browser/skin/images/toggledarkboth-active-64.png") 10 repeat repeat;
|
||||
}
|
||||
|
||||
|
||||
#feedback-feedback-happy {
|
||||
list-style-image: url("chrome://feedback/skin/happy-32.png");
|
||||
}
|
||||
|
||||
#feedback-feedback-sad {
|
||||
list-style-image: url("chrome://feedback/skin/sad-32.png");
|
||||
}
|
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/sad-32.png
Normal file
Двоичные данные
mobile/app/profile/extensions/feedback@mobile.mozilla.org/skin/sad-32.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.3 KiB |
|
@ -13,7 +13,7 @@
|
|||
|
||||
<binding id="autocomplete-aligned" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
|
||||
<implementation>
|
||||
<property name="mIgnoreFocus" onget="return true;"/>
|
||||
<property name="mIgnoreFocus" onget="return true;" onset="val;"/>
|
||||
<method name="openPopup">
|
||||
<body><![CDATA[
|
||||
this.popup.openAutocompletePopup(this, null);
|
||||
|
@ -391,11 +391,25 @@
|
|||
if (!item.hasAttribute("url"))
|
||||
continue;
|
||||
|
||||
let itemHost = self._getEffectiveHost(Services.io.newURI(item.getAttribute("url"), null, null));
|
||||
let currentURL = item.getAttribute("url");
|
||||
let itemHost = self._getEffectiveHost(Services.io.newURI(currentURL, null, null));
|
||||
for (let badgeHost in self._badges) {
|
||||
if (itemHost == badgeHost) {
|
||||
// wrap the item to prevent setting a badge on a wrong item
|
||||
let wrapper = {
|
||||
set: function(aBadge) {
|
||||
if (item.getAttribute("url") != currentURL)
|
||||
return;
|
||||
|
||||
if (!aBadge || aBadge == "")
|
||||
item.removeAttribute("badge");
|
||||
else
|
||||
item.setAttribute("badge", aBadge);
|
||||
}
|
||||
};
|
||||
|
||||
let handler = self._badges[badgeHost];
|
||||
handler.updateBadge ? handler.updateBadge(item) : handler(item);
|
||||
handler.updateBadge ? handler.updateBadge(wrapper) : handler(wrapper);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1216,15 +1230,15 @@
|
|||
tabs.push({ name: client.clientName });
|
||||
|
||||
client.tabs.forEach(function({title, urlHistory, icon}) {
|
||||
let pageUrl = urlHistory[0];
|
||||
let pageURL = urlHistory[0];
|
||||
|
||||
// Skip tabs that are already open
|
||||
if (engine.locallyOpenTabMatchesURL(pageUrl))
|
||||
if (engine.locallyOpenTabMatchesURL(pageURL))
|
||||
return;
|
||||
|
||||
tabs.push({
|
||||
title: title || pageUrl,
|
||||
uri: pageUrl,
|
||||
title: title || pageURL,
|
||||
uri: pageURL,
|
||||
icon: Weave.Utils.getIcon(icon, "chrome://browser/skin/images/tab.png")
|
||||
});
|
||||
});
|
||||
|
@ -1450,7 +1464,7 @@
|
|||
|
||||
<binding id="select-button" extends="xul:box">
|
||||
<content>
|
||||
<svg:svg width="11px" version="1.1" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 35%; margin-left: 4px;">
|
||||
<svg:svg width="11px" version="1.1" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: -moz-calc(50% - 2px); margin-left: 4px;">
|
||||
<svg:polyline points="1 1 5 6 9 1" stroke="#414141" stroke-width="2" stroke-linecap="round" fill="transparent" stroke-linejoin="round"/>
|
||||
</svg:svg>
|
||||
</content>
|
||||
|
|
|
@ -2497,11 +2497,11 @@ var BadgeHandlers = {
|
|||
_lastUpdate: 0,
|
||||
_lastCount: 0,
|
||||
url: "http://mail.google.com",
|
||||
updateBadge: function(aItem) {
|
||||
updateBadge: function(aBadge) {
|
||||
// Use the cache if possible
|
||||
let now = Date.now();
|
||||
if (this._lastCount && this._lastUpdate > now - 1000) {
|
||||
aItem.setAttribute("badge", this._lastCount);
|
||||
aBadge.set(this._lastCount);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2523,7 +2523,7 @@ var BadgeHandlers = {
|
|||
} else {
|
||||
this._lastCount = 0;
|
||||
}
|
||||
this._lastCount = BadgeHandlers.setNumberBadge(aItem, this._lastCount);
|
||||
this._lastCount = BadgeHandlers.setNumberBadge(aBadge, this._lastCount);
|
||||
}
|
||||
};
|
||||
req.send(null);
|
||||
|
@ -2551,12 +2551,12 @@ var BadgeHandlers = {
|
|||
return aValue;
|
||||
},
|
||||
|
||||
setNumberBadge: function(aItem, aValue) {
|
||||
setNumberBadge: function(aBadge, aValue) {
|
||||
if (parseInt(aValue) != 0) {
|
||||
aValue = this.clampBadge(aValue);
|
||||
aItem.setAttribute("badge", aValue);
|
||||
aBadge.set(aValue);
|
||||
} else {
|
||||
aItem.removeAttribute("badge");
|
||||
aBadge.set("");
|
||||
}
|
||||
return aValue;
|
||||
}
|
||||
|
|
|
@ -73,23 +73,26 @@ var DownloadsView = {
|
|||
},
|
||||
|
||||
_createItem: function dv__createItem(aAttrs) {
|
||||
let item = document.createElement("richlistitem");
|
||||
|
||||
// Copy the attributes from the argument into the item
|
||||
for (let attr in aAttrs)
|
||||
item.setAttribute(attr, aAttrs[attr]);
|
||||
|
||||
// Initialize other attributes
|
||||
item.setAttribute("typeName", "download");
|
||||
item.setAttribute("id", "dl-" + aAttrs.id);
|
||||
item.setAttribute("downloadID", aAttrs.id);
|
||||
item.setAttribute("iconURL", "moz-icon://" + aAttrs.file + "?size=32");
|
||||
item.setAttribute("lastSeconds", Infinity);
|
||||
|
||||
// Initialize more complex attributes
|
||||
this._updateTime(item);
|
||||
this._updateStatus(item);
|
||||
// Make sure this doesn't already exist
|
||||
let item = this.getElementForDownload(aAttrs.id);
|
||||
if (!item) {
|
||||
item = document.createElement("richlistitem");
|
||||
|
||||
// Copy the attributes from the argument into the item
|
||||
for (let attr in aAttrs)
|
||||
item.setAttribute(attr, aAttrs[attr]);
|
||||
|
||||
// Initialize other attributes
|
||||
item.setAttribute("typeName", "download");
|
||||
item.setAttribute("id", "dl-" + aAttrs.id);
|
||||
item.setAttribute("downloadID", aAttrs.id);
|
||||
item.setAttribute("iconURL", "moz-icon://" + aAttrs.file + "?size=32");
|
||||
item.setAttribute("lastSeconds", Infinity);
|
||||
|
||||
// Initialize more complex attributes
|
||||
this._updateTime(item);
|
||||
this._updateStatus(item);
|
||||
}
|
||||
return item;
|
||||
},
|
||||
|
||||
|
@ -370,11 +373,14 @@ var DownloadsView = {
|
|||
|
||||
removeDownload: function dv_removeDownload(aItem) {
|
||||
this._dlmgr.removeDownload(aItem.getAttribute("downloadID"));
|
||||
let f = this._getLocalFile(aItem.getAttribute("file"));
|
||||
if (f.exists())
|
||||
f.remove(false);
|
||||
},
|
||||
|
||||
cancelDownload: function dv_cancelDownload(aItem) {
|
||||
this._dlmgr.cancelDownload(aItem.getAttribute("downloadID"));
|
||||
var f = this._getLocalFile(aItem.getAttribute("file"));
|
||||
let f = this._getLocalFile(aItem.getAttribute("file"));
|
||||
if (f.exists())
|
||||
f.remove(false);
|
||||
},
|
||||
|
|
|
@ -65,9 +65,8 @@ function FormAssistant() {
|
|||
addMessageListener("FormAssist:AutoComplete", this);
|
||||
|
||||
addEventListener("keyup", this, false);
|
||||
|
||||
// change on rotation/resize
|
||||
addEventListener("resize", this, false);
|
||||
addEventListener("focus", this, true);
|
||||
};
|
||||
|
||||
FormAssistant.prototype = {
|
||||
|
@ -189,54 +188,60 @@ FormAssistant.prototype = {
|
|||
if (!this._enabled || !this.currentElement)
|
||||
return;
|
||||
|
||||
// change zoom on resize/rotation
|
||||
if (aEvent.type == "resize") {
|
||||
sendAsyncMessage("FormAssist:Resize");
|
||||
} else {
|
||||
let currentElement = this.currentElement;
|
||||
switch (aEvent.keyCode) {
|
||||
case aEvent.DOM_VK_DOWN:
|
||||
if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
|
||||
if (this._hasKeyListener(currentElement))
|
||||
return;
|
||||
}
|
||||
else if (currentElement instanceof HTMLTextAreaElement) {
|
||||
let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
|
||||
let isEnd = (currentElement.textLength == currentElement.selectionEnd);
|
||||
if (!isEnd || existSelection)
|
||||
return;
|
||||
}
|
||||
switch (aEvent.type) {
|
||||
case "resize":
|
||||
sendAsyncMessage("FormAssist:Resize");
|
||||
break;
|
||||
case "focus":
|
||||
let focusedIndex = this._getIndexForElement(gFocusManager.focusedElement);
|
||||
if (focusedIndex != -1 && this.currentIndex != focusedIndex)
|
||||
this.currentIndex = focusedIndex;
|
||||
break;
|
||||
case "keyup":
|
||||
let currentElement = this.currentElement;
|
||||
switch (aEvent.keyCode) {
|
||||
case aEvent.DOM_VK_DOWN:
|
||||
if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
|
||||
if (this._hasKeyListener(currentElement))
|
||||
return;
|
||||
}
|
||||
else if (currentElement instanceof HTMLTextAreaElement) {
|
||||
let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
|
||||
let isEnd = (currentElement.textLength == currentElement.selectionEnd);
|
||||
if (!isEnd || existSelection)
|
||||
return;
|
||||
}
|
||||
|
||||
this.currentIndex++;
|
||||
break;
|
||||
this.currentIndex++;
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_UP:
|
||||
if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
|
||||
if (this._hasKeyListener(currentElement))
|
||||
return;
|
||||
}
|
||||
else if (currentElement instanceof HTMLTextAreaElement) {
|
||||
let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
|
||||
let isStart = (currentElement.selectionEnd == 0);
|
||||
if (!isStart || existSelection)
|
||||
return;
|
||||
}
|
||||
case aEvent.DOM_VK_UP:
|
||||
if (currentElement instanceof HTMLInputElement && !this._isAutocomplete(currentElement)) {
|
||||
if (this._hasKeyListener(currentElement))
|
||||
return;
|
||||
}
|
||||
else if (currentElement instanceof HTMLTextAreaElement) {
|
||||
let existSelection = currentElement.selectionEnd - currentElement.selectionStart;
|
||||
let isStart = (currentElement.selectionEnd == 0);
|
||||
if (!isStart || existSelection)
|
||||
return;
|
||||
}
|
||||
|
||||
this.currentIndex--;
|
||||
break;
|
||||
this.currentIndex--;
|
||||
break;
|
||||
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
break;
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
break;
|
||||
|
||||
default:
|
||||
if (this._isAutocomplete(aEvent.target))
|
||||
sendAsyncMessage("FormAssist:AutoComplete", this._getJSON());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (this._isAutocomplete(aEvent.target))
|
||||
sendAsyncMessage("FormAssist:AutoComplete", this._getJSON());
|
||||
break;
|
||||
}
|
||||
|
||||
let caretRect = this._getCaretRect();
|
||||
if (!caretRect.isEmpty())
|
||||
sendAsyncMessage("FormAssist:Update", { caretRect: caretRect });
|
||||
let caretRect = this._getCaretRect();
|
||||
if (!caretRect.isEmpty())
|
||||
sendAsyncMessage("FormAssist:Update", { caretRect: caretRect });
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -381,16 +386,20 @@ FormAssistant.prototype = {
|
|||
elements = elements.sort(orderByTabIndex);
|
||||
|
||||
// retrieve the correct index
|
||||
let currentIndex = -1;
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
if (elements[i] == aElement) {
|
||||
currentIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let currentIndex = this._getIndexForElement(aElement);
|
||||
return currentIndex;
|
||||
},
|
||||
|
||||
_getIndexForElement: function(aElement) {
|
||||
let currentIndex = -1;
|
||||
let elements = this._elements;
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
if (elements[i] == aElement)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
|
||||
_getJSON: function() {
|
||||
let element = this.currentElement;
|
||||
let list = getListForElement(element);
|
||||
|
|
|
@ -208,6 +208,7 @@ var AutoCompleteUtils = {
|
|||
|
||||
// Add back functions to the result
|
||||
result.getValueAt = function(index) this.data[index][0];
|
||||
result.getLabelAt = function(index) this.data[index][0];
|
||||
result.getCommentAt = function(index) this.data[index][1];
|
||||
result.getStyleAt = function(index) this.data[index][2];
|
||||
result.getImageAt = function(index) this.data[index][3];
|
||||
|
|
|
@ -7,6 +7,28 @@ Cu.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
const kCountBeforeWeRemember = 5;
|
||||
|
||||
function setPagePermission(type, uri, allow) {
|
||||
let pm = Services.perms;
|
||||
let contentPrefs = Services.contentPrefs;
|
||||
let contentPrefName = type + ".request.remember";
|
||||
|
||||
if (!contentPrefs.hasPref(uri, contentPrefName))
|
||||
contentPrefs.setPref(uri, contentPrefName, 0);
|
||||
|
||||
let count = contentPrefs.getPref(uri, contentPrefName);
|
||||
|
||||
if (allow == false)
|
||||
count--;
|
||||
else
|
||||
count++;
|
||||
|
||||
contentPrefs.setPref(uri, contentPrefName, count);
|
||||
if (count == kCountBeforeWeRemember)
|
||||
pm.add(uri, type, Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
else if (count == -kCountBeforeWeRemember)
|
||||
pm.add(uri, type, Ci.nsIPermissionManager.DENY_ACTION);
|
||||
}
|
||||
|
||||
function ContentPermissionPrompt() {}
|
||||
|
||||
ContentPermissionPrompt.prototype = {
|
||||
|
@ -14,97 +36,80 @@ ContentPermissionPrompt.prototype = {
|
|||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
|
||||
|
||||
prompt: function(aRequest) {
|
||||
if (aRequest.type != "geolocation")
|
||||
return;
|
||||
getChromeWindow: function getChromeWindow(aWindow) {
|
||||
let chromeWin = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow)
|
||||
.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
return chromeWin;
|
||||
},
|
||||
|
||||
getNotificationBoxForRequest: function getNotificationBoxForRequest(request) {
|
||||
let notificationBox = null;
|
||||
if (request.window) {
|
||||
let requestingWindow = request.window.top;
|
||||
let chromeWin = this.getChromeWindow(requestingWindow).wrappedJSObject;
|
||||
return chromeWin.getNotificationBox(requestingWindow);
|
||||
}
|
||||
|
||||
let chromeWin = request.element.ownerDocument.defaultView;
|
||||
return chromeWin.Browser.getNotificationBox();
|
||||
},
|
||||
|
||||
handleExistingPermission: function handleExistingPermission(request) {
|
||||
let result = Services.perms.testExactPermission(request.uri, request.type);
|
||||
if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
|
||||
request.allow();
|
||||
return true;
|
||||
}
|
||||
if (result == Ci.nsIPermissionManager.DENY_ACTION) {
|
||||
request.cancel();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
prompt: function(request) {
|
||||
// returns true if the request was handled
|
||||
if (this.handleExistingPermission(request))
|
||||
return;
|
||||
|
||||
let pm = Services.perms;
|
||||
let result = pm.testExactPermission(aRequest.uri, "geo");
|
||||
|
||||
if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
|
||||
aRequest.allow();
|
||||
let notificationBox = this.getNotificationBoxForRequest(request);
|
||||
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
|
||||
let notification = notificationBox.getNotificationWithValue(request.type);
|
||||
if (notification)
|
||||
return;
|
||||
} else if (result == Ci.nsIPermissionManager.DENY_ACTION) {
|
||||
aRequest.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
function setPagePermission(aUri, aAllow) {
|
||||
let contentPrefs = Services.contentPrefs;
|
||||
let buttons = [{
|
||||
label: browserBundle.GetStringFromName(request.type + ".allow"),
|
||||
accessKey: null,
|
||||
callback: function(notification) {
|
||||
setPagePermission(request.type, request.uri, true);
|
||||
request.allow();},
|
||||
},
|
||||
{
|
||||
label: browserBundle.GetStringFromName(request.type + ".dontAllow"),
|
||||
accessKey: null,
|
||||
callback: function(notification) {
|
||||
setPagePermission(request.type, request.uri, false);
|
||||
request.cancel();},
|
||||
}];
|
||||
|
||||
if (!contentPrefs.hasPref(aRequest.uri, "geo.request.remember"))
|
||||
contentPrefs.setPref(aRequest.uri, "geo.request.remember", 0);
|
||||
let message = browserBundle.formatStringFromName(request.type + ".siteWantsTo",
|
||||
[request.uri.host], 1);
|
||||
let newBar = notificationBox.appendNotification(message,
|
||||
request.type,
|
||||
"", // Notifications in Fennec do not display images.
|
||||
notificationBox.PRIORITY_WARNING_MEDIUM,
|
||||
buttons);
|
||||
return;
|
||||
},
|
||||
|
||||
let count = contentPrefs.getPref(aRequest.uri, "geo.request.remember");
|
||||
|
||||
if (aAllow == false)
|
||||
count--;
|
||||
else
|
||||
count++;
|
||||
|
||||
contentPrefs.setPref(aRequest.uri, "geo.request.remember", count);
|
||||
|
||||
if (count == kCountBeforeWeRemember)
|
||||
pm.add(aUri, "geo", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
else if (count == -kCountBeforeWeRemember)
|
||||
pm.add(aUri, "geo", Ci.nsIPermissionManager.DENY_ACTION);
|
||||
}
|
||||
|
||||
function getChromeWindow(aWindow) {
|
||||
let chromeWin = aWindow
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow)
|
||||
.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
return chromeWin;
|
||||
}
|
||||
|
||||
let notificationBox = null;
|
||||
if (aRequest.window) {
|
||||
let requestingWindow = aRequest.window.top;
|
||||
let chromeWin = getChromeWindow(requestingWindow).wrappedJSObject;
|
||||
notificationBox = chromeWin.getNotificationBox(requestingWindow);
|
||||
} else {
|
||||
let chromeWin = aRequest.element.ownerDocument.defaultView;
|
||||
notificationBox = chromeWin.Browser.getNotificationBox();
|
||||
}
|
||||
|
||||
let notification = notificationBox.getNotificationWithValue("geolocation");
|
||||
if (!notification) {
|
||||
let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
|
||||
let buttons = [{
|
||||
label: browserBundle.GetStringFromName("geolocation.share"),
|
||||
accessKey: null,
|
||||
callback: function(notification) {
|
||||
setPagePermission(aRequest.uri, true);
|
||||
aRequest.allow();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: browserBundle.GetStringFromName("geolocation.dontShare"),
|
||||
accessKey: null,
|
||||
callback: function(notification) {
|
||||
setPagePermission(aRequest.uri, false);
|
||||
aRequest.cancel();
|
||||
},
|
||||
}];
|
||||
|
||||
let message = browserBundle.formatStringFromName("geolocation.siteWantsToKnow",
|
||||
[aRequest.uri.host], 1);
|
||||
|
||||
let newBar = notificationBox.appendNotification(message,
|
||||
"geolocation",
|
||||
"chrome://browser/skin/images/geo-16.png",
|
||||
notificationBox.PRIORITY_WARNING_MEDIUM,
|
||||
buttons);
|
||||
// Make this a geolocation notification.
|
||||
newBar.setAttribute("type", "geo");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -139,8 +139,10 @@ FormAutoComplete.prototype = {
|
|||
},
|
||||
|
||||
autoCompleteSearch: function autoCompleteSearch(aName, aQuery, aField, aPrev) {
|
||||
LOG("autocomplete search", Array.slice(arguments));
|
||||
if (!Services.prefs.getBoolPref("browser.formfill.enable"))
|
||||
return;
|
||||
|
||||
LOG("autocomplete search", Array.slice(arguments));
|
||||
let result = Cc["@mozilla.org/autocomplete/simple-result;1"].createInstance(Ci.nsIAutoCompleteSimpleResult);
|
||||
result.setSearchString(aQuery);
|
||||
|
||||
|
|
|
@ -684,6 +684,10 @@ UserAutoCompleteResult.prototype = {
|
|||
return this.logins[index].username;
|
||||
},
|
||||
|
||||
getLabelAt : function (index) {
|
||||
return this.getValueAt(index);
|
||||
},
|
||||
|
||||
getCommentAt : function (index) {
|
||||
return "";
|
||||
},
|
||||
|
|
|
@ -42,6 +42,7 @@ component {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5} ContentPermissionPrompt.js
|
|||
contract @mozilla.org/content-permission/prompt;1 {C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}
|
||||
|
||||
# AlertsService.js
|
||||
|
||||
component {fe33c107-82a4-41d6-8c64-5353267e04c9} AlertsService.js
|
||||
contract @mozilla.org/system-alerts-service;1 {fe33c107-82a4-41d6-8c64-5353267e04c9}
|
||||
|
||||
|
|
|
@ -122,9 +122,14 @@ identity.unknown.tooltip=This web site does not supply identity information.
|
|||
identity.ownerUnknown2=(unknown)
|
||||
|
||||
# Geolocation UI
|
||||
geolocation.share=Share
|
||||
geolocation.dontShare=Don't share
|
||||
geolocation.siteWantsToKnow=%S wants your location.
|
||||
geolocation.allow=Share
|
||||
geolocation.dontAllow=Don't share
|
||||
geolocation.siteWantsTo=%S wants your location.
|
||||
|
||||
# Desktop notification UI
|
||||
desktop-notification.allow=Allow
|
||||
desktop-notification.dontAllow=Don't allow
|
||||
desktop-notification.siteWantsTo=%S wants use notifications.
|
||||
|
||||
# New Tab Popup
|
||||
# LOCALIZATION NOTE (newtabpopup): Semi-colon list of plural forms.
|
||||
|
|
|
@ -41,6 +41,7 @@ dom/locales/Makefile
|
|||
toolkit/locales/Makefile
|
||||
security/manager/locales/Makefile
|
||||
mobile/app/Makefile
|
||||
mobile/app/profile/extensions/Makefile
|
||||
$MOZ_BRANDING_DIRECTORY/Makefile
|
||||
$MOZ_BRANDING_DIRECTORY/locales/Makefile
|
||||
mobile/chrome/Makefile
|
||||
|
|
|
@ -693,49 +693,6 @@ placeitem[ui="manage"] > .bookmark-manage > image {
|
|||
visibility: collapse;
|
||||
}
|
||||
|
||||
.tool-search {
|
||||
list-style-image: url("chrome://browser/skin/images/navigation-magnifier-30.png");
|
||||
-moz-margin-end: 8px;
|
||||
}
|
||||
|
||||
.searchengine {
|
||||
-moz-box-orient: horizontal;
|
||||
min-width: 140px !important;
|
||||
}
|
||||
|
||||
.searchengine .radio-icon {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
-moz-margin-end: 8px;
|
||||
}
|
||||
|
||||
#autocomplete_navbuttons {
|
||||
padding: 4px 0; /* half core spacing & none (autorepeat arrows compensate) */
|
||||
}
|
||||
|
||||
#autocomplete_navbuttons .autorepeatbutton-down {
|
||||
list-style-image: url(images/arrowrightdark-16.png);
|
||||
}
|
||||
|
||||
#autocomplete_navbuttons .autorepeatbutton-down:-moz-locale-dir(rtl) {
|
||||
list-style-image: url(images/arrowleftdark-16.png);
|
||||
}
|
||||
|
||||
#autocomplete_navbuttons .autorepeatbutton-up {
|
||||
list-style-image: url(images/arrowleftdark-16.png);
|
||||
}
|
||||
|
||||
#autocomplete_navbuttons .autorepeatbutton-up:-moz-locale-dir(rtl) {
|
||||
list-style-image: url(images/arrowrightdark-16.png);
|
||||
}
|
||||
|
||||
/* force the autorepeat buttons to create a 'padding' when collapsed */
|
||||
#autocomplete_navbuttons autorepeatbutton[collapsed="true"],
|
||||
#autocomplete_navbuttons autorepeatbutton[disabled="true"] {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.autocomplete-items {
|
||||
background-color: white;
|
||||
}
|
||||
|
@ -855,7 +812,9 @@ autocompleteresult[class="remotetabs-item-title"] {
|
|||
}
|
||||
|
||||
autocompleteresult[class="history-item-title"] .bookmark-item-url,
|
||||
autocompleteresult[class="remotetabs-item-title"] .bookmark-item-url {
|
||||
autocompleteresult[class="history-item-title"] .autocomplete-item-tags,
|
||||
autocompleteresult[class="remotetabs-item-title"] .bookmark-item-url,
|
||||
autocompleteresult[class="remotetabs-item-title"] .autocomplete-item-tags {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
Двоичные данные
mobile/themes/core/images/geo-16.png
Двоичные данные
mobile/themes/core/images/geo-16.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 960 B |
|
@ -140,4 +140,3 @@ chrome.jar:
|
|||
skin/images/task-close-40.png (images/task-close-40.png)
|
||||
skin/images/task-back-40.png (images/task-back-40.png)
|
||||
skin/images/task-back-rtl-40.png (images/task-back-rtl-40.png)
|
||||
skin/images/geo-16.png (images/geo-16.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче