mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Add new Extension Manager front end as part of 170006. Not currently hooked up to anything.
This commit is contained in:
parent
aa41d561d7
commit
32d5ae2da0
46
toolkit/mozapps/extensions/Makefile.in
Normal file
46
toolkit/mozapps/extensions/Makefile.in
Normal file
@ -0,0 +1,46 @@
|
||||
# ***** 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 the Extension Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@mozilla.org>
|
||||
#
|
||||
# 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
|
||||
|
||||
DIRS = public src
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
0
toolkit/mozapps/extensions/content/about.js
Normal file
0
toolkit/mozapps/extensions/content/about.js
Normal file
46
toolkit/mozapps/extensions/content/about.xul
Normal file
46
toolkit/mozapps/extensions/content/about.xul
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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 The Extension Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.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 *****
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<dialog id="genericAbout"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
</dialog>
|
||||
|
||||
|
21
toolkit/mozapps/extensions/content/extensions.css
Normal file
21
toolkit/mozapps/extensions/content/extensions.css
Normal file
@ -0,0 +1,21 @@
|
||||
view {
|
||||
-moz-binding: url("chrome://mozapps/skin/shared/richview.xml#richview");
|
||||
}
|
||||
|
||||
extension {
|
||||
-moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#extension");
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
extension[install-state="pending"] {
|
||||
-moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#extension-pending");
|
||||
}
|
||||
|
||||
extension[install-state="downloading"] {
|
||||
-moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#extension-downloading");
|
||||
}
|
||||
|
||||
extension[install-state="installing"] {
|
||||
-moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#extension-installing");
|
||||
}
|
||||
|
300
toolkit/mozapps/extensions/content/extensions.js
Normal file
300
toolkit/mozapps/extensions/content/extensions.js
Normal file
@ -0,0 +1,300 @@
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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 The Extension Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.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 *****
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Globals
|
||||
|
||||
const kObserverServiceProgID = "@mozilla.org/observer-service;1";
|
||||
|
||||
var gExtensionManager = null;
|
||||
var gDownloadListener = null;
|
||||
var gExtensionssView = null;
|
||||
var gWindowState = "";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Utility Functions
|
||||
function setRDFProperty(aID, aProperty, aValue)
|
||||
{
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
|
||||
var db = gDownloadManager.datasource;
|
||||
var propertyArc = rdf.GetResource(NC_NS + aProperty);
|
||||
|
||||
var res = rdf.GetResource(aID);
|
||||
var node = db.GetTarget(res, propertyArc, true);
|
||||
if (node)
|
||||
db.Change(res, propertyArc, node, rdf.GetLiteral(aValue));
|
||||
else
|
||||
db.Assert(res, propertyArc, rdf.GetLiteral(aValue), true);
|
||||
}
|
||||
|
||||
function getRDFProperty(aID, aProperty)
|
||||
{
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
|
||||
var db = gDownloadManager.datasource;
|
||||
var propertyArc = rdf.GetResource(NC_NS + aProperty);
|
||||
|
||||
var res = rdf.GetResource(aID);
|
||||
var node = db.GetTarget(res, propertyArc, true);
|
||||
if (!node) return "";
|
||||
try {
|
||||
node = node.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
return node.Value;
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
node = node.QueryInterface(Components.interfaces.nsIRDFInt);
|
||||
return node.Value;
|
||||
}
|
||||
catch (e) {
|
||||
node = node.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
return node.Value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function fireEventForElement(aElement, aEventType)
|
||||
{
|
||||
var e = document.createEvent("Events");
|
||||
e.initEvent("extension-" + aEventType, false, true);
|
||||
|
||||
aElement.dispatchEvent(e);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Download Event Handlers
|
||||
|
||||
function onExtensionViewOptions(aEvent)
|
||||
{
|
||||
var optionsURL = aEvent.target.getAttribute("optionsURL");
|
||||
if (optionsURL != "")
|
||||
openDialog(optionsURL, "", "chrome,modal");
|
||||
}
|
||||
|
||||
function onExtensionVisitHomepage(aEvent)
|
||||
{
|
||||
var homepageURL = aEvent.target.getAttribute("homepageURL");
|
||||
if (homepageURL != "") {
|
||||
dump("*** attempting to load " + homepageURL + "\n");
|
||||
var uri = Components.classes["@mozilla.org/network/standard-url;1"]
|
||||
.createInstance(Components.interfaces.nsIURI);
|
||||
uri.spec = homepageURL;
|
||||
|
||||
# If we're not a browser, use the external protocol service to load the URI.
|
||||
#ifndef MOZ_PHOENIX
|
||||
var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
|
||||
.getService(Components.interfaces.nsIExternalProtocolService);
|
||||
if (protocolSvc.isExposedProtocol(uri.scheme))
|
||||
protocolSvc.loadUrl(uri);
|
||||
# If we're a browser, open a new browser window instead.
|
||||
#else
|
||||
openDialog("chrome://browser/content/browser.xul", "_blank", "chrome,all,dialog=no", homepageURL, null, null);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
function onExtensionViewAbout(aEvent)
|
||||
{
|
||||
var aboutURL = aEvent.target.getAttribute("aboutURL");
|
||||
if (aboutURL != "")
|
||||
openDialog(aboutURL, "", "chrome,modal");
|
||||
else
|
||||
openDialog("chrome://mozapps/content/extensions/about.xul", "", "chrome,modal", aEvent.target.id);
|
||||
}
|
||||
|
||||
function onExtensionMoveTop(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function onExtensionMoveUp(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function onExtensionMoveDown(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function onExtensionUpdate(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function onExtensionEnableDisable(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function onExtensionUninstall(aEvent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Startup, Shutdown
|
||||
function Startup()
|
||||
{
|
||||
gExtensionsView = document.getElementById("extensionsView");
|
||||
|
||||
gExtensionManager = Components.classes["@mozilla.org/extension-manager;1"]
|
||||
.getService(Components.interfaces.nsIExtensionManager);
|
||||
|
||||
// Handlers for events generated by the Download Manager (download events)
|
||||
var observerService = Components.classes[kObserverServiceProgID]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
|
||||
gWindowState = window.arguments[0];
|
||||
|
||||
// This is for the "Clean Up" button, which requires there to be
|
||||
// non-active downloads before it can be enabled.
|
||||
gExtensionsView.controllers.appendController(gExtensionsViewController);
|
||||
gExtensionsView.addEventListener("extension-open", onExtensionViewOptions, false);
|
||||
gExtensionsView.addEventListener("extension-show-options", onExtensionViewOptions, false);
|
||||
gExtensionsView.addEventListener("extension-show-homepage", onExtensionVisitHomepage, false);
|
||||
gExtensionsView.addEventListener("extension-show-info", onExtensionViewAbout, false);
|
||||
gExtensionsView.addEventListener("extension-uninstall", onExtensionUninstall, false);
|
||||
gExtensionsView.addEventListener("extension-update", onExtensionUpdate, false);
|
||||
gExtensionsView.addEventListener("extension-disable", onExtensionEnableDisable, false);
|
||||
gExtensionsView.addEventListener("extension-move-top", onExtensionMoveTop, false);
|
||||
gExtensionsView.addEventListener("extension-move-up", onExtensionMoveUp, false);
|
||||
gExtensionsView.addEventListener("extension-move-dn", onExtensionMoveDn, false);
|
||||
|
||||
// Finally, update the UI.
|
||||
gExtensionsView.database.AddDataSource(gExtensionManager.datasource);
|
||||
gExtensionsView.setAttribute("ref", "urn:mozilla:extension:root");
|
||||
gExtensionsView.focus();
|
||||
}
|
||||
|
||||
function Shutdown()
|
||||
{
|
||||
var observerService = Components.classes[kObserverServiceProgID]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// View Context Menus
|
||||
var gExtensionContextMenus = ["menuitem_options", "menuitem_homepage", "menuitem_about",
|
||||
"menuseparator_1", "menuitem_uninstall", "menuitem_update",
|
||||
"menuitem_disable", "menuseparator_2", "menuitem_moveTop",
|
||||
"menuitem_moveUp", "menuitem_moveDn"];
|
||||
var gThemeContextMenus = ["menuitem_homepage", "menuitem_about", "menuseparator_1",
|
||||
"menuitem_uninstall", "menuitem_update"];
|
||||
|
||||
function buildContextMenu(aEvent)
|
||||
{
|
||||
if (aEvent.target.id != "extensionContextMenu")
|
||||
return false;
|
||||
|
||||
var popup = document.getElementById("extensionContextMenu");
|
||||
while (popup.hasChildNodes())
|
||||
popup.removeChild(popup.firstChild);
|
||||
|
||||
var menus = gWindowState == "extensions" ? gExtensionContextMenus : gThemeContextMenus;
|
||||
for (var i = 0; i < menus.length; ++i)
|
||||
popup.appendChild(document.getElementById(menus[i]).cloneNode(true));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Drag and Drop
|
||||
|
||||
var gExtensionsDNDObserver =
|
||||
{
|
||||
onDragOver: function (aEvent, aFlavour, aDragSession)
|
||||
{
|
||||
aDragSession.canDrop = true;
|
||||
},
|
||||
|
||||
onDrop: function(aEvent, aXferData, aDragSession)
|
||||
{
|
||||
var split = aXferData.data.split("\n");
|
||||
var url = split[0];
|
||||
if (url != aXferData.data) { //do nothing, not a valid URL
|
||||
var name = split[1];
|
||||
saveURL(url, name, null, true, true);
|
||||
}
|
||||
},
|
||||
_flavourSet: null,
|
||||
getSupportedFlavours: function ()
|
||||
{
|
||||
if (!this._flavourSet) {
|
||||
this._flavourSet = new FlavourSet();
|
||||
this._flavourSet.appendFlavour("text/x-moz-url");
|
||||
this._flavourSet.appendFlavour("text/unicode");
|
||||
}
|
||||
return this._flavourSet;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Command Updating and Command Handlers
|
||||
|
||||
var gExtensionsViewController = {
|
||||
supportsCommand: function (aCommand)
|
||||
{
|
||||
return aCommand == "cmd_cleanUp";
|
||||
},
|
||||
|
||||
isCommandEnabled: function (aCommand)
|
||||
{
|
||||
if (aCommand == "cmd_cleanUp")
|
||||
return gDownloadManager.canCleanUp;
|
||||
return false;
|
||||
},
|
||||
|
||||
doCommand: function (aCommand)
|
||||
{
|
||||
if (aCommand == "cmd_cleanUp" && this.isCommandEnabled(aCommand)) {
|
||||
gDownloadManager.cleanUp();
|
||||
this.onCommandUpdate();
|
||||
}
|
||||
},
|
||||
|
||||
onCommandUpdate: function ()
|
||||
{
|
||||
var command = "cmd_cleanUp";
|
||||
var enabled = this.isCommandEnabled(command);
|
||||
goSetCommandEnabled(command, enabled);
|
||||
}
|
||||
};
|
||||
|
97
toolkit/mozapps/extensions/content/extensions.xml
Normal file
97
toolkit/mozapps/extensions/content/extensions.xml
Normal file
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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 The Extension Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.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 *****
|
||||
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd" >
|
||||
%extensionsDTD;
|
||||
]>
|
||||
|
||||
<bindings id="extensionBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="extension">
|
||||
<resources>
|
||||
<stylesheet src="chrome://mozapps/skin/extensions/extensions.css"/>
|
||||
</resources>
|
||||
<content>
|
||||
<xul:hbox flex="1">
|
||||
<xul:vbox pack="start">
|
||||
<xul:image class="extension-icon" xbl:inherits="src=image"
|
||||
style="width: 32px; max-width: 32px; height: 32px; max-height: 32px;"/>
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="start" flex="1">
|
||||
<xul:hbox>
|
||||
<xul:label class="extension-item-name" xbl:inherits="value=name" crop="center"/>
|
||||
<xul:label class="extension-item-version" xbl:inherits="value=version"/>
|
||||
</xul:hbox>
|
||||
<xul:label class="extension-item-description" xbl:inherits="value=description" crop="right"/>
|
||||
<xul:label class="extension-item-creator" xbl:inherits="value=creator" crop="right"/>
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="start">
|
||||
<xul:image class="extension-button" anonid="options-button"
|
||||
tooltiptext="&options.tooltip;"
|
||||
onclick="this.parentNode.parentNode.parentNode.fireEvent('options');"/>
|
||||
<xul:image class="extension-button" anonid="about-button"
|
||||
tooltiptext="&about.tooltip;"
|
||||
onclick="this.parentNode.parentNode.parentNode.fireEvent('about');"/>
|
||||
<xul:image class="extension-button" anonid="homepage-button"
|
||||
tooltiptext="&homepage.tooltip;"
|
||||
onclick="this.parentNode.parentNode.parentNode.fireEvent('homepage');"/>
|
||||
</xul:vbox>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
<implementation>
|
||||
<method name="fireEvent">
|
||||
<parameter name="aEventType"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var e = document.createEvent("Events");
|
||||
e.initEvent("extension-" + aEventType, false, true);
|
||||
|
||||
this.dispatchEvent(e);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
166
toolkit/mozapps/extensions/content/extensions.xul
Normal file
166
toolkit/mozapps/extensions/content/extensions.xul
Normal file
@ -0,0 +1,166 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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 The Extension Manager.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.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 *****
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mozapps/content/extensions/extensions.css"?>
|
||||
<?xml-stylesheet href="chrome://mozapps/skin/extensions/extensions.css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
|
||||
%extensionsDTD;
|
||||
]>
|
||||
|
||||
<window xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="extensionsManager" windowtype="Extension:Manager"
|
||||
orient="vertical" title="&extensions.title;" statictitle="&extensions.title;"
|
||||
width="400" height="300" screenX="10" screenY="10"
|
||||
persist="width height screenX screenY sizeMode"
|
||||
onload="Startup();" onunload="Shutdown();"
|
||||
onclose="return closeWindow(false);">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://mozapps/content/extensions/extensions.js"/>
|
||||
|
||||
<stringbundleset id="extensionsSet">
|
||||
<stringbundle id="brandStrings" src="chrome://global/locale/brand.properties"/>
|
||||
<stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
|
||||
</stringbundleset>
|
||||
|
||||
<keyset id="extensionsKeys">
|
||||
<key id="key_close" key="&cmd.close.commandKey;" oncommand="closeWindow(true);" modifiers="accel"/>
|
||||
<key id="key_info" key="&cmd.info.commandKey;" oncommand="onExtensionsShowInfo();" modifiers="accel"/>
|
||||
</keyset>
|
||||
|
||||
<vbox id="contextMenuPalette" hidden="true">
|
||||
<menuitem id="menuitem_options" default="true"
|
||||
label="&cmd.options.label;" accesskey="&cmd.options.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'show-options');"/>
|
||||
<menuitem id="menuitem_homepage"
|
||||
label="&cmd.homepage.label;" accesskey="&cmd.homepage.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'show-homepage');"/>
|
||||
<menuitem id="menuitem_about"
|
||||
label="&cmd.about.label;" accesskey="&cmd.about.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'show-info');"/>
|
||||
<menuseparator id="menuseparator_1"/>
|
||||
<menuitem id="menuitem_uninstall"
|
||||
label="&cmd.uninstall.label;" accesskey="&cmd.uninstall.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'uninstall');"/>
|
||||
<menuitem id="menuitem_update"
|
||||
label="&cmd.update.label;" accesskey="&cmd.update.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'update');"/>
|
||||
<menuitem id="menuitem_disable"
|
||||
label="&cmd.disable.label;" accesskey="&cmd.disable.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'disable');"/>
|
||||
<menuseparator id="menuseparator_2"/>
|
||||
<menuitem id="menuitem_moveTop"
|
||||
label="&cmd.moveToTop.label;" accesskey="&cmd.moveToTop.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'move-top');"/>
|
||||
<menuitem id="menuitem_moveUp"
|
||||
label="&cmd.moveUp.label;" accesskey="&cmd.moveUp.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'move-up');"/>
|
||||
<menuitem id="menuitem_moveDn"
|
||||
label="&cmd.moveDn.label;" accesskey="&cmd.moveDn.accesskey;"
|
||||
oncommand="fireEventForElement(gExtensionsView.selected, 'move-dn');"/>
|
||||
</vbox>
|
||||
|
||||
<popup id="extensionContextMenu" onpopupshowing="return buildContextMenu(event);"/>
|
||||
|
||||
<view id="extensionsView" flex="1" style="overflow: auto;"
|
||||
datasources="rdf:null">
|
||||
<template>
|
||||
<rule>
|
||||
<conditions>
|
||||
<content uri="?uri"/>
|
||||
<member container="?uri" child="?extension"/>
|
||||
<triple subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#name"
|
||||
object="?name"/>
|
||||
<triple subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#version"
|
||||
object="?version"/>
|
||||
</conditions>
|
||||
<bindings>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#creator"
|
||||
object="?creator"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#iconURL"
|
||||
object="?icon"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#optionsURL"
|
||||
object="?options-url"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#aboutURL"
|
||||
object="?about-url"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#updateURL"
|
||||
object="?update-url"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#homepageURL"
|
||||
object="?homepage-url"/>
|
||||
<binding subject="?extension"
|
||||
predicate="http://www.mozilla.org/2004/em-rdf#description"
|
||||
object="?description"/>
|
||||
</bindings>
|
||||
<action>
|
||||
<extension uri="?extension" context="extensionContextMenu"
|
||||
image="?icon" name="?name" version="?version"
|
||||
description="?description" creator="?creator"
|
||||
optionsURL="?options-url" homepageURL="?homepage-url"
|
||||
aboutURL="?about-url" updateURL="?update-url"/>
|
||||
</action>
|
||||
</rule>
|
||||
</template>
|
||||
</view>
|
||||
<hbox>
|
||||
<hbox id="commandBar" flex="1">
|
||||
<button id="uninstallButton"
|
||||
label="&cmd.uninstall.label;" accesskey="&cmd.uninstall.accesskey;" tooltiptext="&cmd.uninstall.tooltip;"
|
||||
command="cmd_uninstall"/>
|
||||
<separator id="commandBarSeparator"/>
|
||||
<button id="updateButton"
|
||||
label="&cmd.update.label;" accesskey="&cmd.update.accesskey;" tooltiptext="&cmd.update.tooltip;"
|
||||
oncommand="onSoftwareUpdateCheck();"/>
|
||||
</hbox>
|
||||
|
||||
<resizer id="windowResizer" dir="bottomright"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
87
toolkit/mozapps/extensions/locale/extensions.dtd
Normal file
87
toolkit/mozapps/extensions/locale/extensions.dtd
Normal file
@ -0,0 +1,87 @@
|
||||
<!ENTITY name.label "Name">
|
||||
<!ENTITY progress.label "Progress">
|
||||
<!ENTITY status.label "Status">
|
||||
<!ENTITY timeremaining.label "Time Remaining">
|
||||
<!ENTITY transferred.label "Transferred">
|
||||
<!ENTITY transferrate.label "Speed">
|
||||
<!ENTITY timeelapsed.label "Time Elapsed">
|
||||
<!ENTITY status.label "Status">
|
||||
<!--<!ENTITY progresstext.label "%">-->
|
||||
<!ENTITY source.label "Source">
|
||||
|
||||
<!ENTITY done.label "Done">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!ENTITY canceled.label "Canceled">
|
||||
<!ENTITY launch.label "Launch">
|
||||
<!ENTITY divider.label "-">
|
||||
<!ENTITY show.label "Show">
|
||||
<!ENTITY open.label "Open">
|
||||
<!ENTITY retry.label "Retry">
|
||||
<!ENTITY remove.label "Remove">
|
||||
<!ENTITY pause.label "Pause">
|
||||
<!ENTITY resume.label "Resume">
|
||||
|
||||
<!ENTITY installing.label "Installing...">
|
||||
<!ENTITY pending.label "Queued, please wait...">
|
||||
<!ENTITY failed.label "Failed">
|
||||
|
||||
<!ENTITY extensions.title "Extensions">
|
||||
|
||||
<!ENTITY cmd.pause.label "Pause">
|
||||
<!ENTITY cmd.pause.accesskey "P">
|
||||
<!ENTITY cmd.resume.label "Resume">
|
||||
<!ENTITY cmd.resume.accesskey "R">
|
||||
<!ENTITY cmd.cancel.label "Cancel">
|
||||
<!ENTITY cmd.cancel.accesskey "C">
|
||||
<!ENTITY cmd.show.label "Show">
|
||||
<!ENTITY cmd.show.accesskey "S">
|
||||
<!ENTITY cmd.show.tooltipWin "Show this file in Explorer">
|
||||
<!ENTITY cmd.show.tooltipMac "Show this file in Finder">
|
||||
<!ENTITY cmd.show.tooltipUnix "Show this file in a browser window">
|
||||
<!ENTITY cmd.open.label "Open">
|
||||
<!ENTITY cmd.open.accesskey "O">
|
||||
<!ENTITY cmd.openWith.label "Open With...">
|
||||
<!ENTITY cmd.openWith.accesskey "h">
|
||||
<!ENTITY cmd.retry.label "Retry">
|
||||
<!ENTITY cmd.retry.accesskey "R">
|
||||
<!ENTITY cmd.remove.label "Remove">
|
||||
<!ENTITY cmd.remove.accesskey "e">
|
||||
<!ENTITY cmd.properties.label "Properties">
|
||||
<!ENTITY cmd.properties.accesskey "i">
|
||||
<!ENTITY cmd.info.commandKey "i">
|
||||
|
||||
<!ENTITY cmd.close.commandKey "w">
|
||||
|
||||
<!-- Command Bar items -->
|
||||
<!ENTITY cmd.uninstall.label "Uninstall">
|
||||
<!ENTITY cmd.uninstall.tooltip "Uninstalls the selected Extension">
|
||||
<!ENTITY cmd.uninstall.accesskey "i">
|
||||
<!ENTITY cmd.update.label "Update">
|
||||
<!ENTITY cmd.update.accesskey "U">
|
||||
<!ENTITY cmd.update.tooltip "Checks for Updates to your Extensions">
|
||||
|
||||
<!-- Context Menu Options: Extension -->
|
||||
<!ENTITY cmd.options.label "Options">
|
||||
<!ENTITY cmd.options.accesskey "O">
|
||||
<!ENTITY cmd.homepage.label "Visit Home Page">
|
||||
<!ENTITY cmd.homepage.accesskey "H">
|
||||
<!ENTITY cmd.about.label "About this Extension">
|
||||
<!ENTITY cmd.about.accesskey "E">
|
||||
<!ENTITY cmd.uninstall.label "Uninstall">
|
||||
<!ENTITY cmd.uninstall.accesskey "i">
|
||||
<!ENTITY cmd.update.label "Update">
|
||||
<!ENTITY cmd.update.accesskey "U">
|
||||
<!ENTITY cmd.disable.label "Disable">
|
||||
<!ENTITY cmd.disable.accesskey "D">
|
||||
<!ENTITY cmd.moveToTop.label "Move to Top">
|
||||
<!ENTITY cmd.moveToTop.accesskey "T">
|
||||
<!ENTITY cmd.moveUp.label "Move Up">
|
||||
<!ENTITY cmd.moveUp.accesskey "p">
|
||||
<!ENTITY cmd.moveDn.label "Move Down">
|
||||
<!ENTITY cmd.moveDn.accesskey "w">
|
||||
|
||||
<!-- Extension Items -->
|
||||
<!ENTITY options.tooltip "Options">
|
||||
<!ENTITY about.tooltip "About">
|
||||
<!ENTITY homepage.tooltip "Home Page">
|
||||
|
76
toolkit/mozapps/extensions/skin/extensions.css
Normal file
76
toolkit/mozapps/extensions/skin/extensions.css
Normal file
@ -0,0 +1,76 @@
|
||||
#extensionManager {
|
||||
background-color: ThreeDFace;
|
||||
}
|
||||
|
||||
/* Extension Manager Command Bar */
|
||||
#commandBar {
|
||||
padding: 0px 10px 5px 10px;
|
||||
}
|
||||
|
||||
#uninstallButton {
|
||||
margin: 0px;
|
||||
-moz-user-focus: ignore;
|
||||
list-style-image: url("chrome://mozapps/skin/extensions/extensionUninstall.png");
|
||||
}
|
||||
|
||||
#updateButton {
|
||||
margin: 0px;
|
||||
-moz-user-focus: ignore;
|
||||
list-style-image: url("chrome://mozapps/skin/extensions/extensionUpdate.png");
|
||||
}
|
||||
|
||||
#uninstallButton .button-icon, #updateButton .button-icon {
|
||||
margin: 0px 5px 0px 0px !important;
|
||||
}
|
||||
|
||||
#uninstallButton[disabled="true"] {
|
||||
list-style-image: url("chrome://mozapps/skin/downloads/downloadCleanupDisabled.png");
|
||||
}
|
||||
|
||||
#commandBarSeparator {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* Extension Buttons (Iconic buttons in each extension item) */
|
||||
.extension-button {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.extension-button[anonid="options-button"] {
|
||||
background-color: Blue;
|
||||
}
|
||||
|
||||
.extension-button[anonid="about-button"] {
|
||||
background-color: Red;
|
||||
}
|
||||
|
||||
.extension-button[anonid="homepage-button"] {
|
||||
background-color: Green;
|
||||
}
|
||||
|
||||
/* Extension List Items */
|
||||
extension[selected="true"] {
|
||||
background-image: url("chrome://mozapps/skin/shared/itemSelected.png");
|
||||
}
|
||||
|
||||
extension {
|
||||
padding: 13px 10px 13px 13px;
|
||||
min-height: 25px;
|
||||
border-bottom: 1px dotted #C0C0C0;
|
||||
background-image: url("chrome://mozapps/skin/shared/itemFader.png");
|
||||
}
|
||||
|
||||
extension[disabled="true"] {
|
||||
color: GrayText;
|
||||
}
|
||||
|
||||
.extension-item-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.extension-icon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
@ -13,6 +13,13 @@ toolkit.jar:
|
||||
* content/mozapps/downloads/download.xml (downloads/content/download.xml)
|
||||
* content/mozapps/downloads/downloadProperties.xul (downloads/content/downloadProperties.xul)
|
||||
* content/mozapps/downloads/downloadProperties.js (downloads/content/downloadProperties.js)
|
||||
* content/mozapps/extensions/extensions.xul (extensions/content/extensions.xul)
|
||||
* content/mozapps/extensions/extensions.js (extensions/content/extensions.js)
|
||||
* content/mozapps/extensions/extensions.xml (extensions/content/extensions.xml)
|
||||
* content/mozapps/extensions/extensions.css (extensions/content/extensions.css)
|
||||
* content/mozapps/extensions/about.xul (extensions/content/about.xul)
|
||||
* content/mozapps/extensions/about.js (extensions/content/about.js)
|
||||
* content/mozapps/shared/richview.xml (shared/content/richview.xml)
|
||||
content/mozapps/contents.rdf (contents-content.rdf)
|
||||
|
||||
en-US.jar:
|
||||
@ -23,7 +30,16 @@ en-US.jar:
|
||||
locale/en-US/mozapps/downloads/downloads.dtd (downloads/locale/downloads.dtd)
|
||||
locale/en-US/mozapps/downloads/downloads.properties (downloads/locale/downloads.properties)
|
||||
locale/en-US/mozapps/downloads/downloadProperties.dtd (downloads/locale/downloadProperties.dtd)
|
||||
locale/en-US/mozapps/extensions/extensions.dtd (extensions/locale/extensions.dtd)
|
||||
locale/en-US/mozapps/extensions/extensions.properties (extensions/locale/extensions.properties)
|
||||
locale/en-US/mozapps/contents.rdf (contents-locale.rdf)
|
||||
|
||||
classic.jar:
|
||||
skin/classic/mozapps/extensions/extensions.css (extensions/skin/extensions.css)
|
||||
skin/classic/mozapps/shared/richview.xml (shared/skin/richview.xml)
|
||||
skin/classic/mozapps/shared/richview.css (shared/skin/richview.css)
|
||||
skin/classic/mozapps/shared/viewFader.png (shared/skin/viewFader.png)
|
||||
skin/classic/mozapps/shared/itemFader.png (shared/skin/itemFader.png)
|
||||
skin/classic/mozapps/shared/itemSelected.png (shared/skin/itemSelected.png)
|
||||
skin/classic/mozapps/contents.rdf (contents-skin.rdf)
|
||||
|
||||
|
141
toolkit/mozapps/shared/content/richview.xml
Normal file
141
toolkit/mozapps/shared/content/richview.xml
Normal file
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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 the Rich ScrollView.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Ben Goodger.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2003-2004
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.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 *****
|
||||
|
||||
|
||||
<bindings id="richViewBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="richview-item">
|
||||
<implementation>
|
||||
<method name="fireEvent">
|
||||
<parameter name="aEventType"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var e = document.createEvent("Events");
|
||||
e.initEvent("extension-" + aEventType, false, true);
|
||||
|
||||
this.dispatchEvent(e);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="richview">
|
||||
<implementation>
|
||||
<field name="_selected">null</field>
|
||||
<property name="selected">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (this._selected)
|
||||
this._selected.removeAttribute("selected");
|
||||
this._selected = val;
|
||||
if (this._selected)
|
||||
this._selected.setAttribute("selected", "true");
|
||||
]]>
|
||||
</setter>
|
||||
<getter>
|
||||
<![CDATA[
|
||||
return this._selected;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<method name="selectionForward">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.selected) {
|
||||
if (this.selected.nextSibling)
|
||||
this.selected = this.selected.nextSibling;
|
||||
}
|
||||
else {
|
||||
if (this.hasChildNodes())
|
||||
this.selected = this.firstChild.nextSibling;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="selectionBackward">
|
||||
<parameter name="aEvent"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.selected) {
|
||||
if (this.selected.previousSibling)
|
||||
this.selected = this.selected.previousSibling;
|
||||
}
|
||||
else {
|
||||
if (this.hasChildNodes())
|
||||
this.selected = this.lastChild;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="click">
|
||||
<![CDATA[
|
||||
if (event.ctrlKey) {
|
||||
this.selected = null;
|
||||
return;
|
||||
}
|
||||
|
||||
this.selected = event.target;
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="dblclick" action="if (this.selected && event.button == 0) this.selected.fireEvent('open');"/>
|
||||
<handler event="keypress" keycode="vk_enter" action="if (this.selected) this.selected.fireEvent('open');"/>
|
||||
<handler event="keypress" keycode="vk_return" action="if (this.selected) this.selected.fireEvent('open');"/>
|
||||
<handler event="keypress" keycode="vk_up" action="this.selectionBackward(event);"/>
|
||||
<handler event="keypress" keycode="vk_left" action="this.selectionBackward(event);"/>
|
||||
<handler event="keypress" keycode="vk_down" action="this.selectionForward(event);"/>
|
||||
<handler event="keypress" keycode="vk_right" action="this.selectionForward(event);"/>
|
||||
<handler event="keypress" keycode="vk_up" modifiers="meta" action="this.selected = null"/>
|
||||
<handler event="keypress" keycode="vk_down" modifiers="meta" action="this.selected = null"/>
|
||||
<handler event="keypress" keycode="vk_left" modifiers="meta" action="this.selected = null"/>
|
||||
<handler event="keypress" keycode="vk_right" modifiers="meta" action="this.selected = null"/>
|
||||
<handler event="keypress" keycode="vk_delete" action="if (this.selected) this.selected.fireEvent('remove');"/>
|
||||
<handler event="keypress" key=" " action="if (this.selected) { this.selected.pauseResume(); }"/>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
BIN
toolkit/mozapps/shared/skin/itemFader.png
Normal file
BIN
toolkit/mozapps/shared/skin/itemFader.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 849 B |
BIN
toolkit/mozapps/shared/skin/itemSelected.png
Normal file
BIN
toolkit/mozapps/shared/skin/itemSelected.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
21
toolkit/mozapps/shared/skin/richview.css
Normal file
21
toolkit/mozapps/shared/skin/richview.css
Normal file
@ -0,0 +1,21 @@
|
||||
/* Generic RichView */
|
||||
|
||||
view {
|
||||
margin: 10px 10px 5px 10px;
|
||||
-moz-appearance: listbox;
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
|
||||
.richviewInner2 {
|
||||
background-image: url("chrome://mozapps/skin/shared/viewFader.png");
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.richviewInner1 {
|
||||
background-color: Window;
|
||||
background-image: inherit;
|
||||
background-attachment: fixed;
|
||||
background-repeat: no-repeat;
|
||||
background-position: bottom right;
|
||||
}
|
||||
|
22
toolkit/mozapps/shared/skin/richview.xml
Normal file
22
toolkit/mozapps/shared/skin/richview.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="richviewSkinBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="richview" extends="chrome://mozapps/content/shared/richview.xml#richview">
|
||||
<resources>
|
||||
<stylesheet src="chrome://mozapps/skin/shared/richview.css"/>
|
||||
</resources>
|
||||
<content>
|
||||
<xul:vbox flex="1" class="richviewInner1">
|
||||
<xul:vbox flex="1" class="richviewInner2">
|
||||
<children/>
|
||||
</xul:vbox>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
BIN
toolkit/mozapps/shared/skin/viewFader.png
Normal file
BIN
toolkit/mozapps/shared/skin/viewFader.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 849 B |
Loading…
Reference in New Issue
Block a user