This commit is contained in:
blakeross%telocity.com 2002-08-15 00:22:41 +00:00
Родитель a1f760cdec
Коммит 6d79590a7e
36 изменённых файлов: 2159 добавлений и 1 удалений

Просмотреть файл

@ -42,6 +42,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = prefwindow history
DIRS = prefwindow history bookmarks
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

@ -0,0 +1,30 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,341 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Goodger <ben@netscape.com> (Original Author)
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
* Add Bookmark Dialog.
* ====================
*
* This is a generic bookmark dialog that allows for bookmark addition
* and folder selection. It can be opened with various parameters that
* result in appearance/purpose differences and initial state.
*
* Use: Open with 'openDialog', with the flags
* 'centerscreen,chrome,dialog=no,resizable=yes'
*
* Parameters:
* Apart from the standard openDialog parameters, this dialog can
* be passed additional information, which gets mapped to the
* window.arguments array:
*
* window.arguments[0]: Bookmark Name. The value to be prefilled
* into the "Name: " field (if visible).
* window.arguments[1]: Bookmark URL: The location of the bookmark.
* The value to be filled in the "Location: "
* field (if visible).
* window.arguments[2]: Bookmark Folder. The RDF Resource URI of the
* folder that this bookmark should be created in.
* window.arguments[3]: Bookmark Charset. The charset that should be
* used when adding a bookmark to the specified
* URL. (Usually the charset of the current
* document when launching this window).
* window.arguments[4]: The mode of operation. See notes for details.
* window.arguments[5]: If the mode is "addGroup", this is an array
* of objects with name, URL and charset
* properties, one for each group member.
*
* Mode of Operation Notes:
* ------------------------
* This dialog can be opened in four different ways by using a parameter
* passed through the call to openDialog. The 'mode' of operation
* of the window is expressed in window.arguments[4]. The valid modes are:
*
* 1) <default> (no fifth open parameter).
* Opens this dialog with the bookmark Name, URL and folder selection
* components visible.
* 2) "newBookmark" (fifth open parameter = String("newBookmark"))
* Opens the dialog as in (1) above except the folder selection tree
* is hidden. This type of mode is useful when the creation folder
* is pre-determined.
* 3) "selectFolder" (fifth open parameter = String("selectFolder"))
* Opens the dialog as in (1) above except the Name/Location section
* is hidden, and the dialog takes on the utility of a Folder chooser.
* Used when the user must select a Folder for some purpose.
* 4) "addGroup" (fifth open parameter = String("addGroup"))
* Opens the dialog like <default>, with a checkbox to select between
* filing a single bookmark or a group. For the single bookmark the
* values are taken from the name, URL and charset arguments.
* For the group, the values are taken from the sixth argument.
* This parameter can also be String("addGroup,group") where "group"
* specifies that the dialog starts in filing as a group.
*/
var gFld_Name = null;
var gFld_URL = null;
var gFolderTree = null;
var gCB_AddGroup = null;
var gBookmarkCharset = null;
const kRDFSContractID = "@mozilla.org/rdf/rdf-service;1";
const kRDFSIID = Components.interfaces.nsIRDFService;
const kRDF = Components.classes[kRDFSContractID].getService(kRDFSIID);
var gSelectItemObserver = null;
var gCreateInFolder = "NC:NewBookmarkFolder";
function Startup()
{
gFld_Name = document.getElementById("name");
gFld_URL = document.getElementById("url");
gCB_AddGroup = document.getElementById("addgroup");
var bookmarkView = document.getElementById("bookmarks-view");
var shouldSetOKButton = true;
var dialogElement = document.documentElement;
if ("arguments" in window) {
var ind;
var folderItem = null;
var arg;
if (window.arguments.length < 5)
arg = null;
else
arg = window.arguments[4];
switch (arg) {
case "selectFolder":
// If we're being opened as a folder selection window
document.getElementById("bookmarknamegrid").setAttribute("hidden", "true");
document.getElementById("createinseparator").setAttribute("hidden", "true");
document.getElementById("nameseparator").setAttribute("hidden", "true");
sizeToContent();
dialogElement.setAttribute("title", dialogElement.getAttribute("title-selectFolder"));
shouldSetOKButton = false;
if (window.arguments[2])
folderItem = bookmarkView.rdf.GetResource(window.arguments[2]);
if (folderItem) {
ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem);
bookmarkView.treeBoxObject.selection.select(ind);
}
break;
case "newBookmark":
setupFields();
if (window.arguments[2])
gCreateInFolder = window.arguments[2];
document.getElementById("folderbox").setAttribute("hidden", "true");
sizeToFit();
break;
case "addGroup":
document.getElementById("showaddgroup").setAttribute("hidden", "false");
setupFields();
sizeToFit();
break;
case "addGroup,group":
document.getElementById("showaddgroup").setAttribute("hidden", "false");
gCB_AddGroup.setAttribute("checked", "true");
setupFields();
toggleGroup();
sizeToFit();
break;
default:
// Regular Add Bookmark
setupFields();
if (window.arguments[2]) {
gCreateInFolder = window.arguments[2];
folderItem = bookmarkView.rdf.GetResource(gCreateInFolder);
if (folderItem) {
ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem);
bookmarkView.treeBoxObject.selection.select(ind);
}
}
}
}
if (shouldSetOKButton)
onFieldInput();
if (document.getElementById("bookmarknamegrid").hasAttribute("hidden")) {
bookmarkView.tree.focus();
if (bookmarkView.currentIndex == -1)
bookmarkView.treeBoxObject.selection.select(0);
}
else {
gFld_Name.select();
gFld_Name.focus();
}
}
function sizeToFit()
{
var dialogElement = document.documentElement;
dialogElement.removeAttribute("persist");
dialogElement.removeAttribute("height");
dialogElement.removeAttribute("width");
dialogElement.setAttribute("style", dialogElement.getAttribute("style"));
sizeToContent();
}
function setupFields()
{
// New bookmark in predetermined folder.
gFld_Name.value = window.arguments[0] || "";
gFld_URL.value = window.arguments[1] || "";
onFieldInput();
gFld_Name.select();
gFld_Name.focus();
gBookmarkCharset = window.arguments[3] || null;
}
function onFieldInput()
{
const ok = document.documentElement.getButton("accept");
ok.disabled = gFld_URL.value == "" && !addingGroup() ||
gFld_Name.value == "";
}
function onOK()
{
if (!document.getElementById("folderbox").hasAttribute("hidden")) {
var bookmarkView = document.getElementById("bookmarks-view");
var currentIndex = bookmarkView.currentIndex;
if (currentIndex != -1)
gCreateInFolder = bookmarkView.treeBuilder.getResourceAtIndex(currentIndex).Value;
}
// In Select Folder Mode, do nothing but tell our caller what
// folder was selected.
if (window.arguments.length > 4 && window.arguments[4] == "selectFolder")
window.arguments[5].selectedFolder = gCreateInFolder;
else {
// Otherwise add a bookmark to the selected folder.
const kBMDS = kRDF.GetDataSource("rdf:bookmarks");
const kBMSContractID = "@mozilla.org/browser/bookmarks-service;1";
const kBMSIID = Components.interfaces.nsIBookmarksService;
const kBMS = Components.classes[kBMSContractID].getService(kBMSIID);
var rFolder = kRDF.GetResource(gCreateInFolder, true);
const kRDFCContractID = "@mozilla.org/rdf/container;1";
const kRDFIID = Components.interfaces.nsIRDFContainer;
const kRDFC = Components.classes[kRDFCContractID].getService(kRDFIID);
try {
kRDFC.Init(kBMDS, rFolder);
}
catch (e) {
// No "NC:NewBookmarkFolder" exists, just append to the root.
rFolder = kRDF.GetResource("NC:BookmarksRoot", true);
kRDFC.Init(kBMDS, rFolder);
}
// if no URL was provided and we're not filing as a group, do nothing
if (!gFld_URL.value && !addingGroup())
return;
var url;
if (addingGroup()) {
const group = kBMS.createGroup(gFld_Name.value, rFolder);
const groups = window.arguments[5];
for (var i = 0; i < groups.length; ++i) {
url = getNormalizedURL(groups[i].url);
kBMS.createBookmarkWithDetails(groups[i].name, url,
groups[i].charset, group, -1);
}
} else {
url = getNormalizedURL(gFld_URL.value);
var newBookmark = kBMS.createBookmarkWithDetails(gFld_Name.value, url, gBookmarkCharset, rFolder, -1);
if (window.arguments.length > 4 && window.arguments[4] == "newBookmark") {
window.arguments[5].newBookmark = newBookmark;
}
}
}
}
function getNormalizedURL(url)
{
// Check to see if the item is a local directory path, and if so, convert
// to a file URL so that aggregation with rdf:files works
try {
const kLF = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
kLF.initWithPath(url);
if (kLF.exists()) {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.classes.nsIIOService);
url = ioService.getURLSpecFromFile(kLF);
}
}
catch (e) {
}
return url;
}
var gBookmarksShell = null;
function createNewFolder ()
{
var bookmarksView = document.getElementById("bookmarks-view");
bookmarksView.createNewFolder();
}
function useDefaultFolder ()
{
var bookmarkView = document.getElementById("bookmarks-view");
var folder = BookmarksUtils.getNewBookmarkFolder();
var ind = bookmarkView.treeBuilder.getIndexOfResource(folder);
if (ind != -1) {
bookmarkView.tree.focus();
bookmarkView.treeBoxObject.selection.select(ind);
} else {
bookmarkView.treeBoxObject.selection.clearSelection();
}
gCreateInFolder = folder.Value;
}
var gOldNameValue = "";
var gOldURLValue = "";
function toggleGroup()
{
// swap between single bookmark and group name
var temp = gOldNameValue;
gOldNameValue = gFld_Name.value;
gFld_Name.value = temp;
// swap between single bookmark and group url
temp = gOldURLValue;
gOldURLValue = gFld_URL.value;
gFld_URL.value = temp;
gFld_URL.disabled = gCB_AddGroup.getAttribute("checked") == "true";
gFld_Name.select();
gFld_Name.focus();
onFieldInput();
}
function addingGroup()
{
const showAddGroup = document.getElementById("showaddgroup");
return showAddGroup.getAttribute("hidden") != "true" && gCB_AddGroup.getAttribute("checked") == "true";
}

