зеркало из https://github.com/mozilla/gecko-dev.git
Move history resources here from rdf/resources.
This commit is contained in:
Родитель
2c7329f66e
Коммит
c9ed1229ff
|
@ -0,0 +1,198 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="history.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY newWinCmd.label "New Window">
|
||||
<!ENTITY closeCmd.label ".Close">
|
||||
<!ENTITY editMenu.label "Edit">
|
||||
<!ENTITY undoCmd.label "Undo">
|
||||
<!ENTITY redoCmd.label "Redo">
|
||||
<!ENTITY cutCmd.label "Cut">
|
||||
<!ENTITY copyCmd.label "Copy">
|
||||
<!ENTITY pasteCmd.label "Paste">
|
||||
<!ENTITY deleteCmd.label "Delete">
|
||||
<!ENTITY selAllCmd.label "Select All">
|
||||
<!ENTITY findHisCmd.label "Find in History...">
|
||||
<!ENTITY findAgainCmd.label "Find Again...">
|
||||
<!ENTITY historyBySite.label "History By Site">
|
||||
<!ENTITY historyByDate.label "History By Date">
|
||||
<!ENTITY historyWindowTitle.label "History">
|
||||
]>
|
||||
|
||||
<window title="&historyWindowTitle.label;"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script>
|
||||
|
||||
function HistoryNewWindow()
|
||||
{
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.ShowWindow("resource:/res/rdf/history.xul",
|
||||
window);
|
||||
}
|
||||
}
|
||||
|
||||
function OpenURL(event,node)
|
||||
{
|
||||
|
||||
url = node.getAttribute('id');
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:") {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*window.open(url,'bookmarks');*/
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.ShowWindow(url,window);
|
||||
}
|
||||
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function doSort(sortColName)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!node) return(false);
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
sortDirection = "descending";
|
||||
else if (currentDirection == "descending")
|
||||
sortDirection = "natural";
|
||||
else sortDirection = "ascending";
|
||||
}
|
||||
|
||||
// get RDF Core service
|
||||
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||
if (!rdfCore)
|
||||
{
|
||||
rdfCore = new RDFCore();
|
||||
if (!rdfCore)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
rdfCore.Init("RDFCore");
|
||||
}
|
||||
// sort!!!
|
||||
rdfCore.doSort(node, sortResource, sortDirection);
|
||||
return(false);
|
||||
}
|
||||
|
||||
</html:script>
|
||||
|
||||
<menubar>
|
||||
<menu name="&fileMenu.label;">
|
||||
<menuitem name="&newWinCmd.label;" onclick="HistoryNewWindow();"/>
|
||||
<separator/>
|
||||
<menuitem name="&closeCmd.label;"/>
|
||||
</menu>
|
||||
<menu name="&editMenu.label;">
|
||||
<menuitem name="&undoCmd.label;"/>
|
||||
<menuitem name="&redoCmd.label;"/>
|
||||
<separator/>
|
||||
<menuitem name="&cutCmd.label;"/>
|
||||
<menuitem name="©Cmd.label;"/>
|
||||
<menuitem name="&pasteCmd.label;"/>
|
||||
<menuitem name="&deleteCmd.label;"/>
|
||||
<menuitem name="&selAllCmd.label;"/>
|
||||
<separator/>
|
||||
<menuitem name="&findHisCmd.label;"/>
|
||||
<menuitem name="&findAgainCmd.label;"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tree rdf:datasources="rdf:history" ondblclick="return OpenURL(event,event.target.parentNode);">
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treebody" subcontainment="treechildren">
|
||||
<treeitem uri="...">
|
||||
<treecell>
|
||||
<html:hr width="75%" align="center" size="1" />
|
||||
</treecell>
|
||||
</treeitem>
|
||||
</rule>
|
||||
|
||||
<rule rootcontainment="treebody" subcontainment="treechildren">
|
||||
<treeitem uri="...">
|
||||
<treecell>
|
||||
<treeindentation />
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
|
||||
</treecell>
|
||||
<treecell>
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#URL" align="right" style="list-style-image: none;" />
|
||||
</treecell>
|
||||
<treecell>
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" align="right" style="list-style-image: none;" />
|
||||
</treecell>
|
||||
</treeitem>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecol id="URLColumn" rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecol id="ShortcutURLColumn" rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell onclick="return doSort('NameColumn');">
|
||||
<xul:observes element="NameColumn" attribute="sortActive"/>
|
||||
<xul:observes element="NameColumn" attribute="sortDirection"/>
|
||||
Name</treecell>
|
||||
<treecell onclick="return doSort('URLColumn');">
|
||||
<xul:observes element="URLColumn" attribute="sortActive"/>
|
||||
<xul:observes element="URLColumn" attribute="sortDirection"/>
|
||||
URL</treecell>
|
||||
<treecell onclick="return doSort('ShortcutURLColumn');">
|
||||
<xul:observes element="ShortcutURLColumn" attribute="sortActive"/>
|
||||
<xul:observes element="ShortcutURLColumn" attribute="sortDirection"/>
|
||||
Shortcut URL</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody>
|
||||
<treeitem id="NC:HistoryBySite" open="true">
|
||||
<treecell>&historyBySite.label;</treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
</treeitem>
|
||||
|
||||
<treeitem id="NC:HistoryByDate" open="true">
|
||||
<treecell>&historyByDate.label;</treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
</treeitem>
|
||||
|
||||
</treebody>
|
||||
|
||||
</tree>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,2 @@
|
|||
history.xul
|
||||
history.css
|
|
@ -22,8 +22,15 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
# Nuthin' to do yet...
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
FILES = \
|
||||
history.xul \
|
||||
history.css \
|
||||
$(NULL)
|
||||
|
||||
FILES := $(addprefix $(srcdir)/, $(FILES))
|
||||
|
||||
install::
|
||||
$(INSTALL) $(FILES) $(DIST)/bin/res/samples
|
||||
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
window {
|
||||
display: block;
|
||||
}
|
||||
|
||||
menubar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
tree {
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
background-color: #FFFFFF;
|
||||
border: none;
|
||||
border-spacing: 0px;
|
||||
// border-collapse: collapse;
|
||||
// width: 100%;
|
||||
}
|
||||
|
||||
treecol {
|
||||
display: table-column;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
treeitem {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
treehead {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
treebody {
|
||||
display: table-row-group;
|
||||
}
|
||||
|
||||
treecell {
|
||||
display: table-cell;
|
||||
font-family: Verdana, Sans-Serif;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
treecell[selectedcell] {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
treecell[sortActive="true"][sortDirection="ascending"] {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
treecell[sortActive="true"][sortDirection="descending"] {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
treecol[sortActive="true"] {
|
||||
background-color: lightgreen;
|
||||
}
|
||||
|
||||
treehead treeitem treecell {
|
||||
background-color: #c0c0c0;
|
||||
border: outset 1px;
|
||||
border-color: white #707070 #707070 white;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
treecell[selectedcell] {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/personal-folder-closed.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/personal-folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-item.gif");
|
||||
}
|
|
@ -0,0 +1,198 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="history.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY newWinCmd.label "New Window">
|
||||
<!ENTITY closeCmd.label ".Close">
|
||||
<!ENTITY editMenu.label "Edit">
|
||||
<!ENTITY undoCmd.label "Undo">
|
||||
<!ENTITY redoCmd.label "Redo">
|
||||
<!ENTITY cutCmd.label "Cut">
|
||||
<!ENTITY copyCmd.label "Copy">
|
||||
<!ENTITY pasteCmd.label "Paste">
|
||||
<!ENTITY deleteCmd.label "Delete">
|
||||
<!ENTITY selAllCmd.label "Select All">
|
||||
<!ENTITY findHisCmd.label "Find in History...">
|
||||
<!ENTITY findAgainCmd.label "Find Again...">
|
||||
<!ENTITY historyBySite.label "History By Site">
|
||||
<!ENTITY historyByDate.label "History By Date">
|
||||
<!ENTITY historyWindowTitle.label "History">
|
||||
]>
|
||||
|
||||
<window title="&historyWindowTitle.label;"
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script>
|
||||
|
||||
function HistoryNewWindow()
|
||||
{
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.ShowWindow("resource:/res/rdf/history.xul",
|
||||
window);
|
||||
}
|
||||
}
|
||||
|
||||
function OpenURL(event,node)
|
||||
{
|
||||
|
||||
url = node.getAttribute('id');
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:") {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*window.open(url,'bookmarks');*/
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.ShowWindow(url,window);
|
||||
}
|
||||
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function doSort(sortColName)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!node) return(false);
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
sortDirection = "descending";
|
||||
else if (currentDirection == "descending")
|
||||
sortDirection = "natural";
|
||||
else sortDirection = "ascending";
|
||||
}
|
||||
|
||||
// get RDF Core service
|
||||
var rdfCore = XPAppCoresManager.Find("RDFCore");
|
||||
if (!rdfCore)
|
||||
{
|
||||
rdfCore = new RDFCore();
|
||||
if (!rdfCore)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
rdfCore.Init("RDFCore");
|
||||
}
|
||||
// sort!!!
|
||||
rdfCore.doSort(node, sortResource, sortDirection);
|
||||
return(false);
|
||||
}
|
||||
|
||||
</html:script>
|
||||
|
||||
<menubar>
|
||||
<menu name="&fileMenu.label;">
|
||||
<menuitem name="&newWinCmd.label;" onclick="HistoryNewWindow();"/>
|
||||
<separator/>
|
||||
<menuitem name="&closeCmd.label;"/>
|
||||
</menu>
|
||||
<menu name="&editMenu.label;">
|
||||
<menuitem name="&undoCmd.label;"/>
|
||||
<menuitem name="&redoCmd.label;"/>
|
||||
<separator/>
|
||||
<menuitem name="&cutCmd.label;"/>
|
||||
<menuitem name="©Cmd.label;"/>
|
||||
<menuitem name="&pasteCmd.label;"/>
|
||||
<menuitem name="&deleteCmd.label;"/>
|
||||
<menuitem name="&selAllCmd.label;"/>
|
||||
<separator/>
|
||||
<menuitem name="&findHisCmd.label;"/>
|
||||
<menuitem name="&findAgainCmd.label;"/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<tree rdf:datasources="rdf:history" ondblclick="return OpenURL(event,event.target.parentNode);">
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator" rootcontainment="treebody" subcontainment="treechildren">
|
||||
<treeitem uri="...">
|
||||
<treecell>
|
||||
<html:hr width="75%" align="center" size="1" />
|
||||
</treecell>
|
||||
</treeitem>
|
||||
</rule>
|
||||
|
||||
<rule rootcontainment="treebody" subcontainment="treechildren">
|
||||
<treeitem uri="...">
|
||||
<treecell>
|
||||
<treeindentation />
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#Name" align="right" />
|
||||
</treecell>
|
||||
<treecell>
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#URL" align="right" style="list-style-image: none;" />
|
||||
</treecell>
|
||||
<treecell>
|
||||
<titledbutton value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL" align="right" style="list-style-image: none;" />
|
||||
</treecell>
|
||||
</treeitem>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecol id="NameColumn" rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecol id="URLColumn" rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecol id="ShortcutURLColumn" rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell onclick="return doSort('NameColumn');">
|
||||
<xul:observes element="NameColumn" attribute="sortActive"/>
|
||||
<xul:observes element="NameColumn" attribute="sortDirection"/>
|
||||
Name</treecell>
|
||||
<treecell onclick="return doSort('URLColumn');">
|
||||
<xul:observes element="URLColumn" attribute="sortActive"/>
|
||||
<xul:observes element="URLColumn" attribute="sortDirection"/>
|
||||
URL</treecell>
|
||||
<treecell onclick="return doSort('ShortcutURLColumn');">
|
||||
<xul:observes element="ShortcutURLColumn" attribute="sortActive"/>
|
||||
<xul:observes element="ShortcutURLColumn" attribute="sortDirection"/>
|
||||
Shortcut URL</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody>
|
||||
<treeitem id="NC:HistoryBySite" open="true">
|
||||
<treecell>&historyBySite.label;</treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
</treeitem>
|
||||
|
||||
<treeitem id="NC:HistoryByDate" open="true">
|
||||
<treecell>&historyByDate.label;</treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
<treecell></treecell>
|
||||
</treeitem>
|
||||
|
||||
</treebody>
|
||||
|
||||
</tree>
|
||||
|
||||
</window>
|
|
@ -19,8 +19,18 @@ IGNORE_MANIFEST=1
|
|||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
FILES=\
|
||||
history.xul \
|
||||
history.css \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
# Nuthin' to do yet...
|
||||
install:: $(FILES:/=\)
|
||||
!@$(MAKE_INSTALL) $** $(DIST)\bin\res\samples
|
||||
|
||||
clobber:: $(FILES:/=\)
|
||||
!$(RM) $(DIST)\bin\res\samples\$**
|
||||
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче