diff --git a/mozilla/rdf/build/nsRDFCID.h b/mozilla/rdf/build/nsRDFCID.h index 5b0d3870516..e42f63a0155 100644 --- a/mozilla/rdf/build/nsRDFCID.h +++ b/mozilla/rdf/build/nsRDFCID.h @@ -42,10 +42,6 @@ #define NS_RDFINMEMORYDATASOURCE_CID \ { 0xbfd0526d, 0x834c, 0x11d2, { 0x8e, 0xac, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } } -// {E638D760-8687-11d2-B530-000000000000} -#define NS_RDFBOOKMARKDATASOURCE_CID \ -{ 0xe638d760, 0x8687, 0x11d2, { 0xb5, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } - // {E638D760-8687-11d2-B530-000000000001} #define NS_RDFFILESYSTEMDATASOURCE_CID \ { 0xe638d760, 0x8687, 0x11d2, { 0xb5, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x01 } } diff --git a/mozilla/rdf/build/nsRDFFactory.cpp b/mozilla/rdf/build/nsRDFFactory.cpp index c8f40a7e04b..54757602294 100644 --- a/mozilla/rdf/build/nsRDFFactory.cpp +++ b/mozilla/rdf/build/nsRDFFactory.cpp @@ -56,7 +56,6 @@ static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID); static NS_DEFINE_CID(kLocalStoreCID, NS_LOCALSTORE_CID); -static NS_DEFINE_CID(kRDFBookmarkDataSourceCID, NS_RDFBOOKMARKDATASOURCE_CID); static NS_DEFINE_CID(kRDFCompositeDataSourceCID, NS_RDFCOMPOSITEDATASOURCE_CID); static NS_DEFINE_CID(kRDFContainerCID, NS_RDFCONTAINER_CID); static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); @@ -185,10 +184,6 @@ RDFFactoryImpl::CreateInstance(nsISupports *aOuter, if (NS_FAILED(rv = NS_NewRDFXMLDataSource((nsIRDFXMLDataSource**) &inst))) return rv; } - else if (mClassID.Equals(kRDFBookmarkDataSourceCID)) { - if (NS_FAILED(rv = NS_NewRDFBookmarkDataSource((nsIRDFDataSource**) &inst))) - return rv; - } else if (mClassID.Equals(kRDFFileSystemDataSourceCID)) { if (NS_FAILED(rv = NS_NewRDFFileSystemDataSource((nsIRDFDataSource**) &inst))) return rv; @@ -358,11 +353,6 @@ NSRegisterSelf(nsISupports* aServMgr , const char* aPath) if (NS_FAILED(rv)) return rv; // register our build-in datasources: - rv = compMgr->RegisterComponent(kRDFBookmarkDataSourceCID, - "Bookmarks", - NS_RDF_DATASOURCE_PROGID_PREFIX "bookmarks", - aPath, PR_TRUE, PR_TRUE); - if (NS_FAILED(rv)) goto done; rv = compMgr->RegisterComponent(kRDFCompositeDataSourceCID, "RDF Composite Data Source", NS_RDF_DATASOURCE_PROGID_PREFIX "composite-datasource", @@ -515,8 +505,6 @@ NSUnregisterSelf(nsISupports* aServMgr, const char* aPath) (nsISupports**)&compMgr); if (NS_FAILED(rv)) return rv; - rv = compMgr->UnregisterComponent(kRDFBookmarkDataSourceCID, aPath); - if (NS_FAILED(rv)) goto done; rv = compMgr->UnregisterComponent(kRDFFileSystemDataSourceCID,aPath); if (NS_FAILED(rv)) goto done; rv = compMgr->UnregisterComponent(kRDFSearchDataSourceCID,aPath); diff --git a/mozilla/rdf/datasource/public/MANIFEST b/mozilla/rdf/datasource/public/MANIFEST index b089af55883..e5cc6359ca7 100644 --- a/mozilla/rdf/datasource/public/MANIFEST +++ b/mozilla/rdf/datasource/public/MANIFEST @@ -1,4 +1,3 @@ -nsIBookmarkDataSource.h nsILocalStore.h nsIRDFFileSystem.h nsIRDFFind.h diff --git a/mozilla/rdf/datasource/public/Makefile.in b/mozilla/rdf/datasource/public/Makefile.in index 5444ad75ed3..6bfb64f7047 100644 --- a/mozilla/rdf/datasource/public/Makefile.in +++ b/mozilla/rdf/datasource/public/Makefile.in @@ -25,7 +25,6 @@ include $(DEPTH)/config/autoconf.mk MODULE = rdf EXPORTS = \ - nsIBookmarkDataSource.h \ nsILocalStore.h \ nsIRDFFileSystem.h \ nsIRDFFind.h \ diff --git a/mozilla/rdf/datasource/public/makefile.win b/mozilla/rdf/datasource/public/makefile.win index 29fdbace525..771a84a087a 100644 --- a/mozilla/rdf/datasource/public/makefile.win +++ b/mozilla/rdf/datasource/public/makefile.win @@ -21,7 +21,6 @@ MODULE=rdf DEPTH=..\..\.. EXPORTS = \ - nsIBookmarkDataSource.h \ nsILocalStore.h \ nsIRDFFileSystem.h \ nsIRDFFind.h \ diff --git a/mozilla/rdf/datasource/public/nsIBookmarkDataSource.h b/mozilla/rdf/datasource/public/nsIBookmarkDataSource.h deleted file mode 100644 index 4c1639273c4..00000000000 --- a/mozilla/rdf/datasource/public/nsIBookmarkDataSource.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* - - The global bookmark data source. - - */ - -#ifndef nsIRDFBookmarkDataSource_h__ -#define nsIRDFBookmarkDataSource_h__ - -#include "nscore.h" -#include "nsIRDFDataSource.h" - -// {a82e9300-e4af-11d2-8fdf-0008c70adc7b} -#define NS_IRDFBOOKMARKDATASOURCE_IID \ -{ 0xa82e9300, 0xe4af, 0x11d2, { 0x8f, 0xdf, 0x0, 0x08, 0xc7, 0x0a, 0xdc, 0x7b } } - -class nsIRDFBookmarkDataSource : public nsIRDFDataSource -{ -public: - static const nsIID& GetIID() { static nsIID iid = NS_IRDFBOOKMARKDATASOURCE_IID; return iid; } - - /** - * Add the specified item to bookmarks - */ - NS_IMETHOD AddBookmark (const char *aURI, const PRUnichar *aOptionalTitle) = 0; - NS_IMETHOD FindBookmarkShortcut (const char *userInput, char **shortcutURL /* out */) = 0; -}; - -#endif /* nsIRDFBookmarkDataSource_h__ */ - diff --git a/mozilla/rdf/datasource/src/Makefile.in b/mozilla/rdf/datasource/src/Makefile.in index c8924c00788..4d3272ba915 100644 --- a/mozilla/rdf/datasource/src/Makefile.in +++ b/mozilla/rdf/datasource/src/Makefile.in @@ -27,7 +27,6 @@ include $(topsrcdir)/config/config.mk LIBRARY_NAME = rdfdatasource_s CPPSRCS = \ - nsBookmarkDataSource.cpp \ nsLocalStore.cpp \ nsFileSystemDataSource.cpp \ nsFindDataSource.cpp \ diff --git a/mozilla/rdf/datasource/src/makefile.win b/mozilla/rdf/datasource/src/makefile.win index a9d5bbec6a9..9a1b9b969ac 100644 --- a/mozilla/rdf/datasource/src/makefile.win +++ b/mozilla/rdf/datasource/src/makefile.win @@ -22,7 +22,6 @@ LIBRARY_NAME=rdfdatasource_s LCFLAGS=-DMOZ_BRPROF CPP_OBJS=\ - .\$(OBJDIR)\nsBookmarkDataSource.obj \ .\$(OBJDIR)\nsFileSystemDataSource.obj \ .\$(OBJDIR)\nsFindDataSource.obj \ .\$(OBJDIR)\nsFTPDataSource.obj \ diff --git a/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp b/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp deleted file mode 100644 index e2be463b686..00000000000 --- a/mozilla/rdf/datasource/src/nsBookmarkDataSource.cpp +++ /dev/null @@ -1,1499 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* - A data source that reads the 4.x "bookmarks.html" file and - constructs an in-memory data source. - */ - -#include "nsIRDFContainer.h" -#include "nsIRDFContainerUtils.h" -#include "nsIRDFDataSource.h" -#include "nsIRDFNode.h" -#include "nsIRDFService.h" -#include "nsIServiceManager.h" -#include "nsFileSpec.h" -#include "nsFileStream.h" -#include "nsSpecialSystemDirectory.h" -#include "nsRDFCID.h" -#include "nsString.h" -#include "nsVoidArray.h" -#include "nsXPIDLString.h" -#include "prio.h" -#include "rdf.h" -#include "rdfutil.h" -#include "prlog.h" -#include "nsIComponentManager.h" -#include "xp_core.h" -#include "nsIBookmarkDataSource.h" - -//////////////////////////////////////////////////////////////////////// - -static NS_DEFINE_IID(kIRDFDataSourceIID, NS_IRDFDATASOURCE_IID); -static NS_DEFINE_IID(kIRDFServiceIID, NS_IRDFSERVICE_IID); -static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID); -static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); -static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); -static NS_DEFINE_CID(kRDFBookmarkDataSourceCID, NS_RDFBOOKMARKDATASOURCE_CID); -static NS_DEFINE_IID(kIRDFBookmarkDataSourceIID,NS_IRDFBOOKMARKDATASOURCE_IID); -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - -static const char kURINC_BookmarksRoot[] = "NC:BookmarksRoot"; // XXX? -static const char kURINC_IEFavoritesRoot[] = "NC:IEFavoritesRoot"; // XXX? -static const char kURINC_PersonalToolbarFolder[] = "NC:PersonalToolbarFolder"; // XXX? - -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, child); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Bookmark); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, BookmarkSeparator); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, BookmarkAddDate); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Description); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Folder); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, IEFavorite); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Name); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, PersonalToolbarFolderCategory); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, URL); -DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, ShortcutURL); - -DEFINE_RDF_VOCAB(WEB_NAMESPACE_URI, WEB, LastVisitDate); -DEFINE_RDF_VOCAB(WEB_NAMESPACE_URI, WEB, LastModifiedDate); - -DEFINE_RDF_VOCAB(RDF_NAMESPACE_URI, RDF, instanceOf); -DEFINE_RDF_VOCAB(RDF_NAMESPACE_URI, RDF, type); - -static const char kPersonalToolbarFolder[] = "Personal Toolbar Folder"; - - -//////////////////////////////////////////////////////////////////////// - -PRInt32 gRefCnt; -nsIRDFService* gRDFService; -nsIRDFResource* kNC_Bookmark; -nsIRDFResource* kNC_BookmarkSeparator; -nsIRDFResource* kNC_BookmarkAddDate; -nsIRDFResource* kNC_BookmarksRoot; -nsIRDFResource* kNC_Description; -nsIRDFResource* kNC_Folder; -nsIRDFResource* kNC_IEFavorite; -nsIRDFResource* kNC_IEFavoritesRoot; -nsIRDFResource* kNC_Name; -nsIRDFResource* kNC_PersonalToolbarFolder; -nsIRDFResource* kNC_ShortcutURL; -nsIRDFResource* kNC_URL; -nsIRDFResource* kRDF_type; -nsIRDFResource* kWEB_LastModifiedDate; -nsIRDFResource* kWEB_LastVisitDate; - -static void -bm_AddRefGlobals() -{ - if (gRefCnt++ == 0) { - nsresult rv; - if (NS_FAILED(rv = nsServiceManager::GetService(kRDFServiceCID, - kIRDFServiceIID, - (nsISupports**) &gRDFService))) { - NS_ERROR("unable to get RDF service"); - return; - } - - gRDFService->GetResource(kURINC_Bookmark, &kNC_Bookmark); - gRDFService->GetResource(kURINC_BookmarkSeparator, &kNC_BookmarkSeparator); - gRDFService->GetResource(kURINC_BookmarkAddDate, &kNC_BookmarkAddDate); - gRDFService->GetResource(kURINC_BookmarksRoot, &kNC_BookmarksRoot); - gRDFService->GetResource(kURINC_Description, &kNC_Description); - gRDFService->GetResource(kURINC_Folder, &kNC_Folder); - gRDFService->GetResource(kURINC_IEFavorite, &kNC_IEFavorite); - gRDFService->GetResource(kURINC_IEFavoritesRoot, &kNC_IEFavoritesRoot); - gRDFService->GetResource(kURINC_Name, &kNC_Name); - gRDFService->GetResource(kURINC_PersonalToolbarFolder, &kNC_PersonalToolbarFolder); - gRDFService->GetResource(kURINC_ShortcutURL, &kNC_ShortcutURL); - gRDFService->GetResource(kURINC_URL, &kNC_URL); - gRDFService->GetResource(kURIRDF_type, &kRDF_type); - gRDFService->GetResource(kURIWEB_LastModifiedDate, &kWEB_LastModifiedDate); - gRDFService->GetResource(kURIWEB_LastVisitDate, &kWEB_LastVisitDate); - } -} - - -static void -bm_ReleaseGlobals() -{ - if (--gRefCnt == 0) { - if (gRDFService) - nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService); - - NS_IF_RELEASE(kNC_Bookmark); - NS_IF_RELEASE(kNC_BookmarkSeparator); - NS_IF_RELEASE(kNC_BookmarkAddDate); - NS_IF_RELEASE(kNC_BookmarksRoot); - NS_IF_RELEASE(kNC_Description); - NS_IF_RELEASE(kNC_Folder); - NS_IF_RELEASE(kNC_IEFavorite); - NS_IF_RELEASE(kNC_IEFavoritesRoot); - NS_IF_RELEASE(kNC_Name); - NS_IF_RELEASE(kNC_PersonalToolbarFolder); - NS_IF_RELEASE(kNC_ShortcutURL); - NS_IF_RELEASE(kNC_URL); - NS_IF_RELEASE(kRDF_type); - NS_IF_RELEASE(kWEB_LastModifiedDate); - NS_IF_RELEASE(kWEB_LastVisitDate); - } -} - - -//////////////////////////////////////////////////////////////////////// - -/** - * The bookmark parser knows how to read bookmarks.html and convert it - * into an RDF graph. - */ -class BookmarkParser { -private: - nsInputFileStream *mStream; - nsIRDFDataSource *mDataSource; - const char *mIEFavoritesRoot; - PRBool mFoundIEFavoritesRoot; - -protected: - nsresult AssertTime(nsIRDFResource* aSource, - nsIRDFResource* aLabel, - PRInt32 aTime); - - nsresult ParseBookmark(const nsString& aLine, nsIRDFResource* aContainer, nsIRDFResource *nodeType); - nsresult ParseBookmarkHeader(const nsString& aLine, nsIRDFResource* aContainer, nsIRDFResource *nodeType); - nsresult ParseBookmarkSeparator(const nsString& aLine, nsIRDFResource* aContainer); - nsresult ParseHeaderBegin(const nsString& aLine, nsIRDFResource* aContainer); - nsresult ParseHeaderEnd(const nsString& aLine); - nsresult ParseAttribute(const nsString& aLine, - const char* aAttribute, - PRInt32 aAttributeLen, - nsString& aResult); - -public: - BookmarkParser(); - ~BookmarkParser(); - - nsresult Init(nsInputFileStream *aStream, nsIRDFDataSource *aDataSource); - nsresult Parse(nsIRDFResource* aContainer, nsIRDFResource *nodeType); - - nsresult AddBookmark(nsIRDFResource* aContainer, - const char* aURL, - const PRUnichar* aOptionalTitle, - PRInt32 aAddDate, - PRInt32 aLastVisitDate, - PRInt32 aLastModifiedDate, - const char* aShortcutURL, - nsIRDFResource* aNodeType); - - nsresult SetIEFavoritesRoot(const char *IEFavoritesRootURL) - { - mIEFavoritesRoot = IEFavoritesRootURL; - return(NS_OK); - } - nsresult ParserFoundIEFavoritesRoot(PRBool *foundIEFavoritesRoot) - { - *foundIEFavoritesRoot = mFoundIEFavoritesRoot; - return(NS_OK); - } -}; - - -BookmarkParser::BookmarkParser() -{ - bm_AddRefGlobals(); -} - -nsresult -BookmarkParser::Init(nsInputFileStream *aStream, nsIRDFDataSource *aDataSource) -{ - mStream = aStream; - mDataSource = aDataSource; - mIEFavoritesRoot = nsnull; - mFoundIEFavoritesRoot = PR_FALSE; - return(NS_OK); -} - -BookmarkParser::~BookmarkParser(void) -{ - bm_ReleaseGlobals(); -} - -static const char kHREFEquals[] = "HREF=\""; -static const char kCloseAnchor[] = ""; - -static const char kOpenHeading[] = "= 0) { - rv = ParseBookmark(line, aContainer, nodeType); - } - else if ((offset = line.Find(kOpenHeading)) >= 0 && - nsString::IsDigit(line.CharAt(offset + 2))) { - // XXX Ignore