Просмотреть файл

@ -0,0 +1,118 @@
<?xml version="1.0"?>
<!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
<!--
The contents of this file are subject to the Netscape 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/NPL/
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.org code.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger <ben@netscape.com> (Original Author)
-->
<?xml-stylesheet href="chrome://communicator/skin/"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>
<?xml-stylesheet href="chrome://communicator/content/bookmarks/bookmarks.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % addBookmarkDTD SYSTEM "chrome://communicator/locale/bookmarks/addBookmark.dtd">
%addBookmarkDTD;
]>
<dialog id="newBookmarkDialog" style="width: 36em;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
ondialogaccept="return onOK(event)"
title="&newBookmark.title;" title-selectFolder="&selectFolder.label;"
onload="Startup();"
persist="screenX screenY width height"
screenX="24" screenY="24">
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksTree.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/addBookmark.js"/>
<stringbundle id="bookmarksbundle"
src="chrome://communicator/locale/bookmarks/bookmark.properties"/>
<broadcaster id="showaddgroup" hidden="true"/>
<separator id="nameseparator" class="thin"/>
<grid id="bookmarknamegrid">
<columns>
<column/>
<column flex="5"/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&name.label;" accesskey="&name.accesskey;" control="name"/>
<textbox id="name" oninput="onFieldInput();"/>
<spacer/>
</row>
<row>
<separator class="thin"/>
<separator class="thin"/>
<spacer/>
</row>
<row align="center">
<label value="&url.label;" accesskey="&url.accesskey;" control="url"/>
<textbox id="url" oninput="onFieldInput();"/>
<spacer/>
</row>
<row observes="showaddgroup">
<separator class="thin"/>
<separator class="thin"/>
<spacer/>
</row>
<row observes="showaddgroup">
<spacer/>
<hbox pack="start">
<checkbox id="addgroup" label="&addGroup.label;"
accesskey="&addGroup.accesskey;" oncommand="toggleGroup();"/>
</hbox>
<spacer/>
</row>
</rows>
</grid>
<separator id="createinseparator"/>
<vbox id="folderbox" flex="1">
<separator/>
<hbox flex="1">
<label id="createinlabel" value="&createin.label;"/>
<hbox flex="1">
<bookmarks-tree id="bookmarks-view" flex="1" type="folders"/>
<vbox>
<button label="&button.newfolder.label;" accesskey="&button.newfolder.accesskey;"
oncommand="createNewFolder();"/>
<button label="&button.defaultfolder.label;"
accesskey="&button.defaultfolder.accesskey;"
oncommand="useDefaultFolder();"/>
</vbox>
</hbox>
</hbox>
</vbox>
<separator/>
</dialog>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,14 @@
bookmarks-tree, bookmarks-tree[type="multi-column"]
{
-moz-binding : url("chrome://communicator/content/bookmarks/bookmarks.xml#bookmarks-tree-full");
}
bookmarks-tree[type="single-column"]
{
-moz-binding : url("chrome://communicator/content/bookmarks/bookmarks.xml#bookmarks-tree-name");
}
bookmarks-tree[type="folders"]
{
-moz-binding : url("chrome://communicator/content/bookmarks/bookmarks.xml#bookmarks-tree-folders");
}

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,237 @@
<?xml version="1.0"?>
<!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
<!--
The contents of this file are subject to the Netscape 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/NPL/
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.org code.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger <ben@netscape.com>
Blake Ross <blakeross@telocity.com>
Dean Tessman <dean_tessman@hotmail.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarksWindow.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/content/bookmarks/bookmarks.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://browser/content/bookmarks/bookmarksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % utilDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd" >
%utilDTD;
<!ENTITY % bmDTD SYSTEM "chrome://browser/locale/bookmarks/bookmarks.dtd">
%bmDTD;
]>
<window id="bookmark-window" windowtype="bookmarks:manager"
title="&bookmarksWindowTitle.label;"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:web="http://home.netscape.com/WEB-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="630" height="400" screenX="20" screenY="20"
persist="width height screenX screenY sizemode"
onload="Startup();" onunload="Shutdown();">
<!-- The order of loading of these script files is IMPORTANT -->
<!-- Shared Libraries -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"></script>
<!-- XXX - This should SO become an XBL widget -->
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
<!-- Shared Bookmarks Utility Library -->
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksOverlay.js"/>
<!-- Tree-based Bookmarks UI Utility Library -->
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksTree.js"/>
<!-- Bookmarks Window -->
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<!-- Bookmarks Window Drag & Drop -->
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksDD.js"/>
<popupset id="bookmarksPopupset"/>
<commands id="commands">
<commandset id="CommandUpdate_Bookmarks"
commandupdater="true"
events="focus,tree-select"
oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
</commandset>
<commandset id="tasksCommands"/>
<!-- File Menu -->
<command id="cmd_close" oncommand="close()"/>
<!-- Edit Menu -->
<command id="cmd_undo"/>
</commands>
<stringbundleset id="stringbundleset"/>
<keyset id="tasksKeys">
<!-- File Menu -->
<key id="key_close"/>
<key id="key_quit"/>
<!-- Edit Menu -->
<key id="key_undo"/>
<!-- These keybindings do not have a command specified in the overlay,
which is good, but we need to specify it ourselves here -->
<key id="key_cut" command="cmd_bm_cut"/>
<key id="key_copy" command="cmd_bm_copy"/>
<key id="key_paste" command="cmd_bm_paste"/>
<key id="key_selectAll" command="cmd_bm_selectAll"/>
<!-- We need to provide our own delete key binding because the key_delete
handler in platformGlobalOverlay.xul maps command to "cmd_delete" which
is NOT what we want! -->
<key id="key_bm_delete" keycode="VK_DELETE" command="cmd_bm_delete"/>
<key id="bm_key_find"
key="&edit.find.keybinding;"
command="cmd_bm_find" modifiers="accel"/>
<key id="bm_key_properties"
key="&edit.properties.keybinding;"
command="cmd_bm_properties" modifiers="accel"/>
</keyset>
<toolbox id="bookmarks-toolbox">
<menubar id="main-menubar" grippytooltiptext="&menuBar.tooltip;">
<menu label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
<menupopup>
<menuitem label="&menuitem.newBookmark.label;"
accesskey="&command.newBookmark.accesskey;"
observes="cmd_bm_newbookmark"/>
<menuitem label="&button.newFolder.label;"
accesskey="&command.newFolder.accesskey;"
observes="cmd_bm_newfolder"/>
<menuitem label="&button.newSeparator.label;"
accesskey="&command.newSeparator.accesskey;"
observes="cmd_bm_newseparator"/>
<menuseparator/>
<menuitem id="menu_close"/>
</menupopup>
</menu>
<menu id="menu_Edit">
<menupopup>
<menuitem id="menu_undo" disabled="true"/>
<menuseparator/>
<menuitem id="menu_bm_cut"
label="&cutCmd.label;" accesskey="&cutCmd.accesskey;"
key="key_cut" command="cmd_bm_cut"/>
<menuitem id="menu_bm_copy"
label="&copyCmd.label;" accesskey="&copyCmd.accesskey;"
key="key_copy" command="cmd_bm_copy"/>
<menuitem id="menu_bm_paste"
label="&pasteCmd.label;" accesskey="&pasteCmd.accesskey;"
key="key_paste" command="cmd_bm_paste"/>
<menuitem id="menu_bm_delete"
label="&deleteCmd.label;" accesskey="&deleteCmd.label;"
key="key_bm_delete" command="cmd_bm_delete"/>
<menuseparator/>
<menuitem id="menu_bm_selectAll"
label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"
key="key_selectAll" command="cmd_bm_selectAll"/>
<menuseparator/>
<menuitem label="&command.fileBookmark.label;"
accesskey="&command.fileBookmark.accesskey;"
command="cmd_bm_fileBookmark"/>
<menuseparator/>
<menuitem observes="cmd_bm_properties" key="bm_key_properties"
label="&command.properties.label;"
accesskey="&command.properties.accesskey;" />
</menupopup>
</menu>
<menu id="menu_View">
<menupopup onpopupshowing="fillViewMenu(event)"
oncommand="onViewMenuSortItemSelected(event);">
<menuitem id="viewCommandToolbar" type="checkbox" class="menuitem-iconic"
label="&menuitem.view.command.toolbar.label;"
accesskey="&menuitem.view.command.toolbar.accesskey;"
oncommand="goToggleToolbar('command-toolbar', 'viewCommandToolbar'); event.preventBubble();"
persist="checked"/>
<menuseparator id="fill-after-this-node"/>
<menuitem id="natural" label="&menuitem.view.unsorted.label;"
accesskey="&menuitem.view.unsorted.accesskey;"
type="radio"
resource="direction" name="sortSet"/>
<menuseparator id="fill-before-this-node"/>
<menuitem id="ascending" label="&menuitem.view.ascending.label;"
accesskey="&menuitem.view.ascending.accesskey;"
type="radio"
resource="direction" name="sortDirectionSet"/>
<menuitem id="descending" label="&menuitem.view.descending.label;"
accesskey="&menuitem.view.descending.accesskey;"
type="radio"
resource="direction" name="sortDirectionSet"/>
<menuseparator/>
<menu id="descending" label="&menuitem.view.show_columns.label;"
accesskey="&menuitem.view.show_columns.accesskey;">
<menupopup id="columnsPopup" onpopupshowing="fillColumnsMenu(event);"
oncommand="onViewMenuColumnItemSelected(event);"/>
</menu>
<menuseparator/>
<menuitem label="&menuitem.newbookmarkfolder.label;"
command="cmd_bm_setnewbookmarkfolder"
accesskey="&menuitem.newbookmarkfolder.accesskey;"/>
<menuitem label="&menuitem.newinternetsearchfolder.label;"
command="cmd_bm_setnewsearchfolder"
accesskey="&menuitem.newinternetsearchfolder.accesskey;"/>
<menuitem label="&menuitem.personaltoolbarfolder.label;"
command="cmd_bm_setpersonaltoolbarfolder"
accesskey="&menuitem.personaltoolbarfolder.accesskey;"/>
</menupopup>
</menu>
<menu id="menu_Help"/>
</menubar>
<toolbar id="command-toolbar" tbalign="stretch" grippytooltiptext="&bookmarkToolbar.tooltip;">
<toolbarbutton id="newfolder" label="&button.newFolder.label;"
command="cmd_bm_newfolder"/>
<toolbarbutton id="newseparator" label="&button.newSeparator.label;"
command="cmd_bm_newseparator"/>
<toolbarseparator/>
<toolbarbutton id="fileBookmark" label="&command.fileBookmark.label;"
command="cmd_bm_fileBookmark"/>
<toolbarseparator/>
<toolbarbutton id="properties" label="&command.properties.label;"
command="cmd_bm_properties"/>
<toolbarbutton id="rename" label="&command.rename.label;"
command="cmd_bm_rename"/>
<toolbarbutton id="delete" label="&command.delete.label;"
command="cmd_bm_delete"/>
</toolbar>
<toolbar align="center" pack="center">
<label value="&find.label;" accesskey="&find.accesskey;" control="search-box"/>
<textbox id="search-box" flex="1"
type="timed" timeout="500"
callback="searchBookmarks(gSearchBox.value);"/>
</toolbar>
</toolbox>
<bookmarks-tree id="bookmarks-view" flex="1"/>
</window>

