Initial revision. Not yet in the build.
git-svn-id: svn://10.0.0.236/trunk@34741 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
79
mozilla/suite/common/bookmarks/bm-panel.xul
Normal file
79
mozilla/suite/common/bookmarks/bm-panel.xul
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
The contents of this file are subject to the Netscape Public License
|
||||
Version 1.0 (the "NPL"); you may not use this file except in
|
||||
compliance with the NPL. You may obtain a copy of the NPL at
|
||||
http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
for the specific language governing rights and limitations under the
|
||||
NPL.
|
||||
|
||||
The Initial Developer of this code under the NPL is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
Reserved.
|
||||
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="resource:/res/rdf/sidebar.css" type="text/css"?>
|
||||
|
||||
<xul:window
|
||||
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 src="bookmarks.js"/>
|
||||
|
||||
<tree id="bookmarksTree"
|
||||
datasources="rdf:bookmarks rdf:files rdf:ftp rdf:find"
|
||||
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>
|
||||
</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"/>
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell onclick="return doSort('NameColumn');">
|
||||
<observes element="NameColumn" attribute="sortActive"/>
|
||||
<observes element="NameColumn" attribute="sortDirection"/>
|
||||
Name</treecell>
|
||||
<treecell onclick="return doSort('URLColumn');">
|
||||
<observes element="URLColumn" attribute="sortActive"/>
|
||||
<observes element="URLColumn" attribute="sortDirection"/>
|
||||
URL</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody id="NC:BookmarksRoot">
|
||||
</treebody>
|
||||
</tree>
|
||||
|
||||
</xul:window>
|
||||
|
||||
118
mozilla/suite/common/bookmarks/bm-props.xul
Normal file
118
mozilla/suite/common/bookmarks/bm-props.xul
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
|
||||
<!--
|
||||
|
||||
The contents of this file are subject to the Netscape Public License
|
||||
Version 1.0 (the "NPL"); you may not use this file except in
|
||||
compliance with the NPL. You may obtain a copy of the NPL at
|
||||
http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
for the specific language governing rights and limitations under the
|
||||
NPL.
|
||||
|
||||
The Initial Developer of this code under the NPL is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
Reserved.
|
||||
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="bookmarks.css" type="text/css"?>
|
||||
|
||||
<xul:window
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns="http://www.w3.org/TR/REC-html40"
|
||||
title="Bookmark Properties">
|
||||
|
||||
|
||||
<xul:data>
|
||||
<xul:broadcaster id="properties_node"/>
|
||||
<xul:broadcaster id="dialog.start" ready="false"/>
|
||||
<xul:observes element="dialog.start" attribute="ready" onchange="onLoad()"/>
|
||||
</xul:data>
|
||||
|
||||
<script>
|
||||
var node;
|
||||
var form_ids;
|
||||
var bm_attrs;
|
||||
|
||||
function onLoad() {
|
||||
node = new Object;
|
||||
node = document.getElementById("properties_node");
|
||||
|
||||
form_ids = new Array("name", "url", "shortcut", "description");
|
||||
bm_attrs = new Array("Name", "url", "ShortcutURL", "Description");
|
||||
|
||||
var element;
|
||||
var value;
|
||||
for (var ii=0; ii != form_ids.length; ii++) {
|
||||
element = document.getElementById(form_ids[ii]);
|
||||
value = node.getAttribute(bm_attrs[ii]);
|
||||
element.setAttribute("value", value);
|
||||
}
|
||||
}
|
||||
function commit() {
|
||||
var element;
|
||||
var value;
|
||||
for (var ii=0; ii != form_ids.length; ii++) {
|
||||
element = document.getElementById(form_ids[ii]);
|
||||
node.setAttribute(bm_attrs[ii], element.value);
|
||||
}
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
closeDialog();
|
||||
}
|
||||
function closeDialog() {
|
||||
// XXX This needs to be replaced with window.close()!
|
||||
var toolkitCore = XPAppCoresManager.Find("toolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("toolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.CloseWindow(window);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<table><tr><td>
|
||||
<table>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Name:
|
||||
</td><td>
|
||||
<input type="text" id="name" size="60"/>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td align="right">
|
||||
Location:
|
||||
</td><td>
|
||||
<input type="text" id="url" size="60"/>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td align="right">
|
||||
Shortcut:
|
||||
</td><td>
|
||||
<input type="text" id="shortcut" size="60"/>
|
||||
</td>
|
||||
</tr><tr valign="top">
|
||||
<td align="right">
|
||||
Description:
|
||||
</td><td>
|
||||
<textarea id="description" rows="7" cols="60" wrap="hard">
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr><tr><td>
|
||||
<table width="100%"><tr align="center"><td>
|
||||
<input type="button" value="Ok" onclick="return commit();"/>
|
||||
</td><td>
|
||||
<input type="button" value="Cancel" onclick="return cancel();"/>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
</xul:window>
|
||||
126
mozilla/suite/common/bookmarks/bookmarks.css
Normal file
126
mozilla/suite/common/bookmarks/bookmarks.css
Normal file
@@ -0,0 +1,126 @@
|
||||
window {
|
||||
display: block;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
menubar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
tree {
|
||||
display: table;
|
||||
background-color: #FFFFFF;
|
||||
border: none;
|
||||
border-spacing: 0px;
|
||||
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[container="true"][open="true"][loading="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/loading.gif") ! important ;
|
||||
}
|
||||
|
||||
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#BookmarkSeparator"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-item.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/IEFavorite.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-item.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/article.gif");
|
||||
}
|
||||
|
||||
treeitem[container="true"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/folder-open.gif");
|
||||
}
|
||||
|
||||
treeitem[container="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/folder-closed.gif");
|
||||
}
|
||||
|
||||
treeitem > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/document.gif");
|
||||
}
|
||||
|
||||
titledbutton#bookmarks {
|
||||
list-style-image:url("resource:/res/rdf/bookmark-item.gif");
|
||||
}
|
||||
131
mozilla/suite/common/bookmarks/bookmarks.js
Normal file
131
mozilla/suite/common/bookmarks/bookmarks.js
Normal file
@@ -0,0 +1,131 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Script for the bookmarks properties window
|
||||
|
||||
*/
|
||||
|
||||
function BookmarksNewWindow()
|
||||
{
|
||||
// XXX This needs to be "window.open()", I think...
|
||||
var toolkitCore = XPAppCoresManager.Find("toolkitCore");
|
||||
if (!toolkitCore) {
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore) {
|
||||
toolkitCore.Init("toolkitCore");
|
||||
}
|
||||
}
|
||||
if (toolkitCore) {
|
||||
toolkitCore.ShowWindow("resource://res/rdf/bookmarks.xul",window);
|
||||
}
|
||||
}
|
||||
|
||||
function BookmarkProperties()
|
||||
{
|
||||
var tree = document.getElementById('bookmarksTree');
|
||||
var select_list = tree.getElementsByAttribute("selected", "true");
|
||||
|
||||
if (select_list.length >= 1) {
|
||||
dump("Bookmark Properties: Have selection\n");
|
||||
var propsCore = XPAppCoresManager.Find(select_list[0].id);
|
||||
if (!propsCore) {
|
||||
dump("Bookmark Properties: no existing appcore\n");
|
||||
var propsCore = new DOMPropsCore();
|
||||
if (propsCore) {
|
||||
dump("Bookmark Properties: initing new appcore\n");
|
||||
propsCore.Init(select_list[0].id);
|
||||
} else {
|
||||
dump("Bookmark Properties: failed to create new appcore\n");
|
||||
}
|
||||
}
|
||||
if (propsCore) {
|
||||
dump("Bookmark Properties: opening new window\n");
|
||||
propsCore.showProperties("resource://res/rdf/bm-props.xul",
|
||||
window, select_list[0]);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
dump("nothing selected!\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function OpenURL(event,node)
|
||||
{
|
||||
if (node.getAttribute('container') == "true") {
|
||||
return false;
|
||||
}
|
||||
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");
|
||||
// XPAppCoresManager.Add(rdfCore);
|
||||
}
|
||||
// sort!!!
|
||||
rdfCore.doSort(node, sortResource, sortDirection);
|
||||
return(false);
|
||||
}
|
||||
Reference in New Issue
Block a user