so that bookmarks root _is_

- if (line.CharAt(offset + 2) != PRUnichar('1')) - rv = ParseBookmarkHeader(line, aContainer, nodeType); - } - else if ((offset = line.Find(kSeparator)) >= 0) { - rv = ParseBookmarkSeparator(line, aContainer); - } - else if ((offset = line.Find(kCloseUL)) >= 0 || - (offset = line.Find(kCloseMenu)) >= 0 || - (offset = line.Find(kCloseDL)) >= 0) { - return ParseHeaderEnd(line); - } - else if ((offset = line.Find(kOpenUL)) >= 0 || - (offset = line.Find(kOpenMenu)) >= 0 || - (offset = line.Find(kOpenDL)) >= 0) { - rv = ParseHeaderBegin(line, aContainer); - } - else { - // XXX Discard the line. We should be treating this as the - // description. - } - } - return rv; -} - - -nsresult -BookmarkParser::ParseBookmark(const nsString& aLine, nsIRDFResource* aContainer, nsIRDFResource *nodeType) -{ - NS_PRECONDITION(aContainer != nsnull, "null ptr"); - if (! aContainer) - return NS_ERROR_NULL_POINTER; - - PRInt32 start = aLine.Find(kHREFEquals); - NS_ASSERTION(start >= 0, "no 'HREF=\"' string: how'd we get here?"); - if (start < 0) - return NS_ERROR_UNEXPECTED; - - // 1. Crop out the URL - - // Skip past the first double-quote - start += (sizeof(kHREFEquals) - 1); - - // ...and find the next so we can chop the URL. - PRInt32 end = aLine.Find(PRUnichar('"'), start); - NS_ASSERTION(end >= 0, "unterminated string"); - if (end < 0) - return NS_ERROR_UNEXPECTED; - - nsAutoString url; - aLine.Mid(url, start, end - start); - - { - // Now do properly replace %22's (this is what 4.5 did, anyway...) - static const char kEscape22[] = "%22"; - PRInt32 offset; - while ((offset = url.Find(kEscape22)) >= 0) { - url.SetCharAt(' ',offset); - url.Cut(offset + 1, sizeof(kEscape22) - 2); - } - } - - // XXX At this point, the URL may be relative. 4.5 called into - // netlib to make an absolute URL, and there was some magic - // "relative_URL" parameter that got sent down as well. We punt on - // that stuff. - - // 2. Parse the name - - start = aLine.Find(PRUnichar('>'), end + 1); // 'end' still points to the end of the URL - NS_ASSERTION(start >= 0, "open anchor tag not terminated"); - if (start < 0) - return NS_ERROR_UNEXPECTED; - - nsAutoString name; - aLine.Right(name, aLine.Length() - (start + 1)); - - end = name.Find(kCloseAnchor); - NS_ASSERTION(end >= 0, "anchor tag not terminated"); - if (end < 0) - return NS_ERROR_UNEXPECTED; - - name.Truncate(end); - - // 3. Parse the target - nsAutoString target; - - start = aLine.Find(kTargetEquals); - if (start >= 0) { - start += (sizeof(kTargetEquals) - 1); - end = aLine.Find(PRUnichar('"'), start); - aLine.Mid(target, start, end - start); - } - - - // 4. Parse the addition date - PRInt32 addDate = 0; - - { - nsAutoString s; - ParseAttribute(aLine, kAddDateEquals, sizeof(kAddDateEquals) - 1, s); - if (s.Length() > 0) { - PRInt32 err; - addDate = s.ToInteger(&err); // ignored. - } - } - - // 5. Parse the last visit date - - PRInt32 lastVisitDate = 0; - - { - nsAutoString s; - ParseAttribute(aLine, kLastVisitEquals, sizeof(kLastVisitEquals) - 1, s); - if (s.Length() > 0) { - PRInt32 err; - lastVisitDate = s.ToInteger(&err); // ignored. - } - } - - // 6. Parse the last modified date - - PRInt32 lastModifiedDate; - - { - nsAutoString s; - ParseAttribute(aLine, kLastModifiedEquals, sizeof(kLastModifiedEquals) - 1, s); - if (s.Length() > 0) { - PRInt32 err; - lastModifiedDate = s.ToInteger(&err); // ignored. - } - } - - // 7. Parse the shortcut URL - - nsAutoString shortcut; - ParseAttribute(aLine, kShortcutURLEquals, sizeof(kShortcutURLEquals) -1, shortcut); - - - // Dunno. 4.5 did it, so will we. - if (!lastModifiedDate) - lastModifiedDate = lastVisitDate; - - // XXX There was some other cruft here to deal with aliases, but - // since I have no clue what those are, I'll punt. - - char *cURL = url.ToNewCString(); - if (cURL) - { - char *cShortcutURL = shortcut.ToNewCString(); - if (! cShortcutURL) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = AddBookmark(aContainer, - cURL, - name.GetUnicode(), - addDate, - lastVisitDate, - lastModifiedDate, - cShortcutURL, - nodeType); - - delete [] cURL; - if (cShortcutURL) delete [] cShortcutURL; - } - return(NS_OK); -} - - - - // Now create the bookmark -nsresult -BookmarkParser::AddBookmark(nsIRDFResource* aContainer, - const char* aURL, - const PRUnichar* aOptionalTitle, - PRInt32 aAddDate, - PRInt32 aLastVisitDate, - PRInt32 aLastModifiedDate, - const char* aShortcutURL, - nsIRDFResource* aNodeType) -{ - nsresult rv; - nsCOMPtr bookmark; - - if (NS_FAILED(rv = gRDFService->GetResource(aURL, getter_AddRefs(bookmark) ))) - { - NS_ERROR("unable to get bookmark resource"); - return rv; - } - - PRBool result = PR_FALSE; - if (nsnull != mIEFavoritesRoot) - { - if (!PL_strcmp(aURL, mIEFavoritesRoot)) - { - mFoundIEFavoritesRoot = PR_TRUE; - } - } - - nsCOMPtr container; - rv = NS_NewRDFContainer(mDataSource, aContainer, getter_AddRefs(container)); - if (NS_FAILED(rv)) return rv; - - rv = container->AppendElement(bookmark); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add bookmark to container"); - if (NS_FAILED(rv)) return rv; - - rv = mDataSource->Assert(bookmark, kRDF_type, aNodeType, PR_TRUE); - if (rv != NS_RDF_ASSERTION_ACCEPTED) - { - NS_ERROR("unable to add bookmark to data source"); - return rv; - } - - if ((nsnull != aOptionalTitle) && (*aOptionalTitle != PRUnichar('\0'))) - { - nsCOMPtr literal; - if (NS_FAILED(rv = gRDFService->GetLiteral(aOptionalTitle, getter_AddRefs(literal)))) - { - NS_ERROR("unable to create literal for bookmark name"); - return rv; - } - - rv = mDataSource->Assert(bookmark, kNC_Name, literal, PR_TRUE); - if (rv != NS_RDF_ASSERTION_ACCEPTED) - { - NS_ERROR("unable to set bookmark name"); - return rv; - } - } - - AssertTime(bookmark, kNC_BookmarkAddDate, aAddDate); - AssertTime(bookmark, kWEB_LastVisitDate, aLastVisitDate); - AssertTime(bookmark, kWEB_LastModifiedDate, aLastModifiedDate); - - if ((nsnull != aShortcutURL) && (*aShortcutURL != '\0')) - { - nsCOMPtr shortcutLiteral; - if (NS_FAILED(rv = gRDFService->GetLiteral(nsAutoString(aShortcutURL).GetUnicode(), - getter_AddRefs(shortcutLiteral)))) - { - NS_ERROR("unable to get literal for bookmark shortcut URL"); - return(rv); - } - if (rv != NS_RDF_NO_VALUE) - { - rv = mDataSource->Assert(bookmark, - kNC_ShortcutURL, - shortcutLiteral, - PR_TRUE); - - if (rv != NS_RDF_ASSERTION_ACCEPTED) - { - NS_ERROR("unable to set bookmark shortcut URL"); - return(rv); - } - } - } - - return(NS_OK); -} - - - -nsresult -BookmarkParser::ParseBookmarkHeader(const nsString& aLine, nsIRDFResource* aContainer, nsIRDFResource *nodeType) -{ - // Snip out the header - PRInt32 start = aLine.Find(kOpenHeading); - NS_ASSERTION(start >= 0, "couldn't find ''), start); // skip to the end of the '' tag - - if (start < 0) { - NS_WARNING("couldn't find end of header tag"); - return NS_OK; - } - - nsAutoString name; - aLine.Right(name, aLine.Length() - (start + 1)); - - PRInt32 end = name.Find(kCloseHeading); - if (end < 0) - NS_WARNING("No '= 0) - name.Truncate(end); - - // Find the add date - PRInt32 addDate = 0; - - nsAutoString s; - ParseAttribute(aLine, kAddDateEquals, sizeof(kAddDateEquals) - 1, s); - if (s.Length() > 0) { - PRInt32 err; - addDate = s.ToInteger(&err); // ignored - } - - nsAutoString id; - ParseAttribute(aLine, kIDEquals, sizeof(kIDEquals) - 1, id); - - // Make the necessary assertions - nsresult rv; - nsCOMPtr folder; - if (id.Length() > 0) { - // Use the ID attribute, if one is set. - rv = gRDFService->GetUnicodeResource(id.GetUnicode(), getter_AddRefs(folder)); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create resource for folder"); - if (NS_FAILED(rv)) return rv; - } - else if (name.Equals(kPersonalToolbarFolder)) { // XXX I18n!!! - folder = dont_QueryInterface( kNC_PersonalToolbarFolder ); - } - else { - // We've never seen this folder before. Assign it an anonymous ID - rv = rdf_CreateAnonymousResource(kURINC_BookmarksRoot, getter_AddRefs(folder)); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create anonymous resource for folder"); - if (NS_FAILED(rv)) return rv; - } - - nsCOMPtr literal; - rv = gRDFService->GetLiteral(name.GetUnicode(), getter_AddRefs(literal)); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to create literal for folder name"); - if (NS_FAILED(rv)) return rv; - - rv = mDataSource->Assert(folder, kNC_Name, literal, PR_TRUE); - if (rv != NS_RDF_ASSERTION_ACCEPTED) { - NS_ERROR("unable to set folder name"); - return rv; - } - - nsCOMPtr container; - rv = NS_NewRDFContainer(mDataSource, aContainer, getter_AddRefs(container)); - if (NS_FAILED(rv)) return rv; - - rv = container->AppendElement(folder); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add bookmark to container"); - if (NS_FAILED(rv)) return rv; - - NS_WITH_SERVICE(nsIRDFContainerUtils, rdfc, kRDFContainerUtilsCID, &rv); - if (NS_FAILED(rv)) return rv; - - rv = rdfc->MakeSeq(mDataSource, folder, nsnull); - NS_ASSERTION(NS_SUCCEEDED(rv), "unable to make new folder as sequence"); - if (NS_FAILED(rv)) return rv; - - rv = mDataSource->Assert(folder, kRDF_type, kNC_Folder, PR_TRUE); - if (rv != NS_RDF_ASSERTION_ACCEPTED) { - NS_ERROR("unable to mark new folder as folder"); - return rv; - } - - if (NS_FAILED(rv = AssertTime(folder, kNC_BookmarkAddDate, addDate))) { - NS_ERROR("unable to mark add date"); - return rv; - } - - // And now recursively parse the rest of the file... - - if (NS_FAILED(rv = Parse(folder, nodeType))) { - NS_ERROR("recursive parse of bookmarks file failed"); - return rv; - } - - return NS_OK; -} - - -nsresult -BookmarkParser::ParseBookmarkSeparator(const nsString& aLine, nsIRDFResource* aContainer) -{ - nsresult rv; - nsCOMPtr separator; - - if (NS_SUCCEEDED(rv = rdf_CreateAnonymousResource(kURINC_BookmarksRoot, getter_AddRefs(separator)))) - { - nsAutoString defaultSeparatorName("-----"); - nsCOMPtr nameLiteral; - if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(defaultSeparatorName.GetUnicode(), getter_AddRefs(nameLiteral)))) - { - if (NS_SUCCEEDED(rv = mDataSource->Assert(separator, kNC_Name, nameLiteral, PR_TRUE))) - { - } - } - if (NS_SUCCEEDED(rv = mDataSource->Assert(separator, kRDF_type, kNC_BookmarkSeparator, PR_TRUE))) - { - nsCOMPtr container; - rv = NS_NewRDFContainer(mDataSource, aContainer, getter_AddRefs(container)); - if (NS_SUCCEEDED(rv)) - { - rv = container->AppendElement(separator); - } - } - } - return(rv); -} - - - -nsresult -BookmarkParser::ParseHeaderBegin(const nsString& aLine, nsIRDFResource* aContainer) -{ - return NS_OK; -} - - - -nsresult -BookmarkParser::ParseHeaderEnd(const nsString& aLine) -{ - return NS_OK; -} - - -nsresult -BookmarkParser::ParseAttribute(const nsString& aLine, - const char* aAttributeName, - PRInt32 aAttributeLen, - nsString& aResult) -{ - aResult.Truncate(); - - PRInt32 start = aLine.Find(aAttributeName); - if (start < 0) - return NS_OK; - - start += aAttributeLen; - PRInt32 end = aLine.Find(PRUnichar('"'), start); - aLine.Mid(aResult, start, end - start); - - return NS_OK; -} - -nsresult -BookmarkParser::AssertTime(nsIRDFResource* aSource, - nsIRDFResource* aLabel, - PRInt32 aTime) -{ - // XXX TO DO: Convert to a date literal - - nsAutoString time; - time.Append(aTime, 10); - - nsresult rv; - nsIRDFLiteral* literal; - if (NS_FAILED(rv = gRDFService->GetLiteral(time.GetUnicode(), &literal))) { - NS_ERROR("unable to get literal for time"); - return rv; - } - - rv = mDataSource->Assert(aSource, aLabel, literal, PR_TRUE); - NS_ASSERTION(rv == NS_RDF_ASSERTION_ACCEPTED, "unable to assert time"); - - NS_RELEASE(literal); - return rv; -} - -//////////////////////////////////////////////////////////////////////// -// BookmarkDataSourceImpl - -/** - * The bookmark data source uses a BookmarkParser to read the - * bookmarks.html file from the local disk and present an - * in-memory RDF graph based on it. - */ - -class BookmarkDataSourceImpl : public nsIRDFBookmarkDataSource { -protected: - nsIRDFDataSource* mInner; - - nsresult ReadBookmarks(void); - nsresult WriteBookmarks(nsIRDFDataSource *ds, nsIRDFResource *root); - nsresult WriteBookmarksContainer(nsIRDFDataSource *ds, nsOutputFileStream strm, nsIRDFResource *container, PRInt32 level); - nsresult WriteBookmarkProperties(nsIRDFDataSource *ds, nsOutputFileStream strm, nsIRDFResource *node, - nsIRDFResource *property, const char *htmlAttrib, PRBool isFirst); - PRBool CanAccept(nsIRDFResource* aSource, nsIRDFResource* aProperty, nsIRDFNode* aTarget); - -public: - BookmarkDataSourceImpl(void); - virtual ~BookmarkDataSourceImpl(void); -#if 0 - // for nsIGenericFactory: - static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); -#endif - // nsISupports - NS_DECL_ISUPPORTS - - // nsIRDFBookmarkDataSource - NS_IMETHOD AddBookmark(const char *aURI, const PRUnichar *aOptionalTitle) - { - // XXX for the moment, just add it as a child of BookmarksRoot - BookmarkParser parser; - parser.Init(nsnull, NS_STATIC_CAST(nsIRDFDataSource *, this)); - nsresult rv = parser.AddBookmark(kNC_BookmarksRoot, aURI, aOptionalTitle, - 0L, 0L, 0L, nsnull, kNC_Bookmark); - if (NS_SUCCEEDED(rv)) - { - Flush(); - } - return(rv); - } - - NS_IMETHOD FindBookmarkShortcut(const char *userInput, char **shortcutURL) - { - nsresult rv = NS_RDF_NO_VALUE; - if (nsnull != shortcutURL) - { - *shortcutURL = nsnull; - nsCOMPtr literalTarget; - if (NS_FAILED(rv = gRDFService->GetLiteral(nsAutoString(userInput).GetUnicode(), - getter_AddRefs(literalTarget)))) - { - } - else if (rv != NS_RDF_NO_VALUE) - { - nsCOMPtr source; - if (NS_FAILED(rv = GetSource(kNC_ShortcutURL, literalTarget, - PR_TRUE, getter_AddRefs(source)))) - { - } - else if (rv != NS_RDF_NO_VALUE) - { - nsXPIDLCString uri; - source->GetValue(getter_Copies(uri)); - nsAutoString url(uri); - *shortcutURL = url.ToNewCString(); - } - } - } - return(rv); - } - - // nsIRDFDataSource - NS_IMETHOD Init(const char* uri); - - NS_IMETHOD GetURI(char* *uri) { - return mInner->GetURI(uri); - } - - NS_IMETHOD GetSource(nsIRDFResource* property, - nsIRDFNode* target, - PRBool tv, - nsIRDFResource** source) { - return mInner->GetSource(property, target, tv, source); - } - - NS_IMETHOD GetSources(nsIRDFResource* property, - nsIRDFNode* target, - PRBool tv, - nsISimpleEnumerator** sources) { - return mInner->GetSources(property, target, tv, sources); - } - - NS_IMETHOD GetTarget(nsIRDFResource* source, - nsIRDFResource* property, - PRBool tv, - nsIRDFNode** target); - - NS_IMETHOD GetTargets(nsIRDFResource* source, - nsIRDFResource* property, - PRBool tv, - nsISimpleEnumerator** targets) { - return mInner->GetTargets(source, property, tv, targets); - } - - NS_IMETHOD Assert(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - nsIRDFNode* aTarget, - PRBool aTruthValue); - - NS_IMETHOD Unassert(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - nsIRDFNode* aTarget); - - NS_IMETHOD HasAssertion(nsIRDFResource* source, - nsIRDFResource* property, - nsIRDFNode* target, - PRBool tv, - PRBool* hasAssertion) { - return mInner->HasAssertion(source, property, target, tv, hasAssertion); - } - - NS_IMETHOD AddObserver(nsIRDFObserver* n) { - return mInner->AddObserver(n); - } - - NS_IMETHOD RemoveObserver(nsIRDFObserver* n) { - return mInner->RemoveObserver(n); - } - - NS_IMETHOD ArcLabelsIn(nsIRDFNode* node, - nsISimpleEnumerator** labels) { - return mInner->ArcLabelsIn(node, labels); - } - - NS_IMETHOD ArcLabelsOut(nsIRDFResource* source, - nsISimpleEnumerator** labels) { - return mInner->ArcLabelsOut(source, labels); - } - - NS_IMETHOD GetAllResources(nsISimpleEnumerator** aResult) { - return mInner->GetAllResources(aResult); - } - - NS_IMETHOD Flush(void); - - NS_IMETHOD GetAllCommands(nsIRDFResource* source, - nsIEnumerator/**/** commands); - - NS_IMETHOD IsCommandEnabled(nsISupportsArray/**/* aSources, - nsIRDFResource* aCommand, - nsISupportsArray/**/* aArguments, - PRBool* aResult); - - NS_IMETHOD DoCommand(nsISupportsArray/**/* aSources, - nsIRDFResource* aCommand, - nsISupportsArray/**/* aArguments); - -}; - - -//////////////////////////////////////////////////////////////////////// - -BookmarkDataSourceImpl::BookmarkDataSourceImpl(void) -{ - // XXX rvg there should be only one instance of this class. - // this is actually true of all datasources. - NS_INIT_REFCNT(); - bm_AddRefGlobals(); -} - -BookmarkDataSourceImpl::~BookmarkDataSourceImpl(void) -{ - Flush(); - NS_RELEASE(mInner); - bm_ReleaseGlobals(); -} - -#if 0 -nsresult -BookmarkDataSourceImpl::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) -{ - nsresult rv; - if (aOuter) - return NS_ERROR_NO_AGGREGATION; - if (aResult == nsnull) - return NS_ERROR_NULL_POINTER; - BookmarkDataSourceImpl* ds = new BookmarkDataSourceImpl(); - if (ds == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - rv = ds->QueryInterface(aIID, aResult); - if (NS_FAILED(rv)) { - delete ds; - return rv; - } - return rv; -} -#endif - -//NS_IMPL_ISUPPORTS(BookmarkDataSourceImpl, kIRDFDataSourceIID); -NS_IMPL_ADDREF(BookmarkDataSourceImpl); -NS_IMPL_RELEASE(BookmarkDataSourceImpl); - -NS_IMETHODIMP -BookmarkDataSourceImpl::QueryInterface(REFNSIID iid, void **result) -{ - if (! result) - return NS_ERROR_NULL_POINTER; - - *result = nsnull; - if (iid.Equals(kIRDFDataSourceIID) || - iid.Equals(kIRDFBookmarkDataSourceIID) || - iid.Equals(kISupportsIID)) - { - *result = NS_STATIC_CAST(nsIRDFBookmarkDataSource *, this); - AddRef(); - return NS_OK; - } - return(NS_NOINTERFACE); -} - -NS_IMETHODIMP -BookmarkDataSourceImpl::Init(const char* uri) -{ - nsresult rv; - - if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID, - nsnull, - kIRDFDataSourceIID, - (void**) &mInner))) - return rv; - - if (NS_FAILED(rv = mInner->Init(uri))) - return rv; - - if (NS_FAILED(rv = ReadBookmarks())) - return rv; - - // register this as a named data source with the RDF service - return gRDFService->RegisterDataSource(this, PR_FALSE); -} - -NS_IMETHODIMP -BookmarkDataSourceImpl::GetTarget(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - PRBool aTruthValue, - nsIRDFNode** aTarget) -{ - nsresult rv; - - // If they want the URL... - if (aTruthValue && aProperty == kNC_URL) { - // ...and it is in fact a bookmark... - PRBool hasAssertion; - if (NS_SUCCEEDED(mInner->HasAssertion(aSource, kRDF_type, kNC_Bookmark, PR_TRUE, &hasAssertion)) - && hasAssertion) { - - nsXPIDLCString uri; - if (NS_FAILED(rv = aSource->GetValue( getter_Copies(uri) ))) { - NS_ERROR("unable to get source's URI"); - return rv; - } - - nsAutoString ncURI(uri); - if (ncURI.Find("NC:") == 0) - { - return(NS_RDF_NO_VALUE); - } - - nsIRDFLiteral* literal; - if (NS_FAILED(rv = gRDFService->GetLiteral(nsAutoString(uri).GetUnicode(), &literal))) { - NS_ERROR("unable to construct literal for URL"); - return rv; - } - - *aTarget = (nsIRDFNode*)literal; - return NS_OK; - } - } - - return mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget); -} - - -NS_IMETHODIMP -BookmarkDataSourceImpl::Assert(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - nsIRDFNode* aTarget, - PRBool aTruthValue) -{ - if (CanAccept(aSource, aProperty, aTarget)) { - return mInner->Assert(aSource, aProperty, aTarget, aTruthValue); - } - else { - return NS_RDF_ASSERTION_REJECTED; - } -} - - - -NS_IMETHODIMP -BookmarkDataSourceImpl::Unassert(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - nsIRDFNode* aTarget) -{ - if (CanAccept(aSource, aProperty, aTarget)) { - return mInner->Unassert(aSource, aProperty, aTarget); - } - else { - return NS_RDF_ASSERTION_REJECTED; - } -} - - - -NS_IMETHODIMP -BookmarkDataSourceImpl::Flush(void) -{ - return WriteBookmarks(mInner, kNC_BookmarksRoot); -} - - -NS_IMETHODIMP -BookmarkDataSourceImpl::GetAllCommands(nsIRDFResource* source, - nsIEnumerator/**/** commands) -{ - NS_NOTYETIMPLEMENTED("write me!"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -BookmarkDataSourceImpl::IsCommandEnabled(nsISupportsArray/**/* aSources, - nsIRDFResource* aCommand, - nsISupportsArray/**/* aArguments, - PRBool* aResult) -{ - NS_NOTYETIMPLEMENTED("write me!"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -BookmarkDataSourceImpl::DoCommand(nsISupportsArray* aSources, - nsIRDFResource* aCommand, - nsISupportsArray* aArguments) -{ - NS_NOTYETIMPLEMENTED("write me!"); - return NS_ERROR_NOT_IMPLEMENTED; -} - -nsresult -BookmarkDataSourceImpl::ReadBookmarks(void) -{ - nsresult rv; - - NS_WITH_SERVICE(nsIRDFContainerUtils, rdfc, kRDFContainerUtilsCID, &rv); - if (NS_FAILED(rv)) return rv; - - rv = rdfc->MakeSeq(mInner, kNC_BookmarksRoot, nsnull); - NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to make NC:BookmarksRoot a sequence"); - if (NS_FAILED(rv)) return rv; - - nsSpecialSystemDirectory bookmarksFile(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); - - // XXX we should get this from prefs. - bookmarksFile += "res"; - bookmarksFile += "rdf"; - bookmarksFile += "bookmarks.html"; - - PRBool foundIERoot = PR_FALSE; - #ifdef XP_WIN - nsCOMPtr ieFolder; - const char *ieFavoritesURL; - #endif - { // <-- scope the stream to get the open/close automatically. - nsInputFileStream strm(bookmarksFile); - - if (! strm.is_open()) - { - NS_ERROR("unable to open file"); - return NS_ERROR_FAILURE; - } - - BookmarkParser parser; - parser.Init(&strm, NS_STATIC_CAST(nsIRDFDataSource *, this)); - - #ifdef XP_MAC - parser.SetIEFavoritesRoot(kURINC_IEFavoritesRoot); - #endif - - #ifdef XP_WIN - nsSpecialSystemDirectory ieFavoritesFile(nsSpecialSystemDirectory::Win_Favorites); - nsFileURL ieFavoritesURLSpec(ieFavoritesFile); - ieFavoritesURL = ieFavoritesURLSpec.GetAsString(); - parser.SetIEFavoritesRoot(ieFavoritesURL); - #endif - - parser.Parse(kNC_BookmarksRoot, kNC_Bookmark); - - parser.ParserFoundIEFavoritesRoot(&foundIERoot); - } // <-- scope the stream to get the open/close automatically. - - // look for and import any IE Favorites - nsAutoString ieTitle("Imported IE Favorites"); // XXX localization? - -#ifdef XP_MAC - nsSpecialSystemDirectory ieFavoritesFile(nsSpecialSystemDirectory::Mac_PreferencesDirectory); - ieFavoritesFile += "Explorer"; - ieFavoritesFile += "Favorites.html"; - - nsInputFileStream ieStream(ieFavoritesFile); - if (ieStream.is_open()) - { - NS_WITH_SERVICE(nsIRDFContainerUtils, rdfc, kRDFContainerUtilsCID, &rv); - if (NS_SUCCEEDED(rv)) - { - if (NS_SUCCEEDED(rv = rdfc->MakeSeq(mInner, kNC_IEFavoritesRoot, nsnull))) - { - BookmarkParser parser; - parser.Init(&ieStream, this); - parser.Parse(kNC_IEFavoritesRoot, kNC_IEFavorite); - - nsCOMPtr ieTitleLiteral; - if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(ieTitle.GetUnicode(), getter_AddRefs(ieTitleLiteral)))) - { - rv = mInner->Assert(kNC_IEFavoritesRoot, kNC_Name, ieTitleLiteral, PR_TRUE); - } - - // if the IE Favorites root isn't somewhere in bookmarks.html, add it - if (!foundIERoot) - { - nsCOMPtr bookmarksRoot; - rv = NS_NewRDFContainer(mInner, kNC_BookmarksRoot, getter_AddRefs(bookmarksRoot)); - if (NS_SUCCEEDED(rv)) - { - rv = bookmarksRoot->AppendElement(kNC_IEFavoritesRoot); - } - } - } - } - } -#endif - -#ifdef XP_WIN - if (NS_SUCCEEDED(rv = gRDFService->GetResource(ieFavoritesURL, getter_AddRefs(ieFolder)))) - { - nsCOMPtr ieTitleLiteral; - if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(ieTitle.GetUnicode(), getter_AddRefs(ieTitleLiteral)))) - { - rv = mInner->Assert(ieFolder, kNC_Name, ieTitleLiteral, PR_TRUE); - } - - // if the IE Favorites root isn't somewhere in bookmarks.html, add it - if (!foundIERoot) - { - nsCOMPtr container; - rv = NS_NewRDFContainer(mInner, kNC_BookmarksRoot, getter_AddRefs(container)); - if (NS_SUCCEEDED(rv)) - { - rv = container->AppendElement(ieFolder); - } - } - } -#endif - - return NS_OK; -} - - -nsresult -BookmarkDataSourceImpl::WriteBookmarks(nsIRDFDataSource *ds, nsIRDFResource *root) -{ - nsSpecialSystemDirectory bookmarksFile(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); - - // XXX we should get this from prefs. - bookmarksFile += "res"; - bookmarksFile += "rdf"; - bookmarksFile += "bookmarks.html"; - - nsresult rv = NS_ERROR_FAILURE; - nsOutputFileStream strm(bookmarksFile); - if (strm.is_open()) - { - strm << "\n"; - strm << "\n"; - strm << "Bookmarks\n"; - strm << "

Bookmarks

\n\n"; - - rv = WriteBookmarksContainer(ds, strm, root, 0); - } - return(rv); -} - - -nsresult -BookmarkDataSourceImpl::WriteBookmarksContainer(nsIRDFDataSource *ds, nsOutputFileStream strm, nsIRDFResource *parent, PRInt32 level) -{ - nsresult rv = NS_OK; - - nsAutoString indentationString(""); - for (PRInt32 loop=0; loop container; - if (NS_SUCCEEDED(rv = NS_NewRDFContainer(ds, parent, getter_AddRefs(container)))) - { - nsCOMPtr containerUtils; - if (NS_SUCCEEDED(rv = NS_NewRDFContainerUtils(getter_AddRefs(containerUtils)))) - { - strm << indentation; - strm << "

\n"; - - nsCOMPtr children; - if (NS_SUCCEEDED(rv = container->GetElements(getter_AddRefs(children)))) - { - PRBool more = PR_TRUE; - while (more == PR_TRUE) - { - if (NS_FAILED(rv = children->HasMoreElements(&more))) break; - if (more != PR_TRUE) break; - - nsCOMPtr iSupports; - if (NS_FAILED(rv = children->GetNext(getter_AddRefs(iSupports)))) break; - - nsCOMPtr child = do_QueryInterface(iSupports); - if (!child) break; - - PRBool isIERoot = PR_FALSE, isContainer = PR_FALSE; - if (NS_SUCCEEDED(child->EqualsResource(kNC_IEFavoritesRoot, &isIERoot))) - { - if (isIERoot == PR_FALSE) - { - if (NS_SUCCEEDED(rv = containerUtils->IsContainer(ds, child, &isContainer))) - { - } - } - } - - nsCOMPtr nameNode; - nsAutoString nameString(""); - char *name = nsnull; - if (NS_SUCCEEDED(rv = ds->GetTarget(child, kNC_Name, PR_TRUE, getter_AddRefs(nameNode)))) - { - nsCOMPtr nameLiteral = do_QueryInterface(nameNode); - PRUnichar *title = nsnull; - if (NS_SUCCEEDED(rv = nameLiteral->GetValue(&title))) - { - nameString = title; - name = nameString.ToNewCString(); - } - - } - - strm << indentation; - strm << " "; - if (isContainer == PR_TRUE) - { - strm << "

GetValue(getter_Copies(id)); - if (NS_SUCCEEDED(rv) && (id)) { - strm << (const char*) id; - } - strm << "\""; - - strm << ">"; - - // output title - if (name) strm << name; - strm << "

\n"; - rv = WriteBookmarksContainer(ds, strm, child, level+1); - } - else - { - char *url = nsnull; - if (NS_SUCCEEDED(rv = child->GetValue(&url))) - { - if (url) - { - nsAutoString uri(url); - // XXX What's the best way to determine if its a separator? - if (uri.Find(kURINC_BookmarksRoot) == 0) - { - // its a separator - strm << "
\n"; - } - else - { - strm << "
"; - // output title - if (name) strm << name; - strm << "\n"; - } - } - } - } - - if (nsnull != name) - { - delete []name; - name = nsnull; - } - - if (NS_FAILED(rv)) break; - } - } - strm << indentation; - strm << "

\n"; - } - } - delete [] indentation; - return(rv); -} - - -nsresult -BookmarkDataSourceImpl::WriteBookmarkProperties(nsIRDFDataSource *ds, nsOutputFileStream strm, - nsIRDFResource *child, nsIRDFResource *property, const char *htmlAttrib, PRBool isFirst) -{ - nsresult rv; - nsCOMPtr node; - if (NS_SUCCEEDED(rv = ds->GetTarget(child, property, PR_TRUE, getter_AddRefs(node)))) - { - nsCOMPtr literal = do_QueryInterface(node); - if (literal) - { - PRUnichar *literalUni = nsnull; - if (NS_SUCCEEDED(rv = literal->GetValue(&literalUni))) - { - nsAutoString literalString = literalUni; - char *attribute = literalString.ToNewCString(); - if (nsnull != attribute) - { - if (isFirst == PR_FALSE) - { - strm << " "; - } - strm << htmlAttrib; - strm << attribute; - strm << "\""; - delete [] attribute; - attribute = nsnull; - } - } - } - } - return(rv); -} - - -PRBool -BookmarkDataSourceImpl::CanAccept(nsIRDFResource* aSource, - nsIRDFResource* aProperty, - nsIRDFNode* aTarget) -{ - // XXX This is really crippled, and needs to be stricter. We want - // to exclude any property that isn't talking about a known - // bookmark. - nsresult rv; - NS_WITH_SERVICE(nsIRDFContainerUtils, rdfc, kRDFContainerUtilsCID, &rv); - if (NS_FAILED(rv)) - return PR_FALSE; - - PRBool isOrdinal; - rv = rdfc->IsOrdinalProperty(aProperty, &isOrdinal); - if (NS_FAILED(rv)) - return PR_FALSE; - - if (isOrdinal) { - return PR_TRUE; - } - else if ((aProperty != kRDF_type) || - (aProperty != kWEB_LastModifiedDate) || - (aProperty != kWEB_LastVisitDate) || - (aProperty != kNC_Name) || - (aProperty != kNC_BookmarkAddDate)) { - return PR_TRUE; - } - else { - return PR_FALSE; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -#if 0 -#include "nsXPComFactory.h" - -NS_DEF_FACTORY(BookmarkDataSource,BookmarkDataSourceImpl) - -nsresult -NS_NewRDFBookmarkDataSourceFactory(nsIFactory** aResult) -{ - nsresult rv = NS_OK; - nsIFactory* inst = new nsBookmarkDataSourceFactory; - if (NULL == inst) { - rv = NS_ERROR_OUT_OF_MEMORY; - } else { - NS_ADDREF(inst); - } - *aResult = inst; - return rv; -} -#endif - -nsresult -NS_NewRDFBookmarkDataSource(nsIRDFDataSource** result) -{ - BookmarkDataSourceImpl* ds = new BookmarkDataSourceImpl(); - if (! ds) - return NS_ERROR_NULL_POINTER; - - *result = ds; - NS_ADDREF(*result); - return NS_OK; -} diff --git a/mozilla/rdf/datasource/src/nsRDFBuiltInDataSources.h b/mozilla/rdf/datasource/src/nsRDFBuiltInDataSources.h index 682a59e6e66..f39324d3197 100644 --- a/mozilla/rdf/datasource/src/nsRDFBuiltInDataSources.h +++ b/mozilla/rdf/datasource/src/nsRDFBuiltInDataSources.h @@ -32,10 +32,6 @@ #include "nsError.h" class nsIRDFDataSource; -class nsIRDFDataBase; - -// in nsBookmarkDataSource.cpp -nsresult NS_NewRDFBookmarkDataSource(nsIRDFDataSource** result); // in nsFileSystemDataSource.cpp nsresult NS_NewRDFFileSystemDataSource(nsIRDFDataSource** result); @@ -49,9 +45,6 @@ nsresult NS_NewRDFFindDataSource(nsIRDFDataSource** result); // in nsFTPDataSource.cpp nsresult NS_NewRDFFTPDataSource(nsIRDFDataSource** result); -// in nsRelatedLinksDataSource.cpp -nsresult NS_NewRDFRelatedLinksDataSource(nsIRDFDataSource **result); - #endif // nsBuiltinDataSources_h__ diff --git a/mozilla/rdf/macbuild/rdf.mcp b/mozilla/rdf/macbuild/rdf.mcp index 93677861294..9c4c7b67d8b 100644 Binary files a/mozilla/rdf/macbuild/rdf.mcp and b/mozilla/rdf/macbuild/rdf.mcp differ diff --git a/mozilla/rdf/resources/Makefile.in b/mozilla/rdf/resources/Makefile.in index 75500a45100..6c3157b86c2 100644 --- a/mozilla/rdf/resources/Makefile.in +++ b/mozilla/rdf/resources/Makefile.in @@ -27,17 +27,8 @@ include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/rules.mk FILES = \ - bookmarks.html \ history.css \ history.xul \ - bm-panel.xul \ - bm-props.xul \ - bookmark-folder-closed.gif \ - bookmark-folder-open.gif \ - bookmark-item.gif \ - bookmarks.css \ - bookmarks.js \ - bookmarks.xul \ document.gif \ dom-test-1.css \ dom-test-1.xul \ @@ -53,12 +44,9 @@ FILES = \ flames.gif \ folder-closed.gif \ folder-open.gif \ - iefavorite.gif \ ignore-test.xul \ loading.gif \ online.gif \ - personal-folder-closed.gif \ - personal-folder-open.gif \ remote-flash-1.rdf \ remote-flash-2.rdf \ remote-flash-3.rdf \ diff --git a/mozilla/rdf/resources/bm-panel.xul b/mozilla/rdf/resources/bm-panel.xul deleted file mode 100644 index fb4409cc971..00000000000 --- a/mozilla/rdf/resources/bm-panel.xul +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - Name - - - - URL - - - - - - - - - diff --git a/mozilla/rdf/resources/bm-props.xul b/mozilla/rdf/resources/bm-props.xul deleted file mode 100644 index 17a171f5b20..00000000000 --- a/mozilla/rdf/resources/bm-props.xul +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - -
- - - - - - - - - - -
- Name: - - -
- Location: - - -
- Shortcut: - - -
- Description: - - -
-
-
- - - -
-
-
diff --git a/mozilla/rdf/resources/bookmark-folder-closed.gif b/mozilla/rdf/resources/bookmark-folder-closed.gif deleted file mode 100644 index d8f072037f3..00000000000 Binary files a/mozilla/rdf/resources/bookmark-folder-closed.gif and /dev/null differ diff --git a/mozilla/rdf/resources/bookmark-folder-open.gif b/mozilla/rdf/resources/bookmark-folder-open.gif deleted file mode 100644 index 12e67a19417..00000000000 Binary files a/mozilla/rdf/resources/bookmark-folder-open.gif and /dev/null differ diff --git a/mozilla/rdf/resources/bookmark-item.gif b/mozilla/rdf/resources/bookmark-item.gif deleted file mode 100644 index 02d55f528ed..00000000000 Binary files a/mozilla/rdf/resources/bookmark-item.gif and /dev/null differ diff --git a/mozilla/rdf/resources/bookmarks.css b/mozilla/rdf/resources/bookmarks.css deleted file mode 100644 index ae8c2f9174d..00000000000 --- a/mozilla/rdf/resources/bookmarks.css +++ /dev/null @@ -1,126 +0,0 @@ -window { - display: block; - background-color: #FFFFFF; -} - -menubar { - display: none; -} - -tree { - display: table; - background-color: #FFFFFF; - border: none; - border-spacing: 0px; - width: 100%; -} - -treecol { - display: table-column; - width: 200px; -} - -treeitem { - display: table-row; -} - -treehead { - display: table-header-group; -} - -treebody { - display: table-row-group; -} - -treecell { - display: table-cell; - font-family: Verdana, Sans-Serif; - font-size: 8pt; -} - -treecell[selectedcell] { - background-color: yellow; - } - -treecell[sortActive="true"][sortDirection="ascending"] { - background-color: green; - } - -treecell[sortActive="true"][sortDirection="descending"] { - background-color: red; - } - -treecol[sortActive="true"] { - background-color: lightgreen; -} - -treehead treeitem treecell { - background-color: #c0c0c0; - border: outset 1px; - border-color: white #707070 #707070 white; - padding-left: 4px; -} - -treecell[selectedcell] { - background-color: yellow; -} - -treeitem[container="true"][open="true"][loading="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/loading.gif") ! important ; -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/personal-folder-closed.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/personal-folder-open.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-item.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/IEFavorite.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-item.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/folder-open.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/folder-closed.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/article.gif"); -} - -treeitem[container="true"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/folder-open.gif"); -} - -treeitem[container="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/folder-closed.gif"); -} - -treeitem > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/document.gif"); -} - -titledbutton#bookmarks { - list-style-image:url("resource:/res/rdf/bookmark-item.gif"); -} diff --git a/mozilla/rdf/resources/bookmarks.html b/mozilla/rdf/resources/bookmarks.html deleted file mode 100644 index aaccc1d7d5b..00000000000 --- a/mozilla/rdf/resources/bookmarks.html +++ /dev/null @@ -1,151 +0,0 @@ - - -Bookmarks for temp -

Bookmarks for temp

- -

-

Sample FTP URLs

-

-

FTP: Netscape -
FTP: XPNav -

-

Sample SmartFind queries

-

-

Find: Bookmark Names containing 'Netscape' -
Find: Bookmark Names starting with 'A' -
Find: Bookmark Names ending with '.com' -
Find: Bookmark Names containing 'Mac' -
Find: Bookmark URLs containing 'mac' -

-

Personal Toolbar Folder

-

-

Mozilla.org -
Tinderbox -
Bonsai -
Bugzilla -

Channels

-

-

Autos -
Business -
Computing and Internet -
Education -
Entertainment -
Games -
Health -
Kids and Family -
Lifestyles -
Local -
Netscape -
News -
Personal Finance -
Real Estate -
Shopping -
Sports -
Travel -

-

-


-

Search

-

-

Alta Vista -
Excite -
GoTo.com -
Infoseek -
LookSmart -
Lycos -
Netscape Search -

-

Business and Finance

-

-

Career Center -
CBS.MarketWatch -
Datek Online -
dbusiness.com -
Gartner Group, Inc. -
NextCard Internet Visa -
Personal Finance -
Small Business Source -
Virtual Office by Netopia -

-

Computers and Internet

-

-

@vantage -
Computing Channel -
Netscape Channel -
ONSALE Computer Auctions -
Open Studio -
Professional Connections -
SmartUpdate -
Toshiba -

-

Directories

-

-

GTE SuperPages -
Member Directory -
Netcenter Yellow Pages -
People -
Thomas Register -
Web Directory -
YellowPages AtHand -

-

Entertainment and Lifestyle

-

-

Entertainment Channel -
Games -
Health -
Kids and Family -
Lifestyle Channel -
theglobe.com community -
TV Guide -
Women.com -

-

News and Sports

-

-

ABCNEWS.com -
Business Journal -
CBS SportsLine -
In-Box Direct -
News Channel -
Sports Channel -

-

Shopping and Classifieds

-

-

Amazon.com -
Audio Book Club -
DealDeal.com Auctions -
FreeRide -
FTD Flowers -
Music Boulevard -
netMarket -
Real Estate -
Rent.Net -
Software Depot -

-

Travel and Leisure

-

-

Leisure Planet -
Local -
Renaissance Cruises -
Travelocity -

-

Macintosh Resources

-

-

Mac OS Rumors -
MacSurfer -
Macintouch -
MacWEEK -
O'Grady's Mac PowerPage -

-

AAA URLs with no redirection

-

-

Netscape -
Yahoo -
AOL -

-


-

Personal Bookmarks

-

-

-

diff --git a/mozilla/rdf/resources/bookmarks.js b/mozilla/rdf/resources/bookmarks.js deleted file mode 100644 index 3ed0ba1c778..00000000000 --- a/mozilla/rdf/resources/bookmarks.js +++ /dev/null @@ -1,108 +0,0 @@ -// -*- Mode: Java -*- - -function BookmarksNewWindow() -{ - var toolkitCore = XPAppCoresManager.Find("toolkitCore"); - if (!toolkitCore) { - toolkitCore = new ToolkitCore(); - if (toolkitCore) { - toolkitCore.Init("toolkitCore"); - } - } - if (toolkitCore) { - toolkitCore.ShowWindow("resource://res/rdf/bookmarks.xul",window); - } -} - -function BookmarkProperties() -{ - var tree = document.getElementById('bookmarksTree'); - var select_list = tree.getElementsByAttribute("selected", "true"); - - if (select_list.length >= 1) { - dump("Bookmark Properties: Have selection\n"); - var propsCore = XPAppCoresManager.Find(select_list[0].id); - if (!propsCore) { - dump("Bookmark Properties: no existing appcore\n"); - var propsCore = new DOMPropsCore(); - if (propsCore) { - dump("Bookmark Properties: initing new appcore\n"); - propsCore.Init(select_list[0].id); - } else { - dump("Bookmark Properties: failed to create new appcore\n"); - } - } - if (propsCore) { - dump("Bookmark Properties: opening new window\n"); - propsCore.showProperties("resource://res/rdf/bm-props.xul", - window, select_list[0]); - return true; - } - } else { - dump("nothing selected!\n"); - } - return false; -} - -function OpenURL(event,node) -{ - if (node.getAttribute('container') == "true") { - return false; - } - url = node.getAttribute('id'); - - // Ignore "NC:" urls. - if (url.substring(0, 3) == "NC:") { - return false; - } - - /*window.open(url,'bookmarks');*/ - var toolkitCore = XPAppCoresManager.Find("ToolkitCore"); - if (!toolkitCore) { - toolkitCore = new ToolkitCore(); - if (toolkitCore) { - toolkitCore.Init("ToolkitCore"); - } - } - if (toolkitCore) { - toolkitCore.ShowWindow(url,window); - } - - dump("OpenURL(" + url + ")\n"); - - return true; -} - -function doSort(sortColName) -{ - var node = document.getElementById(sortColName); - // determine column resource to sort on - var sortResource = node.getAttribute('resource'); - if (!node) return(false); - - var sortDirection="ascending"; - var isSortActive = node.getAttribute('sortActive'); - if (isSortActive == "true") { - var currentDirection = node.getAttribute('sortDirection'); - if (currentDirection == "ascending") - sortDirection = "descending"; - else if (currentDirection == "descending") - sortDirection = "natural"; - else - sortDirection = "ascending"; - } - - // get RDF Core service - var rdfCore = XPAppCoresManager.Find("RDFCore"); - if (!rdfCore) { - rdfCore = new RDFCore(); - if (!rdfCore) { - return(false); - } - rdfCore.Init("RDFCore"); -// XPAppCoresManager.Add(rdfCore); - } - // sort!!! - rdfCore.doSort(node, sortResource, sortDirection); - return(false); -} diff --git a/mozilla/rdf/resources/bookmarks.xul b/mozilla/rdf/resources/bookmarks.xul deleted file mode 100644 index 12e7fc8a9b3..00000000000 --- a/mozilla/rdf/resources/bookmarks.xul +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &tree.header.name.label; - - - - &tree.header.url.label; - - - - &tree.header.shortcut.label; - - - - - - - - - diff --git a/mozilla/rdf/resources/iefavorite.gif b/mozilla/rdf/resources/iefavorite.gif deleted file mode 100644 index cba35c4225a..00000000000 Binary files a/mozilla/rdf/resources/iefavorite.gif and /dev/null differ diff --git a/mozilla/rdf/resources/makefile.win b/mozilla/rdf/resources/makefile.win index d59b5e51da6..18933a8cb73 100644 --- a/mozilla/rdf/resources/makefile.win +++ b/mozilla/rdf/resources/makefile.win @@ -21,17 +21,8 @@ MODULE=rdf include <$(DEPTH)\config\rules.mak> FILES=\ - bookmarks.html \ history.css \ history.xul \ - bm-panel.xul \ - bm-props.xul \ - bookmark-folder-closed.gif \ - bookmark-folder-open.gif \ - bookmark-item.gif \ - bookmarks.css \ - bookmarks.js \ - bookmarks.xul \ document.gif \ dom-test-1.css \ dom-test-1.xul \ @@ -47,12 +38,9 @@ FILES=\ flames.gif \ folder-closed.gif \ folder-open.gif \ - iefavorite.gif \ ignore-test.xul \ loading.gif \ online.gif \ - personal-folder-closed.gif \ - personal-folder-open.gif \ remote-flash-1.rdf \ remote-flash-2.rdf \ remote-flash-3.rdf \ diff --git a/mozilla/rdf/resources/personal-folder-closed.gif b/mozilla/rdf/resources/personal-folder-closed.gif deleted file mode 100644 index 69fa1c09379..00000000000 Binary files a/mozilla/rdf/resources/personal-folder-closed.gif and /dev/null differ diff --git a/mozilla/rdf/resources/personal-folder-open.gif b/mozilla/rdf/resources/personal-folder-open.gif deleted file mode 100644 index 01733f4f780..00000000000 Binary files a/mozilla/rdf/resources/personal-folder-open.gif and /dev/null differ diff --git a/mozilla/rdf/resources/sidebar-browser.rdf b/mozilla/rdf/resources/sidebar-browser.rdf index 3395cdd3498..6bcb62001df 100644 --- a/mozilla/rdf/resources/sidebar-browser.rdf +++ b/mozilla/rdf/resources/sidebar-browser.rdf @@ -35,8 +35,8 @@ &sidebar.bookmarks.label; - resource://res/rdf/bm-panel.xul - resource://res/rdf/bm-panel-cust.xul + resource://res/samples/bm-panel.xul + resource://res/samples/bm-panel-cust.xul diff --git a/mozilla/rdf/resources/sidebar.css b/mozilla/rdf/resources/sidebar.css index 1045eab472f..37752880327 100644 --- a/mozilla/rdf/resources/sidebar.css +++ b/mozilla/rdf/resources/sidebar.css @@ -75,34 +75,6 @@ treeitem[container="true"][open="true"][loading="true"] > treecell > titledbutto list-style-image: url("resource:/res/rdf/loading.gif") ! important ; } -treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/personal-folder-closed.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Folder"][id="NC:PersonalToolbarFolder"][open="true"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/personal-folder-open.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#BookmarkSeparator"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-item.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#IEFavorite"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/IEFavorite.gif"); -} - -treeitem[type="http://home.netscape.com/NC-rdf#Bookmark"] > treecell > titledbutton { - list-style-image: url("resource:/res/rdf/bookmark-item.gif"); -} - treeitem[type="http://home.netscape.com/NC-rdf#FileSystemObject"][container="true"][open="true"] > treecell > titledbutton { list-style-image: url("resource:/res/rdf/folder-open.gif"); } @@ -127,10 +99,6 @@ treeitem > treecell > titledbutton { list-style-image: url("resource:/res/rdf/document.gif"); } -titledbutton#bookmarks { - list-style-image:url("resource:/res/rdf/bookmark-item.gif"); -} - toolbar#sidebarbar titledbutton{ color:#CCCCFF; }