This commit is contained in:
chanial%noos.fr 2002-09-13 03:12:27 +00:00
Родитель 3d2457096e
Коммит 90bc615022
13 изменённых файлов: 2689 добавлений и 132 удалений

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

@ -101,10 +101,6 @@ var gCB_AddGroup = null;
var gBookmarkCharset = 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 gSelectItemObserver = null;
var gCreateInFolder = "NC:NewBookmarkFolder"; var gCreateInFolder = "NC:NewBookmarkFolder";
@ -136,7 +132,7 @@ function Startup()
dialogElement.setAttribute("title", dialogElement.getAttribute("title-selectFolder")); dialogElement.setAttribute("title", dialogElement.getAttribute("title-selectFolder"));
shouldSetOKButton = false; shouldSetOKButton = false;
if (window.arguments[2]) if (window.arguments[2])
folderItem = bookmarkView.rdf.GetResource(window.arguments[2]); folderItem = RDF.GetResource(window.arguments[2]);
if (folderItem) { if (folderItem) {
ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem); ind = bookmarkView.treeBuilder.getIndexOfResource(folderItem);
bookmarkView.treeBoxObject.selection.select(ind); bookmarkView.treeBoxObject.selection.select(ind);
@ -230,44 +226,41 @@ function onOK()
window.arguments[5].selectedFolder = gCreateInFolder; window.arguments[5].selectedFolder = gCreateInFolder;
else { else {
// Otherwise add a bookmark to the selected folder. // Otherwise add a bookmark to the selected folder.
var rFolder = RDF.GetResource(gCreateInFolder);
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 { try {
kRDFC.Init(kBMDS, rFolder); RDFC.Init(BMDS, rFolder);
} }
catch (e) { catch (e) {
// No "NC:NewBookmarkFolder" exists, just append to the root. // No "NC:NewBookmarkFolder" exists, just append to the root.
rFolder = kRDF.GetResource("NC:BookmarksRoot", true); rFolder = RDF.GetResource("NC:BookmarksRoot");
kRDFC.Init(kBMDS, rFolder); RDFC.Init(BMDS, rFolder);
} }
// if no URL was provided and we're not filing as a group, do nothing // if no URL was provided and we're not filing as a group, do nothing
if (!gFld_URL.value && !addingGroup()) if (!gFld_URL.value && !addingGroup())
return; return;
var url; var url, rSource;
if (addingGroup()) { if (addingGroup()) {
const group = kBMS.createGroup(gFld_Name.value, rFolder); rSource = BMDS.createGroup(gFld_Name.value);
const groups = window.arguments[5]; const groups = window.arguments[5];
for (var i = 0; i < groups.length; ++i) { for (var i = 0; i < groups.length; ++i) {
url = getNormalizedURL(groups[i].url); url = getNormalizedURL(groups[i].url);
kBMS.createBookmarkWithDetails(groups[i].name, url, BMDS.createBookmarkInContainer(groups[i].name, url,
groups[i].charset, group, -1); groups[i].charset, rSource, -1);
} }
} else { } else {
url = getNormalizedURL(gFld_URL.value); url = getNormalizedURL(gFld_URL.value);
var newBookmark = kBMS.createBookmarkWithDetails(gFld_Name.value, url, gBookmarkCharset, rFolder, -1); rSource = BMDS.createBookmark(gFld_Name.value, url, gBookmarkCharset);
if (window.arguments.length > 4 && window.arguments[4] == "newBookmark") { if (window.arguments.length > 4 && window.arguments[4] == "newBookmark") {
window.arguments[5].newBookmark = newBookmark; window.arguments[5].newBookmark = rSource;
} }
} }
var selection, target;
selection = BookmarksUtils.getSelectionFromResource(rSource);
target = BookmarksUtils.getSelectionFromResource(rFolder);
target = BookmarksUtils.getTargetFromSelection(target);
BookmarksUtils.insertSelection("newbookmark", selection, target);
} }
} }
@ -292,7 +285,6 @@ function getNormalizedURL(url)
return url; return url;
} }
var gBookmarksShell = null;
function createNewFolder () function createNewFolder ()
{ {
var bookmarksView = document.getElementById("bookmarks-view"); var bookmarksView = document.getElementById("bookmarks-view");

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

@ -25,16 +25,10 @@
--> -->
<?xml-stylesheet href="chrome://communicator/skin/"?> <?xml-stylesheet href="chrome://browser/skin/"?>
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?> <?xml-stylesheet href="chrome://browser/content/bookmarks/bookmarks.css"?>
<?xml-stylesheet href="chrome://communicator/content/bookmarks/bookmarks.css" type="text/css"?>
<!DOCTYPE window [ <!DOCTYPE dialog SYSTEM "chrome://browser/locale/bookmarks/addBookmark.dtd">
<!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;" <dialog id="newBookmarkDialog" style="width: 36em;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -44,13 +38,8 @@
persist="screenX screenY width height" persist="screenX screenY width height"
screenX="24" screenY="24"> screenX="24" screenY="24">
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/addBookmark.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.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"/> <broadcaster id="showaddgroup" hidden="true"/>

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

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

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

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

@ -99,9 +99,7 @@ function fillViewMenu(aEvent)
if (!gConstructedViewMenuSortItems) { if (!gConstructedViewMenuSortItems) {
for (var i = 0; i < columns.length; ++i) { for (var i = 0; i < columns.length; ++i) {
var name = columns[i].name;
var accesskey = columns[i].accesskey; var accesskey = columns[i].accesskey;
var menuitem = document.createElement("menuitem"); var menuitem = document.createElement("menuitem");
var name = BookmarksUtils.getLocaleString("SortMenuItem", columns[i].label); var name = BookmarksUtils.getLocaleString("SortMenuItem", columns[i].label);
menuitem.setAttribute("label", name); menuitem.setAttribute("label", name);

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

@ -58,7 +58,7 @@
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script> <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
<!-- Shared Bookmarks Utility Library --> <!-- Shared Bookmarks Utility Library -->
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksOverlay.js"/> <script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<!-- Bookmarks Window --> <!-- Bookmarks Window -->
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksManager.js"/> <script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksManager.js"/>
@ -89,6 +89,7 @@
<command id="cmd_bm_open" oncommand="goDoCommand('cmd_bm_open');"/> <command id="cmd_bm_open" oncommand="goDoCommand('cmd_bm_open');"/>
<command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/> <command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
<command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/> <command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
<command id="cmd_bm_managefolder" oncommand="goDoCommand('cmd_bm_managefolder');"/>
<command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/> <command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/>
<command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/> <command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/>
<command id="cmd_bm_newseparator" oncommand="goDoCommand('cmd_bm_newseparator');"/> <command id="cmd_bm_newseparator" oncommand="goDoCommand('cmd_bm_newseparator');"/>

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

@ -0,0 +1,87 @@
<?xml version="1.0"?> <!-- -*- Mode: SGML; 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, v2.0)
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebarListView.css" 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://communicator/content/utilityOverlay.xul"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/bookmarks/bookmarksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/communicatorOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">
<page id="bookmarksPanel"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup();" elementtofocus="bookmarks-view">
<!-- XXX - would like to cut this dependency out -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<!-- Bookmarks Shell -->
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksOverlay.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/bookmarks/bookmarksPanel.js"/>
<!-- Drag and 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://communicator/content/bookmarks/bookmarksDD.js"/>
<!-- context menu, tooltips, etc -->
<popupset id="bookmarksPopupset"/>
<!-- bookmarks string bundle -->
<stringbundleset id="stringbundleset"/>
<!-- bookmarks & edit commands -->
<commands id="commands">
<commandset id="CommandUpdate_Bookmarks"
commandupdater="true"
events="click,focus"
oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
</commandset>
<commandset id="bookmarksItems"/>
</commands>
<hbox id="panel-bar" class="toolbar">
<toolbarbutton id="btnAddBookmark" label="&command.addBookmark.label;"
oncommand="addBookmark();"/>
<toolbarbutton id="btnManageBookmarks" label="&command.manageBookmarks.label;"
oncommand="manageBookmarks();"/>
<spacer flex="1"/>
<toolbarseparator/>
<toolbarbutton id="btnFindBookmarks" label="&command.findBookmarks.label;"
oncommand="document.getElementById('bookmarks-view').openFindDialog();"/>
</hbox>
<bookmarks-tree id="bookmarks-view" class="sidebar" type="single-column" flex="1"/>
</page>

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

@ -0,0 +1,395 @@
/* -*- 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):
*
* 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 ***** */
// XXX MAKE SURE that the "url" field is LAST!
// This is important for what happens if/when the URL itself is changed.
// Ask rjc@netscape.com if you want to know why exactly this is.
// This is the set of fields that are visible in the window.
var gFields = ["name", "shortcut", "description", "url"];
// ...and this is a parallel array that contains the RDF properties
// that they are associated with.
var gProperties = [NC_NS + "Name",
NC_NS + "ShortcutURL",
NC_NS + "Description",
NC_NS + "URL"];
var Bookmarks = RDF.GetDataSource("rdf:bookmarks");
var gBookmarkURL = "";
function showDescription()
{
gBookmarkURL = window.arguments[0];
var resource = RDF.GetResource(gBookmarkURL);
// Check the description
var primaryType = BookmarksUtils.resolveType(resource);
var description = BookmarksUtils.getLocaleString("description_"+primaryType);
var newBookmarkFolder = BookmarksUtils.getNewBookmarkFolder();
var newSearchFolder = BookmarksUtils.getNewSearchFolder();
if (resource == newBookmarkFolder && resource == newSearchFolder)
description = description+" "+BookmarksUtils.getLocaleString("description_NewBookmarkAndSearchFolder")
else if (resource == newBookmarkFolder )
description = description+" "+BookmarksUtils.getLocaleString("description_NewBookmarkFolder")
else if (resource == newSearchFolder)
description = description+" "+BookmarksUtils.getLocaleString("description_NewSearchFolder");
var textNode = document.createTextNode(description);
document.getElementById("bookmarkDescription").appendChild(textNode);
}
function Init()
{
var x;
var resource = RDF.GetResource(gBookmarkURL);
// Initialize the properties panel by copying the values from the
// RDF graph into the fields on screen.
for (var i = 0; i < gFields.length; ++i) {
var field = document.getElementById(gFields[i]);
var value = Bookmarks.GetTarget(resource, RDF.GetResource(gProperties[i]), true);
if (value)
value = value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
if (value) //make sure were aren't stuffing null into any fields
field.value = value;
}
var propsWindow = document.getElementById("bmPropsWindow");
var nameNode = document.getElementById("name");
var title = propsWindow.getAttribute("title");
title = title.replace(/\*\*bm_title\*\*/gi, nameNode.value);
propsWindow.setAttribute("title", title);
// check bookmark schedule
var scheduleArc = RDF.GetResource("http://home.netscape.com/WEB-rdf#Schedule");
value = Bookmarks.GetTarget(resource, scheduleArc, true);
if (value) {
value = value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
if (value) {
var values = value.split("|");
if (values.length == 4) {
// get day range
var days = values[0];
var dayNode = document.getElementById("dayRange");
var dayItems = dayNode.childNodes[0].childNodes;
for (x=0; x < dayItems.length; ++x) {
if (dayItems[x].getAttribute("value") == days) {
dayNode.selectedItem = dayItems[x];
break;
}
}
// get hour range
var hours = values[1].split("-");
var startHour = "";
var endHour = "";
if (hours.length == 2) {
startHour = hours[0];
endHour = hours[1];
}
// set start hour
var startHourNode = document.getElementById("startHourRange");
var startHourItems = startHourNode.childNodes[0].childNodes;
for (x=0; x < startHourItems.length; ++x) {
if (startHourItems[x].getAttribute("value") == startHour) {
startHourNode.selectedItem = startHourItems[x];
break;
}
}
// set end hour
var endHourNode = document.getElementById("endHourRange");
var endHourItems = endHourNode.childNodes[0].childNodes;
for (x=0; x < endHourItems.length; ++x) {
if (endHourItems[x].getAttribute("value") == endHour) {
endHourNode.selectedItem = endHourItems[x];
break;
}
}
// get duration
var duration = values[2];
var durationNode = document.getElementById("duration");
durationNode.value = duration;
// get notification method
var method = values[3];
if (method.indexOf("icon") >= 0)
document.getElementById("bookmarkIcon").checked = true;
if (method.indexOf("sound") >= 0)
document.getElementById("playSound").checked = true;
if (method.indexOf("alert") >= 0)
document.getElementById("showAlert").checked = true;
if (method.indexOf("open") >= 0)
document.getElementById("openWindow").checked = true;
}
}
}
// if its a container, disable some things
var isContainerFlag = RDFCU.IsContainer(Bookmarks, RDF.GetResource(gBookmarkURL));
if (!isContainerFlag) {
// XXX To do: the "RDFCU.IsContainer" call above only works for RDF sequences;
// if its not a RDF sequence, we should to more checking to see if
// the item in question is really a container of not. A good example
// of this is the "File System" container.
}
if (isContainerFlag) {
// If it is a folder, it has no URL or Keyword
document.getElementById("locationrow").setAttribute("hidden", "true");
document.getElementById("shortcutrow").setAttribute("hidden", "true");
}
if (gBookmarkURL.substr(0, 7).toLowerCase() != "http://" &&
gBookmarkURL.substr(0, 8).toLowerCase() != "https://") {
// only allow scheduling of http/https URLs
document.getElementById("ScheduleTab").setAttribute("hidden", "true");
document.getElementById("NotifyTab").setAttribute("hidden", "true");
}
sizeToContent();
// Set up the enabled of controls on the scheduling panels
dayRangeChange(document.getElementById("dayRange"));
// set initial focus
nameNode.focus();
nameNode.select();
}
function Commit()
{
var changed = false;
// Grovel through the fields to see if any of the values have
// changed. If so, update the RDF graph and force them to be saved
// to disk.
for (var i = 0; i < gFields.length; ++i) {
var field = document.getElementById(gFields[i]);
if (field) {
// Get the new value as a literal, using 'null' if the value is empty.
var newvalue = field.value;
var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL),
RDF.GetResource(gProperties[i]),
true);
if (oldvalue)
oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) {
// shortcuts are always lowercased internally
newvalue = newvalue.toLowerCase();
}
else if (newvalue && gProperties[i] == (NC_NS + "URL")) {
// we're dealing with the URL attribute;
// if a scheme isn't specified, use "http://"
if (newvalue.indexOf(":") < 0)
newvalue = "http://" + newvalue;
}
if (newvalue)
newvalue = RDF.GetLiteral(newvalue);
if (updateAttribute(gProperties[i], oldvalue, newvalue)) {
// Update gBookmarkURL if the url changed
if (newvalue && gProperties[i] == NC_NS + "URL")
gBookmarkURL = newvalue.Value;
changed = true;
}
}
}
// Update bookmark schedule if necessary;
// if the tab was removed, just skip it
var scheduleTab = document.getElementById("ScheduleTab");
if (scheduleTab) {
var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule";
oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkURL),
RDF.GetResource(scheduleRes), true);
newvalue = "";
var dayRangeNode = document.getElementById("dayRange");
var dayRange = dayRangeNode.selectedItem.getAttribute("value");
if (dayRange) {
var startHourRangeNode = document.getElementById("startHourRange");
var startHourRange = startHourRangeNode.selectedItem.getAttribute("value");
var endHourRangeNode = document.getElementById("endHourRange");
var endHourRange = endHourRangeNode.selectedItem.getAttribute("value");
if (parseInt(startHourRange) > parseInt(endHourRange)) {
var temp = startHourRange;
startHourRange = endHourRange;
endHourRange = temp;
}
var duration = document.getElementById("duration").value;
if (!duration) {
alert(BookmarksUtils.getLocaleString("pleaseEnterADuration"));
return false;
}
var methods = [];
if (document.getElementById("bookmarkIcon").checked)
methods.push("icon");
if (document.getElementById("playSound").checked)
methods.push("sound");
if (document.getElementById("showAlert").checked)
methods.push("alert");
if (document.getElementById("openWindow").checked)
methods.push("open");
if (methods.length == 0) {
alert(BookmarksUtils.getLocaleString("pleaseSelectANotification"));
return false;
}
var method = methods.join(); // join string in array with ","
newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method;
}
if (newvalue)
newvalue = RDF.GetLiteral(newvalue);
if (updateAttribute(scheduleRes, oldvalue, newvalue))
changed = true;
}
if (changed) {
var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
if (remote)
remote.Flush();
}
window.close();
return true;
}
function updateAttribute(prop, oldvalue, newvalue)
{
var changed = false;
if (prop && (oldvalue || newvalue) && oldvalue != newvalue) {
if (oldvalue && !newvalue) {
Bookmarks.Unassert(RDF.GetResource(gBookmarkURL),
RDF.GetResource(prop),
oldvalue);
}
else if (!oldvalue && newvalue) {
Bookmarks.Assert(RDF.GetResource(gBookmarkURL),
RDF.GetResource(prop),
newvalue,
true);
}
else /* if (oldvalue && newvalue) */ {
Bookmarks.Change(RDF.GetResource(gBookmarkURL),
RDF.GetResource(prop),
oldvalue,
newvalue);
}
changed = true;
}
return changed;
}
function setEndHourRange()
{
// Get the values of the start-time and end-time as ints
var startHourRangeNode = document.getElementById("startHourRange");
var startHourRange = startHourRangeNode.selectedItem.getAttribute("value");
var startHourRangeInt = parseInt(startHourRange);
var endHourRangeNode = document.getElementById("endHourRange");
var endHourRange = endHourRangeNode.selectedItem.getAttribute("value");
var endHourRangeInt = parseInt(endHourRange);
var endHourItemNode = endHourRangeNode.firstChild.firstChild;
var index = 0;
// disable all those end-times before the start-time
for (; index < startHourRangeInt; ++index) {
endHourItemNode.setAttribute("disabled", "true");
endHourItemNode = endHourItemNode.nextSibling;
}
// update the selected value if it's out of the allowed range
if (startHourRangeInt >= endHourRangeInt)
endHourRangeNode.selectedItem = endHourItemNode;
// make sure all the end-times after the start-time are enabled
for (; index < 24; ++index) {
endHourItemNode.removeAttribute("disabled");
endHourItemNode = endHourItemNode.nextSibling;
}
}
function dayRangeChange (aMenuList)
{
var controls = ["startHourRange", "endHourRange", "duration", "bookmarkIcon",
"showAlert", "openWindow", "playSound", "durationSubLabel",
"durationLabel", "startHourRangeLabel", "endHourRangeLabel"];
for (var i = 0; i < controls.length; ++i)
document.getElementById(controls[i]).disabled = !aMenuList.value;
}

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

@ -0,0 +1,238 @@
<?xml version="1.0"?> <!-- -*- Mode: SGML; 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):
-->
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % bmpropsDTD SYSTEM "chrome://browser/locale/bookmarks/bookmarksProperties.dtd">
%bmpropsDTD;
]>
<dialog id="bmPropsWindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&bookmarks.windowtitle.label;"
onload="Init()" style="width: 30em;"
ondialogaccept="return Commit();">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksProperties.js"/>
<keyset id="keyset"/>
<tabbox>
<tabs>
<tab label="&generalInfo.label;" accesskey="&generalInfo.accesskey;"/>
<tab id="ScheduleTab" label="&schedule.label;" accesskey="&schedule.accesskey;"/>
<tab id="NotifyTab" label="&notification.label;" accesskey="&notification.accesskey;"/>
</tabs>
<tabpanels>
<vbox>
<separator class="thin"/>
<hbox align="start">
<image class="message-icon"/>
<separator class="thin" orient="vertical"/>
<description id="bookmarkDescription" flex="1"/>
</hbox>
<separator class="thin"/>
<vbox class="box-padded">
<grid>
<columns>
<column />
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&bookmarks.name.label;" control="name"/>
<textbox id="name"/>
</row>
<row id="locationrow" align="center">
<label value="&bookmarks.location.label;" control="url"/>
<textbox id="url" />
</row>
<row id="shortcutrow" align="center">
<label value="&bookmarks.shortcut.label;" control="shortcut"/>
<textbox id="shortcut" />
</row>
<row>
<label value="&bookmarks.description.label;" control="description"/>
<textbox multiline="true" wrap="virtual" id="description" flex="1"/>
</row>
</rows>
</grid>
<separator/>
</vbox>
</vbox>
<vbox>
<separator class="thin"/>
<hbox align="center">
<image id="schedule-icon"/>
<separator class="thin" orient="vertical"/>
<description flex="1">&schedule.description;</description>
</hbox>
<separator class="thin"/>
<hbox class="box-padded">
<spacer flex="1"/>
<groupbox>
<caption label="&checkforupdates.legend.label;"/>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&when.label;" control="dayRange"/>
<hbox>
<menulist id="dayRange" oncommand="dayRangeChange(this);">
<menupopup>
<menuitem value="" label="&checknever.label;"/>
<menuseparator />
<menuitem value="0123456" label="&checkeveryday.label;"/>
<menuitem value="12345" label="&checkweekdays.label;"/>
<menuitem value="06" label="&checkweekends.label;"/>
<menuitem value="1" label="&checkmondays.label;"/>
<menuitem value="2" label="&checktuesdays.label;"/>
<menuitem value="3" label="&checkwednesdays.label;"/>
<menuitem value="4" label="&checkthursdays.label;"/>
<menuitem value="5" label="&checkfridays.label;"/>
<menuitem value="6" label="&checksaturdays.label;"/>
<menuitem value="0" label="&checksundays.label;"/>
</menupopup>
</menulist>
</hbox>
</row>
<row align="center">
<label id="startHourRangeLabel"
value="&from.label;" control="startHourRange"/>
<hbox align="center">
<menulist id="startHourRange" oncommand="setEndHourRange()">
<menupopup>
<menuitem value="0" label="&midnight.label;"/>
<menuitem value="1" label="&AMone.label;"/>
<menuitem value="2" label="&AMtwo.label;"/>
<menuitem value="3" label="&AMthree.label;"/>
<menuitem value="4" label="&AMfour.label;"/>
<menuitem value="5" label="&AMfive.label;"/>
<menuitem value="6" label="&AMsix.label;"/>
<menuitem value="7" label="&AMseven.label;"/>
<menuitem value="8" label="&AMeight.label;"/>
<menuitem value="9" label="&AMnine.label;"/>
<menuitem value="10" label="&AMten.label;"/>
<menuitem value="11" label="&AMeleven.label;"/>
<menuitem value="12" label="&noon.label;"/>
<menuitem value="13" label="&PMone.label;"/>
<menuitem value="14" label="&PMtwo.label;"/>
<menuitem value="15" label="&PMthree.label;"/>
<menuitem value="16" label="&PMfour.label;"/>
<menuitem value="17" label="&PMfive.label;"/>
<menuitem value="18" label="&PMsix.label;"/>
<menuitem value="19" label="&PMseven.label;"/>
<menuitem value="20" label="&PMeight.label;"/>
<menuitem value="21" label="&PMnine.label;"/>
<menuitem value="22" label="&PMten.label;"/>
<menuitem value="23" label="&PMeleven.label;"/>
</menupopup>
</menulist>
<label id="endHourRangeLabel"
value="&to.label;" control="endHourRange"/>
<menulist id="endHourRange">
<menupopup onpopupshowing="setEndHourRange()">
<menuitem value="1" label="&AMone.label;"/>
<menuitem value="2" label="&AMtwo.label;"/>
<menuitem value="3" label="&AMthree.label;"/>
<menuitem value="4" label="&AMfour.label;"/>
<menuitem value="5" label="&AMfive.label;"/>
<menuitem value="6" label="&AMsix.label;"/>
<menuitem value="7" label="&AMseven.label;"/>
<menuitem value="8" label="&AMeight.label;"/>
<menuitem value="9" label="&AMnine.label;"/>
<menuitem value="10" label="&AMten.label;"/>
<menuitem value="11" label="&AMeleven.label;"/>
<menuitem value="12" label="&noon.label;"/>
<menuitem value="13" label="&PMone.label;"/>
<menuitem value="14" label="&PMtwo.label;"/>
<menuitem value="15" label="&PMthree.label;"/>
<menuitem value="16" label="&PMfour.label;"/>
<menuitem value="17" label="&PMfive.label;"/>
<menuitem value="18" label="&PMsix.label;"/>
<menuitem value="19" label="&PMseven.label;"/>
<menuitem value="20" label="&PMeight.label;"/>
<menuitem value="21" label="&PMnine.label;"/>
<menuitem value="22" label="&PMten.label;"/>
<menuitem value="23" label="&PMeleven.label;"/>
<menuitem value="24" label="&midnight.label;"/>
</menupopup>
</menulist>
</hbox>
</row>
<row align="center">
<label id="durationLabel"
value="&every.label;" control="duration"/>
<hbox align="center">
<textbox id="duration" size="4" value="60" />
<label id="durationSubLabel" value="&minutes.label;" />
</hbox>
</row>
</rows>
</grid>
<separator class="thin"/>
</groupbox>
<spacer flex="1"/>
</hbox>
</vbox>
<vbox>
<separator class="thin"/>
<hbox align="start">
<image id="notification-icon"/>
<separator class="thin" orient="vertical"/>
<description flex="1">&notification.description;</description>
</hbox>
<separator class="thin"/>
<hbox class="box-padded">
<spacer flex="1"/>
<groupbox>
<caption label="&notifications.legend.label;" />
<vbox align="start">
<checkbox id="bookmarkIcon" label="&notification.icon.label;" />
<checkbox id="showAlert" label="&notification.alert.label;" />
<checkbox id="openWindow" label="&notification.window.label;" />
<checkbox id="playSound" label="&notification.sound.label;" />
</vbox>
</groupbox>
<spacer flex="1"/>
</hbox>
</vbox>
</tabpanels>
</tabbox>
<!-- By calling this inline, we guarantee the description text node
will have its bindings before Init() is called, and the
dialog will be intrinsically sized correctly. -->
<script type="application/x-javascript">showDescription();</script>
</dialog>

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

