Bug 386392 - remove browser/components/history/, r=mano, a=schrep

This commit is contained in:
philringnalda@gmail.com 2007-11-21 18:58:00 -08:00
Родитель 7400c27578
Коммит 0b81086213
5 изменённых файлов: 0 добавлений и 529 удалений

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

@ -1,46 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is 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 MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

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

@ -1,138 +0,0 @@
<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is 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 MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<!DOCTYPE page SYSTEM "chrome://browser/locale/history/history.dtd">
<page id="history-panel" orient="vertical"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
onload="HistoryCommonInit();">
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTreeController.js"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/history/history.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<stringbundle id="historyBundle" src="chrome://global/locale/history/history.properties"/>
<commandset id="editMenuCommands"/>
<keyset id="editMenuKeys">
#ifdef XP_MACOSX
<key id="key_delete2" keycode="VK_BACK" command="cmd_delete"/>
#endif
</keyset>
<popup id="historyContextMenu" onpopupshowing="buildContextMenu(event);">
<menuitem id="miExpand" label="&expand.label;" accesskey="&expand.accesskey;"
default="true" oncommand="collapseExpand();"/>
<menuitem id="miCollapse" label="&collapse.label;" accesskey="&collapse.accesskey;"
default="true" oncommand="collapseExpand();"/>
<menuitem id="miOpen" label="&openLinkInWindow.label;" accesskey="&openLinkInWindow.accesskey;" default="true"
oncommand="openURLIn('current');"/>
<menuitem id="miOpenInNewWindow" label="&openInNewWindow.label;" accesskey="&openInNewWindow.accesskey;"
oncommand="openURLIn('window');"/>
<menuitem id="miOpenInNewTab" label="&openInNewTab.label;" accesskey="&openInNewTab.accesskey;"
oncommand="openURLIn('tab');"/>
<menuseparator id="pre-bookmarks-separator"/>
<menuitem id="miAddBookmark" label="&bookmarkLink.label;" accesskey="&bookmarkLink.accesskey;" oncommand="historyAddBookmarks();"/>
<menuitem id="miCopyLink" label="&copyLink.label;" accesskey="&copyLink.accesskey;" oncommand="historyCopyLink();"/>
<menuseparator id="post-bookmarks-separator"/>
<menuitem id="cMenu_delete"/>
</popup>
<hbox align="center">
<label value="&find.label;" accesskey="&find.accesskey;" control="search-box"/>
<textbox id="search-box" flex="1" type="timed" timeout="500"
oncommand="searchHistory(gSearchBox.value);"/>
<button id="viewButton" style="min-width:0px !important;" type="menu"
label="&view.label;" accesskey="&view.accesskey;" selectedsort="day"
persist="selectedsort">
<menupopup>
<menuitem id="bydayandsite" label="&byDayAndSite.label;" accesskey="&byDayAndSite.accesskey;" type="radio"
oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'dayandsite'); GroupBy('dayandsite');"/>
<menuitem id="bysite" label="&bySite.label;" accesskey="&bySite.accesskey;" type="radio"
oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'site'); GroupBy('site');"/>
<menuitem id="byday" label="&byDate.label;" accesskey="&byDate.accesskey;"
type="radio"
oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'day');
GroupBy('day');"/>
<menuitem id="byvisited" label="&byMostVisited.label;" accesskey="&byMostVisited.accesskey;"
type="radio"
oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'visited');
GroupBy('visited');"/>
<menuitem id="bylastvisited" label="&byLastVisited.label;" accesskey="&byLastVisited.accesskey;"
type="radio"
oncommand="this.parentNode.parentNode.setAttribute('selectedsort', 'lastvisited');
GroupBy('lastvisited');"/>
</menupopup>
</button>
</hbox>
<tree id="historyTree" flex="1" class="plain"
context="historyContextMenu" seltype="multiple"
datasources="rdf:history" ref="NC:HistoryByDate" flags="dont-build-content"
onkeypress="if (event.keyCode == 13) openURL(event);"
hidecolumnpicker="true"
ondraggesture="if (event.originalTarget.localName == 'treechildren') nsDragAndDrop.startDrag(event, historyDNDObserver);"
onclick="handleHistoryClick(event);">
<template>
<rule>
<treechildren>
<treeitem uri="rdf:*" rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
<treerow>
<treecell label="rdf:http://home.netscape.com/NC-rdf#Name"
sortName="rdf:http://home.netscape.com/NC-rdf#Name?sort=true"
visitcount="rdf:http://home.netscape.com/NC-rdf#VisitCount"
date="rdf:http://home.netscape.com/NC-rdf#Date"/>
</treerow>
</treeitem>
</treechildren>
</rule>
</template>
<treecols id="historyTreeCols">
<treecol flex="1" id="Name" persist="sortActive sortDirection"
hideheader="true" primary="true"
sort="rdf:http://home.netscape.com/NC-rdf#Name?sort=true"
sortActive="true"/>
</treecols>
</tree>
</page>

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