Просмотреть файл

Просмотреть файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

Просмотреть файл

@ -0,0 +1,64 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Goodger <ben@netscape.com> (Original Author)
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
////////////////////////////////////////////////////////////////////////////////
// Get the two bookmarks utility libraries running, attach controllers, focus
// tree widget, etc.
function Startup()
{
var bookmarksView = document.getElementById("bookmarks-view");
bookmarksView.treeBoxObject.selection.select(0);
}
function manageBookmarks() {
openDialog("chrome://communicator/content/bookmarks/bookmarks.xul", "", "chrome,dialog=no,resizable=yes");
}
function addBookmark() {
var contentArea = top.document.getElementById('content');
if (contentArea) {
const browsers = contentArea.browsers;
if (browsers.length > 1)
BookmarksUtils.addBookmarkForTabBrowser(contentArea);
else
BookmarksUtils.addBookmarkForBrowser(contentArea.webNavigation, true);
}
else
BookmarksUtils.addBookmark(null, null, undefined, true);
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,97 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Goodger <ben@netscape.com> (Original Author)
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const BMARKS_CONTRACTID = "@mozilla.org/browser/bookmarks-service;1";
const nsIBookmarksService = Components.interfaces.nsIBookmarksService;
var gOKButton;
var gSearchField;
function Startup()
{
var bundle = document.getElementById("bookmarksBundle");
gOKButton = document.documentElement.getButton("accept");
gOKButton.label = bundle.getString("search_button_label");
gOKButton.disabled = true;
gSearchField = document.getElementById("searchField");
gSearchField.focus();
}
var gCreatingNewWindow = false;
function find()
{
// Build up a find URI from the search fields and open a new window
// rooted on the URI.
var match = document.getElementById("matchList");
var method = document.getElementById("methodList");
var searchURI = "find:datasource=rdf:bookmarks"
searchURI += "&match=" + match.selectedItem.value;
searchURI += "&method=" + method.selectedItem.value;
searchURI += "&text=" + escape(gSearchField.value);
var bmWindow = findMostRecentWindow("bookmarks:searchresults", "chrome://communicator/content/bookmarks/bookmarks.xul", searchURI);
// Update the root of the tree if we're using an existing search window.
if (!gCreatingNewWindow)
bmWindow.document.getElementById("bookmarks-view").tree.setAttribute("ref", searchURI);
bmWindow.focus();
if (document.getElementById("saveQuery").checked == true)
{
var bundle = document.getElementById("bookmarksBundle");
var findTitle = bundle.stringBundle.formatStringFromName(
"ShortFindTitle", [gSearchField.value], 1);
var bmks = Components.classes[BMARKS_CONTRACTID].getService(nsIBookmarksService);
bmks.addBookmarkImmediately(searchURI, findTitle, bmks.BOOKMARK_FIND_TYPE, null);
}
return true;
}
function findMostRecentWindow(aType, aURI, aParam)
{
var WM = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
WM = WM.QueryInterface(Components.interfaces.nsIWindowMediator);
var topWindow = WM.getMostRecentWindow(aType);
if (!topWindow) gCreatingNewWindow = true;
return topWindow || openDialog("chrome://communicator/content/bookmarks/bookmarks.xul",
"", "chrome,all,dialog=no", aParam);
}
function doEnabling()
{
gOKButton.disabled = !gSearchField.value;
}

Просмотреть файл

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!-- -*- Mode: HTML; indent-tabs-mode: nil; -*- -->
<!--
The contents of this file are subject to the Netscape 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/NPL/
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.org code.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger <ben@netscape.com> (Original Author)
-->
<!--
"Find Bookmarks" window
-->
<?xml-stylesheet href="chrome://communicator/skin/"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/findBookmark.dtd">
<dialog id="findBookmarkWindow" style="width: 36em;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&findBookmark.title;"
onload="Startup();"
ondialogaccept="return find();">
<stringbundle id="bookmarksBundle" src="chrome://communicator/locale/bookmarks/bookmark.properties"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/findBookmark.js"/>
<label value="&search.for.label;"/>
<hbox align="center">
<menulist id="matchList" class="menulist-toolbar">
<menupopup>
<menuitem value="http://home.netscape.com/NC-rdf#Name" label="&search.name.label;"/>
<menuitem value="http://home.netscape.com/NC-rdf#URL" label="&search.url.label;"/>
<menuitem value="http://home.netscape.com/NC-rdf#Description" label="&search.description.label;"/>
<menuitem value="http://home.netscape.com/NC-rdf#ShortcutURL" label="&search.shortcut.label;"/>
</menupopup>
</menulist>
<menulist id="methodList" class="menulist-toolbar">
<menupopup>
<menuitem value="contains" label="&search.contains.label;"/>
<menuitem value="startswith" label="&search.startswith.label;"/>
<menuitem value="endswith" label="&search.endswith.label;"/>
<menuitem value="is" label="&search.is.label;"/>
<menuitem value="isnot" label="&search.isnot.label;"/>
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
</menupopup>
</menulist>
<textbox id="searchField" flex="1" oninput="doEnabling();"/>
</hbox>
<checkbox id="saveQuery" label="&save.query.label;" />
</dialog>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,47 @@
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
browser.jar:
content/browser/bookmarks/addBookmark.xul (content/addBookmark.xul)
content/browser/bookmarks/addBookmark.js (content/addBookmark.js)
content/browser/bookmarks/bm-props.js (content/bm-props.js)
content/browser/bookmarks/bm-props.xul (content/bm-props.xul)
content/browser/bookmarks/bookmarksDD.js (content/bookmarksDD.js)
content/browser/bookmarks/bookmarks.xul (content/bookmarks.xul)
content/browser/bookmarks/bookmarks.js (content/bookmarks.js)
content/browser/bookmarks/bookmarks.css (content/bookmarks.css)
content/browser/bookmarks/bookmarks.xml (content/bookmarks.xml)
content/browser/bookmarks/bookmarksTree.js (content/bookmarksTree.js)
content/browser/bookmarks/bookmarksOverlay.xul (content/bookmarksOverlay.xul)
content/browser/bookmarks/bookmarksOverlay.js (content/bookmarksOverlay.js)
content/browser/bookmarks/bm-panel.xul (content/bm-panel.xul)
content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js)
content/browser/bookmarks/findBookmark.js (content/findBookmark.js)
content/browser/bookmarks/findBookmark.xul (content/findBookmark.xul)
content/browser/bookmarks/pref-bookmarks.xul (content/pref-bookmarks.xul)
content/browser/bookmarks/oTest.xul (content/oTest.xul)
en-US.jar:
locale/en-US/browser/bookmarks/addBookmark.dtd (locale/addBookmark.dtd)
locale/en-US/browser/bookmarks/bm-props.dtd (locale/bm-props.dtd)
locale/en-US/browser/bookmarks/bookmarks.dtd (locale/bookmarks.dtd)
locale/en-US/browser/bookmarks/bookmark.properties (locale/bookmark.properties)
locale/en-US/browser/bookmarks/bookmarksOverlay.dtd (locale/bookmarksOverlay.dtd)
locale/en-US/browser/bookmarks/findBookmark.dtd (locale/findBookmark.dtd)
locale/en-US/browser/bookmarks/pref-bookmarks.dtd (locale/pref-bookmarks.dtd)