@ -365,7 +365,7 @@
if (selection.item.length == 0) { if (selection.item.length == 0) {
selection = { item : [RDF.GetResource("NC:BookmarksRoot")], selection = { item : [RDF.GetResource("NC:BookmarksRoot")],
parent : [null], parent : [null],
isExpanded: [true], isExpanded: [true]
} }
} }
selection.length = selection.item.length; selection.length = selection.item.length;

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

@ -1,69 +0,0 @@
<?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>

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

@ -21,7 +21,7 @@
- Blake Ross <blakeross@telocity.com> - Blake Ross <blakeross@telocity.com>
--> -->
<!-- extracted from ./bookmarks.xul --> <!-- extracted from bookmarksManager.xul -->
<!ENTITY menuBar.tooltip "Menu Bar"> <!ENTITY menuBar.tooltip "Menu Bar">
<!ENTITY bookmarkToolbar.tooltip "Bookmark Toolbar"> <!ENTITY bookmarkToolbar.tooltip "Bookmark Toolbar">
<!ENTITY menuitem.newBookmark.label "New Bookmark..."> <!ENTITY menuitem.newBookmark.label "New Bookmark...">
@ -39,12 +39,12 @@
<!ENTITY menuitem.find.accesskey "S"> <!ENTITY menuitem.find.accesskey "S">
<!ENTITY edit.find.keybinding "f"> <!ENTITY edit.find.keybinding "f">
<!ENTITY command.properties.label "Properties..."> <!ENTITY command.properties.label "Properties...">
<!ENTITY command.properties.accesskey "r"> <!ENTITY command.properties.accesskey "i">
<!ENTITY edit.properties.keybinding "i"> <!ENTITY edit.properties.keybinding "i">
<!ENTITY command.rename.label "Rename..."> <!ENTITY command.rename.label "Rename...">
<!ENTITY command.delete.label "Delete"> <!ENTITY command.delete.label "Delete">
<!ENTITY command.fileBookmark.label "File Bookmark(s)..."> <!ENTITY command.moveBookmark.label "Move Bookmark(s)...">
<!ENTITY command.fileBookmark.accesskey "l"> <!ENTITY command.moveBookmark.accesskey "M">
<!ENTITY command.addBookmark.label "Add..."> <!ENTITY command.addBookmark.label "Add...">
<!ENTITY command.manageBookmarks.label "Manage"> <!ENTITY command.manageBookmarks.label "Manage">

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