@ -1,341 +0,0 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is 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):
# Alec Flett <alecf@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
// The history window uses JavaScript in bookmarksManager.js too.
var gHistoryTree;
var gGlobalHistory;
var gSearchBox;
var gHistoryGrouping = "";
function HistoryCommonInit()
{
gHistoryTree = document.getElementById("historyTree");
gSearchBox = document.getElementById("search-box");
var treeController = new nsTreeController(gHistoryTree);
gHistoryGrouping = document.getElementById("viewButton").getAttribute("selectedsort");
if (gHistoryGrouping == "site")
document.getElementById("bysite").setAttribute("checked", "true");
else if (gHistoryGrouping == "visited")
document.getElementById("byvisited").setAttribute("checked", "true");
else if (gHistoryGrouping == "lastvisited")
document.getElementById("bylastvisited").setAttribute("checked", "true");
else if (gHistoryGrouping == "dayandsite")
document.getElementById("bydayandsite").setAttribute("checked", "true");
else
document.getElementById("byday").setAttribute("checked", "true");
// XXXBlake we should persist the last search value
// If it's empty, this will do the right thing and just group by the old grouping.
searchHistory(gSearchBox.value);
gSearchBox.focus();
}
function historyOnSelect()
{
document.commandDispatcher.updateCommands("select");
}
var historyDNDObserver = {
onDragStart: function (aEvent, aXferData, aDragAction)
{
var currentIndex = gHistoryTree.currentIndex;
if (isContainer(gHistoryTree, currentIndex))
return false;
var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
var url = builder.getResourceAtIndex(currentIndex).ValueUTF8;
var col = gHistoryTree.columns["Name"];
var title = gHistoryTree.view.getCellText(currentIndex, col);
var htmlString = "<A HREF='" + url + "'>" + title + "</A>";
aXferData.data = new TransferData();
aXferData.data.addDataForFlavour("text/unicode", url);
aXferData.data.addDataForFlavour("text/html", htmlString);
aXferData.data.addDataForFlavour("text/x-moz-url", url + "\n" + title);
return true;
}
};
function collapseExpand()
{
var currentIndex = gHistoryTree.currentIndex;
gHistoryTree.treeBoxObject.view.toggleOpenState(currentIndex);
}
function openURLIn(where)
{
var count = gHistoryTree.view.selection.count;
if (count != 1)
return;
var currentIndex = gHistoryTree.currentIndex;
if (isContainer(gHistoryTree, currentIndex))
return;
var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
var url = builder.getResourceAtIndex(currentIndex).ValueUTF8;
if (!checkURLSecurity(url))
return;
openUILinkIn(url, where);
}
function openURL(aEvent)
{
openURLIn(whereToOpenLink(aEvent));
}
function handleHistoryClick(aEvent)
{
var tbo = gHistoryTree.treeBoxObject;
var row = { }, col = { }, obj = { };
tbo.getCellAt(aEvent.clientX, aEvent.clientY, row, col, obj);
var x = { }, y = { }, w = { }, h = { };
tbo.getCoordsForCellItem(row.value, col.value, "image",
x, y, w, h);
var mouseInGutter = aEvent.clientX < x.value;
if (row.value == -1 || obj.value == "twisty")
return;
var modifKey = aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey ||
aEvent.metaKey || aEvent.button == 1;
if (!modifKey && tbo.view.isContainer(row.value)) {
tbo.view.toggleOpenState(row.value);
return;
}
if (!mouseInGutter &&
aEvent.originalTarget.localName == "treechildren" &&
(aEvent.button == 0 || aEvent.button == 1)) {
// Clear all other selection since we're loading a link now. We must
// do this *before* attempting to load the link since openURL uses
// selection as an indication of which link to load.
tbo.view.selection.select(row.value);
openURL(aEvent);
}
}
function checkURLSecurity(aURL)
{
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService)
.newURI(aURL, null, null);
if (uri.schemeIs("javascript") || uri.schemeIs("data")) {
var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var historyBundle = strBundleService.createBundle("chrome://global/locale/history/history.properties");
var brandBundle = strBundleService.createBundle("chrome://branding/locale/brand.properties");
var brandStr = brandBundle.GetStringFromName("brandShortName");
var errorStr = historyBundle.GetStringFromName("load-js-data-url-error");
promptService.alert(window, brandStr, errorStr);
return false;
}
return true;
}
function SortBy(sortKey)
{
// We set the sortDirection to the one before we actually want it to be in the
// cycle list, since cycleHeader cycles it forward before doing the sort.
var sortDirection;
switch(sortKey) {
case "visited":
sortKey = "rdf:http://home.netscape.com/NC-rdf#VisitCount";
sortDirection = "ascending";
break;
case "name":
sortKey = "rdf:http://home.netscape.com/NC-rdf#Name?sort=true";
sortDirection = "natural";
break;
case "lastvisited":
sortKey = "rdf:http://home.netscape.com/NC-rdf#Date";
sortDirection = "ascending";
break;
default:
return;
}
var col = document.getElementById("Name");
col.setAttribute("sort", sortKey);
col.setAttribute("sortDirection", sortDirection);
var column = gHistoryTree.columns.getColumnFor(col);
gHistoryTree.view.cycleHeader(column);
}
function IsFindResource(uri)
{
return (uri.substr(0, 5) == "find:");
}
function GroupBy(groupingType)
{
var isFind = IsFindResource(groupingType);
if (!isFind) {
gHistoryGrouping = groupingType;
gSearchBox.value = "";
}
switch(groupingType) {
case "site":
gHistoryTree.setAttribute("ref", "NC:HistoryRoot");
break;
case "dayandsite":
gHistoryTree.setAttribute("ref", "NC:HistoryByDateAndSite");
break;
case "visited":
gHistoryTree.setAttribute("ref", "NC:HistoryRoot");
break;
case "lastvisited":
gHistoryTree.setAttribute("ref", "NC:HistoryRoot");
break;
case "day":
gHistoryTree.setAttribute("ref", "NC:HistoryByDate");
break;
default:
gHistoryTree.setAttribute("ref", groupingType);
}
Sort(isFind? gHistoryGrouping : groupingType);
}
function Sort(groupingType)
{
switch(groupingType) {
case "site":
case "dayandsite":
case "day":
SortBy("name");
break;
case "lastvisited":
SortBy("lastvisited");
break;
case "visited":
SortBy("visited");
break;
}
}
function historyAddBookmarks()
{
var count = gHistoryTree.view.selection.count;
if (count != 1)
return;
var currentIndex = gHistoryTree.currentIndex;
var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
var url = builder.getResourceAtIndex(currentIndex).ValueUTF8;
//XXXBlake don't use getCellText
var col = gHistoryTree.columns["Name"];
var title = gHistoryTree.view.getCellText(currentIndex, col);
BookmarksUtils.addBookmark(url, title, undefined);
}
function historyCopyLink()
{
var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder);
var url = builder.getResourceAtIndex(gHistoryTree.currentIndex).ValueUTF8;
var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper );
clipboard.copyString(url);
}
function buildContextMenu(aEvent)
{
// if nothing is selected, bail and don't show a context menu
var count = gHistoryTree.view.selection.count;
if (count != 1) {
aEvent.preventDefault();
return;
}
var openItem = document.getElementById("miOpen");
var openItemInNewWindow = document.getElementById("miOpenInNewWindow");
var openItemInNewTab = document.getElementById("miOpenInNewTab");
var bookmarkItem = document.getElementById("miAddBookmark");
var copyLocationItem = document.getElementById("miCopyLink");
var sep1 = document.getElementById("pre-bookmarks-separator");
var sep2 = document.getElementById("post-bookmarks-separator");
var expandItem = document.getElementById("miExpand");
var collapseItem = document.getElementById("miCollapse");
var currentIndex = gHistoryTree.currentIndex;
if ((gHistoryGrouping == "day" || gHistoryGrouping == "dayandsite")
&& isContainer(gHistoryTree, currentIndex)) {
openItem.hidden = true;
openItemInNewWindow.hidden = true;
openItemInNewTab.hidden = true;
bookmarkItem.hidden = true;
copyLocationItem.hidden = true;
sep1.hidden = true;
sep2.hidden = false;
if (isContainerOpen(gHistoryTree, currentIndex)) {
expandItem.hidden = true;
collapseItem.hidden = false;
} else {
expandItem.hidden = false;
collapseItem.hidden = true;
}
}
else {
openItem.hidden = false;
openItemInNewWindow.hidden = false;
openItemInNewTab.hidden = false;
bookmarkItem.hidden = false;
copyLocationItem.hidden = false;
sep1.hidden = false;
sep2.hidden = false;
expandItem.hidden = true;
collapseItem.hidden = true;
}
}
function searchHistory(aInput)
{
if (aInput == "") {
GroupBy(gHistoryGrouping);
return;
}
GroupBy("find:datasource=history&match=Name&method=contains&text=" + encodeURIComponent(aInput));
}

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

@ -1,3 +0,0 @@
browser.jar:
* content/browser/history/history-panel.xul (content/history-panel.xul)
* content/browser/history/history.js (content/history.js)

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

@ -43,7 +43,6 @@ browser/base/Makefile
browser/components/Makefile
browser/components/build/Makefile
browser/components/dirprovider/Makefile
browser/components/history/Makefile
browser/components/migration/Makefile
browser/components/migration/public/Makefile
browser/components/migration/src/Makefile