Просмотреть файл

@ -0,0 +1,4 @@
bm-find.dtd
bm-props.dtd
bookmark.properties
bookmarks.dtd

Просмотреть файл

@ -0,0 +1,46 @@
<!--
- 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 Communicator.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape Communications
- Corp. are Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ben Goodger <ben@netscape.com> (Original Author)
-->
<!ENTITY newBookmark.title "Add Bookmark">
<!ENTITY newbookmark.label "&brandShortName; will add a bookmark to this page.">
<!ENTITY name.label "Name:">
<!ENTITY name.accesskey "n">
<!ENTITY url.label "Location:">
<!ENTITY url.accesskey "l">
<!ENTITY button.createin.label "Create In &gt;&gt;">
<!ENTITY button.createin.accesskey "c">
<!ENTITY button.createin2.label "Create In &lt;&lt;">
<!ENTITY createin.label "Create in:">
<!ENTITY createin.accesskey "i">
<!ENTITY button.newfolder.label "New Folder...">
<!ENTITY button.newfolder.accesskey "w">
<!ENTITY alwayscreateinfolder.label "Don't show this dialog again">
<!ENTITY alwayscreateinfolder.accesskey "a">
<!ENTITY dontshowmessage.tooltip "When this option is selected, new Bookmarks will be added using the title provided by the page.">
<!ENTITY button.defaultfolder.label "Use Default">
<!ENTITY button.defaultfolder.accesskey "d">
<!ENTITY selectFolder.label "Choose Folder">
<!ENTITY addGroup.label "Bookmark this group of tabs">
<!ENTITY addGroup.accesskey "B">

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,89 @@
<!--
- 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 Communicator.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape Communications
- Corp. are Copyright (C) 1999 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Stephen Lamm <slamm@netscape.com>
- Blake Ross <blakeross@telocity.com>
-->
<!-- extracted from ./bookmarks.xul -->
<!ENTITY menuBar.tooltip "Menu Bar">
<!ENTITY bookmarkToolbar.tooltip "Bookmark Toolbar">
<!ENTITY menuitem.newBookmark.label "New Bookmark...">
<!ENTITY command.newBookmark.accesskey "B">
<!ENTITY button.newFolder.label "New Folder...">
<!ENTITY command.newFolder.accesskey "F">
<!ENTITY button.newSeparator.label "New Separator">
<!ENTITY command.newSeparator.accesskey "S">
<!ENTITY menuitem.import.label "Import...">
<!ENTITY menuitem.import.accesskey "i">
<!ENTITY menuitem.export.label "Export...">
<!ENTITY menuitem.export.accesskey "e">
<!ENTITY menuitem.find.label "Search Bookmarks...">
<!ENTITY command.findBookmarks.label "Search...">
<!ENTITY menuitem.find.accesskey "S">
<!ENTITY edit.find.keybinding "f">
<!ENTITY command.properties.label "Properties...">
<!ENTITY command.properties.accesskey "r">
<!ENTITY edit.properties.keybinding "i">
<!ENTITY command.rename.label "Rename...">
<!ENTITY command.delete.label "Delete">
<!ENTITY command.fileBookmark.label "File Bookmark(s)...">
<!ENTITY command.fileBookmark.accesskey "l">
<!ENTITY command.addBookmark.label "Add...">
<!ENTITY command.manageBookmarks.label "Manage">
<!ENTITY menuitem.view.command.toolbar.label "Toolbar">
<!ENTITY menuitem.view.command.toolbar.accesskey "t">
<!ENTITY menuitem.view.unsorted.label "Unsorted">
<!ENTITY menuitem.view.unsorted.accesskey "u">
<!ENTITY menuitem.view.ascending.label "A > Z Sort Order">
<!ENTITY menuitem.view.ascending.accesskey "a">
<!ENTITY menuitem.view.descending.label "Z > A Sort Order">
<!ENTITY menuitem.view.descending.accesskey "z">
<!ENTITY menuitem.view.show_columns.label "Show columns">
<!ENTITY menuitem.view.show_columns.accesskey "S">
<!ENTITY menuitem.newbookmarkfolder.label "Set as New Bookmark Folder">
<!ENTITY menuitem.newbookmarkfolder.accesskey "b">
<!ENTITY menuitem.newinternetsearchfolder.label "Set as New Internet Search Folder">
<!ENTITY menuitem.newinternetsearchfolder.accesskey "i">
<!ENTITY menuitem.personaltoolbarfolder.label "Set as Personal Toolbar Folder">
<!ENTITY menuitem.personaltoolbarfolder.accesskey "p">
<!ENTITY treecol.name.label "Name">
<!ENTITY treecol.name.accesskey "n">
<!ENTITY treecol.url.label "Location">
<!ENTITY treecol.url.accesskey "l">
<!ENTITY treecol.shortcut.label "Keyword">
<!ENTITY treecol.shortcut.accesskey "k">
<!ENTITY treecol.addedon.label "Added">
<!ENTITY treecol.addedon.accesskey "a">
<!ENTITY treecol.lastmod.label "Last Modified">
<!ENTITY treecol.lastmod.accesskey "m">
<!ENTITY treecol.lastvisit.label "Last Visited">
<!ENTITY treecol.lastvisit.accesskey "b">
<!ENTITY treecol.description.label "Description">
<!ENTITY treecol.description.accesskey "d">
<!ENTITY bookmarksWindowTitle.label "Bookmark Manager">
<!ENTITY find.label "Find">
<!ENTITY find.accesskey "F">
<!ENTITY fileMenu.label "File">
<!ENTITY fileMenu.accesskey "F">

Просмотреть файл

Просмотреть файл

Просмотреть файл