@ -0,0 +1,91 @@
<!--
- 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>
- Robert John Churchill <rjc@netscape.com>
- Ben Goodger <ben@netscape.com>
-->
<!ENTITY bookmarks.windowtitle.label "Properties for &quot;**bm_title**&quot;">
<!ENTITY generalInfo.label "Info">
<!ENTITY generalInfo.accesskey "i">
<!ENTITY schedule.label "Schedule">
<!ENTITY schedule.accesskey "s">
<!ENTITY schedule.description "&brandShortName; can check this site for updates and notify you when one occurs. Use these settings to customize the schedule for this Bookmark.">
<!ENTITY notification.label "Notify">
<!ENTITY notification.accesskey "n">
<!-- ICK. fix me -->
<!ENTITY notification.description "&brandShortName; will notify you when this site changes. Use these settings to customize notification.">
<!ENTITY bookmarks.information.label "Information:">
<!ENTITY bookmarks.name.label "Name:">
<!ENTITY bookmarks.location.label "Location:">
<!ENTITY bookmarks.shortcut.label "Keyword:">
<!ENTITY bookmarks.description.label "Description:">
<!ENTITY checkforupdates.legend.label "Check this location for updates:">
<!ENTITY when.label "When:">
<!ENTITY from.label "from:">
<!ENTITY to.label "to: ">
<!ENTITY every.label "every">
<!ENTITY minutes.label "minute(s)">
<!ENTITY notifications.legend.label "Notification:">
<!ENTITY checknever.label "Never">
<!ENTITY checkeveryday.label "Every day">
<!ENTITY checkweekdays.label "Weekdays">
<!ENTITY checkweekends.label "Weekends">
<!ENTITY checkmondays.label "Mondays">
<!ENTITY checktuesdays.label "Tuesdays">
<!ENTITY checkwednesdays.label "Wednesdays">
<!ENTITY checkthursdays.label "Thursdays">
<!ENTITY checkfridays.label "Fridays">
<!ENTITY checksaturdays.label "Saturdays">
<!ENTITY checksundays.label "Sundays">
<!ENTITY midnight.label "Midnight">
<!ENTITY AMone.label "1 AM">
<!ENTITY AMtwo.label "2 AM">
<!ENTITY AMthree.label "3 AM">
<!ENTITY AMfour.label "4 AM">
<!ENTITY AMfive.label "5 AM">
<!ENTITY AMsix.label "6 AM">
<!ENTITY AMseven.label "7 AM">
<!ENTITY AMeight.label "8 AM">
<!ENTITY AMnine.label "9 AM">
<!ENTITY AMten.label "10 AM">
<!ENTITY AMeleven.label "11 AM">
<!ENTITY noon.label "Noon">
<!ENTITY PMone.label "1 PM">
<!ENTITY PMtwo.label "2 PM">
<!ENTITY PMthree.label "3 PM">
<!ENTITY PMfour.label "4 PM">
<!ENTITY PMfive.label "5 PM">
<!ENTITY PMsix.label "6 PM">
<!ENTITY PMseven.label "7 PM">
<!ENTITY PMeight.label "8 PM">
<!ENTITY PMnine.label "9 PM">
<!ENTITY PMten.label "10 PM">
<!ENTITY PMeleven.label "11 PM">
<!ENTITY notification.icon.label "Change the bookmark's icon">
<!ENTITY notification.sound.label "Play a sound">
<!ENTITY notification.alert.label "Display an alert">
<!ENTITY notification.window.label "Open web page in a new window">