Compare commits
2 Commits
XPFE_COMPS
...
M15-patch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53866ece4f | ||
|
|
350be55313 |
105
mozilla/java/dom/jni/javaDOMGlobals.h
Normal file
105
mozilla/java/dom/jni/javaDOMGlobals.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
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 Sun Microsystems,
|
||||
Inc. Portions created by Sun are
|
||||
Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
*/
|
||||
|
||||
#ifndef __JavaDOMGlobals_h__
|
||||
#define __JavaDOMGlobals_h__
|
||||
|
||||
#include "jni.h"
|
||||
#include "prclist.h"
|
||||
#include "nsError.h"
|
||||
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
class nsISupports;
|
||||
class nsIDOMNode;
|
||||
struct PRLogModuleInfo;
|
||||
struct PRLock;
|
||||
|
||||
class JavaDOMGlobals {
|
||||
|
||||
public:
|
||||
static jclass attrClass;
|
||||
static jclass cDataSectionClass;
|
||||
static jclass commentClass;
|
||||
static jclass documentClass;
|
||||
static jclass documentFragmentClass;
|
||||
static jclass documentTypeClass;
|
||||
static jclass domImplementationClass;
|
||||
static jclass elementClass;
|
||||
static jclass entityClass;
|
||||
static jclass entityReferenceClass;
|
||||
static jclass namedNodeMapClass;
|
||||
static jclass nodeClass;
|
||||
static jclass nodeListClass;
|
||||
static jclass notationClass;
|
||||
static jclass processingInstructionClass;
|
||||
static jclass textClass;
|
||||
|
||||
static jfieldID nodePtrFID;
|
||||
static jfieldID nodeListPtrFID;
|
||||
static jfieldID domImplementationPtrFID;
|
||||
|
||||
static jfieldID nodeTypeAttributeFID;
|
||||
static jfieldID nodeTypeCDataSectionFID;
|
||||
static jfieldID nodeTypeCommentFID;
|
||||
static jfieldID nodeTypeDocumentFragmentFID;
|
||||
static jfieldID nodeTypeDocumentFID;
|
||||
static jfieldID nodeTypeDocumentTypeFID;
|
||||
static jfieldID nodeTypeElementFID;
|
||||
static jfieldID nodeTypeEntityFID;
|
||||
static jfieldID nodeTypeEntityReferenceFID;
|
||||
static jfieldID nodeTypeNotationFID;
|
||||
static jfieldID nodeTypeProcessingInstructionFID;
|
||||
static jfieldID nodeTypeTextFID;
|
||||
|
||||
static jclass domExceptionClass;
|
||||
static jmethodID domExceptionInitMID;
|
||||
static jclass runtimeExceptionClass;
|
||||
static jmethodID runtimeExceptionInitMID;
|
||||
|
||||
static const char* const DOM_EXCEPTION_MESSAGE[];
|
||||
|
||||
typedef enum ExceptionType { EXCEPTION_RUNTIME,
|
||||
EXCEPTION_DOM } ExceptionType;
|
||||
|
||||
static PRLogModuleInfo* log;
|
||||
static PRCList garbage;
|
||||
static PRLock* garbageLock;
|
||||
|
||||
static PRInt32 javaMaxInt;
|
||||
|
||||
static void Initialize(JNIEnv *env);
|
||||
static void Destroy(JNIEnv *env);
|
||||
static jobject CreateNodeSubtype(JNIEnv *env,
|
||||
nsIDOMNode *node);
|
||||
|
||||
static void AddToGarbage(nsISupports* domObject);
|
||||
static void TakeOutGarbage();
|
||||
|
||||
static void ThrowException(JNIEnv *env,
|
||||
const char * message = NULL,
|
||||
nsresult rv = NS_OK,
|
||||
ExceptionType exceptionType = EXCEPTION_RUNTIME);
|
||||
};
|
||||
|
||||
#endif /* __JavaDOMGlobals_h__ */
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public bookmarks directory filepicker find history search sidebar related regviewer ucth xfer prefwindow shistory remote timebomb console autocomplete urlbarhistory build
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src resources
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
#include "MacSharedPrefix.h"
|
||||
@@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
#include "MacSharedPrefix_debug.h"
|
||||
@@ -1,26 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS= public src resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1 +0,0 @@
|
||||
nsIAutoCompleteSession.idl
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
XPIDL_MODULE = autocomplete
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIAutoCompleteListener.idl \
|
||||
nsIAutoCompleteResults.idl \
|
||||
nsIAutoCompleteSession.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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):
|
||||
|
||||
|
||||
|
||||
MODULE=xpfe\components
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
XPIDL_MODULE=autocomplete
|
||||
|
||||
XPIDLSRCS=\
|
||||
.\nsIAutoCompleteListener.idl \
|
||||
.\nsIAutoCompleteResults.idl \
|
||||
.\nsIAutoCompleteSession.idl \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,50 +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.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.
|
||||
*
|
||||
* Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIAutoCompleteResults.idl"
|
||||
|
||||
|
||||
typedef long AutoCompleteStatus;
|
||||
|
||||
[scriptable, uuid(4BA0A180-097C-11d4-A449-CD1A8B47ED7C)]
|
||||
interface nsIAutoCompleteStatus {
|
||||
const long failed = -1;
|
||||
const long noMatch = 0;
|
||||
const long matchFound = 1;
|
||||
const long ignored = 2;
|
||||
};
|
||||
|
||||
[scriptable, uuid(4BA0A181-097C-11d4-A449-CD1A8B47ED7C)]
|
||||
interface nsIAutoCompleteListener : nsISupports {
|
||||
|
||||
/* onStatus is called by the autocomplete session during the seach */
|
||||
void onStatus(in wstring statusText);
|
||||
|
||||
/* onAutoComplete is called by the autocomplete session when the search is done or over */
|
||||
void onAutoComplete(in nsIAutoCompleteResults result, in AutoCompleteStatus status);
|
||||
|
||||
/* private param used by the autocomplete widget */
|
||||
attribute nsISupports param;
|
||||
};
|
||||
@@ -1,60 +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.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.
|
||||
*
|
||||
* Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsISupportsArray.idl"
|
||||
|
||||
[scriptable, uuid(88DCFA80-062F-11d4-a449-B36A1A94C0FC)]
|
||||
interface nsIAutoCompleteItem : nsISupports {
|
||||
attribute wstring value; // the result value
|
||||
attribute wstring comment; // an extra comment that will be displayed next to the value but that
|
||||
// will not be part of the value itself
|
||||
attribute string className; // class name used to define some style through css like the colors, an
|
||||
// icon url, etc...
|
||||
attribute nsISupports param; // parameter use by the search engin
|
||||
};
|
||||
|
||||
|
||||
[scriptable, uuid(88DCFA81-062F-11d4-a449-B36A1A94C0FC)]
|
||||
interface nsIAutoCompleteResults : nsISupports {
|
||||
attribute wstring searchString; // the original search string
|
||||
|
||||
attribute nsISupportsArray items; // Array of result items (nsIAutoCompleteItem)
|
||||
attribute long defaultItemIndex; // Index (0 base) of the default item that will be preselected and displayed
|
||||
|
||||
attribute nsISupports param; // param use by the the search engine
|
||||
};
|
||||
|
||||
%{ C++
|
||||
// {FE4FC780-063D-11d4-A449-D45A120774BC}
|
||||
#define NS_AUTOCOMPLETERESULTS_CID \
|
||||
{ 0xfe4fc780, 0x063d, 0x11d4, { 0xa4, 0x49, 0xd4, 0x5a, 0x12, 0x07, 0x74, 0xbc } }
|
||||
#define NS_AUTOCOMPLETERESULTS_PROGID "component://netscape/autocomplete/results"
|
||||
|
||||
// {FE4FC781-063D-11d4-A449-D45A120774BC}
|
||||
#define NS_AUTOCOMPLETEITEM_CID \
|
||||
{ 0xfe4fc781, 0x063d, 0x11d4, { 0xa4, 0x49, 0xd4, 0x5a, 0x12, 0x07, 0x74, 0xbc } }
|
||||
#define NS_AUTOCOMPLETEITEM_PROGID "component://netscape/autocomplete/item"
|
||||
%}
|
||||
|
||||
@@ -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.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.
|
||||
*
|
||||
* Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
%{ C++
|
||||
#include "nsIAutoCompleteResults.h"
|
||||
#include "nsIAutoCompleteListener.h"
|
||||
%}
|
||||
|
||||
interface nsIAutoCompleteResults;
|
||||
interface nsIAutoCompleteListener;
|
||||
|
||||
[scriptable, uuid(E0140B60-0264-11d4-8378-000000000000)]
|
||||
interface nsIAutoCompleteSession : nsISupports {
|
||||
|
||||
/* onStartLookup is called when the user has stop typing for a predifined elapse time */
|
||||
void onStartLookup(in wstring searchString, in nsIAutoCompleteResults previousSearchResult,
|
||||
in nsIAutoCompleteListener listener);
|
||||
|
||||
/* onStopLookup is called each time the user press a key */
|
||||
void onStopLookup();
|
||||
|
||||
/* onAutoComplete is called either when the user press enter/return or when the input element loose focus */
|
||||
void onAutoComplete(in wstring searchString, in nsIAutoCompleteResults previousSearchResult,
|
||||
in nsIAutoCompleteListener listener);
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = content
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
autocomplete.xml
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXPORT_CHROME = $(srcdir)/autocomplete.xml \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
install::
|
||||
$(INSTALL) $(EXPORT_CHROME) $(DIST)/bin/chrome/packages/widget-toolkit/global/content
|
||||
@@ -1,438 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="autocompleteBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="autocomplete" extends="chrome://global/content/xulBindings.xml#textfield">
|
||||
<content excludes="template,observes,menupopup">
|
||||
<xul:box class="textfield-internal-box" flex="1">
|
||||
<html:input class="textfield-input" flex="1" inherits="value,type,maxlength,disabled,size,readonly"/>
|
||||
<xul:popupset ignorekeys="true"
|
||||
oncommand="var me = this.parentNode.parentNode; me.privatefunc.onMenuCommand(me, this);"
|
||||
>
|
||||
<xul:popup oncreate="this.parentNode.parentNode.parentNode.menuOpen='true'" ondestroy="this.parentNode.parentNode.parentNode.menuOpen='false';">
|
||||
</xul:popup>
|
||||
</xul:popupset>
|
||||
</xul:box>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<property name="value"
|
||||
onset="
|
||||
if (this.ignoreInputEventTimer)
|
||||
clearTimeout(this.ignoreInputEventTimer);
|
||||
this.ignoreInputEvent = true;
|
||||
this.ignoreInputEventTimer = setTimeout(this.privatefunc.resetInput, 250, this);
|
||||
return document.getAnonymousNodes(this)[0].firstChild.value = val;"
|
||||
onget="this.privatefunc.cleanupInputField(this); return document.getAnonymousNodes(this)[0].firstChild.value;"
|
||||
/>
|
||||
|
||||
<property name="timeout"
|
||||
onset="return this.setAttribute('timeout', val);"
|
||||
onget="return this.getAttribute('timeout');"
|
||||
/>
|
||||
|
||||
<property name="displayMenu"
|
||||
onset="return this.setAttribute('displayMenu', val);"
|
||||
onget="return this.getAttribute('displayMenu');"
|
||||
/>
|
||||
|
||||
<property name="autoCompleteSession">
|
||||
<![CDATA[
|
||||
if (this.getAttribute('searchSessionType') != "") {
|
||||
searchSession = unescape('component:%2F%2Fnetscape%2FautocompleteSession%26type=');
|
||||
searchSession = searchSession + this.getAttribute('searchSessionType');
|
||||
try {
|
||||
Components.classes[searchSession].getService(Components.interfaces.nsIAutoCompleteSession);
|
||||
// var session = Components.classes[searchSession].createInstance();
|
||||
// session.QueryInterface(Components.interfaces.nsIAutoCompleteSession);
|
||||
} catch (e) {dump("### ERROR, cannot create a search session. " + e + "\n");}
|
||||
}
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="disableAutocomplete"
|
||||
onset="return this.setAttribute('disableAutocomplete', val);"
|
||||
onget="return this.getAttribute('disableAutocomplete');"
|
||||
/>
|
||||
|
||||
<property name="autoCompleteTimer">
|
||||
<![CDATA[
|
||||
0;
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="ignoreInputEventTimer">
|
||||
<![CDATA[
|
||||
0;
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="lastResults">
|
||||
<![CDATA[
|
||||
var results = Components.classes["component://netscape/autocomplete/results"].createInstance();
|
||||
results.QueryInterface(Components.interfaces.nsIAutoCompleteResults);
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="autoCompleteListener">
|
||||
<![CDATA[
|
||||
({
|
||||
onAutoComplete: function(result, status) {
|
||||
var me = this.param;
|
||||
if (status == Components.interfaces.nsIAutoCompleteStatus.failed)
|
||||
return;
|
||||
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
|
||||
me.lastResults = result;
|
||||
if (status == Components.interfaces.nsIAutoCompleteStatus.ignored ||
|
||||
status == Components.interfaces.nsIAutoCompleteStatus.noMatch)
|
||||
return;
|
||||
|
||||
if (result == null && result.items.Count() == 0)
|
||||
return;
|
||||
|
||||
if (result.defaultItemIndex > result.items.Count())
|
||||
result.defaultItemIndex = 0;
|
||||
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
|
||||
//Time to build the new edit field value
|
||||
//First, check if the search string correspond to the current value of the field, else ignore it
|
||||
if (result.searchString != inputElement.value)
|
||||
return;
|
||||
|
||||
var item = null;
|
||||
if (result.defaultItemIndex != -1)
|
||||
{
|
||||
item = result.items.QueryElementAt(result.defaultItemIndex, Components.interfaces.nsIAutoCompleteItem);
|
||||
var match = item.value.toLowerCase();
|
||||
var entry = inputElement.value.toLowerCase();
|
||||
if (entry != match)
|
||||
{
|
||||
me.ignoreInputEvent = true;
|
||||
if (match.substring(0, entry.length) == entry)
|
||||
{
|
||||
inputElement.value = inputElement.value + item.value.substring(entry.length, match.length);
|
||||
inputElement.setSelectionRange(entry.length, match.length);
|
||||
me.noDirectMatch = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputElement.value = inputElement.value + " >> " + item.value;
|
||||
inputElement.setSelectionRange(entry.length, inputElement.value.length);
|
||||
me.noDirectMatch = true;
|
||||
}
|
||||
me.ignoreInputEvent = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Now, build the popup content
|
||||
if (me.displayMenu == "false")
|
||||
return;
|
||||
|
||||
popupset = document.getAnonymousNodes(me)[0].childNodes[1];
|
||||
popupElement = popupset.firstChild;
|
||||
|
||||
//First, remove all the current menu items
|
||||
for (i = popupElement.childNodes.length - 1; i >= 0 ; i --)
|
||||
popupElement.removeChild(popupElement.childNodes[i]);
|
||||
|
||||
//Then build the new menu items
|
||||
for (i = 0; i < result.items.Count(); i ++)
|
||||
{
|
||||
item = result.items.QueryElementAt(i, Components.interfaces.nsIAutoCompleteItem);
|
||||
menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute('data', i);
|
||||
menuitem.setAttribute('value', item.value);
|
||||
popupElement.appendChild(menuitem);
|
||||
// dump(" match=" + item.value + "\n");
|
||||
}
|
||||
// dump(" count=" + result.items.Count() + ", default=" + result.defaultItemIndex + "\n");
|
||||
|
||||
me.privatefunc.selectedItemIndex = result.defaultItemIndex;
|
||||
if (result.defaultItemIndex != 0 || result.items.Count() != 1)
|
||||
{
|
||||
// me.privatefunc.closePopupMenu(me); //Close it first as openPopup seems to work as a toggle!
|
||||
popupset.firstChild.openPopup(document.getAnonymousNodes(me)[0].firstChild, -1, -1, "popup", "bottomleft", "topleft");
|
||||
|
||||
if (result.defaultItemIndex != -1)
|
||||
popupElement.activeChild = popupElement.childNodes[result.defaultItemIndex];
|
||||
}
|
||||
},
|
||||
|
||||
param: this
|
||||
})
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="privatefunc">
|
||||
<![CDATA[
|
||||
({
|
||||
|
||||
onMenuCommand: function(me, popupSetElem) {
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
var popupElem = popupSetElem.firstChild;
|
||||
for (var i = 0; i < popupElem.childNodes.length; i ++)
|
||||
{
|
||||
var menuitem = popupElem.childNodes[i];
|
||||
if (menuitem.getAttribute("menuactive") == "true")
|
||||
{
|
||||
me.ignoreInputEvent = true;
|
||||
inputElement.value = menuitem.getAttribute("value");
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
inputElement.setSelectionRange(inputElement.value.length, inputElement.value.length);
|
||||
needToAutocomplete = false;
|
||||
me.privatefunc.selectedItemIndex = i;
|
||||
me.ignoreInputEvent = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
callListener: function(me, action) {
|
||||
switch (action) {
|
||||
case 'startLookup':
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
if (!me.lastResults || inputElement.value != me.lastResults.searchString)
|
||||
me.autoCompleteSession.onStartLookup(inputElement.value, me.lastResults, me.autoCompleteListener);
|
||||
break;
|
||||
|
||||
case 'stopLookup':
|
||||
me.autoCompleteSession.onStopLookup();
|
||||
break;
|
||||
|
||||
case 'autoComplete':
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
me.needToAutocomplete = false;
|
||||
if (this.disableAutocomplete == "true")
|
||||
return;
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
me.autoCompleteSession.onAutoComplete(inputElement.value, me.lastResults, me.autoCompleteListener);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
finishAutoComplete: function(me, event) {
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
var value = inputElement.value;
|
||||
var entry = value.substring(0, inputElement.selectionStart) + value.substring(inputElement.selectionEnd, value.length);
|
||||
|
||||
if (me.lastResults)
|
||||
{
|
||||
if (me.lastResults.searchString == entry)
|
||||
{
|
||||
me.ignoreInputEvent = true;
|
||||
try {
|
||||
inputElement.value = me.lastResults.items.QueryElementAt(me.lastResults.defaultItemIndex, Components.interfaces.nsIAutoCompleteItem).value;
|
||||
} catch(e) {};
|
||||
inputElement.setSelectionRange(inputElement.value.length, inputElement.value.length);
|
||||
me.ignoreInputEvent = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
me.privatefunc.callListener(me, 'autoComplete');
|
||||
},
|
||||
|
||||
closePopupMenu: function(me) {
|
||||
popup = document.getAnonymousNodes(me)[0].childNodes[1].firstChild;
|
||||
if (popup && me.menuOpen == "true")
|
||||
popup.closePopup();
|
||||
},
|
||||
|
||||
cleanupInputField: function(me) {
|
||||
if (me.noDirectMatch)
|
||||
{
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
var value = inputElement.value;
|
||||
var index = value.indexOf(">> ");
|
||||
if (index >= 0)
|
||||
{
|
||||
me.ignoreInputEvent = true;
|
||||
inputElement.value = value.substr(index + 3);
|
||||
inputElement.setSelectionRange(inputElement.value.length, inputElement.value.length);
|
||||
me.ignoreInputEvent = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
keyNavigation: function(me, event, popup) {
|
||||
if (me.lastResults == null)
|
||||
return;
|
||||
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
if (event.keyCode == 38 || event.keyCode == 40)
|
||||
{
|
||||
if (event.keyCode == 38)
|
||||
{
|
||||
if (me.privatefunc.selectedItemIndex <= -1)
|
||||
me.privatefunc.selectedItemIndex = me.lastResults.items.Count() - 1;
|
||||
else
|
||||
me.privatefunc.selectedItemIndex --;
|
||||
}
|
||||
else
|
||||
{
|
||||
me.privatefunc.selectedItemIndex ++;
|
||||
if (me.privatefunc.selectedItemIndex >= me.lastResults.items.Count())
|
||||
me.privatefunc.selectedItemIndex = -1
|
||||
}
|
||||
|
||||
me.ignoreInputEvent = true;
|
||||
if (me.privatefunc.selectedItemIndex == -1)
|
||||
inputElement.value = me.lastResults.searchString;
|
||||
else
|
||||
inputElement.value = me.lastResults.items.QueryElementAt(me.privatefunc.selectedItemIndex, Components.interfaces.nsIAutoCompleteItem).value;
|
||||
inputElement.setSelectionRange(inputElement.value.length, inputElement.value.length);
|
||||
noDirectMatch = false;
|
||||
needToAutocomplete = false;
|
||||
me.ignoreInputEvent = false;
|
||||
|
||||
if (popup)
|
||||
{
|
||||
if (me.privatefunc.selectedItemIndex >= 0)
|
||||
popup.activeChild = popupElement.childNodes[me.privatefunc.selectedItemIndex];
|
||||
else
|
||||
popup.activeChild = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
resetInput: function(me) {
|
||||
me.ignoreInputEventTimer = null;
|
||||
me.ignoreInputEvent = false;
|
||||
},
|
||||
|
||||
processInput: function(me) {
|
||||
//Stop current lookup in case it's async.
|
||||
me.privatefunc.callListener(me, 'stopLookup');
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
|
||||
if (me.ignoreInputEvent)
|
||||
return;
|
||||
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
|
||||
/*We want to autocomplete only if the user is editing at the end of the text */
|
||||
var inputElement = document.getAnonymousNodes(me)[0].firstChild;
|
||||
if (inputElement.selectionEnd >= inputElement.value.length)
|
||||
{
|
||||
me.needToAutocomplete = true;
|
||||
me.autoCompleteTimer = setTimeout(me.privatefunc.callListener, me.timeout, me, 'startLookup');
|
||||
}
|
||||
},
|
||||
|
||||
processKeyPress: function(me, event) {
|
||||
if (me.disableAutocomplete == "true")
|
||||
{
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
return;
|
||||
}
|
||||
|
||||
var popup = document.getAnonymousNodes(me)[0].childNodes[1].firstChild;
|
||||
if (popup && me.menuOpen != "true")
|
||||
popup = null;
|
||||
|
||||
switch (event.keyCode)
|
||||
{
|
||||
case 9: /*vk_tab*/
|
||||
if (popup)
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
return;
|
||||
|
||||
case 13 /*vk_return*/:
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
me.privatefunc.finishAutoComplete(me, event);
|
||||
return;
|
||||
|
||||
case 27 /*vk_escape*/:
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
if (popup) {
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
event.preventDefault();
|
||||
event.preventBubble();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 37 /*vk_left*/:
|
||||
case 39 /*vk_right*/:
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
if (popup)
|
||||
{
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
event.preventDefault();
|
||||
event.preventBubble();
|
||||
}
|
||||
me.privatefunc.cleanupInputField(me);
|
||||
break;
|
||||
|
||||
case 38 /*vk_up*/:
|
||||
case 40 /*vk_down*/:
|
||||
if (me.autoCompleteTimer) {
|
||||
clearTimeout(me.autoCompleteTimer);
|
||||
me.autoCompleteTimer = 0;
|
||||
}
|
||||
me.privatefunc.keyNavigation(me, event, popup);
|
||||
event.preventDefault();
|
||||
event.preventBubble();
|
||||
if (! popup)
|
||||
me.privatefunc.cleanupInputField(me);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
selectedItemIndex: 0
|
||||
|
||||
})
|
||||
]]>
|
||||
</property>
|
||||
|
||||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="click" action="this.privatefunc.cleanupInputField(this);"/>
|
||||
<handler event="dblclick" action="this.privatefunc.cleanupInputField(this);"/>
|
||||
<handler event="input" action="this.privatefunc.processInput(this);"/>
|
||||
<handler event="keypress" action="this.privatefunc.processKeyPress(this, event);"/>
|
||||
<handler event="focus" action="this.needToAutocomplete = false; this.lastResults.searchString=''; this.ignoreInputEvent = false"/>
|
||||
<handler event="blur" action="
|
||||
this.privatefunc.closePopupMenu(this);
|
||||
if (this.needToAutocomplete)
|
||||
this.privatefunc.finishAutoComplete(this, event);
|
||||
this.privatefunc.cleanupInputField(this);
|
||||
"/>
|
||||
</handlers>
|
||||
|
||||
</binding>
|
||||
</bindings>
|
||||
@@ -1,32 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
DISTXUL=$(DIST)\bin\chrome\packages\widget-toolkit\global\content
|
||||
|
||||
install::
|
||||
$(MAKE_INSTALL) autocomplete.xml $(DISTXUL)
|
||||
|
||||
clobber::
|
||||
rm -f $(DISTXUL)\autocomplete.xml
|
||||
@@ -1,26 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
DIRS= content
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE=appcomps
|
||||
LIBRARY_NAME = autocomplete_s
|
||||
|
||||
CPPSRCS = nsAutoComplete.cpp
|
||||
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# 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):
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH = ..\..\..\..
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
MODULE=appcomps
|
||||
LIBRARY_NAME=autocomplete_s
|
||||
LCFLAGS = -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
LINCS = \
|
||||
-I$(PUBLIC)/xpcom \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nsAutoComplete.obj \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
@@ -1,165 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "prtypes.h"
|
||||
#include "nsAutoComplete.h"
|
||||
|
||||
/******************************************************************************
|
||||
* nsAutoCompleteItem
|
||||
******************************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsAutoCompleteItem, nsIAutoCompleteItem)
|
||||
|
||||
nsAutoCompleteItem::nsAutoCompleteItem()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsAutoCompleteItem::~nsAutoCompleteItem()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteItem::GetValue(PRUnichar * *aValue)
|
||||
{
|
||||
if (!aValue) return NS_ERROR_NULL_POINTER;
|
||||
*aValue = mValue.ToNewUnicode();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteItem::SetValue(const PRUnichar * aValue)
|
||||
{
|
||||
mValue = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteItem::GetComment(PRUnichar * *aComment)
|
||||
{
|
||||
if (!aComment) return NS_ERROR_NULL_POINTER;
|
||||
*aComment = mComment.ToNewUnicode();
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsAutoCompleteItem::SetComment(const PRUnichar * aComment)
|
||||
{
|
||||
mComment = aComment;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute string className; */
|
||||
NS_IMETHODIMP nsAutoCompleteItem::GetClassName(char * *aClassName)
|
||||
{
|
||||
if (!aClassName) return NS_ERROR_NULL_POINTER;
|
||||
*aClassName = mClassName.ToNewCString();
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsAutoCompleteItem::SetClassName(const char * aClassName)
|
||||
{
|
||||
mClassName.AssignWithConversion(aClassName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute nsISupports param; */
|
||||
NS_IMETHODIMP nsAutoCompleteItem::GetParam(nsISupports * *aParam)
|
||||
{
|
||||
if (!aParam) return NS_ERROR_NULL_POINTER;
|
||||
*aParam = mParam;
|
||||
NS_IF_ADDREF(*aParam);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsAutoCompleteItem::SetParam(nsISupports * aParam)
|
||||
{
|
||||
mParam = aParam;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* nsAutoCompleteResults
|
||||
******************************************************************************/
|
||||
NS_IMPL_ISUPPORTS1(nsAutoCompleteResults, nsIAutoCompleteResults)
|
||||
|
||||
nsAutoCompleteResults::nsAutoCompleteResults() :
|
||||
mDefaultItemIndex(0)
|
||||
{
|
||||
NS_NewISupportsArray(getter_AddRefs(mItems));
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsAutoCompleteResults::~nsAutoCompleteResults()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::GetSearchString(PRUnichar * *aSearchString)
|
||||
{
|
||||
if (!aSearchString) return NS_ERROR_NULL_POINTER;
|
||||
*aSearchString = mSearchString.ToNewUnicode();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::SetSearchString(const PRUnichar * aSearchString)
|
||||
{
|
||||
mSearchString = aSearchString;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::GetParam(nsISupports * *aParam)
|
||||
{
|
||||
if (!aParam) return NS_ERROR_NULL_POINTER;
|
||||
*aParam = mParam;
|
||||
NS_IF_ADDREF(*aParam);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::SetParam(nsISupports * aParam)
|
||||
{
|
||||
mParam = aParam;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::GetItems(nsISupportsArray * *aItems)
|
||||
{
|
||||
if (!aItems) return NS_ERROR_NULL_POINTER;
|
||||
*aItems = mItems;
|
||||
NS_IF_ADDREF(*aItems);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::SetItems(nsISupportsArray * aItems)
|
||||
{
|
||||
mItems = aItems;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::GetDefaultItemIndex(PRInt32 *aDefaultItemIndex)
|
||||
{
|
||||
if (!aDefaultItemIndex) return NS_ERROR_NULL_POINTER;
|
||||
*aDefaultItemIndex = mDefaultItemIndex;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAutoCompleteResults::SetDefaultItemIndex(PRInt32 aDefaultItemIndex)
|
||||
{
|
||||
mDefaultItemIndex = aDefaultItemIndex;
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Original Author: Jean-Francois Ducarroz (ducarroz@netscape.com)
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#ifndef nsAutoComplete_h___
|
||||
#define nsAutoComplete_h___
|
||||
|
||||
#include "nslayout.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIAutoCompleteListener.h"
|
||||
#include "nsIAutoCompleteResults.h"
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* nsAutoCompleteItem
|
||||
******************************************************************************/
|
||||
class nsAutoCompleteItem : public nsIAutoCompleteItem
|
||||
{
|
||||
public:
|
||||
nsAutoCompleteItem();
|
||||
virtual ~nsAutoCompleteItem();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIAUTOCOMPLETEITEM
|
||||
|
||||
private:
|
||||
nsString mValue;
|
||||
nsString mComment;
|
||||
nsString mClassName;
|
||||
|
||||
nsCOMPtr<nsISupports> mParam;
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* nsAutoCompleteResults
|
||||
******************************************************************************/
|
||||
class nsAutoCompleteResults : public nsIAutoCompleteResults
|
||||
{
|
||||
public:
|
||||
nsAutoCompleteResults();
|
||||
virtual ~nsAutoCompleteResults();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIAUTOCOMPLETERESULTS
|
||||
|
||||
private:
|
||||
nsString mSearchString;
|
||||
nsCOMPtr<nsISupportsArray> mItems;
|
||||
PRInt32 mDefaultItemIndex;
|
||||
|
||||
nsCOMPtr<nsISupports> mParam;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,136 +0,0 @@
|
||||
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
|
||||
|
||||
<window id="actest"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:nc="http://home.netscape.com/NC-rdf#"
|
||||
align="vertical"
|
||||
width="750"
|
||||
height="500"
|
||||
onload="Initialize();"
|
||||
>
|
||||
|
||||
<html:script language="JavaScript">
|
||||
|
||||
var AutoCompleteSession = {
|
||||
onStartLookup: function(value, prevResult, listener)
|
||||
{
|
||||
dump("Search Session: onStartLookup\n");
|
||||
|
||||
var results = Components.classes["component://netscape/autocomplete/results"].createInstance();
|
||||
results = results.QueryInterface(Components.interfaces.nsIAutoCompleteResults);
|
||||
results.searchString = value;
|
||||
results.defaultItemIndex = 0;
|
||||
results.param = null;
|
||||
|
||||
var item = Components.classes["component://netscape/autocomplete/item"].createInstance();
|
||||
item = item.QueryInterface(Components.interfaces.nsIAutoCompleteItem);
|
||||
item.value = "Jean-Francois Ducarroz";
|
||||
item.comment = "[put your comment here]";
|
||||
item.className = "";
|
||||
item.param = null;
|
||||
|
||||
results.items.AppendElement(item);
|
||||
listener.onAutoComplete(results, Components.interfaces.nsIAutoCompleteStatus.matchFound);
|
||||
},
|
||||
|
||||
onStopLookup: function()
|
||||
{
|
||||
dump("Search Session: onStopLookup\n");
|
||||
},
|
||||
|
||||
onAutoComplete: function(value, prevResult, listener)
|
||||
{
|
||||
dump("Search Session: onAutoComplete, value =" + value + "\n");
|
||||
|
||||
var results = Components.classes["component://netscape/autocomplete/results"].createInstance();
|
||||
results = results.QueryInterface(Components.interfaces.nsIAutoCompleteResults);
|
||||
results.searchString = value;
|
||||
results.defaultItemIndex = 0;
|
||||
results.param = null;
|
||||
|
||||
var item = Components.classes["component://netscape/autocomplete/item"].createInstance();
|
||||
item = item.QueryInterface(Components.interfaces.nsIAutoCompleteItem);
|
||||
item.value = value + "@mozilla.org";
|
||||
item.comment = "[put your comment here]";
|
||||
item.className = "";
|
||||
item.param = null;
|
||||
|
||||
results.items.AppendElement(item);
|
||||
|
||||
item = Components.classes["component://netscape/autocomplete/item"].createInstance();
|
||||
item = item.QueryInterface(Components.interfaces.nsIAutoCompleteItem);
|
||||
item.value = value + "@netscape.com";
|
||||
item.comment = "[put your comment here]";
|
||||
item.className = "";
|
||||
item.param = null;
|
||||
|
||||
results.items.AppendElement(item);
|
||||
|
||||
listener.onAutoComplete(results, Components.interfaces.nsIAutoCompleteStatus.matchFound);
|
||||
}
|
||||
};
|
||||
|
||||
function function1()
|
||||
{
|
||||
var myAutoComplete = document.getElementById("test");
|
||||
value = myAutoComplete.value;
|
||||
match = "Jean-Francois Ducarroz";
|
||||
|
||||
lmatch = match.toLowerCase();
|
||||
lvalue = value.toLowerCase();
|
||||
|
||||
dump("value = " + lvalue + ", match = " + lmatch + "\n");
|
||||
|
||||
if (lvalue == lmatch)
|
||||
dump("exact match\n");
|
||||
else
|
||||
{
|
||||
dump("substring = " + lmatch.substring(0, lvalue.length) + "\n");
|
||||
if (lmatch.substring(0, lvalue.length) == lvalue)
|
||||
{
|
||||
dump("Ok, we can merge\n");
|
||||
myAutoComplete.value = value + match.substring(value.length, match.length);
|
||||
// myAutoComplete.anonymousContent[0].firstChild.anonymousContent[0].firstChild.setSelectionRange(value.length, match.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
dump("oops, no match!\n");
|
||||
myAutoComplete.value = value + " " + match;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Initialize()
|
||||
{
|
||||
dump("Initialize!!\n");
|
||||
var secondAutoComplete = document.getElementById("test2");
|
||||
abSession = secondAutoComplete.autoCompleteSession.QueryInterface(Components.interfaces.nsIAbAutoCompleteSession)
|
||||
dump("abSession = " + secondAutoComplete + ", abSession = " + secondAutoComplete.autoCompleteSession + "\n");
|
||||
abSession.defaultDomain = "mozilla.org";
|
||||
|
||||
var myAutoComplete = document.getElementById("test");
|
||||
dump("myAutoComplete = " + myAutoComplete + ", session = " + myAutoComplete.autoCompleteSession + "\n");
|
||||
myAutoComplete.autoCompleteSession = AutoCompleteSession;
|
||||
}
|
||||
|
||||
</html:script>
|
||||
|
||||
<!--autocomplete id="test" timeout="300" /-->
|
||||
|
||||
<autocomplete id="test2"
|
||||
searchSessionType="addrbook"
|
||||
timeout="300"
|
||||
onkeypress="if (event.keyCode == 13) dump('Done, value=' + this.value + '\n');"
|
||||
/>
|
||||
|
||||
<!--autocomplete
|
||||
searchSessionClass="netscape%2Fmessenger%2Fautocomplete%26type%3Daddrbook"
|
||||
timeout="300"
|
||||
/-->
|
||||
</window>
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src resources
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,26 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
|
||||
#define _IMPL_NS_APPSHELL
|
||||
|
||||
#include "MacSharedPrefix.h"
|
||||
@@ -1,26 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
|
||||
#define _IMPL_NS_APPSHELL
|
||||
|
||||
#include "MacSharedPrefix_debug.h"
|
||||
@@ -1,26 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=public src resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1 +0,0 @@
|
||||
nsIBookmarksService.idl
|
||||
@@ -1,34 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = bookmarks
|
||||
|
||||
XPIDLSRCS = nsIBookmarksService.idl
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MODULE=bookmarks
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIBookmarksService.idl \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
@@ -1,59 +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.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):
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
The Browser Bookmarks service
|
||||
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(a82e9300-e4af-11d2-8fdf-0008c70adc7b)]
|
||||
interface nsIBookmarksService : nsISupports
|
||||
{
|
||||
const unsigned long BOOKMARK_DEFAULT_TYPE = 0;
|
||||
const unsigned long BOOKMARK_SEARCH_TYPE = 1;
|
||||
const unsigned long BOOKMARK_FIND_TYPE = 2;
|
||||
|
||||
void ReadBookmarks();
|
||||
boolean IsBookmarked(in string aURI);
|
||||
void AddBookmark(in string aURI, in wstring aTitle, in long bmType, in wstring docCharset);
|
||||
void UpdateBookmarkLastVisitedDate(in string aURL, in wstring docCharset);
|
||||
string FindShortcut(in wstring aName);
|
||||
wstring GetLastCharset(in string aURI);
|
||||
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
||||
// {E638D760-8687-11d2-B530-000000000000}
|
||||
#define NS_BOOKMARKS_SERVICE_CID \
|
||||
{ 0xe638d760, 0x8687, 0x11d2, { 0xb5, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
|
||||
|
||||
#define NS_BOOKMARKS_SERVICE_PROGID \
|
||||
"component://netscape/browser/bookmarks-service"
|
||||
|
||||
#define NS_BOOKMARKS_DATASOURCE_PROGID \
|
||||
"component://netscape/rdf/datasource?name=bookmarks"
|
||||
|
||||
%}
|
||||
@@ -1,9 +0,0 @@
|
||||
bm-find.js
|
||||
bm-find.xul
|
||||
bm-panel.js
|
||||
bm-panel.xul
|
||||
bm-props.js
|
||||
bm-props.xul
|
||||
bookmarks.js
|
||||
bookmarksDD.js
|
||||
bookmarks.xul
|
||||
@@ -1,53 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
CHROME_DIR = .
|
||||
CHROME_CONTENT_DIR = packages/core/communicator/content/bookmarks
|
||||
CHROME_L10N_DIR = locales/en-US/communicator/locale/bookmarks
|
||||
|
||||
CHROME_CONTENT = \
|
||||
bm-find.js \
|
||||
bm-find.xul \
|
||||
bm-panel.js \
|
||||
bm-panel.xul \
|
||||
bm-props.js \
|
||||
bm-props.xul \
|
||||
bookmarks.js \
|
||||
bookmarksDD.js \
|
||||
bookmarks.xul \
|
||||
$(NULL)
|
||||
|
||||
CHROME_L10N = \
|
||||
locale/en-US/bm-find.dtd \
|
||||
locale/en-US/bm-props.dtd \
|
||||
locale/en-US/bookmarks.dtd \
|
||||
locale/en-US/bookmark.properties \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,264 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Original Author(s):
|
||||
* Robert John Churchill <rjc@netscape.com>
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
|
||||
function debug(msg)
|
||||
{
|
||||
// uncomment for noise
|
||||
// dump(msg+"\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doLoad()
|
||||
{
|
||||
// disable "Save Search" button (initially)
|
||||
var searchButton = document.getElementById("SaveSearch");
|
||||
if (searchButton)
|
||||
{
|
||||
searchButton.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
// set initial focus
|
||||
var findtext = document.getElementById("findtext");
|
||||
if (findtext)
|
||||
{
|
||||
findtext.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doUnload()
|
||||
{
|
||||
// Get the current window position/size.
|
||||
var x = window.screenX;
|
||||
var y = window.screenY;
|
||||
var h = window.outerHeight;
|
||||
var w = window.outerWidth;
|
||||
|
||||
// Store these into the window attributes (for persistence).
|
||||
var win = document.getElementById( "bookmark-find-window" );
|
||||
win.setAttribute( "x", x );
|
||||
win.setAttribute( "y", y );
|
||||
win.setAttribute( "height", h );
|
||||
win.setAttribute( "width", w );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var gDatasourceName = "";
|
||||
var gMatchName = "";
|
||||
var gMethodName = "";
|
||||
var gTextName = "";
|
||||
|
||||
function doFind()
|
||||
{
|
||||
gDatasourceName = "";
|
||||
gMatchName = "";
|
||||
gMethodName = "";
|
||||
gTextName = "";
|
||||
|
||||
// get RDF datasource to query
|
||||
var datasourceNode = document.getElementById("datasource");
|
||||
if (!datasourceNode) return(false);
|
||||
var datasource = datasourceNode.selectedItem.getAttribute("data");
|
||||
gDatasourceName = datasourceNode.selectedItem.getAttribute("value");
|
||||
debug("Datasource: " + gDatasourceName + "\n");
|
||||
|
||||
// get match
|
||||
var matchNode = document.getElementById("match");
|
||||
if (!matchNode) return(false);
|
||||
var match = matchNode.selectedItem.getAttribute("data");
|
||||
gMatchName = matchNode.selectedItem.getAttribute("value");
|
||||
debug("Match: " + match + "\n");
|
||||
|
||||
// get method
|
||||
var methodNode = document.getElementById("method");
|
||||
if (!methodNode) return(false);
|
||||
var method = methodNode.selectedItem.getAttribute("data");
|
||||
gMethodName = methodNode.selectedItem.getAttribute("value");
|
||||
debug("Method: " + method + "\n");
|
||||
|
||||
// get user text to find
|
||||
var textNode = document.getElementById("findtext");
|
||||
if (!textNode) return(false);
|
||||
gTextName = textNode.value;
|
||||
if (!gTextName || gTextName=="") return(false);
|
||||
debug("Find text: " + gTextName + "\n");
|
||||
|
||||
// construct find URL
|
||||
var url = "find:datasource=" + datasource;
|
||||
url += "&match=" + match;
|
||||
url += "&method=" + method;
|
||||
url += "&text=" + escape(gTextName);
|
||||
debug("Find URL: " + url + "\n");
|
||||
|
||||
// load find URL into results pane
|
||||
var resultsTree = document.getElementById("findresultstree");
|
||||
if (!resultsTree) return(false);
|
||||
resultsTree.setAttribute("ref", "");
|
||||
resultsTree.setAttribute("ref", url);
|
||||
|
||||
// enable "Save Search" button
|
||||
var searchButton = document.getElementById("SaveSearch");
|
||||
if (searchButton)
|
||||
{
|
||||
searchButton.removeAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
debug("doFind done.\n");
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveFind()
|
||||
{
|
||||
var resultsTree = document.getElementById("findresultstree");
|
||||
if (!resultsTree) return(false);
|
||||
var searchURL = resultsTree.getAttribute("ref");
|
||||
if ((!searchURL) || (searchURL == "")) return(false);
|
||||
|
||||
debug("Bookmark search URL: " + searchURL + "\n");
|
||||
var searchTitle = "Find: " + gMatchName + " " + gMethodName + " '" + gTextName + "' in " + gDatasourceName;
|
||||
debug("Title: " + searchTitle + "\n\n");
|
||||
|
||||
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
|
||||
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
|
||||
if (bmks) bmks.AddBookmark(searchURL, searchTitle, bmks.BOOKMARK_FIND_TYPE, null);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getAbsoluteID(root, node)
|
||||
{
|
||||
var url = node.getAttribute("ref");
|
||||
if ((url == null) || (url == ""))
|
||||
{
|
||||
url = node.getAttribute("id");
|
||||
}
|
||||
try
|
||||
{
|
||||
var rootNode = document.getElementById(root);
|
||||
var ds = null;
|
||||
if (rootNode)
|
||||
{
|
||||
ds = rootNode.database;
|
||||
}
|
||||
|
||||
// add support for anonymous resources such as Internet Search results,
|
||||
// IE favorites under Win32, and NetPositive URLs under BeOS
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf && ds)
|
||||
{
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = ds.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
return(url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function OpenURL(event, node, root)
|
||||
{
|
||||
if ((event.button != 1) || (event.detail != 2) || (node.nodeName != "treeitem"))
|
||||
return(false);
|
||||
|
||||
if (node.getAttribute("container") == "true")
|
||||
return(false);
|
||||
|
||||
var url = getAbsoluteID(root, node);
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
return(false);
|
||||
|
||||
// get right sized window
|
||||
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Note: doSort() does NOT support natural order sorting, unless naturalOrderResource is valid,
|
||||
in which case we sort ascending on naturalOrderResource
|
||||
*/
|
||||
function doSort(sortColName, naturalOrderResource)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
if (!sortResource) return(false);
|
||||
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
sortDirection = "ascending";
|
||||
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
{
|
||||
if (sortResource != naturalOrderResource)
|
||||
{
|
||||
sortDirection = "descending";
|
||||
}
|
||||
}
|
||||
else if (currentDirection == "descending")
|
||||
{
|
||||
if (naturalOrderResource != null && naturalOrderResource != "")
|
||||
{
|
||||
sortResource = naturalOrderResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isupports = Components.classes["component://netscape/rdf/xul-sort-service"].getService();
|
||||
if (!isupports) return(false);
|
||||
var xulSortService = isupports.QueryInterface(Components.interfaces.nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
try
|
||||
{
|
||||
xulSortService.Sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
debug("Exception calling xulSortService.Sort()");
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
<?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.
|
||||
|
||||
Original Author(s):
|
||||
Robert John Churchill <rjc@netscape.com>
|
||||
|
||||
Contributor(s):
|
||||
Blake Ross <BlakeR1234@aol.com>
|
||||
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bm-find.dtd">
|
||||
|
||||
<window title="&window.title.label;" id="bookmark-find-window"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:web="http://home.netscape.com/WEB-rdf#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="630" height="400" x="20" y="20" persist="width height x y" orient="vertical"
|
||||
windowtype="bookmarks:find"
|
||||
onload="doLoad()" onunload="doUnload()"
|
||||
>
|
||||
|
||||
<script src="chrome://communicator/content/bookmarks/bm-find.js" />
|
||||
<script src="chrome://global/content/treePopups.js" />
|
||||
|
||||
<broadcasterset id="broadcasterset">
|
||||
<!-- File Menu -->
|
||||
<broadcaster id="cmd_newNavigator"/>
|
||||
<broadcaster id="cmd_newEditor"/>
|
||||
<broadcaster id="cmd_close" oncommand="window.close()"/>
|
||||
<broadcaster id="cmd_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<broadcaster id="cmd_undo"/>
|
||||
<broadcaster id="cmd_redo"/>
|
||||
<broadcaster id="cmd_cut"/>
|
||||
<broadcaster id="cmd_copy"/>
|
||||
<broadcaster id="cmd_paste"/>
|
||||
<broadcaster id="cmd_delete"/>
|
||||
<broadcaster id="cmd_selectAll"/>
|
||||
</broadcasterset>
|
||||
<keyset id="keyset">
|
||||
<!-- File Menu -->
|
||||
<key id="key_newNavigator"/>
|
||||
<key id="key_newEditor"/>
|
||||
<key id="key_close"/>
|
||||
<key id="key_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<key id="key_undo"/>
|
||||
<key id="key_redo"/>
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_paste"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_selectAll"/>
|
||||
</keyset>
|
||||
<menubar>
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menu id="menu_New">
|
||||
<menupopup id="menu_NewPopup">
|
||||
<menuitem id="menu_newNavigator" observes="cmd_newNavigator"/>
|
||||
<menuitem id="menu_newEditor" observes="cmd_newEditor"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_close"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_Edit">
|
||||
<menupopup>
|
||||
<menuitem id="menu_undo" disabled="true" />
|
||||
<menuitem id="menu_redo" disabled="true" />
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_cut"/>
|
||||
<menuitem id="menu_copy"/>
|
||||
<menuitem id="menu_paste"/>
|
||||
<menuitem id="menu_delete"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="tasksMenu" accesskey="t" />
|
||||
<menu id="menu_Help" accesskey="h" />
|
||||
</menubar>
|
||||
|
||||
<titledbox orient="horizontal">
|
||||
<spring align="horizontal" flex="100%" />
|
||||
<box align="vertical">
|
||||
<box align="horizontal">
|
||||
<spring align="horizontal" flex="100%" />
|
||||
<text value="&search1.label;" />
|
||||
<menulist id="datasource">
|
||||
<menupopup id="datasourcePopup">
|
||||
<menuitem data="rdf:bookmarks" value="&bookmarks.label;" />
|
||||
<menuitem data="rdf:history" value="&history.label;" />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<text value="&search2.label;" />
|
||||
<spring align="horizontal" flex="100%" />
|
||||
</box>
|
||||
|
||||
<box align="horizontal">
|
||||
<spring align="horizontal" flex="100%" />
|
||||
<menulist id="match">
|
||||
<menupopup id="matchPopup">
|
||||
<menuitem data="http://home.netscape.com/NC-rdf#Name" value="&name.label;" />
|
||||
<menuitem data="http://home.netscape.com/NC-rdf#URL" value="&url.label;" />
|
||||
<menuitem data="http://home.netscape.com/NC-rdf#ShortcutURL" value="&shortcut.label;" />
|
||||
<menuitem data="http://home.netscape.com/NC-Description" value="&description.label;" />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<menulist id="method">
|
||||
<menupopup id="methodPopup">
|
||||
<menuitem data="contains" value="&contains.label;" />
|
||||
<menuitem data="startswith" value="&startswith.label;" />
|
||||
<menuitem data="endswith" value="&endswith.label;" />
|
||||
<menuitem data="is" value="&is.label;" />
|
||||
<menuitem data="isnot" value="&isnot.label;" />
|
||||
<menuitem data="doesntcontain" value="&doesntcontain.label;" />
|
||||
</menupopup>
|
||||
</menulist>
|
||||
|
||||
<textfield id="findtext" type="text" style="width:10em;" onkeypress="if (event.keyCode == 13) { return doFind(); }" />
|
||||
<box autostretch="never">
|
||||
<button value="&search.button.label;" onclick="return doFind();" class="dialog toolbar-non-iconic" />
|
||||
</box>
|
||||
<spring align="horizontal" flex="100%" />
|
||||
</box>
|
||||
</box>
|
||||
<spring align="horizontal" flex="100%" />
|
||||
</titledbox>
|
||||
|
||||
<box height="10" />
|
||||
|
||||
<tree id="findresultstree" ref="" flex="100%" style="height:0px"
|
||||
datasources="rdf:bookmarks rdf:history rdf:localsearch"
|
||||
onclick="return OpenURL(event, event.target.parentNode.parentNode);">
|
||||
|
||||
<treecolgroup id="theColumns">
|
||||
<treecol id="NameColumn" persist="hidden width" width="2*" flex="2"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Name"
|
||||
sortActive="true" sortDirection="ascending" />
|
||||
<treecol id="URLColumn" persist="hidden width" width="2*" flex="2"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecol id="ShortcutURLColumn" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||
<treecol id="DescriptionColumn" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Description"/>
|
||||
<treecol id="PopupColumn" persist="width" fixed="true" width="14" />
|
||||
</treecolgroup>
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="...">
|
||||
<treerow>
|
||||
<treecell>
|
||||
<html:hr width="100%" align="center" size="1" />
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
|
||||
<rule>
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="rdf:*">
|
||||
<treerow>
|
||||
<treecell align="left" crop="right" indent="true" value="rdf:http://home.netscape.com/NC-rdf#Name" src="rdf:http://home.netscape.com/NC-rdf#Icon" />
|
||||
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||
<treecell align="left" crop="right" value="rdf:http://home.netscape.com/NC-rdf#Description"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treehead>
|
||||
<treerow id="headRow">
|
||||
<treecell class="treecell-header sortDirectionIndicator" observes="NameColumn"
|
||||
value="&name.label;" resource="http://home.netscape.com/NC-rdf#Name"
|
||||
onclick="return doSort('NameColumn', null);" sortActive="true" sortDirection="ascending" />
|
||||
<treecell class="treecell-header sortDirectionIndicator" observes="URLColumn"
|
||||
value="&url.label;" resource="http://home.netscape.com/NC-rdf#URL"
|
||||
onclick="return doSort('URLColumn', null);" />
|
||||
<treecell class="treecell-header sortDirectionIndicator" observes="ShortcutURLColumn"
|
||||
value="&shortcut.label;" resource="http://home.netscape.com/NC-rdf#ShortcutURL"
|
||||
onclick="return doSort('ShortcutURLColumn', null);" />
|
||||
<treecell class="treecell-header sortDirectionIndicator" observes="DescriptionColumn"
|
||||
value="&description.label;" resource="http://home.netscape.com/NC-rdf#Description"
|
||||
onclick="return doSort('DescriptionColumn', null);" />
|
||||
|
||||
<treecell allowevents="true" id="popupCell">
|
||||
<menu>
|
||||
<titledbutton src="chrome://global/skin/opentwisty.gif"/>
|
||||
<menupopup popupanchor="bottomright"
|
||||
popupalign="topright"
|
||||
oncreate="BuildTreePopup(document.getElementById('theColumns'), document.getElementById('headRow'), this,
|
||||
document.getElementById('popupCell'))" />
|
||||
</menu>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treehead>
|
||||
</tree>
|
||||
|
||||
<box align="horizontal">
|
||||
<spring flex="1" />
|
||||
<button id="SaveSearch" disabled="true" value="&save.button.label;" onclick="return saveFind();" class="dialog toolbar-non-iconic"/>
|
||||
<spring flex="1" />
|
||||
</box>
|
||||
|
||||
<!--
|
||||
This extra "status" bar is necessary because the bottom right corner of
|
||||
the window on MacOS is taken up by the growBox. If this window had a
|
||||
horizontal scrollbar, we'd be alright, but since it doesn't the bottom
|
||||
arrow on the vertical scrollbar was being hidden by this growBox. To
|
||||
combat this, we can just stick in a 16px high bar to bump up the bottom
|
||||
of the tree so that the scrollbar is visible. Yes, I know this is not
|
||||
necessary for win32 or gtk, but we can use this area for information
|
||||
(maybe full URL of selected item or the like) in the future.
|
||||
-->
|
||||
<box id="status-bar" style="min-height:16px; max-height:16px;">
|
||||
<titledbutton class="status-bar" align="left" value=""/>
|
||||
</box>
|
||||
|
||||
</window>
|
||||
@@ -1,122 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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 Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stephen Lamm <slamm@netscape.com>
|
||||
* Robert John Churchill <rjc@netscape.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
Code for the Bookmarks Sidebar Panel
|
||||
*/
|
||||
|
||||
// get handle to the BrowserAppCore in the content area.
|
||||
var appCore = window._content.appCore;
|
||||
|
||||
|
||||
|
||||
function clicked(event, target)
|
||||
{
|
||||
if ((event.button != 1) || (event.detail != 2) || (target.nodeName != "treeitem"))
|
||||
return(false);
|
||||
|
||||
if (event.altKey)
|
||||
{
|
||||
// if altKey is down then just open the Bookmark Properties dialog
|
||||
BookmarkProperties();
|
||||
return(true);
|
||||
}
|
||||
|
||||
if (target.getAttribute("container") == "true")
|
||||
return(false);
|
||||
|
||||
OpenBookmarkURL(event, target, document.getElementById('bookmarksTree').database);
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function OpenBookmarkURL(event, node, datasources)
|
||||
{
|
||||
if (node.getAttribute("container") == "true")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
var url = node.getAttribute("id");
|
||||
try
|
||||
{
|
||||
// add support for IE favorites under Win32, and NetPositive URLs under BeOS
|
||||
var rdf = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
if (rdf) rdf = rdf.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
if (rdf && datasources) {
|
||||
var src = rdf.GetResource(url, true);
|
||||
var prop = rdf.GetResource("http://home.netscape.com/NC-rdf#URL", true);
|
||||
var target = datasources.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target) url = target;
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Ignore "NC:" urls.
|
||||
if (url.substring(0, 3) == "NC:")
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
if (!window._content)
|
||||
{
|
||||
const WM_PROGID = "component://netscape/rdf/datasource?name=window-mediator";
|
||||
var wm = nsJSComponentManager.getService(WM_PROGID, "nsIWindowMediator");
|
||||
if (wm)
|
||||
{
|
||||
navWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
if (navWindow)
|
||||
{
|
||||
navWindow.appCore.loadUrl(url);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
|
||||
}
|
||||
}
|
||||
else if (event.metaKey)
|
||||
{
|
||||
// if metaKey is down, open in a new browser window
|
||||
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
|
||||
}
|
||||
else
|
||||
{
|
||||
if(appCore)
|
||||
{
|
||||
// support session history (if appCore is available)
|
||||
appCore.loadUrl(url);
|
||||
}
|
||||
else
|
||||
{
|
||||
// fallback case (if appCore isn't available)
|
||||
window._content.location = url;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
<?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://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">
|
||||
|
||||
<window
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
ondraggesture="return TopLevelDrag(event);"
|
||||
align="vertical">
|
||||
|
||||
<script src="chrome://communicator/content/bookmarks/bm-panel.js" />
|
||||
<script src="chrome://communicator/content/bookmarks/bookmarks.js" />
|
||||
<script src="chrome://communicator/content/bookmarks/bookmarksDD.js"/>
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://global/content/nsJSComponentManager.js"/>
|
||||
|
||||
<popupset>
|
||||
<popup id="contextual" oncreate="return fillContextMenu('contextual');" >
|
||||
<menu />
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<tree id="bookmarksTree" class="bookmarks-panel-tree" context="contextual" ref="NC:BookmarksRoot"
|
||||
flex="1" multiple="true" flags="dont-test-empty"
|
||||
ondragover="return DragOverTree(event);"
|
||||
ondraggesture="return BeginDragTree(event);"
|
||||
ondragdrop="return DropOnTree(event);"
|
||||
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch rdf:httpindex"
|
||||
onclick="return clicked(event, event.target.parentNode.parentNode)">
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="..." rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
|
||||
<treerow>
|
||||
<treecell>
|
||||
<treeindentation/><separator flex="100%" align="center" class="groove" />
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
|
||||
<rule>
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="..." persist="open" class="treeitem-bookmark"
|
||||
web:status="rdf:http://home.netscape.com/WEB-rdf#status"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading">
|
||||
<treerow>
|
||||
<treecell class="treecell-bookmark treecell-indent"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
web:status="rdf:http://home.netscape.com/WEB-rdf#status"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading" />
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecolgroup id="theColumns">
|
||||
<treecol flex="1" id="NameColumn" sortSeparators="true"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
</treecolgroup>
|
||||
|
||||
<treehead>
|
||||
<treerow id="headRow">
|
||||
<treecell class="treecell-header treecell-header-sidebarpanel sortDirectionIndicator"
|
||||
value="&tree.header.name.label;"
|
||||
onclick="return TriStateColumnSort('NameColumn');" observes="NameColumn" />
|
||||
</treerow>
|
||||
</treehead>
|
||||
</tree>
|
||||
</window>
|
||||
@@ -1,461 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.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):
|
||||
*/
|
||||
|
||||
var NC_NAMESPACE_URI = "http://home.netscape.com/NC-rdf#";
|
||||
|
||||
// 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 Fields = ["name", "shortcut", "description", "url"];
|
||||
|
||||
// ...and this is a parallel array that contains the RDF properties
|
||||
// that they are associated with.
|
||||
var Properties = [NC_NAMESPACE_URI + "Name",
|
||||
NC_NAMESPACE_URI + "ShortcutURL",
|
||||
NC_NAMESPACE_URI + "Description",
|
||||
NC_NAMESPACE_URI + "URL"];
|
||||
|
||||
var RDF = Components.classes["component://netscape/rdf/rdf-service"].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
var RDFC = Components.classes["component://netscape/rdf/container-utils"].getService();
|
||||
RDFC = RDFC.QueryInterface(Components.interfaces.nsIRDFContainerUtils);
|
||||
|
||||
var Bookmarks = RDF.GetDataSource("rdf:bookmarks");
|
||||
|
||||
// Init() will fill this in.
|
||||
var bookmark_url = '';
|
||||
|
||||
|
||||
|
||||
function Init()
|
||||
{
|
||||
bookmark_url = window.arguments[0];
|
||||
|
||||
// set up action buttons
|
||||
doSetOKCancel(Commit);
|
||||
|
||||
// Initialize the properties panel by copying the values from the
|
||||
// RDF graph into the fields on screen.
|
||||
|
||||
for (var i = 0; i < Fields.length; ++i) {
|
||||
var field = document.getElementById(Fields[i]);
|
||||
|
||||
var value = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(Properties[i]),
|
||||
true);
|
||||
|
||||
if (value) value = value.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (value) value = value.Value;
|
||||
|
||||
dump("field '" + Fields[i] + "' <== '" + value + "'\n");
|
||||
|
||||
if (value) field.value = value;
|
||||
}
|
||||
|
||||
/*
|
||||
// try and set window title
|
||||
var nameNode = document.getElementById("name");
|
||||
if (nameNode)
|
||||
{
|
||||
var name = nameNode.value;
|
||||
if (name && name != "")
|
||||
{
|
||||
dump("\n Set window name to '" + name + "'\n");
|
||||
window.title = name;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// check bookmark schedule
|
||||
var value = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource("http://home.netscape.com/WEB-rdf#Schedule"),
|
||||
true);
|
||||
|
||||
if (value) value = value.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
if (value) value = value.Value;
|
||||
if ((value) && (value != ""))
|
||||
{
|
||||
var sep;
|
||||
|
||||
// get day range
|
||||
if ((sep = value.indexOf("|")) > 0)
|
||||
{
|
||||
var days = value.substr(0, sep);
|
||||
value = value.substr(sep+1, value.length-1);
|
||||
|
||||
var dayNode = document.getElementById("dayRange");
|
||||
for (var x=0; x < dayNode.childNodes[0].childNodes.length; x++)
|
||||
{
|
||||
if (dayNode.childNodes[0].childNodes[x].getAttribute("data") == days)
|
||||
{
|
||||
dayNode.selectedItem = dayNode.childNodes[0].childNodes[x];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get hour range
|
||||
if ((sep = value.indexOf("|")) > 0)
|
||||
{
|
||||
var hours = value.substr(0, sep);
|
||||
value = value.substr(sep+1, value.length-1);
|
||||
|
||||
var startHour = "";
|
||||
var endHour = "";
|
||||
|
||||
var dashSep = hours.indexOf("-");
|
||||
if (dashSep > 0)
|
||||
{
|
||||
startHour = hours.substr(0, dashSep);
|
||||
endHour = hours.substr(dashSep + 1, hours.length-1);
|
||||
}
|
||||
|
||||
// set start hour
|
||||
var startHourNode = document.getElementById("startHourRange");
|
||||
for (var x=0; x < startHourNode.childNodes[0].childNodes.length; x++)
|
||||
{
|
||||
if (startHourNode.childNodes[0].childNodes[x].getAttribute("data") == startHour)
|
||||
{
|
||||
startHourNode.selectedItem = startHourNode.childNodes[0].childNodes[x];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// set end hour
|
||||
var endHourNode = document.getElementById("endHourRange");
|
||||
for (var x=0; x < endHourNode.childNodes[0].childNodes.length; x++)
|
||||
{
|
||||
if (endHourNode.childNodes[0].childNodes[x].getAttribute("data") == endHour)
|
||||
{
|
||||
endHourNode.selectedItem = endHourNode.childNodes[0].childNodes[x];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get duration
|
||||
if ((sep = value.indexOf("|")) > 0)
|
||||
{
|
||||
var duration = value.substr(0, sep);
|
||||
value = value.substr(sep+1, value.length-1);
|
||||
|
||||
var durationNode = document.getElementById("duration");
|
||||
durationNode.value = duration;
|
||||
}
|
||||
|
||||
// get notification method
|
||||
if (value.indexOf("icon") >= 0)
|
||||
{
|
||||
document.getElementById("bookmarkIcon").checked = true;
|
||||
}
|
||||
if (value.indexOf("sound") >= 0)
|
||||
{
|
||||
document.getElementById("playSound").checked = true;
|
||||
}
|
||||
if (value.indexOf("alert") >= 0)
|
||||
{
|
||||
document.getElementById("showAlert").checked = true;
|
||||
}
|
||||
if (value.indexOf("open") >= 0)
|
||||
{
|
||||
document.getElementById("openWindow").checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// if its a container, disable some things
|
||||
var isContainerFlag = RDFC.IsContainer(Bookmarks, RDF.GetResource(bookmark_url));
|
||||
if (!isContainerFlag)
|
||||
{
|
||||
// XXX To do: the "RDFC.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.
|
||||
var locationBox = document.getElementById("locationBox");
|
||||
if (locationBox)
|
||||
{
|
||||
dump("Hide location box\n");
|
||||
var parentNode = locationBox.parentNode;
|
||||
parentNode.removeChild(locationBox);
|
||||
}
|
||||
|
||||
// If it is a folder, it has no Shortcut URL.
|
||||
var shortcutBox = document.getElementById("shortcutBox");
|
||||
if (shortcutBox)
|
||||
{
|
||||
dump("Hide shortcut box\n");
|
||||
var parentNode = shortcutBox.parentNode;
|
||||
parentNode.removeChild(shortcutBox);
|
||||
}
|
||||
}
|
||||
|
||||
if ((bookmark_url.indexOf("http://") != 0) && (bookmark_url.indexOf("https://") != 0))
|
||||
{
|
||||
// only allow scheduling of http/https URLs
|
||||
var scheduleTab = document.getElementById("ScheduleTab");
|
||||
if (scheduleTab)
|
||||
{
|
||||
dump("Hide schedule tab\n");
|
||||
var parentNode = scheduleTab.parentNode;
|
||||
parentNode.removeChild(scheduleTab);
|
||||
}
|
||||
}
|
||||
|
||||
window.sizeToContent();
|
||||
|
||||
// set initial focus
|
||||
var nameNode = document.getElementById("name");
|
||||
if (nameNode)
|
||||
{
|
||||
nameNode.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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 < Fields.length; ++i)
|
||||
{
|
||||
var field = document.getElementById(Fields[i]);
|
||||
// if the field was removed, just skip it
|
||||
if (!field) continue;
|
||||
|
||||
// Get the new value as a literal, using 'null' if the value is
|
||||
// empty.
|
||||
var newvalue = field.value;
|
||||
dump("field value = " + newvalue + "\n");
|
||||
|
||||
// if the field was removed, just skip it
|
||||
if (!Properties[i]) continue;
|
||||
|
||||
var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(Properties[i]),
|
||||
true);
|
||||
|
||||
if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
|
||||
if ((newvalue) && (Properties[i] == (NC_NAMESPACE_URI + "ShortcutURL")))
|
||||
{
|
||||
// shortcuts are always lowercased internally
|
||||
newvalue = newvalue.toLowerCase();
|
||||
}
|
||||
else if ((newvalue) && (Properties[i] == (NC_NAMESPACE_URI + "URL")))
|
||||
{
|
||||
// we're dealing with the URL attribute;
|
||||
// if a scheme isn't specified, use "http://"
|
||||
if (newvalue.indexOf(":") < 0)
|
||||
{
|
||||
dump("Setting default URL scheme to HTTP.\n");
|
||||
newvalue = "http://" + newvalue;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateAttribute(Properties[i], oldvalue, newvalue) == true)
|
||||
{
|
||||
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";
|
||||
var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(scheduleRes), true);
|
||||
var newvalue = "";
|
||||
|
||||
var dayRange = "";
|
||||
var dayRangeNode = document.getElementById("dayRange");
|
||||
if (dayRangeNode)
|
||||
{
|
||||
dayRange = dayRangeNode.selectedItem.getAttribute("data");
|
||||
}
|
||||
if (dayRange != "")
|
||||
{
|
||||
var startHourRange = "";
|
||||
var startHourRangeNode = document.getElementById("startHourRange");
|
||||
if (startHourRangeNode)
|
||||
{
|
||||
startHourRange = startHourRangeNode.selectedItem.getAttribute("data");
|
||||
}
|
||||
var endHourRange = "";
|
||||
var endHourRangeNode = document.getElementById("endHourRange");
|
||||
if (endHourRangeNode)
|
||||
{
|
||||
endHourRange = endHourRangeNode.selectedItem.getAttribute("data");
|
||||
}
|
||||
|
||||
if (parseInt(startHourRange) > parseInt(endHourRange))
|
||||
{
|
||||
var temp = startHourRange;
|
||||
startHourRange = endHourRange;
|
||||
endHourRange = temp;
|
||||
}
|
||||
|
||||
var duration = document.getElementById("duration").value;
|
||||
if (duration == "")
|
||||
{
|
||||
var bundle = srGetStrBundle("chrome://communicator/locale/bookmarks/bookmark.properties");
|
||||
alert( bundle.GetStringFromName("pleaseEnterADuration") );
|
||||
return(false);
|
||||
}
|
||||
|
||||
var method = "";
|
||||
if (document.getElementById("bookmarkIcon").checked) method += ",icon";
|
||||
if (document.getElementById("playSound").checked) method += ",sound";
|
||||
if (document.getElementById("showAlert").checked) method += ",alert";
|
||||
if (document.getElementById("openWindow").checked) method += ",open";
|
||||
if (method.length < 1)
|
||||
{
|
||||
var bundle = srGetStrBundle("chrome://communicator/locale/bookmarks/bookmark.properties");
|
||||
alert( bundle.GetStringFromName("pleaseSelectANotification") );
|
||||
return(false);
|
||||
}
|
||||
method = method.substr(1, method.length - 1); // trim off the initial comma
|
||||
|
||||
dump("dayRange: " + dayRange + "\n");
|
||||
dump("startHourRange: " + startHourRange + "\n");
|
||||
dump("endHourRange: " + endHourRange + "\n");
|
||||
dump("duration: " + duration + "\n");
|
||||
dump("method: " + method + "\n");
|
||||
|
||||
newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateAttribute(scheduleRes, oldvalue, newvalue) == true)
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed == true)
|
||||
{
|
||||
dump("re-writing bookmarks.html\n");
|
||||
var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
|
||||
if (remote)
|
||||
{
|
||||
remote.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateAttribute(prop, oldvalue, newvalue)
|
||||
{
|
||||
var changed = false;
|
||||
|
||||
if (!prop) return(changed)
|
||||
|
||||
newvalue = (newvalue != '') ? RDF.GetLiteral(newvalue) : null;
|
||||
|
||||
if (oldvalue != newvalue)
|
||||
{
|
||||
dump("replacing value for " + prop + "\n");
|
||||
dump(" oldvalue = " + oldvalue + "\n");
|
||||
dump(" newvalue = " + newvalue + "\n");
|
||||
|
||||
if (oldvalue && !newvalue) {
|
||||
Bookmarks.Unassert(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(prop),
|
||||
oldvalue);
|
||||
}
|
||||
else if (!oldvalue && newvalue) {
|
||||
Bookmarks.Assert(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(prop),
|
||||
newvalue,
|
||||
true);
|
||||
}
|
||||
else if (oldvalue && newvalue) {
|
||||
Bookmarks.Change(RDF.GetResource(bookmark_url),
|
||||
RDF.GetResource(prop),
|
||||
oldvalue,
|
||||
newvalue);
|
||||
}
|
||||
|
||||
changed = true;
|
||||
}
|
||||
return(changed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setEndHourRange()
|
||||
{
|
||||
// Get the values of the start-time and end-time as ints
|
||||
var startHourRange = "";
|
||||
var startHourRangeNode = document.getElementById("startHourRange");
|
||||
if (startHourRangeNode)
|
||||
{
|
||||
startHourRange = startHourRangeNode.selectedItem.getAttribute("data");
|
||||
var startHourRangeInt = parseInt(startHourRange);
|
||||
}
|
||||
var endHourRange = "";
|
||||
var endHourRangeNode = document.getElementById("endHourRange");
|
||||
if (endHourRangeNode)
|
||||
{
|
||||
endHourRange = endHourRangeNode.selectedItem.getAttribute("data");
|
||||
var endHourRangeInt = parseInt(endHourRange);
|
||||
}
|
||||
|
||||
if (endHourRangeNode)
|
||||
{
|
||||
var endHourItemNode = endHourRangeNode.firstChild.firstChild;
|
||||
|
||||
if (endHourItemNode) {
|
||||
|
||||
// disable all those end-times before the start-time
|
||||
for (var index = 0; 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
<?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://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bm-props.dtd" >
|
||||
|
||||
<window
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&bookmarks.windowtitle.label;"
|
||||
onload="Init()" style="width: 36em;"
|
||||
class="dialog" orient="vertical">
|
||||
|
||||
<script language="Javascript" src="chrome://global/content/globalOverlay.js"></script>
|
||||
<script language="JavaScript" src="chrome://global/content/strres.js"></script>
|
||||
<script language="JavaScript" src="chrome://communicator/content/bookmarks/bm-props.js"></script>
|
||||
|
||||
<keyset id="keyset"/>
|
||||
|
||||
<tabcontrol orient="vertical">
|
||||
<tabbox>
|
||||
<tab value="&generalInfo.label;" accesskey="&generalInfo.accesskey;"/>
|
||||
<tab id="ScheduleTab" value="&schedule.label;" accesskey="&schedule.accesskey;"/>
|
||||
</tabbox>
|
||||
<tabpanel>
|
||||
<box orient="vertical">
|
||||
<box id="nameBox" orient="vertical">
|
||||
<text class="label" value="&bookmarks.name.label;" />
|
||||
<textfield id="name" />
|
||||
</box>
|
||||
|
||||
<box id="locationBox" orient="vertical">
|
||||
<text class="label" value="&bookmarks.location.label;" />
|
||||
<textfield id="url" />
|
||||
</box>
|
||||
|
||||
<box id="shortcutBox" orient="vertical">
|
||||
<text class="label" value="&bookmarks.shortcut.label;" />
|
||||
<textfield id="shortcut" />
|
||||
</box>
|
||||
|
||||
<box id="descriptionBox" orient="vertical" flex="1">
|
||||
<text class="label" value="&bookmarks.description.label;" />
|
||||
<textfield multiline="true" id="description" flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
|
||||
<titledbox orient="vertical">
|
||||
<title><text value="&checkforupdates.legend.label;" /></title>
|
||||
|
||||
<box autostretch="never">
|
||||
<text class="label" value="&when.label;" />
|
||||
<menulist id="dayRange">
|
||||
<menupopup>
|
||||
<menuitem data="" value="&checknever.label;"/>
|
||||
<menuseparator />
|
||||
<menuitem data="0123456" value="&checkeveryday.label;"/>
|
||||
<menuitem data="12345" value="&checkweekdays.label;"/>
|
||||
<menuitem data="06" value="&checkweekends.label;"/>
|
||||
<menuitem data="1" value="&checkmondays.label;"/>
|
||||
<menuitem data="2" value="&checktuesdays.label;"/>
|
||||
<menuitem data="3" value="&checkwednesdays.label;"/>
|
||||
<menuitem data="4" value="&checkthursdays.label;"/>
|
||||
<menuitem data="5" value="&checkfridays.label;"/>
|
||||
<menuitem data="6" value="&checksaturdays.label;"/>
|
||||
<menuitem data="0" value="&checksundays.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<spring align="horizontal" flex="1" />
|
||||
<text class="label" value="&from.label;" />
|
||||
<menulist id="startHourRange" oncommand="setEndHourRange()">
|
||||
<menupopup>
|
||||
<menuitem data="0" value="&midnight.label;"/>
|
||||
<menuitem data="1" value="&AMone.label;"/>
|
||||
<menuitem data="2" value="&AMtwo.label;"/>
|
||||
<menuitem data="3" value="&AMthree.label;"/>
|
||||
<menuitem data="4" value="&AMfour.label;"/>
|
||||
<menuitem data="5" value="&AMfive.label;"/>
|
||||
<menuitem data="6" value="&AMsix.label;"/>
|
||||
<menuitem data="7" value="&AMseven.label;"/>
|
||||
<menuitem data="8" value="&AMeight.label;"/>
|
||||
<menuitem data="9" value="&AMnine.label;"/>
|
||||
<menuitem data="10" value="&AMten.label;"/>
|
||||
<menuitem data="11" value="&AMeleven.label;"/>
|
||||
<menuitem data="12" value="&noon.label;"/>
|
||||
<menuitem data="13" value="&PMone.label;"/>
|
||||
<menuitem data="14" value="&PMtwo.label;"/>
|
||||
<menuitem data="15" value="&PMthree.label;"/>
|
||||
<menuitem data="16" value="&PMfour.label;"/>
|
||||
<menuitem data="17" value="&PMfive.label;"/>
|
||||
<menuitem data="18" value="&PMsix.label;"/>
|
||||
<menuitem data="19" value="&PMseven.label;"/>
|
||||
<menuitem data="20" value="&PMeight.label;"/>
|
||||
<menuitem data="21" value="&PMnine.label;"/>
|
||||
<menuitem data="22" value="&PMten.label;"/>
|
||||
<menuitem data="23" value="&PMeleven.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</box>
|
||||
<box align="horizontal">
|
||||
<spring align="horizontal" flex="1" />
|
||||
<text value="&to.label;" />
|
||||
<menulist id="endHourRange">
|
||||
<menupopup oncreate="setEndHourRange()">
|
||||
<menuitem data="1" value="&AMone.label;"/>
|
||||
<menuitem data="2" value="&AMtwo.label;"/>
|
||||
<menuitem data="3" value="&AMthree.label;"/>
|
||||
<menuitem data="4" value="&AMfour.label;"/>
|
||||
<menuitem data="5" value="&AMfive.label;"/>
|
||||
<menuitem data="6" value="&AMsix.label;"/>
|
||||
<menuitem data="7" value="&AMseven.label;"/>
|
||||
<menuitem data="8" value="&AMeight.label;"/>
|
||||
<menuitem data="9" value="&AMnine.label;"/>
|
||||
<menuitem data="10" value="&AMten.label;"/>
|
||||
<menuitem data="11" value="&AMeleven.label;"/>
|
||||
<menuitem data="12" value="&noon.label;"/>
|
||||
<menuitem data="13" value="&PMone.label;"/>
|
||||
<menuitem data="14" value="&PMtwo.label;"/>
|
||||
<menuitem data="15" value="&PMthree.label;"/>
|
||||
<menuitem data="16" value="&PMfour.label;"/>
|
||||
<menuitem data="17" value="&PMfive.label;"/>
|
||||
<menuitem data="18" value="&PMsix.label;"/>
|
||||
<menuitem data="19" value="&PMseven.label;"/>
|
||||
<menuitem data="20" value="&PMeight.label;"/>
|
||||
<menuitem data="21" value="&PMnine.label;"/>
|
||||
<menuitem data="22" value="&PMten.label;"/>
|
||||
<menuitem data="23" value="&PMeleven.label;"/>
|
||||
<menuitem data="24" value="&midnight.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</box>
|
||||
<box autostretch="never">
|
||||
<spring align="horizontal" flex="1" />
|
||||
<text class="label" value="&every.label;" />
|
||||
<textfield id="duration" style="width:4em;" value="60" />
|
||||
<text class="label" value="&minutes.label;" />
|
||||
</box>
|
||||
|
||||
<titledbox orient="vertical">
|
||||
<title><text value="¬ifications.legend.label;" /></title>
|
||||
|
||||
<checkbox id="bookmarkIcon" value="¬ification.icon.label;" />
|
||||
<checkbox id="showAlert" value="¬ification.alert.label;" />
|
||||
<checkbox id="openWindow" value="¬ification.window.label;" />
|
||||
<checkbox id="playSound" value="¬ification.sound.label;" />
|
||||
</titledbox>
|
||||
</titledbox>
|
||||
</tabpanel>
|
||||
</tabcontrol>
|
||||
|
||||
<box id="okCancelButtonsRight"/>
|
||||
|
||||
</window>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,351 +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):
|
||||
Blake Ross <BlakeR1234@aol.com>
|
||||
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">
|
||||
|
||||
<window title="&bookmarksWindowTitle.label;" id="bookmark-window" onunload="doUnload()"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:web="http://home.netscape.com/WEB-rdf#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="630" height="400" screenX="20" screenY="20"
|
||||
persist="width height screenX screenY" orient="vertical"
|
||||
onload="Init();"
|
||||
ondraggesture="return TopLevelDrag(event);"
|
||||
windowtype="bookmarks:manager"
|
||||
>
|
||||
|
||||
<script src="chrome://communicator/content/bookmarks/bookmarks.js"/>
|
||||
<script src="chrome://communicator/content/bookmarks/bookmarksDD.js"/>
|
||||
<script src="chrome://global/content/treePopups.js"/>
|
||||
<script src="chrome://global/content/strres.js"/>
|
||||
<script src="chrome://global/content/globalOverlay.js"/>
|
||||
|
||||
<commands id="commands">
|
||||
<commandset id="CommandUpdate_Bookmarks"
|
||||
commandupdater="true"
|
||||
events="focus,tree-select"
|
||||
oncommandupdate="CommandUpdate_Bookmarks()"/>
|
||||
<commandset id="selectEditMenuItems"/>
|
||||
<commandset id="globalEditMenuItems">
|
||||
<command id="bm_cmd_find" oncommand="return OpenBookmarksFind();"/>
|
||||
<command id="bm_cmd_properties" oncommand="return BookmarkProperties();"/>
|
||||
</commandset>
|
||||
</commands>
|
||||
|
||||
<broadcasterset id="broadcasterset">
|
||||
<!-- File Menu -->
|
||||
<broadcaster id="cmd_newNavigator"/>
|
||||
<broadcaster id="cmd_newEditor"/>
|
||||
<broadcaster id="cmd_close" oncommand="window.close()"/>
|
||||
<broadcaster id="cmd_quit"/>
|
||||
<broadcaster id="bm_cmd_saveas"/>
|
||||
<!-- Edit Menu -->
|
||||
<broadcaster id="cmd_undo"/>
|
||||
<broadcaster id="cmd_cut"/>
|
||||
<broadcaster id="cmd_copy"/>
|
||||
<broadcaster id="cmd_paste"/>
|
||||
<broadcaster id="cmd_delete"/>
|
||||
<broadcaster id="cmd_selectAll"/>
|
||||
</broadcasterset>
|
||||
|
||||
<keyset id="keyset">
|
||||
<!-- File Menu -->
|
||||
<key id="key_newNavigator"/>
|
||||
<key id="key_newEditor"/>
|
||||
<key id="key_close"/>
|
||||
<key id="key_quit"/>
|
||||
<key id="bm_key_saveas" xulkey="true" key="&file.saveas.keybinding;"
|
||||
observes="bm_cmd_saveas"/>
|
||||
<!-- Edit Menu -->
|
||||
<key id="key_undo"/>
|
||||
<key id="key_cut"/>
|
||||
<key id="key_copy"/>
|
||||
<key id="key_paste"/>
|
||||
<key id="key_delete"/>
|
||||
<key id="key_selectAll"/>
|
||||
<key id="bm_key_find" xulkey="true" key="&edit.find.keybinding;"/>
|
||||
<key id="bm_key_properties" xulkey="true"
|
||||
key="&edit.properties.keybinding;"/>
|
||||
</keyset>
|
||||
<toolbox>
|
||||
<menubar>
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem accesskey="&menuitem.newBookmark.accesskey;" value="&menuitem.newBookmark.label;" oncommand="return doContextCmd('http://home.netscape.com/NC-rdf#command?cmd=newbookmark');" />
|
||||
<menu id="menu_New">
|
||||
<menupopup id="menu_NewPopup">
|
||||
<menuitem value="&menuitem.newFolder.label;" oncommand="return doContextCmd('http://home.netscape.com/NC-rdf#command?cmd=newfolder');"/>
|
||||
<menuitem value="&menuitem.newSeparator.label;" oncommand="return doContextCmd('http://home.netscape.com/NC-rdf#command?cmd=newseparator');"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_newNavigator" observes="cmd_newNavigator"/>
|
||||
<menuitem id="menu_newEditor" observes="cmd_newEditor"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_close"/>
|
||||
<menuitem observes="bm_cmd_saveas" key="bm_key_saveas"
|
||||
accesskey="&menuitem.saveas.accesskey;"
|
||||
value="&menuitem.saveas.label;" disabled="true" />
|
||||
<menuseparator/>
|
||||
<menuitem value="&menuitem.import.label;" oncommand="return doContextCmd('http://home.netscape.com/NC-rdf#command?cmd=import');" />
|
||||
<menuitem value="&menuitem.export.label;" oncommand="return doContextCmd('http://home.netscape.com/NC-rdf#command?cmd=export');" />
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_Edit">
|
||||
<menupopup>
|
||||
<menuitem id="menu_undo" disabled="true" />
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_cut"/>
|
||||
<menuitem id="menu_copy"/>
|
||||
<menuitem id="menu_paste"/>
|
||||
<menuitem id="menu_delete"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="menu_selectAll"/>
|
||||
<menuseparator/>
|
||||
<menuitem observes="bm_cmd_find" key="bm_key_find"
|
||||
value="&menuitem.find.label;"/>
|
||||
<menuseparator/>
|
||||
<menuitem observes="bm_cmd_properties" key="bm_key_properties"
|
||||
value="&menuitem.properties.label;" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_View">
|
||||
<menupopup oncreate="fillViewMenu(this)">
|
||||
<menuitem type="radio" name="sort_column" id="unsorted_menuitem"
|
||||
value="&menuitem.view.unsorted.label;"
|
||||
oncommand="return SetSortDirection('natural');"/>
|
||||
<menuseparator id="fill_after_this_node" collapsed="true" />
|
||||
<menuseparator id="fill_before_this_node"/>
|
||||
<menuitem type="radio" name="sort_direction" id="sort_ascending"
|
||||
value="&menuitem.view.ascending.label;"
|
||||
oncommand="return SetSortDirection('ascending');"/>
|
||||
<menuitem type="radio" name="sort_direction" id="sort_descending"
|
||||
value="&menuitem.view.descending.label;"
|
||||
oncommand="return SetSortDirection('descending');"/>
|
||||
<menuseparator/>
|
||||
<menu value="&menuitem.view.show_columns.label;">
|
||||
<menupopup
|
||||
oncreate="BuildTreePopup(document.getElementById('theColumns'),
|
||||
document.getElementById('headRow'), this,
|
||||
document.getElementById('popupCell'))"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem value="&menuitem.newbookmarkfolder.label;"
|
||||
oncommand="return doContextCmd(NC+'command?cmd=setnewbookmarkfolder')"/>
|
||||
<menuitem value="&menuitem.newinternetsearchfolder.label;"
|
||||
oncommand="return doContextCmd(NC+'command?cmd=setnewsearchfolder')"/>
|
||||
<menuitem value="&menuitem.personaltoolbarfolder.label;"
|
||||
oncommand="return doContextCmd(NC+'command?cmd=setpersonaltoolbarfolder')"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="tasksMenu" accesskey="t" />
|
||||
<menu id="menu_Help" accesskey="h" />
|
||||
|
||||
</menubar>
|
||||
</toolbox>
|
||||
|
||||
<popupset>
|
||||
<popup id="contextual" oncreate="return fillContextMenu('contextual');" >
|
||||
<menu />
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<tree id="bookmarksTree" ref="NC:BookmarksRoot" context="contextual"
|
||||
datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch rdf:httpindex"
|
||||
multiple="true" flags="dont-test-empty"
|
||||
onselect="bookmarkSelect();"
|
||||
ondragover="return DragOverTree(event);"
|
||||
ondraggesture="return BeginDragTree(event);"
|
||||
ondragdrop="return DropOnTree(event);"
|
||||
style="height:0px" flex="2">
|
||||
|
||||
<template>
|
||||
<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
|
||||
<treechildren>
|
||||
<treeitem uri="rdf:*"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading">
|
||||
<treerow>
|
||||
<treecell><treeindentation/>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
<treecell>
|
||||
<separator class="groove" flex="1" align="center"/></treecell>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="rdf:*" persist="open" class="treeitem-bookmark"
|
||||
web:status="rdf:http://home.netscape.com/WEB-rdf#status"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading">
|
||||
<treerow>
|
||||
<treecell class="treecell-bookmark treecell-indent"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#Name"
|
||||
src="rdf:http://home.netscape.com/NC-rdf#Icon"
|
||||
web:status="rdf:http://home.netscape.com/WEB-rdf#status"
|
||||
rdf:type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading" />
|
||||
<treecell crop="right"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#URL"/>
|
||||
<treecell
|
||||
value="rdf:http://home.netscape.com/NC-rdf#ShortcutURL"/>
|
||||
<treecell
|
||||
value="rdf:http://home.netscape.com/NC-rdf#Description"/>
|
||||
<treecell
|
||||
value="rdf:http://home.netscape.com/WEB-rdf#LastVisitDate"/>
|
||||
<treecell
|
||||
value="rdf:http://home.netscape.com/NC-rdf#BookmarkAddDate"/>
|
||||
<treecell
|
||||
value="rdf:http://home.netscape.com/WEB-rdf#LastModifiedDate"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
|
||||
<treecolgroup id="theColumns">
|
||||
<treecol id="Name"
|
||||
sortSeparators="true" persist="hidden width" width="4*" flex="4"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="URL"
|
||||
sortSeparators="true" persist="hidden width" width="4*" flex="4"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#URL"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="ShortcutURL"
|
||||
sortSeparators="true" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#ShortcutURL"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="Description"
|
||||
sortSeparators="true" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Description"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="LastVisitDate"
|
||||
sortSeparators="true" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/WEB-rdf#LastVisitDate"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="BookmarkAddDate"
|
||||
sortSeparators="true" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#BookmarkAddDate"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
|
||||
<splitter class="tree-splitter"/>
|
||||
|
||||
<treecol id="LastModifiedDate"
|
||||
sortSeparators="true" persist="hidden width" width="1*" flex="1"
|
||||
rdf:resource="http://home.netscape.com/WEB-rdf#LastModifiedDate"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecol persist="width" fixed="true" width="14" id="PopupColumn"/>
|
||||
</treecolgroup>
|
||||
|
||||
<treehead>
|
||||
<treerow id="headRow">
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.name.label;"
|
||||
onclick="return TriStateColumnSort('Name');"
|
||||
observes="Name" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.url.label;"
|
||||
onclick="return TriStateColumnSort('URL');"
|
||||
observes="URL" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.shortcut.label;"
|
||||
onclick="return TriStateColumnSort('ShortcutURL');"
|
||||
observes="ShortcutURL" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.description.label;"
|
||||
onclick="return TriStateColumnSort('Description');"
|
||||
observes="Description" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.lastvisit.label;"
|
||||
onclick="return TriStateColumnSort('LastVisitDate');"
|
||||
observes="LastVisitDate" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.addedon.label;"
|
||||
onclick="return TriStateColumnSort('BookmarkAddDate');"
|
||||
observes="BookmarkAddDate" />
|
||||
<treecell class="treecell-header sortDirectionIndicator"
|
||||
value="&tree.header.lastmod.label;"
|
||||
onclick="return TriStateColumnSort('LastModifiedDate');"
|
||||
observes="LastModifiedDate" />
|
||||
<treecell class="treecell-header" allowevents="true" id="popupCell">
|
||||
<menu>
|
||||
<image class="treecell-popup-icon"/>
|
||||
<menupopup popupanchor="bottomright"
|
||||
popupalign="topright"
|
||||
oncreate="BuildTreePopup(document.getElementById('theColumns'),
|
||||
document.getElementById('headRow'), this,
|
||||
document.getElementById('popupCell'))"/>
|
||||
</menu>
|
||||
</treecell>
|
||||
</treerow>
|
||||
</treehead>
|
||||
<treechildren flex="1" id="treechildren-bookmarks"
|
||||
onclick="return OpenURL(event, event.target.parentNode.parentNode,
|
||||
'bookmarksTree');"/>
|
||||
</tree>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel id="statusbar-text" flex="1"/>
|
||||
</statusbar>
|
||||
</window>
|
||||
|
||||
@@ -1,504 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
|
||||
|
||||
var NC_NS = "http://home.netscape.com/NC-rdf#";
|
||||
var RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
||||
|
||||
|
||||
|
||||
function TopLevelDrag ( event )
|
||||
{
|
||||
dump("TOP LEVEL bookmarks window got a drag");
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
function BeginDragTree ( event )
|
||||
{
|
||||
//XXX we rely on a capturer to already have determined which item the mouse was over
|
||||
//XXX and have set an attribute.
|
||||
|
||||
// if the click is on the tree proper, ignore it. We only care about clicks on items.
|
||||
|
||||
var tree = document.getElementById("bookmarksTree");
|
||||
if ( event.target == tree )
|
||||
return(true); // continue propagating the event
|
||||
|
||||
var childWithDatabase = tree;
|
||||
if ( ! childWithDatabase )
|
||||
return(false);
|
||||
|
||||
var dragStarted = false;
|
||||
|
||||
var trans =
|
||||
Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);
|
||||
if ( !trans ) return(false);
|
||||
|
||||
var genData =
|
||||
Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);
|
||||
if (!genData) return(false);
|
||||
|
||||
var genDataURL =
|
||||
Components.classes["component://netscape/supports-wstring"].createInstance(Components.interfaces.nsISupportsWString);
|
||||
if (!genDataURL) return(false);
|
||||
|
||||
trans.addDataFlavor("text/unicode");
|
||||
trans.addDataFlavor("moz/rdfitem");
|
||||
|
||||
// ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is
|
||||
// the target of the event.
|
||||
var id = event.target.parentNode.parentNode.getAttribute("ref");
|
||||
if (!id || id=="")
|
||||
{
|
||||
id = event.target.parentNode.parentNode.getAttribute("id");
|
||||
}
|
||||
dump("\n ID: " + id);
|
||||
|
||||
var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref");
|
||||
if (!parentID || parentID == "")
|
||||
{
|
||||
parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id");
|
||||
}
|
||||
dump(" Parent ID: " + parentID);
|
||||
|
||||
var trueID = id;
|
||||
if (parentID != null)
|
||||
{
|
||||
trueID += "\n" + parentID;
|
||||
}
|
||||
genData.data = trueID;
|
||||
genDataURL.data = id;
|
||||
|
||||
var database = childWithDatabase.database;
|
||||
var rdf =
|
||||
Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);
|
||||
if ((!rdf) || (!database)) { dump("CAN'T GET DATABASE\n"); return(false); }
|
||||
|
||||
// make sure its a bookmark, bookmark separator, or bookmark folder
|
||||
var src = rdf.GetResource(id, true);
|
||||
var prop = rdf.GetResource(RDF_NS + "type", true);
|
||||
var target = database.GetTarget(src, prop, true);
|
||||
|
||||
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
if (target) target = target.Value;
|
||||
if ((!target) || (target == "")) {dump("BAD\n"); return(false);}
|
||||
dump(" Type: '" + target + "'");
|
||||
|
||||
if ((target != NC_NS + "BookmarkSeparator") &&
|
||||
(target != NC_NS + "Bookmark") &&
|
||||
(target != NC_NS + "Folder")) return(false);
|
||||
|
||||
dump("genData is " + genData.data + " len is " + genData.data.length + "\n");
|
||||
trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data
|
||||
trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data
|
||||
|
||||
var transArray =
|
||||
Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
|
||||
if ( !transArray ) return(false);
|
||||
|
||||
// put it into the transferable as an |nsISupports|
|
||||
var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);
|
||||
transArray.AppendElement(genTrans);
|
||||
|
||||
var dragService =
|
||||
Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);
|
||||
if ( !dragService ) return(false);
|
||||
|
||||
var nsIDragService = Components.interfaces.nsIDragService;
|
||||
dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +
|
||||
nsIDragService.DRAGDROP_ACTION_MOVE );
|
||||
dragStarted = true;
|
||||
|
||||
return(!dragStarted);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function DragOverTree ( event )
|
||||
{
|
||||
var validFlavor = false;
|
||||
var dragSession = null;
|
||||
var retVal = true;
|
||||
|
||||
var dragService =
|
||||
Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);
|
||||
if ( !dragService ) return(false);
|
||||
|
||||
dragSession = dragService.getCurrentSession();
|
||||
if ( !dragSession ) return(false);
|
||||
|
||||
if ( dragSession.isDataFlavorSupported("moz/rdfitem") ) validFlavor = true;
|
||||
else if ( dragSession.isDataFlavorSupported("text/unicode") ) validFlavor = true;
|
||||
//XXX other flavors here...
|
||||
|
||||
// touch the attribute on the rowgroup to trigger the repaint with the drop feedback.
|
||||
if ( validFlavor )
|
||||
{
|
||||
var treeRoot = document.getElementById("bookmarksTree");
|
||||
if (!treeRoot) return(false);
|
||||
var treeDatabase = treeRoot.database;
|
||||
if (!treeDatabase) return(false);
|
||||
|
||||
//XXX this is really slow and likes to refresh N times per second.
|
||||
var rowGroup = event.target.parentNode.parentNode;
|
||||
var sortActive = treeRoot.getAttribute("sortActive");
|
||||
if (sortActive == "true")
|
||||
rowGroup.setAttribute ( "dd-triggerrepaintsorted", 0 );
|
||||
else
|
||||
rowGroup.setAttribute ( "dd-triggerrepaint", 0 );
|
||||
|
||||
dragSession.canDrop = true;
|
||||
// necessary??
|
||||
retVal = false;
|
||||
}
|
||||
return(retVal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function DropOnTree ( event )
|
||||
{
|
||||
var treeRoot = document.getElementById("bookmarksTree");
|
||||
if (!treeRoot) return(false);
|
||||
var treeDatabase = treeRoot.database;
|
||||
if (!treeDatabase) return(false);
|
||||
|
||||
// for beta1, don't allow D&D if sorting is active
|
||||
var sortActive = treeRoot.getAttribute("sortActive");
|
||||
if (sortActive == "true")
|
||||
{
|
||||
dump("Sorry, drag&drop is currently disabled when sorting is active.\n");
|
||||
return(false);
|
||||
}
|
||||
|
||||
var RDF =
|
||||
Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);
|
||||
if (!RDF) return(false);
|
||||
var RDFC =
|
||||
Components.classes["component://netscape/rdf/container"].getService(Components.interfaces.nsIRDFContainer);
|
||||
if (!RDFC) return(false);
|
||||
|
||||
var Bookmarks = RDF.GetDataSource("rdf:bookmarks");
|
||||
if (!Bookmarks) return(false);
|
||||
|
||||
// target is the <treecell>, and "ref/id" is on the <treeitem> two levels above
|
||||
var treeItem = event.target.parentNode.parentNode;
|
||||
if (!treeItem) return(false);
|
||||
|
||||
// get drop hint attributes
|
||||
var dropBefore = treeItem.getAttribute("dd-droplocation");
|
||||
var dropOn = treeItem.getAttribute("dd-dropon");
|
||||
|
||||
// calculate drop action
|
||||
var dropAction;
|
||||
if (dropBefore == "true") dropAction = "before";
|
||||
else if (dropOn == "true") dropAction = "on";
|
||||
else dropAction = "after";
|
||||
|
||||
// calculate parent container node
|
||||
var containerItem = treeItem;
|
||||
if (dropAction != "on")
|
||||
{
|
||||
containerItem = treeItem.parentNode.parentNode;
|
||||
}
|
||||
|
||||
// magical fix for bug # 33546: handle dropping after open container
|
||||
if (treeItem.getAttribute("container") == "true")
|
||||
{
|
||||
if (treeItem.getAttribute("open") == "true")
|
||||
{
|
||||
if (dropAction == "after")
|
||||
{
|
||||
dropAction = "before";
|
||||
containerItem = treeItem;
|
||||
|
||||
// find <treechildren>, drop before first child
|
||||
var treeChildren = treeItem;
|
||||
treeItem = null;
|
||||
for (var x = 0; x < treeChildren.childNodes.length; x++)
|
||||
{
|
||||
if (treeChildren.childNodes[x].tagName == "treechildren")
|
||||
{
|
||||
treeItem = treeChildren.childNodes[x].childNodes[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!treeItem)
|
||||
{
|
||||
dropAction = "on";
|
||||
containerItem = treeItem.parentNode.parentNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var targetID = getAbsoluteID("bookmarksTree", treeItem);
|
||||
if (!targetID) return(false);
|
||||
var targetNode = RDF.GetResource(targetID, true);
|
||||
if (!targetNode) return(false);
|
||||
|
||||
var containerID = getAbsoluteID("bookmarksTree", containerItem);
|
||||
if (!containerID) return(false);
|
||||
var containerNode = RDF.GetResource(containerID);
|
||||
if (!containerNode) return(false);
|
||||
|
||||
var dragService =
|
||||
Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);
|
||||
if ( !dragService ) return(false);
|
||||
|
||||
var dragSession = dragService.getCurrentSession();
|
||||
if ( !dragSession ) return(false);
|
||||
|
||||
var trans =
|
||||
Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);
|
||||
if ( !trans ) return(false);
|
||||
trans.addDataFlavor("moz/rdfitem");
|
||||
trans.addDataFlavor("text/x-moz-url");
|
||||
trans.addDataFlavor("text/unicode");
|
||||
|
||||
var typeRes = RDF.GetResource(RDF_NS + "type");
|
||||
if (!typeRes) return false;
|
||||
var bmTypeRes = RDF.GetResource(NC_NS + "Bookmark");
|
||||
if (!bmTypeRes) return false;
|
||||
|
||||
var dirty = false;
|
||||
|
||||
for ( var i = 0; i < dragSession.numDropItems; ++i )
|
||||
{
|
||||
dragSession.getData ( trans, i );
|
||||
var dataObj = new Object();
|
||||
var bestFlavor = new Object();
|
||||
var len = new Object();
|
||||
trans.getAnyTransferData ( bestFlavor, dataObj, len );
|
||||
if ( dataObj ) dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString);
|
||||
if ( !dataObj ) continue;
|
||||
|
||||
var sourceID = null;
|
||||
var parentID = null;
|
||||
var checkNameHack = false;
|
||||
var name=null;
|
||||
|
||||
if (bestFlavor.value == "moz/rdfitem")
|
||||
{
|
||||
// pull the URL out of the data object
|
||||
var data = dataObj.data.substring(0, len.value / 2);
|
||||
|
||||
// moz/rdfitem allows parent ID specified on next line; check for it
|
||||
var cr = data.indexOf("\n");
|
||||
if (cr >= 0)
|
||||
{
|
||||
sourceID = data.substr(0, cr);
|
||||
parentID = data.substr(cr+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceID = data;
|
||||
}
|
||||
}
|
||||
else if (bestFlavor.value == "text/x-moz-url")
|
||||
{
|
||||
// pull the URL out of the data object
|
||||
var data = dataObj.data.substring(0, len.value / 2);
|
||||
sourceID = data;
|
||||
|
||||
// we may need to synthesize a name (just use the URL)
|
||||
checkNameHack = true;
|
||||
}
|
||||
else if (bestFlavor.value == "text/unicode")
|
||||
{
|
||||
sourceID = dataObj.data;
|
||||
|
||||
// we may need to synthesize a name (just use the URL)
|
||||
checkNameHack = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// unknown flavor, skip
|
||||
continue;
|
||||
}
|
||||
|
||||
// pull the (optional) name out of the URL
|
||||
var space = sourceID.indexOf(" ");
|
||||
if (space >= 0)
|
||||
{
|
||||
name = sourceID.substr(space+1);
|
||||
sourceID = sourceID.substr(0, space);
|
||||
}
|
||||
|
||||
dump(" Node #" + i + ": drop '" + sourceID + "'\n");
|
||||
dump(" from container '" + parentID + "'\n");
|
||||
dump(" action = '" + dropAction + "'\n");
|
||||
dump(" target = '" + targetID + "'\n");
|
||||
if (name)
|
||||
{
|
||||
dump(" name = '" + name + "'\n");
|
||||
}
|
||||
|
||||
var sourceNode = RDF.GetResource(sourceID, true);
|
||||
if (!sourceNode) continue;
|
||||
|
||||
var parentNode = null;
|
||||
if (parentID != null)
|
||||
{
|
||||
parentNode = RDF.GetResource(parentID, true);
|
||||
}
|
||||
|
||||
// Prevent dropping of a node before, after, or on itself
|
||||
if (sourceNode == targetNode) continue;
|
||||
// Prevent dropping of a node onto its parent container
|
||||
if ((dropAction == "on") && (containerID) && (containerID == parentID)) continue;
|
||||
|
||||
RDFC.Init(Bookmarks, containerNode);
|
||||
|
||||
// make sure appropriate bookmark type is set
|
||||
var bmTypeNode = Bookmarks.GetTarget( sourceNode, typeRes, true );
|
||||
if (!bmTypeNode)
|
||||
{
|
||||
// set default bookmark type
|
||||
Bookmarks.Assert(sourceNode, typeRes, bmTypeRes, true);
|
||||
dump("Setting default bookmark type\n");
|
||||
}
|
||||
|
||||
if ((dropAction == "before") || (dropAction == "after"))
|
||||
{
|
||||
// drop before or after
|
||||
var nodeIndex;
|
||||
|
||||
nodeIndex = RDFC.IndexOf(sourceNode);
|
||||
|
||||
if (nodeIndex >= 1)
|
||||
{
|
||||
// moving a node around inside of the container
|
||||
// so remove, then re-add the node
|
||||
RDFC.RemoveElementAt(nodeIndex, true, sourceNode);
|
||||
}
|
||||
|
||||
nodeIndex = RDFC.IndexOf(targetNode);
|
||||
|
||||
if (nodeIndex < 1) return(false);
|
||||
if (dropAction == "after") ++nodeIndex;
|
||||
|
||||
RDFC.InsertElementAt(sourceNode, nodeIndex, true);
|
||||
|
||||
// select the newly added node
|
||||
if (parentID)
|
||||
{
|
||||
selectDroppedItems(treeRoot, containerID, sourceID);
|
||||
}
|
||||
|
||||
dirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// drop on
|
||||
RDFC.AppendElement(sourceNode);
|
||||
|
||||
// select the newly added node
|
||||
if (parentID)
|
||||
{
|
||||
selectDroppedItems(treeRoot, containerID, sourceID);
|
||||
}
|
||||
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
if ((checkNameHack == true) || (name != null))
|
||||
{
|
||||
var srcArc = RDF.GetResource(sourceID, true);
|
||||
var propArc = RDF.GetResource(NC_NS + "Name", true);
|
||||
if (srcArc && propArc && Bookmarks)
|
||||
{
|
||||
var targetArc = Bookmarks.GetTarget(srcArc, propArc, true);
|
||||
if (!targetArc)
|
||||
{
|
||||
// if no name, fallback to using the URL as the name
|
||||
var defaultNameArc = RDF.GetLiteral((name != null && name != "") ? name : sourceID);
|
||||
if (defaultNameArc)
|
||||
{
|
||||
Bookmarks.Assert(srcArc, propArc, defaultNameArc, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// should we move the node? (i.e. take it out of the source container?)
|
||||
if ((parentNode != null) && (containerNode != parentNode))
|
||||
{
|
||||
try
|
||||
{
|
||||
RDFC.Init(Bookmarks, parentNode);
|
||||
var nodeIndex = RDFC.IndexOf(sourceNode);
|
||||
|
||||
if (nodeIndex >= 1)
|
||||
{
|
||||
RDFC.RemoveElementAt(nodeIndex, true, sourceNode);
|
||||
}
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (dirty == true)
|
||||
{
|
||||
var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
|
||||
if (remote)
|
||||
{
|
||||
remote.Flush();
|
||||
dump("Wrote out bookmark changes.\n");
|
||||
}
|
||||
}
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function selectDroppedItems(treeRoot, containerID, targetID)
|
||||
{
|
||||
var select_list = treeRoot.getElementsByAttribute("id", targetID);
|
||||
for (var x=0; x<select_list.length; x++)
|
||||
{
|
||||
var node = select_list[x];
|
||||
if (!node) continue;
|
||||
|
||||
var parent = node.parentNode.parentNode;
|
||||
if (!parent) continue;
|
||||
|
||||
var id = parent.getAttribute("ref");
|
||||
if (!id || id=="")
|
||||
{
|
||||
id = parent.getAttribute("id");
|
||||
}
|
||||
if (!id || id=="") continue;
|
||||
|
||||
if (id == containerID)
|
||||
{
|
||||
treeRoot.selectItem(node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
en-US:bm-find.dtd
|
||||
en-US:bm-props.dtd
|
||||
en-US:bookmarks.dtd
|
||||
en-US:bookmark.properties
|
||||
@@ -1,4 +0,0 @@
|
||||
bm-find.dtd
|
||||
bm-props.dtd
|
||||
bookmark.properties
|
||||
bookmarks.dtd
|
||||
@@ -1,47 +0,0 @@
|
||||
<!--
|
||||
- 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.
|
||||
-
|
||||
- Original Author(s):
|
||||
- Robert John Churchill <rjc@netscape.com>
|
||||
-
|
||||
- Contributor(s):
|
||||
- Blake Ross <BlakeR1234@aol.com>
|
||||
-->
|
||||
|
||||
<!ENTITY window.title.label "Search Bookmarks/History">
|
||||
|
||||
<!ENTITY search1.label "Find items in ">
|
||||
<!ENTITY search2.label " whose ">
|
||||
|
||||
<!ENTITY search.button.label "Find">
|
||||
<!ENTITY save.button.label "Bookmark Find Query">
|
||||
|
||||
<!ENTITY bookmarks.label "Bookmarks">
|
||||
<!ENTITY history.label "History">
|
||||
|
||||
<!ENTITY name.label "Name">
|
||||
<!ENTITY url.label "URL">
|
||||
<!ENTITY shortcut.label "Custom Keyword">
|
||||
<!ENTITY description.label "Description">
|
||||
|
||||
<!ENTITY contains.label "contains">
|
||||
<!ENTITY startswith.label "starts with">
|
||||
<!ENTITY endswith.label "ends with">
|
||||
<!ENTITY is.label "is">
|
||||
<!ENTITY isnot.label "is not">
|
||||
<!ENTITY doesntcontain.label "doesn't contain">
|
||||
@@ -1,84 +0,0 @@
|
||||
<!--
|
||||
- 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>
|
||||
-->
|
||||
|
||||
<!ENTITY bookmarks.windowtitle.label "Properties">
|
||||
|
||||
<!ENTITY generalInfo.label "General Information">
|
||||
<!ENTITY generalInfo.accesskey "g">
|
||||
<!ENTITY schedule.label "Schedule">
|
||||
<!ENTITY schedule.accesskey "s">
|
||||
|
||||
<!ENTITY bookmarks.information.label "Information:">
|
||||
<!ENTITY bookmarks.name.label "Name:">
|
||||
<!ENTITY bookmarks.location.label "Location:">
|
||||
<!ENTITY bookmarks.shortcut.label "Custom Keyword:">
|
||||
<!ENTITY bookmarks.description.label "Description:">
|
||||
|
||||
<!ENTITY checkforupdates.legend.label "Check URL 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">
|
||||
@@ -1,66 +0,0 @@
|
||||
# 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):
|
||||
#
|
||||
|
||||
NewBookmark = New Bookmark
|
||||
DeleteBookmark = Delete Bookmark
|
||||
|
||||
NewFolder = New Folder
|
||||
DeleteFolder = Delete Folder
|
||||
|
||||
NewSeparator = New Separator
|
||||
DeleteSeparator = Delete Separator
|
||||
|
||||
SetNewBookmarkFolder = Set as New Bookmark Folder
|
||||
SetPersonalToolbarFolder = Set as Personal Toolbar Folder
|
||||
SetNewSearchFolder = Set as New Internet Search Folder
|
||||
|
||||
BookmarkProperties = Properties...
|
||||
|
||||
Import = Import...
|
||||
Export = Export...
|
||||
|
||||
ImportedIEFavorites = Imported IE Favorites
|
||||
ImportedNetPositiveBookmarks = Imported NetPositive Bookmarks
|
||||
|
||||
DefaultPersonalToolbarFolder = Personal Toolbar Folder
|
||||
|
||||
NewBookmarkURLPrompt = Enter a URL for the new bookmark:
|
||||
NewBookmarkNamePrompt = Enter a name for the new bookmark:
|
||||
NewFolderNamePrompt = Enter a name for the new folder:
|
||||
|
||||
NeedValidURL = Please enter a valid, fully qualified URL.
|
||||
|
||||
SelectImport = Import bookmark file:
|
||||
EnterExport = Export bookmark file:
|
||||
|
||||
DeleteItem = Delete the selected item?
|
||||
DeleteItems = Delete the selected items?
|
||||
|
||||
WebPageUpdated = The following web page has been updated:
|
||||
WebPageTitle = Title:
|
||||
WebPageURL = URL:
|
||||
WebPageAskDisplay = Would you like to display it?
|
||||
WebPageAskStopOption = Stop checking for updates on this web page
|
||||
|
||||
pleaseEnterALocation = Please enter a location
|
||||
pleaseEnterADuration = Please enter a duration.
|
||||
pleaseSelectANotification = Please enter at least one notification method.
|
||||
|
||||
SortMenuItem = Sorted by %NAME%
|
||||
@@ -1,56 +0,0 @@
|
||||
<!--
|
||||
- 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>
|
||||
-->
|
||||
|
||||
<!-- extracted from ./bookmarks.xul -->
|
||||
|
||||
<!ENTITY menuitem.newBookmark.label "New Bookmark">
|
||||
<!ENTITY menuitem.newBookmark.accesskey "N">
|
||||
<!ENTITY menuitem.newFolder.label "New Folder">
|
||||
<!ENTITY menuitem.newSeparator.label "New Separator">
|
||||
<!ENTITY menuitem.saveas.label "Save As...">
|
||||
<!ENTITY menuitem.saveas.accesskey "S">
|
||||
<!ENTITY file.saveas.keybinding "s">
|
||||
<!ENTITY menuitem.import.label "Import Bookmarks...">
|
||||
<!ENTITY menuitem.export.label "Export Bookmarks...">
|
||||
<!ENTITY menuitem.find.label "Find in Bookmarks...">
|
||||
<!ENTITY menuitem.find.accesskey "F">
|
||||
<!ENTITY edit.find.keybinding "f">
|
||||
<!ENTITY menuitem.properties.label "Properties...">
|
||||
<!ENTITY menuitem.properties.accesskey "o">
|
||||
<!ENTITY edit.properties.keybinding "e">
|
||||
|
||||
<!ENTITY menuitem.view.unsorted.label "Unsorted">
|
||||
<!ENTITY menuitem.view.ascending.label "A > Z Sort Order">
|
||||
<!ENTITY menuitem.view.descending.label "Z > A Sort Order">
|
||||
<!ENTITY menuitem.view.show_columns.label "Show columns">
|
||||
<!ENTITY menuitem.newbookmarkfolder.label "Set as New Bookmark Folder">
|
||||
<!ENTITY menuitem.newinternetsearchfolder.label "Set as New Internet Search Folder">
|
||||
<!ENTITY menuitem.personaltoolbarfolder.label "Set as Personal Toolbar Folder">
|
||||
|
||||
<!ENTITY tree.header.name.label "Name">
|
||||
<!-- LOCALIZATION NOTE (tree.header.url.label) : DONT_TRANSLATE -->
|
||||
<!ENTITY tree.header.url.label "URL">
|
||||
<!ENTITY tree.header.shortcut.label "Custom Keyword">
|
||||
<!ENTITY tree.header.addedon.label "Added On">
|
||||
<!ENTITY tree.header.lastmod.label "Last Modified">
|
||||
<!ENTITY tree.header.lastvisit.label "Last Visit">
|
||||
<!ENTITY tree.header.description.label "Description">
|
||||
<!ENTITY bookmarksWindowTitle.label "Manage Bookmarks">
|
||||
@@ -1,24 +0,0 @@
|
||||
#!nmake
|
||||
# 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 Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
DEPTH = ..\..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,27 +0,0 @@
|
||||
#!nmake
|
||||
# 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 Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ..\..\..\..\..
|
||||
|
||||
DIRS = en-US
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,50 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
DIRS= locale
|
||||
|
||||
CHROME_DIR = .
|
||||
CHROME_CONTENT_DIR = packages\core\communicator\content\bookmarks
|
||||
CHROME_L10N_DIR = locales\en-US\communicator\locale\bookmarks
|
||||
|
||||
CHROME_CONTENT = \
|
||||
.\bm-find.js \
|
||||
.\bm-find.xul \
|
||||
.\bm-panel.js \
|
||||
.\bm-panel.xul \
|
||||
.\bm-props.js \
|
||||
.\bm-props.xul \
|
||||
.\bookmarks.js \
|
||||
.\bookmarksDD.js \
|
||||
.\bookmarks.xul \
|
||||
$(NULL)
|
||||
|
||||
CHROME_L10N = \
|
||||
.\locale\en-US\bm-find.dtd \
|
||||
.\locale\en-US\bm-props.dtd \
|
||||
.\locale\en-US\bookmarks.dtd \
|
||||
.\locale\en-US\bookmark.properties \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# 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):
|
||||
|
||||
packages/core.jar:
|
||||
communicator/content/bookmarks/bm-find.js
|
||||
communicator/content/bookmarks/bm-find.xul
|
||||
communicator/content/bookmarks/bm-panel.js
|
||||
communicator/content/bookmarks/bm-panel.xul
|
||||
communicator/content/bookmarks/bm-props.js
|
||||
communicator/content/bookmarks/bm-props.xul
|
||||
communicator/content/bookmarks/bookmarks.js
|
||||
communicator/content/bookmarks/bookmarksDD.js
|
||||
communicator/content/bookmarks/bookmarks.xul
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = appcomps
|
||||
LIBRARY_NAME = bookmarks_s
|
||||
|
||||
CPPSRCS = nsBookmarksService.cpp
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
# static lib.
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
MODULE=appcomps
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsBookmarksService.obj \
|
||||
$(NULL)
|
||||
|
||||
LIBRARY_NAME=bookmarks_s
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,206 +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.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):
|
||||
*/
|
||||
|
||||
#ifndef bookmarksservice___h___
|
||||
#define bookmarksservice___h___
|
||||
|
||||
#include "nsIRDFDataSource.h"
|
||||
#include "nsIRDFRemoteDataSource.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIRDFObserver.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsIRDFNode.h"
|
||||
#include "nsIBookmarksService.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIFileSpec.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef XP_MAC
|
||||
#include <Timer.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class nsBookmarksService : public nsIBookmarksService,
|
||||
public nsIRDFDataSource,
|
||||
public nsIRDFRemoteDataSource,
|
||||
public nsIStreamListener,
|
||||
public nsIRDFObserver
|
||||
{
|
||||
protected:
|
||||
nsIRDFDataSource* mInner;
|
||||
PRBool mBookmarksAvailable;
|
||||
PRBool mDirty;
|
||||
PRBool busySchedule;
|
||||
nsCOMPtr<nsIRDFResource> busyResource;
|
||||
PRUint32 htmlSize;
|
||||
nsCOMPtr<nsISupportsArray> mObservers;
|
||||
nsCOMPtr<nsIStringBundle> mBundle;
|
||||
nsString mPersonalToolbarName;
|
||||
PRInt32 mUpdateBatchNest;
|
||||
static nsCOMPtr<nsITimer> mTimer;
|
||||
|
||||
#ifdef XP_MAC
|
||||
PRBool mIEFavoritesAvailable;
|
||||
|
||||
nsresult ReadFavorites();
|
||||
#endif
|
||||
|
||||
static void FireTimer(nsITimer* aTimer, void* aClosure);
|
||||
nsresult ExamineBookmarkSchedule(nsIRDFResource *theBookmark, PRBool & examineFlag);
|
||||
nsresult GetBookmarkToPing(nsIRDFResource **theBookmark);
|
||||
|
||||
nsresult GetBookmarksFile(nsFileSpec* aResult);
|
||||
nsresult WriteBookmarks(nsFileSpec *bookmarksFile, nsIRDFDataSource *ds, nsIRDFResource *root);
|
||||
nsresult WriteBookmarksContainer(nsIRDFDataSource *ds, nsOutputFileStream strm, nsIRDFResource *container, PRInt32 level, nsISupportsArray *parentArray);
|
||||
nsresult GetTextForNode(nsIRDFNode* aNode, nsString& aResult);
|
||||
nsresult UpdateBookmarkLastModifiedDate(nsIRDFResource *aSource);
|
||||
nsresult WriteBookmarkProperties(nsIRDFDataSource *ds, nsOutputFileStream strm, nsIRDFResource *node,
|
||||
nsIRDFResource *property, const char *htmlAttrib, PRBool isFirst);
|
||||
PRBool CanAccept(nsIRDFResource* aSource, nsIRDFResource* aProperty, nsIRDFNode* aTarget);
|
||||
|
||||
nsresult getArgumentN(nsISupportsArray *arguments, nsIRDFResource *res, PRInt32 offset, nsIRDFNode **argValue);
|
||||
nsresult insertBookmarkItem(nsIRDFResource *src, nsISupportsArray *aArguments, PRInt32 parentArgIndex, nsIRDFResource *objType);
|
||||
nsresult deleteBookmarkItem(nsIRDFResource *src, nsISupportsArray *aArguments, PRInt32 parentArgIndex, nsIRDFResource *objType);
|
||||
nsresult setFolderHint(nsIRDFResource *src, nsIRDFResource *objType);
|
||||
nsresult getFolderViaHint(nsIRDFResource *src, PRBool fallbackFlag, nsIRDFResource **folder);
|
||||
nsresult importBookmarks(nsISupportsArray *aArguments);
|
||||
nsresult exportBookmarks(nsISupportsArray *aArguments);
|
||||
|
||||
nsresult getResourceFromLiteralNode(nsIRDFNode *node, nsIRDFResource **res);
|
||||
|
||||
nsresult ChangeURL(nsIRDFResource* aOldURL,
|
||||
nsIRDFResource* aNewURL);
|
||||
|
||||
nsresult getLocaleString(const char *key, nsString &str);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_DECL_NSISTREAMOBSERVER
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_DECL_NSISTREAMLISTENER
|
||||
|
||||
public:
|
||||
nsBookmarksService();
|
||||
virtual ~nsBookmarksService();
|
||||
nsresult Init();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIBookmarksService
|
||||
NS_DECL_NSIBOOKMARKSSERVICE
|
||||
|
||||
// nsIRDFDataSource
|
||||
NS_IMETHOD GetURI(char* *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 Change(nsIRDFResource* aSource,
|
||||
nsIRDFResource* aProperty,
|
||||
nsIRDFNode* aOldTarget,
|
||||
nsIRDFNode* aNewTarget);
|
||||
|
||||
NS_IMETHOD Move(nsIRDFResource* aOldSource,
|
||||
nsIRDFResource* aNewSource,
|
||||
nsIRDFResource* aProperty,
|
||||
nsIRDFNode* aTarget);
|
||||
|
||||
NS_IMETHOD HasAssertion(nsIRDFResource* source,
|
||||
nsIRDFResource* property,
|
||||
nsIRDFNode* target,
|
||||
PRBool tv,
|
||||
PRBool* hasAssertion);
|
||||
|
||||
NS_IMETHOD AddObserver(nsIRDFObserver* aObserver);
|
||||
NS_IMETHOD RemoveObserver(nsIRDFObserver* aObserver);
|
||||
|
||||
NS_IMETHOD HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, PRBool *_retval);
|
||||
NS_IMETHOD HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *_retval);
|
||||
|
||||
NS_IMETHOD ArcLabelsIn(nsIRDFNode* node,
|
||||
nsISimpleEnumerator** labels) {
|
||||
return mInner->ArcLabelsIn(node, labels);
|
||||
}
|
||||
|
||||
NS_IMETHOD ArcLabelsOut(nsIRDFResource* source,
|
||||
nsISimpleEnumerator** labels);
|
||||
|
||||
NS_IMETHOD GetAllResources(nsISimpleEnumerator** aResult);
|
||||
|
||||
NS_IMETHOD GetAllCommands(nsIRDFResource* source,
|
||||
nsIEnumerator/*<nsIRDFResource>*/** commands);
|
||||
|
||||
NS_IMETHOD GetAllCmds(nsIRDFResource* source,
|
||||
nsISimpleEnumerator/*<nsIRDFResource>*/** commands);
|
||||
|
||||
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
PRBool* aResult);
|
||||
|
||||
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments);
|
||||
|
||||
// nsIRDFRemoteDataSource
|
||||
NS_DECL_NSIRDFREMOTEDATASOURCE
|
||||
|
||||
// nsIRDFObserver
|
||||
NS_DECL_NSIRDFOBSERVER
|
||||
};
|
||||
|
||||
#endif // bookmarksservice___h___
|
||||
@@ -1,67 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = appcomps
|
||||
LIBRARY_NAME = appcomps
|
||||
IS_COMPONENT = 1
|
||||
|
||||
CPPSRCS = nsModule.cpp
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libautocomplete_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libbookmarks_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libdirectory_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libhistory_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/librelated_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libsearch_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libtimebomb_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/liburlbarhistory_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_PERF_METRICS
|
||||
SHARED_LIBRARY_LIBS += $(DIST)/lib/libmozutil_s.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir)/../autocomplete/src \
|
||||
-I$(srcdir)/../bookmarks/src \
|
||||
-I$(srcdir)/../directory \
|
||||
-I$(srcdir)/../history/src \
|
||||
-I$(srcdir)/../related/src \
|
||||
-I$(srcdir)/../search/src \
|
||||
-I$(srcdir)/../timebomb \
|
||||
-I$(srcdir)/../urlbarhistory/src \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE=appcomps
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
DLLNAME=appcomps
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
LCFLAGS = -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsModule.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\timer_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\autocomplete_s.lib \
|
||||
$(DIST)\lib\bookmarks_s.lib \
|
||||
$(DIST)\lib\directory_s.lib \
|
||||
$(DIST)\lib\history_s.lib \
|
||||
$(DIST)\lib\related_s.lib \
|
||||
$(DIST)\lib\search_s.lib \
|
||||
$(DIST)\lib\timebomb_s.lib \
|
||||
$(DIST)\lib\urlbarhistory_s.lib \
|
||||
$(DIST)\lib\urlwidgt_s.lib \
|
||||
$(DIST)\lib\winhooks_s.lib \
|
||||
$(NULL)
|
||||
|
||||
INCS = $(INCS) \
|
||||
-I$(DEPTH)\xpfe\components\autocomplete\src \
|
||||
-I$(DEPTH)\xpfe\components\bookmarks\src \
|
||||
-I$(DEPTH)\xpfe\components\directory \
|
||||
-I$(DEPTH)\xpfe\components\history\src \
|
||||
-I$(DEPTH)\xpfe\components\related\src \
|
||||
-I$(DEPTH)\xpfe\components\search\src \
|
||||
-I$(DEPTH)\xpfe\components\timebomb \
|
||||
-I$(DEPTH)\xpfe\components\urlbarhistory\src \
|
||||
-I$(DEPTH)\xpfe\components\urlwidget \
|
||||
-I$(DEPTH)\xpfe\components\winhooks \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
$(RM) $(DIST)\bin\components\$(DLLNAME).dll
|
||||
$(RM) $(DIST)\lib\$(DLLNAME).lib
|
||||
@@ -1,97 +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.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):
|
||||
*/
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsAutoComplete.h"
|
||||
#include "nsBookmarksService.h"
|
||||
#include "nsDirectoryViewer.h"
|
||||
#include "nsGlobalHistory.h"
|
||||
#include "nsLocalSearchService.h"
|
||||
#include "nsInternetSearchService.h"
|
||||
#include "nsRelatedLinksHandlerImpl.h"
|
||||
#include "nsTimeBomb.h"
|
||||
#include "nsUrlbarHistory.h"
|
||||
#ifdef XP_PC
|
||||
#include "nsUrlWidget.h"
|
||||
#include "nsWindowsHooks.h"
|
||||
#endif // XP_PC
|
||||
|
||||
// Factory constructors
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteItem)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteResults)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHTTPIndex, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirectoryViewerFactory)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGlobalHistory, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(LocalSearchDataSource, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(InternetSearchDataSource, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(RelatedLinksHandlerImpl, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimeBomb)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlbarHistory)
|
||||
#ifdef XP_PC
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlWidget, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks)
|
||||
#endif //
|
||||
|
||||
static nsModuleComponentInfo components[] = {
|
||||
{ "AutoComplete Search Results", NS_AUTOCOMPLETERESULTS_CID, NS_AUTOCOMPLETERESULTS_PROGID,
|
||||
nsAutoCompleteResultsConstructor},
|
||||
{ "AutoComplete Search Item", NS_AUTOCOMPLETEITEM_CID, NS_AUTOCOMPLETEITEM_PROGID,
|
||||
nsAutoCompleteItemConstructor},
|
||||
{ "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_SERVICE_PROGID,
|
||||
nsBookmarksServiceConstructor },
|
||||
{ "Bookmarks", NS_BOOKMARKS_SERVICE_CID, NS_BOOKMARKS_DATASOURCE_PROGID,
|
||||
nsBookmarksServiceConstructor },
|
||||
{ "Directory Viewer", NS_DIRECTORYVIEWERFACTORY_CID,
|
||||
NS_DOCUMENT_LOADER_FACTORY_PROGID_PREFIX "view/application/http-index-format",
|
||||
nsDirectoryViewerFactoryConstructor },
|
||||
{ "Directory Viewer", NS_HTTPINDEX_SERVICE_CID, NS_HTTPINDEX_SERVICE_PROGID,
|
||||
nsHTTPIndexConstructor },
|
||||
{ "Directory Viewer", NS_HTTPINDEX_SERVICE_CID, NS_HTTPINDEX_DATASOURCE_PROGID,
|
||||
nsHTTPIndexConstructor },
|
||||
{ "Global History", NS_GLOBALHISTORY_CID, NS_GLOBALHISTORY_PROGID,
|
||||
nsGlobalHistoryConstructor },
|
||||
{ "Global History", NS_GLOBALHISTORY_CID, NS_GLOBALHISTORY_DATASOURCE_PROGID,
|
||||
nsGlobalHistoryConstructor },
|
||||
{ "Local Search", NS_RDFFINDDATASOURCE_CID,
|
||||
NS_LOCALSEARCH_SERVICE_PROGID, LocalSearchDataSourceConstructor },
|
||||
{ "Local Search", NS_RDFFINDDATASOURCE_CID,
|
||||
NS_LOCALSEARCH_DATASOURCE_PROGID, LocalSearchDataSourceConstructor },
|
||||
{ "Internet Search", NS_RDFSEARCHDATASOURCE_CID,
|
||||
NS_INTERNETSEARCH_SERVICE_PROGID, InternetSearchDataSourceConstructor },
|
||||
{ "Internet Search", NS_RDFSEARCHDATASOURCE_CID,
|
||||
NS_INTERNETSEARCH_DATASOURCE_PROGID, InternetSearchDataSourceConstructor },
|
||||
{ "Related Links Handler", NS_RELATEDLINKSHANDLER_CID, NS_RELATEDLINKSHANDLER_PROGID,
|
||||
RelatedLinksHandlerImplConstructor},
|
||||
{ "Netscape TimeBomb", NS_TIMEBOMB_CID, NS_TIMEBOMB_PROGID, nsTimeBombConstructor},
|
||||
{ "nsUrlbarHistory", NS_URLBARHISTORY_CID,
|
||||
NS_URLBARHISTORY_PROGID, nsUrlbarHistoryConstructor },
|
||||
{ "nsUrlbarHistory", NS_URLBARHISTORY_CID,
|
||||
NS_URLBARAUTOCOMPLETE_PROGID, nsUrlbarHistoryConstructor },
|
||||
#ifdef XP_PC
|
||||
{ NS_IURLWIDGET_CLASSNAME, NS_IURLWIDGET_CID, NS_IURLWIDGET_PROGID,
|
||||
nsUrlWidgetConstructor },
|
||||
{ NS_IWINDOWSHOOKS_CLASSNAME, NS_IWINDOWSHOOKS_CID, NS_IWINDOWSHOOKS_PROGID,
|
||||
nsWindowsHooksConstructor },
|
||||
#endif // XP_PC
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE("application", components)
|
||||
@@ -1 +0,0 @@
|
||||
jsconsole-clhandler.js
|
||||
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = resources
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
install::
|
||||
$(INSTALL) $(srcdir)/jsconsole-clhandler.js $(DIST)/bin/components
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* 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 Netscape are
|
||||
* Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Martijn Pieters <mj@digicool.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* -jsconsole commandline handler; starts up the JavaScript console.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const JSCONSOLEHANDLER_PROGID =
|
||||
"component://netscape/commandlinehandler/general-startup-jsconsole";
|
||||
|
||||
const JSCONSOLEHANDLER_CID =
|
||||
Components.ID('{1698ef18-c128-41a1-b4d0-7f9acd2ae86c}');
|
||||
|
||||
/*
|
||||
* Classes
|
||||
*/
|
||||
|
||||
/* jsConsoleHandler class constructor */
|
||||
function jsConsoleHandler() {}
|
||||
|
||||
/* jsConsoleHandler class def */
|
||||
jsConsoleHandler.prototype = {
|
||||
commandLineArgument: '-jsconsole',
|
||||
prefNameForStartup: 'general.startup.jsconsole',
|
||||
chromeUrlForTask: 'chrome://global/content/console.xul',
|
||||
helpText: 'Start with Javascript Console',
|
||||
handlesArgs: false,
|
||||
defaultArgs: null,
|
||||
openWindowWithArgs: false
|
||||
};
|
||||
|
||||
/*
|
||||
* Objects
|
||||
*/
|
||||
|
||||
/* jsConsoleHandler Module (for XPCOM registration) */
|
||||
var jsConsoleHandlerModule = {
|
||||
registerSelf: function(compMgr, fileSpec, location, type) {
|
||||
compMgr.registerComponentWithType(JSCONSOLEHANDLER_CID,
|
||||
'JS Console Commandline Handler component',
|
||||
JSCONSOLEHANDLER_PROGID, fileSpec,
|
||||
location, true, true, type);
|
||||
var catman = Components.classes["mozilla.categorymanager.1"]
|
||||
.getService(Components.interfaces.nsICategoryManager);
|
||||
catman.addCategoryEntry("command-line-argument-handlers", "jsconsole command line handler",
|
||||
JSCONSOLEHANDLER_PROGID,
|
||||
true, true);
|
||||
},
|
||||
|
||||
unregisterSelf: function(compMgr, fileSpec, location) {
|
||||
compMgr.unregisterComponentSpec(JSCONSOLEHANDLER_CID, fileSpec);
|
||||
var catman = Components.classes["mozilla.categorymanager.1"]
|
||||
.getService(Components.interfaces.nsICategoryManager);
|
||||
catman.deleteCategoryEntry("command-line-argument-handlers",
|
||||
JSCONSOLEHANDLER_PROGID, true);
|
||||
},
|
||||
|
||||
getClassObject: function(compMgr, cid, iid) {
|
||||
if (!cid.equals(JSCONSOLEHANDLER_CID))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
|
||||
if (!iid.equals(Components.interfaces.nsIFactory))
|
||||
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
return jsConsoleHandlerFactory;
|
||||
},
|
||||
|
||||
canUnload: function(compMgr) { return true; }
|
||||
};
|
||||
|
||||
/* jsConsoleHandler Class Factory */
|
||||
var jsConsoleHandlerFactory = {
|
||||
createInstance: function(outer, iid) {
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
if (!iid.equals(Components.interfaces.nsICmdLineHandler) &&
|
||||
!iid.equals(Components.interfaces.nsISupports))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
return new jsConsoleHandler();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
/* module initialisation */
|
||||
function NSGetModule(comMgr, fileSpec) { return jsConsoleHandlerModule; }
|
||||
|
||||
// vim:sw=4:sr:sta:et:sts:
|
||||
@@ -1,33 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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):
|
||||
|
||||
# copied in part from ../timebomb/makefile.win
|
||||
|
||||
DEPTH = ..\..\..
|
||||
|
||||
include <$(DEPTH)/config/config.mak>
|
||||
|
||||
DIRS = resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: jsconsole-clhandler.js
|
||||
!@$(MAKE_INSTALL) $** $(DIST)\bin\components
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = content locale
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
console.js
|
||||
console.xul
|
||||
console.css
|
||||
consoleBindings.xml
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# 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):
|
||||
# Axel Hecht <axel@pike.org>
|
||||
#
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
CHROME_DIR = packages/widget-toolkit
|
||||
CHROME_CONTENT_DIR = global/content
|
||||
|
||||
CHROME_CONTENT = \
|
||||
console.js \
|
||||
console.xul \
|
||||
console.css \
|
||||
consoleBindings.xml \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
.treecell-error
|
||||
{
|
||||
behavior : url("chrome://global/content/consoleBindings.xml#errormsg");
|
||||
}
|
||||
|
||||
#console[mode="errors"] > treechildren > treeitem > treerow > treecell[type="warning"]
|
||||
{
|
||||
display : none;
|
||||
}
|
||||
|
||||
#console[mode="warnings"] > treechildren > treeitem > treerow > treecell[type="error"]
|
||||
{
|
||||
display : none;
|
||||
}
|
||||
|
||||
@@ -1,289 +0,0 @@
|
||||
/* -*- Mode: Java; 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.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):
|
||||
*/
|
||||
|
||||
var bundle;
|
||||
|
||||
/*
|
||||
* Functions for initializing and updating the JavaScript Console.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Listener to be registered with the console service, called on new errors.
|
||||
*/
|
||||
var consoleListener = {
|
||||
observe : function(messageObject) {
|
||||
appendMessage(messageObject);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Keeps the number of errors to prevent leak
|
||||
*/
|
||||
var num_errors=0;
|
||||
|
||||
/*
|
||||
* Gets the current context of the console service and dumps it to the window,
|
||||
* and registers a listener with the service to be called on additional errors.
|
||||
*/
|
||||
function onLoadJSConsole()
|
||||
{
|
||||
try {
|
||||
var cs_class = Components.classes['mozilla.consoleservice.1'];
|
||||
var cs_iface = Components.interfaces.nsIConsoleService;
|
||||
var cs_isupports = cs_class.getService();
|
||||
var cs = cs_isupports.QueryInterface(cs_iface);
|
||||
} catch(exn) {
|
||||
// Couldn't get the console service for some reason...
|
||||
// pretend it never happened.
|
||||
|
||||
appendMessage({ message:
|
||||
"Unable to display errors - " +
|
||||
"couldn't get Console Service component. " +
|
||||
"(Missing mozilla.consoleservice.1)" });
|
||||
return;
|
||||
}
|
||||
|
||||
var o1 = {}; // Throwaway references to support 'out' parameters.
|
||||
var o2 = {};
|
||||
|
||||
var messages;
|
||||
cs.getMessageArray(o1, o2);
|
||||
messages = o1.value;
|
||||
|
||||
// In case getMessageArray returns 0-length array as null.
|
||||
if (messages == null)
|
||||
messages = [];
|
||||
|
||||
var i;
|
||||
var cleared=0;
|
||||
|
||||
//Checks if console ever been cleared
|
||||
for (i = messages.length-1; i >=0 ; i--) {
|
||||
if (messages[i].message == "__CLEAR__") {
|
||||
cleared = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Populates tree with error messages after latest "clear"
|
||||
for(i = cleared; i < messages.length; i++) {
|
||||
appendMessage(messages[i]);
|
||||
}
|
||||
|
||||
cs.registerListener(consoleListener);
|
||||
|
||||
bundle = srGetStrBundle("chrome://global/locale/console.properties");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onUnloadJSConsole()
|
||||
{
|
||||
// keep a global ref. to it instead???
|
||||
|
||||
try {
|
||||
var cs_class = Components.classes['mozilla.consoleservice.1'];
|
||||
var cs_iface = Components.interfaces.nsIConsoleService;
|
||||
var cs_isupports = cs_class.getService();
|
||||
var cs = cs_isupports.QueryInterface(cs_iface);
|
||||
} catch(exn) {
|
||||
// Couldn't get the console service for some reason...
|
||||
// pretend it never happened.
|
||||
return;
|
||||
}
|
||||
|
||||
cs.unregisterListener(consoleListener);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
gErrorCount = 0;
|
||||
gWarningCount = 0;
|
||||
|
||||
/*
|
||||
* Given a message, write it to the page.
|
||||
*
|
||||
* TODO: (When interesting subclasses of message objects become available) -
|
||||
* reflect structure of messages (e.g. lineno, etc.) as CSS-decorable structure.
|
||||
*/
|
||||
function appendMessage(messageObject)
|
||||
{
|
||||
|
||||
if(messageObject.message == "__CLEAR__") {return;}
|
||||
var c = document.getElementById("consoleTreeChildren");
|
||||
var item = document.createElement("treeitem");
|
||||
var row = document.createElement("treerow");
|
||||
var cell = document.createElement("treecell");
|
||||
cell.setAttribute("class", "treecell-error");
|
||||
var msgContent;
|
||||
var text;
|
||||
try {
|
||||
// Try to QI it to a script error to get more info.
|
||||
var nsIScriptError = Components.interfaces.nsIScriptError;
|
||||
var scriptError =
|
||||
messageObject.QueryInterface(nsIScriptError);
|
||||
|
||||
// Is this error actually just a non-fatal warning?
|
||||
var warning = scriptError.flags & nsIScriptError.warningFlag != 0;
|
||||
|
||||
// Is this error or warning a result of JavaScript's strict mode,
|
||||
// and therefore something we might decide to be lenient about?
|
||||
var strict = scriptError.flags & nsIScriptError.strictFlag != 0;
|
||||
|
||||
// If true, this error led to the creation of a (catchable!) javascript
|
||||
// exception, and should probably be ignored.
|
||||
// This is worth checking, as I'm not sure how the behavior falls
|
||||
// out. Does an uncaught exception result in this flag being raised?
|
||||
var isexn = scriptError.flags & nsIScriptError.exceptionFlag != 0;
|
||||
|
||||
/*
|
||||
* It'd be nice to do something graphical with our column information,
|
||||
* like what the old js console did, and the js shell does:
|
||||
* js> var scooby = "I am an unterminated string!
|
||||
* 1: unterminated string literal:
|
||||
* 1: var scooby = "I am an unterminated string!
|
||||
* 1: .............^
|
||||
*
|
||||
* But for now, I'm just pushing it out the door.
|
||||
*/
|
||||
|
||||
cell.setAttribute("type", warning ? "warning" : "error");
|
||||
// XXX localize
|
||||
cell.setAttribute("typetext", warning ? "Warning: " : "Error: ");
|
||||
cell.setAttribute("url", scriptError.sourceName);
|
||||
cell.setAttribute("line", scriptError.lineNumber);
|
||||
cell.setAttribute("col", scriptError.columnNumber);
|
||||
cell.setAttribute("msg", scriptError.message);
|
||||
cell.setAttribute("error", scriptError.sourceLine);
|
||||
|
||||
} catch (exn) {
|
||||
// dump(exn + '\n');
|
||||
// QI failed, just try to treat it as an nsIConsoleMessage
|
||||
cell.setAttribute("msg", messageObject.message);
|
||||
}
|
||||
row.appendChild(cell);
|
||||
item.appendChild(row);
|
||||
c.appendChild(item);
|
||||
|
||||
/*
|
||||
var warningBroadcaster = document.getElementById("Console:ShowWarnings");
|
||||
var errorBroadcaster = document.getElementById("Console:ShowErrors");
|
||||
var allBroadcaster = document.getElementById("Console:ShowAll");
|
||||
if (warning) gWarningCount++;
|
||||
else gErrorCount++;
|
||||
|
||||
warningBroadcaster.setAttribute("value",
|
||||
(bundle.GetStringFromName("warningsLabel") + " (" + gWarningCount + ")"));
|
||||
errorBroadcaster.setAttribute("value",
|
||||
(bundle.GetStringFromName("errorsLabel") + " (" + gErrorCount + ")"));
|
||||
allBroadcaster.setAttribute("value",
|
||||
(bundle.GetStringFromName("allMsgsLabel") + " (" + (gErrorCount + gWarningCount) + ")"));
|
||||
*/
|
||||
|
||||
num_errors++;
|
||||
|
||||
//Deletes top error if error console is long
|
||||
if(num_errors>250) { deleteOne(); }
|
||||
|
||||
}
|
||||
|
||||
function changeMode (aMode, aElement)
|
||||
{
|
||||
var broadcaster = document.getElementById(aElement.getAttribute("observes"));
|
||||
var bcset = document.getElementById("broadcasterset");
|
||||
var tree = document.getElementById("console");
|
||||
switch (aMode) {
|
||||
case "clear":
|
||||
clear();
|
||||
return;
|
||||
case "errors":
|
||||
tree.setAttribute("mode", "errors");
|
||||
break;
|
||||
case "warnings":
|
||||
tree.setAttribute("mode", "warnings");
|
||||
break;
|
||||
default:
|
||||
case "all":
|
||||
tree.removeAttribute("mode");
|
||||
break;
|
||||
}
|
||||
|
||||
for (var i = 0; i < bcset.childNodes.length; i++) {
|
||||
bcset.childNodes[i].removeAttribute("toggled");
|
||||
bcset.childNodes[i].removeAttribute("checked");
|
||||
}
|
||||
broadcaster.setAttribute("toggled", "true");
|
||||
broadcaster.setAttribute("checked", "true");
|
||||
}
|
||||
|
||||
/*
|
||||
* If clear selected, __CLEAR__ message is logged to service and window cleared
|
||||
* When console next run, will only list messages after the latest"__CLEAR__"
|
||||
* message.
|
||||
*/
|
||||
function clear ()
|
||||
{
|
||||
|
||||
try {
|
||||
var cs_class = Components.classes['mozilla.consoleservice.1'];
|
||||
var cs_iface = Components.interfaces.nsIConsoleService;
|
||||
var cs_isupports = cs_class.getService();
|
||||
var cs = cs_isupports.QueryInterface(cs_iface);
|
||||
} catch(exn) {
|
||||
// Couldn't get the console service for some reason...
|
||||
// pretend it never happened.
|
||||
return;
|
||||
}
|
||||
|
||||
cs.logStringMessage("__CLEAR__");
|
||||
|
||||
var tree = document.getElementById("console");
|
||||
var treeChildren = document.getElementById("consoleTreeChildren");
|
||||
|
||||
tree.removeChild(treeChildren);
|
||||
|
||||
treeChildren = document.createElement ("treechildren");
|
||||
treeChildren.setAttribute ("id", "consoleTreeChildren");
|
||||
treeChildren.setAttribute ("flex", "1");
|
||||
tree.appendChild(treeChildren);
|
||||
|
||||
|
||||
num_errors=0;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to help prevent too much memory allocation by JS console
|
||||
* Deletes the top-most node
|
||||
*/
|
||||
function deleteOne ()
|
||||
{
|
||||
|
||||
var tree = document.getElementById("consoleTreeChildren");
|
||||
|
||||
var node = tree.firstChild;
|
||||
tree.removeChild(node);
|
||||
num_errors--;
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0"?> <!-- -*- tab-width: 4; 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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________. -->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/console.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://global/content/console.css" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://global/locale/console.dtd" >
|
||||
|
||||
<window id="main-window" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&console.title;"
|
||||
onload="onLoadJSConsole()"
|
||||
onunload="onUnloadJSConsole()"
|
||||
windowtype="global:console"
|
||||
align="vertical"
|
||||
width="640" height="480"
|
||||
screenX="10" screenY="10"
|
||||
persist="screenX screenY width height"
|
||||
>
|
||||
|
||||
<script language="javascript" src="chrome://global/content/strres.js"/>
|
||||
<script language="javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script language="javascript" src="chrome://global/content/console.js"/>
|
||||
|
||||
<broadcasterset>
|
||||
<broadcaster id="cmd_quit"/>
|
||||
</broadcasterset>
|
||||
|
||||
<toolbox>
|
||||
<menubar id="main-menubar" class="chromeclass-menubar">
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem id="menu_close" oncommand="window.close()"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<menu id="menu_Edit">
|
||||
<menupopup id="dummyid">
|
||||
<menuitem id="menu_cut" disabled="true"/>
|
||||
<menuitem id="menu_copy" disabled="true"/>
|
||||
<menuitem id="menu_paste" disabled="true"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
<!-- tasks menu filled from tasksOverlay -->
|
||||
<menu id="tasksMenu"/>
|
||||
|
||||
<!-- help menu filled from globalOverlay -->
|
||||
<menu id="menu_Help"/>
|
||||
</menubar>
|
||||
|
||||
<toolbar id="toolbar">
|
||||
<button class="button-toolbar" observes="Console:ShowAll" oncommand="changeMode('all', this);" value="&all.label;"/>
|
||||
<button class="button-toolbar" observes="Console:ShowErrors" oncommand="changeMode('errors', this);" value="&errors.label;"/>
|
||||
<button class="button-toolbar" observes="Console:ShowWarnings" oncommand="changeMode('warnings', this);" value="&warnings.label;"/>
|
||||
<button class="button-toolbar" observes="Console:Clear" oncommand="changeMode('clear', this);" value="&clear.label;"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<tree flex="1" id="console" context="context">
|
||||
<treecolgroup>
|
||||
<treecol flex="1"/>
|
||||
</treecolgroup>
|
||||
<treechildren id="consoleTreeChildren" flex="1"/>
|
||||
</tree>
|
||||
|
||||
<popupset>
|
||||
<popup id="context">
|
||||
<menuitem type="radio" observes="Console:ShowAll" value="&all.label;" oncommand="changeMode('all', this);"/>
|
||||
<menuitem type="radio" observes="Console:ShowErrors" value="&errors.label;" oncommand="changeMode('errors', this);"/>
|
||||
<menuitem type="radio" observes="Console:ShowWarnings" value="&warnings.label;" oncommand="changeMode('warnings', this);"/>
|
||||
<menuitem type="radio" observes="Console:Clear" value="&clear.label;" oncommand="changeMode('clear', this);"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<broadcasterset id="broadcasterset">
|
||||
<broadcaster id="Console:ShowAll" toggled="true" checked="true"/>
|
||||
<broadcaster id="Console:ShowErrors"/>
|
||||
<broadcaster id="Console:ShowWarnings"/>
|
||||
<broadcaster id="Console:Clear"/>
|
||||
</broadcasterset>
|
||||
|
||||
</window>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://global/locale/console.dtd">
|
||||
|
||||
<bindings id="consoleBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="errormsg">
|
||||
<content>
|
||||
|
||||
<xul:box flex="1">
|
||||
<xul:box autostretch="never" valign="top" class="error-icon-box">
|
||||
<xul:image class="error-icon" inherits="src,type"/>
|
||||
</xul:box>
|
||||
<xul:box orient="vertical" flex="1">
|
||||
<xul:box autostretch="never" valign="top">
|
||||
<xul:text class="label" inherits="typetext:value"/>
|
||||
<xul:html inherits="msg:value" flex="1"/>
|
||||
</xul:box>
|
||||
<xul:box>
|
||||
<xul:text class="label" value="&url.label;"/>
|
||||
<xul:text class="label" inherits="url:value" crop="right"/>
|
||||
</xul:box>
|
||||
<xul:box>
|
||||
<xul:text class="label" value="&line.label;"/>
|
||||
<xul:text class="label" inherits="line:value" flex="1"/>
|
||||
<xul:text class="label" value="&col.label;"/>
|
||||
<xul:text class="label" inherits="col:value" flex="1"/>
|
||||
</xul:box>
|
||||
<xul:html inherits="error:value"/>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
@@ -1,37 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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):
|
||||
# Axel Hecht <axel@pike.org>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
CHROME_DIR = packages\widget-toolkit
|
||||
CHROME_CONTENT_DIR = global\content
|
||||
|
||||
CHROME_CONTENT = \
|
||||
.\console.js \
|
||||
.\console.xul \
|
||||
.\console.css \
|
||||
.\consoleBindings.xml \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = en-US
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
console.dtd
|
||||
console.properties
|
||||
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# 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):
|
||||
# Axel Hecht <axel@pike.org>
|
||||
#
|
||||
|
||||
DEPTH = ../../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
CHROME_DIR = locales/en-US
|
||||
CHROME_L10N_DIR = global/locale
|
||||
|
||||
CHROME_L10N = \
|
||||
console.dtd \
|
||||
console.properties \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<!-- 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 Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________. -->
|
||||
|
||||
<!ENTITY console.title "JavaScript Console">
|
||||
|
||||
<!ENTITY url.label "Source File:">
|
||||
<!ENTITY line.label "Line:">
|
||||
<!ENTITY col.label "Column:">
|
||||
<!ENTITY error.label "Error:">
|
||||
|
||||
<!ENTITY all.label "All Messages">
|
||||
<!ENTITY errors.label "Errors">
|
||||
<!ENTITY warnings.label "Warnings">
|
||||
<!ENTITY clear.label "Clear">
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
allMsgsLabel=All Messages
|
||||
errorsLabel=Errors
|
||||
warningsLabel=Warnings
|
||||
@@ -1,35 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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):
|
||||
# Axel Hecht <axel@pike.org>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..\..\..
|
||||
|
||||
CHROME_DIR = locales\en-US
|
||||
CHROME_L10N_DIR = global\locale
|
||||
|
||||
CHROME_L10N = \
|
||||
.\console.dtd \
|
||||
.\console.properties \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
DIRS= en-US
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
DIRS= content locale
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,26 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
|
||||
#define _IMPL_NS_APPSHELL
|
||||
|
||||
#include "MacSharedPrefix.h"
|
||||
@@ -1,26 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
|
||||
#define _IMPL_NS_APPSHELL
|
||||
|
||||
#include "MacSharedPrefix_debug.h"
|
||||
@@ -1,2 +0,0 @@
|
||||
directory.xul
|
||||
directory.js
|
||||
@@ -1,9 +0,0 @@
|
||||
directory.css
|
||||
file-folder-closed.gif
|
||||
file-folder-closed-sel.gif
|
||||
file-folder-open.gif
|
||||
file-folder-open-sel.gif
|
||||
file-icon.gif
|
||||
file-icon-sel.gif
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
nsIHTTPIndex.idl
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = appcomps
|
||||
LIBRARY_NAME = directory_s
|
||||
SHORT_LIBNAME = directry
|
||||
XPIDL_MODULE=directory
|
||||
XPIDLSRCS = nsIHTTPIndex.idl
|
||||
|
||||
CPPSRCS = nsDirectoryViewer.cpp
|
||||
|
||||
CHROME_DIR = .
|
||||
CHROME_CONTENT_DIR = packages/core/communicator/content/directory
|
||||
CHROME_L10N_DIR = locales/en-US/communicator/locale/directory
|
||||
|
||||
CHROME_CONTENT = \
|
||||
directory.xul \
|
||||
directory.js \
|
||||
$(NULL)
|
||||
|
||||
CHROME_L10N = \
|
||||
locale/en-US/directory.dtd \
|
||||
$(NULL)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
# static lib.
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,388 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4; -*-
|
||||
*
|
||||
* 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):
|
||||
*/
|
||||
|
||||
/*
|
||||
Script for the directory window
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const RDFSERVICE_PROGID = "component://netscape/rdf/rdf-service";
|
||||
const DRAGSERVICE_PROGID = "component://netscape/widget/dragservice";
|
||||
const TRANSFERABLE_PROGID = "component://netscape/widget/transferable";
|
||||
const XULSORTSERVICE_PROGID = "component://netscape/rdf/xul-sort-service";
|
||||
const ARRAY_PROGID = "component://netscape/supports-array";
|
||||
const WSTRING_PROGID = "component://netscape/supports-wstring";
|
||||
|
||||
const NC_NS = "http://home.netscape.com/NC-rdf#";
|
||||
const NC_NAME = NC_NS + "Name";
|
||||
const NC_LOADING = NC_NS + "loading";
|
||||
|
||||
const nsIHTTPIndex = Components.interfaces.nsIHTTPIndex;
|
||||
const nsIDragService = Components.interfaces.nsIDragService;
|
||||
const nsITransferable = Components.interfaces.nsITransferable;
|
||||
const nsIXULSortService = Components.interfaces.nsIXULSortService;
|
||||
const nsIRDFService = Components.interfaces.nsIRDFService;
|
||||
const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral;
|
||||
const nsISupportsArray = Components.interfaces.nsISupportsArray;
|
||||
const nsISupportsWString = Components.interfaces.nsISupportsWString;
|
||||
|
||||
|
||||
|
||||
// By the time this runs, The 'HTTPIndex' variable will have been
|
||||
// magically set on the global object by the native code.
|
||||
|
||||
|
||||
|
||||
function debug(msg)
|
||||
{
|
||||
// Uncomment to print out debug info.
|
||||
// dump(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// get handle to the BrowserAppCore in the content area.
|
||||
var appCore = window._content.appCore;
|
||||
var loadingArc = null;
|
||||
var loadingLevel = 0;
|
||||
|
||||
var RDF_observer = new Object;
|
||||
|
||||
RDF_observer =
|
||||
{
|
||||
onAssert : function(ds, src, prop, target)
|
||||
{
|
||||
if (prop == loadingArc)
|
||||
{
|
||||
if (loadingLevel++ == 0)
|
||||
{
|
||||
SetBusyCursor(window, true);
|
||||
}
|
||||
debug("Directory: assert: loading level is " + loadingLevel + " for " + src.Value + "\n");
|
||||
}
|
||||
},
|
||||
onUnassert : function(ds, src, prop, target)
|
||||
{
|
||||
if (prop == loadingArc)
|
||||
{
|
||||
if (loadingLevel > 0)
|
||||
{
|
||||
if (--loadingLevel == 0)
|
||||
{
|
||||
SetBusyCursor(window, false);
|
||||
}
|
||||
}
|
||||
debug("Directory: unassert: loading level is " + loadingLevel + " for " + src.Value + "\n");
|
||||
}
|
||||
},
|
||||
onChange : function(ds, src, prop, old_target, new_target)
|
||||
{
|
||||
},
|
||||
onMove : function(ds, old_src, new_src, prop, target)
|
||||
{
|
||||
},
|
||||
beginUpdateBatch : function(ds)
|
||||
{
|
||||
},
|
||||
endUpdateBatch : function(ds)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function
|
||||
SetBusyCursor(window, enable)
|
||||
{
|
||||
if(enable == true)
|
||||
{
|
||||
window.setCursor("wait");
|
||||
debug("Directory: cursor=busy\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.setCursor("auto");
|
||||
debug("Directory: cursor=notbusy\n");
|
||||
}
|
||||
|
||||
var numFrames = window.frames.length;
|
||||
for(var i = 0; i < numFrames; i++)
|
||||
{
|
||||
SetBusyCursor(window.frames[i], enable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// We need this hack because we've completely circumvented the onload() logic.
|
||||
function Boot()
|
||||
{
|
||||
if (document.getElementById('tree')) {
|
||||
Init();
|
||||
}
|
||||
else {
|
||||
setTimeout("Boot()", 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
setTimeout("Boot()", 0);
|
||||
|
||||
|
||||
|
||||
function Init()
|
||||
{
|
||||
debug("directory.js: Init()\n");
|
||||
|
||||
var tree = document.getElementById('tree');
|
||||
|
||||
// Initialize the tree's base URL to whatever the HTTPIndex is rooted at
|
||||
var baseURI = HTTPIndex.BaseURL;
|
||||
|
||||
if (baseURI && (baseURI.indexOf("ftp://") == 0))
|
||||
{
|
||||
// fix bug # 37102: if its a FTP directory
|
||||
// ensure it ends with a trailing slash
|
||||
if (baseURI.substr(baseURI.length - 1) != "/")
|
||||
{
|
||||
debug("append traiing slash to FTP directory URL\n");
|
||||
baseURI += "/";
|
||||
}
|
||||
|
||||
// Note: DON'T add the HTTPIndex datasource into the tree
|
||||
// for file URLs, only do it for FTP URLs; the "rdf:files"
|
||||
// datasources handles file URLs
|
||||
tree.database.AddDataSource(HTTPIndex.DataSource);
|
||||
}
|
||||
|
||||
// Note: set encoding BEFORE setting "ref" (important!)
|
||||
var RDF = Components.classes[RDFSERVICE_PROGID].getService();
|
||||
if (RDF) RDF = RDF.QueryInterface(nsIRDFService);
|
||||
if (RDF)
|
||||
{
|
||||
loadingArc = RDF.GetResource(NC_LOADING, true);
|
||||
|
||||
var httpDS = HTTPIndex.DataSource;
|
||||
if (httpDS) httpDS = httpDS.QueryInterface(nsIHTTPIndex);
|
||||
if (httpDS)
|
||||
{
|
||||
httpDS.encoding = "ISO-8859-1";
|
||||
|
||||
// Use a default character set.
|
||||
if (window._content.defaultCharacterset)
|
||||
{
|
||||
httpDS.encoding = window._content.defaultCharacterset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set window title
|
||||
var theWindow = window._content.parentWindow;
|
||||
if (theWindow)
|
||||
{
|
||||
theWindow.title = baseURI;
|
||||
}
|
||||
|
||||
tree.database.AddObserver(RDF_observer);
|
||||
debug("Directory: added observer\n");
|
||||
|
||||
// root the tree (do this last)
|
||||
tree.setAttribute("ref", baseURI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function DoUnload()
|
||||
{
|
||||
var tree = document.getElementById("tree");
|
||||
if (tree)
|
||||
{
|
||||
tree.database.RemoveObserver(RDF_observer);
|
||||
debug("Directory: removed observer\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function OnClick(event, node)
|
||||
{
|
||||
if( event.type == "click" &&
|
||||
( event.button != 1 || event.detail != 2 || node.nodeName != "treeitem") )
|
||||
return(false);
|
||||
if( event.type == "keypress" && event.keyCode != 13 )
|
||||
return(false);
|
||||
|
||||
var tree = document.getElementById("tree");
|
||||
if( tree.selectedItems.length == 1 )
|
||||
{
|
||||
var selectedItem = tree.selectedItems[0];
|
||||
var theID = selectedItem.getAttribute("id");
|
||||
|
||||
//if( selectedItem.getAttribute( "type" ) == "FILE" )
|
||||
if(appCore)
|
||||
{
|
||||
// support session history (if appCore is available)
|
||||
appCore.loadUrl(theID);
|
||||
}
|
||||
else
|
||||
{
|
||||
// fallback case (if appCore isn't available)
|
||||
window._content.location.href = theID;
|
||||
}
|
||||
|
||||
// set window title
|
||||
var theWindow = window._content.parentWindow;
|
||||
if (theWindow)
|
||||
{
|
||||
theWindow.title = theID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doSort(sortColName)
|
||||
{
|
||||
var node = document.getElementById(sortColName);
|
||||
if (!node) return(false);
|
||||
|
||||
// determine column resource to sort on
|
||||
var sortResource = node.getAttribute('resource');
|
||||
|
||||
// switch between ascending & descending sort (no natural order support)
|
||||
var sortDirection="ascending";
|
||||
var isSortActive = node.getAttribute('sortActive');
|
||||
if (isSortActive == "true")
|
||||
{
|
||||
var currentDirection = node.getAttribute('sortDirection');
|
||||
if (currentDirection == "ascending")
|
||||
{
|
||||
sortDirection = "descending";
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var isupports = Components.classes[XULSORTSERVICE_PROGID].getService();
|
||||
if (!isupports) return(false);
|
||||
var xulSortService = isupports.QueryInterface(nsIXULSortService);
|
||||
if (!xulSortService) return(false);
|
||||
xulSortService.Sort(node, sortResource, sortDirection);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function BeginDragTree ( event )
|
||||
{
|
||||
var tree = document.getElementById("tree");
|
||||
if ( event.target == tree )
|
||||
return(true); // continue propagating the event
|
||||
|
||||
// only <treeitem>s can be dragged out
|
||||
if ( event.target.parentNode.parentNode.tagName != "treeitem")
|
||||
return(false);
|
||||
|
||||
var database = tree.database;
|
||||
if (!database) return(false);
|
||||
|
||||
var RDF =
|
||||
Components.classes[RDFSERVICE_PROGID].getService(nsIRDFService);
|
||||
if (!RDF) return(false);
|
||||
|
||||
var dragStarted = false;
|
||||
|
||||
var trans =
|
||||
Components.classes[TRANSFERABLE_PROGID].createInstance(nsITransferable);
|
||||
if ( !trans ) return(false);
|
||||
|
||||
var genData =
|
||||
Components.classes[WSTRING_PROGID].createInstance(nsISupportsWString);
|
||||
if (!genData) return(false);
|
||||
|
||||
var genDataURL =
|
||||
Components.classes[WSTRING_PROGID].createInstance(nsISupportsWString);
|
||||
if (!genDataURL) return(false);
|
||||
|
||||
trans.addDataFlavor("text/unicode");
|
||||
trans.addDataFlavor("moz/rdfitem");
|
||||
|
||||
// ref/id (url) is on the <treeitem> which is two levels above the <treecell> which is
|
||||
// the target of the event.
|
||||
var id = event.target.parentNode.parentNode.getAttribute("ref");
|
||||
if (!id || id=="")
|
||||
{
|
||||
id = event.target.parentNode.parentNode.getAttribute("id");
|
||||
}
|
||||
|
||||
var parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("ref");
|
||||
if (!parentID || parentID == "")
|
||||
{
|
||||
parentID = event.target.parentNode.parentNode.parentNode.parentNode.getAttribute("id");
|
||||
}
|
||||
|
||||
// if we can get node's name, append (space) name to url
|
||||
var src = RDF.GetResource(id, true);
|
||||
var prop = RDF.GetResource(NC_NAME, true);
|
||||
var target = database.GetTarget(src, prop, true);
|
||||
if (target) target = target.QueryInterface(nsIRDFLiteral);
|
||||
if (target) target = target.Value;
|
||||
if (target && (target != ""))
|
||||
{
|
||||
id = id + " " + target;
|
||||
}
|
||||
|
||||
var trueID = id;
|
||||
if (parentID != null)
|
||||
{
|
||||
trueID += "\n" + parentID;
|
||||
}
|
||||
genData.data = trueID;
|
||||
genDataURL.data = id;
|
||||
|
||||
trans.setTransferData ( "moz/rdfitem", genData, genData.data.length * 2); // double byte data
|
||||
trans.setTransferData ( "text/unicode", genDataURL, genDataURL.data.length * 2); // double byte data
|
||||
|
||||
var transArray =
|
||||
Components.classes[ARRAY_PROGID].createInstance(nsISupportsArray);
|
||||
if ( !transArray ) return(false);
|
||||
|
||||
// put it into the transferable as an |nsISupports|
|
||||
var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);
|
||||
transArray.AppendElement(genTrans);
|
||||
|
||||
var dragService =
|
||||
Components.classes[DRAGSERVICE_PROGID].getService(nsIDragService);
|
||||
if ( !dragService ) return(false);
|
||||
|
||||
dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +
|
||||
nsIDragService.DRAGDROP_ACTION_MOVE );
|
||||
dragStarted = true;
|
||||
|
||||
return(!dragStarted);
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
|
||||
<!--
|
||||
|
||||
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://communicator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/directory/directory.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://communicator/locale/directory/directory.dtd">
|
||||
|
||||
<window style="overflow: auto"
|
||||
title="&directoryWindowTitle.label;"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
onunload="DoUnload();">
|
||||
|
||||
<script src="chrome://communicator/content/directory/directory.js"></script>
|
||||
|
||||
<tree id="tree" datasources="rdf:files" flex="1" style="height:0px;"
|
||||
container="true" open="true" flags="dont-test-empty"
|
||||
ondraggesture="return BeginDragTree(event);">
|
||||
<template>
|
||||
<treechildren flex="1">
|
||||
<treeitem uri="..." persist="open"
|
||||
type="rdf:http://home.netscape.com/NC-rdf#File-Type"
|
||||
loading="rdf:http://home.netscape.com/NC-rdf#loading" >
|
||||
<treerow>
|
||||
<treecell class="treecell-filename treecell-indent" indent="true"
|
||||
type="rdf:http://home.netscape.com/NC-rdf#File-Type"
|
||||
value="rdf:http://home.netscape.com/NC-rdf#Name"/>
|
||||
<treecell value="rdf:http://home.netscape.com/NC-rdf#Content-Length" />
|
||||
<treecell value="rdf:http://home.netscape.com/WEB-rdf#LastModifiedDate" />
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</template>
|
||||
|
||||
<treecolgroup>
|
||||
<treecol flex="1" id="FilenameColumn"
|
||||
sortActive="true" sortDirection="ascending"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Name" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol flex="1" id="ContentLengthColumn"
|
||||
rdf:resource="http://home.netscape.com/NC-rdf#Content-Length"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol flex="1" id="LastModColumn"
|
||||
rdf:resource="http://home.netscape.com/WEB-rdf#LastModifiedDate"
|
||||
rdf:resource2="http://home.netscape.com/NC-rdf#Name"/>
|
||||
</treecolgroup>
|
||||
|
||||
<treehead>
|
||||
<treerow>
|
||||
<treecell class="treecell-header sortDirectionIndicator" value="&directoryWindow.filename.label;"
|
||||
onclick="return doSort('FilenameColumn');" observes="FilenameColumn" sortActive="true" sortDirection="ascending" />
|
||||
<treecell class="treecell-header sortDirectionIndicator" value="&directoryWindow.contentlength.label;"
|
||||
onclick="return doSort('ContentLengthColumn');" observes="ContentLengthColumn" />
|
||||
<treecell class="treecell-header sortDirectionIndicator" value="&directoryWindow.lastmodified.label;"
|
||||
onclick="return doSort('LastModColumn');" observes="LastModColumn" />
|
||||
</treerow>
|
||||
</treehead>
|
||||
|
||||
<!-- Create the treechildren here so we can attach event handlers
|
||||
at this level (rather than at the tree level -->
|
||||
<treechildren flex="1" onclick="OnClick(event, event.target.parentNode.parentNode);" onkeypress="OnClick(event, event.target.parentNode.parentNode);"/>
|
||||
|
||||
</tree>
|
||||
</window>
|
||||
@@ -1 +0,0 @@
|
||||
en-US:directory.dtd
|
||||
@@ -1 +0,0 @@
|
||||
directory.dtd
|
||||
@@ -1,4 +0,0 @@
|
||||
<!ENTITY directoryWindowTitle.label "Directory Contents">
|
||||
<!ENTITY directoryWindow.filename.label "Name">
|
||||
<!ENTITY directoryWindow.contentlength.label "Size">
|
||||
<!ENTITY directoryWindow.lastmodified.label "Last Modified">
|
||||
@@ -1,24 +0,0 @@
|
||||
#!nmake
|
||||
# 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 Communicator client code, released
|
||||
# March 31, 1998.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
DEPTH = ..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,62 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=locale
|
||||
|
||||
CHROME_DIR = .
|
||||
CHROME_CONTENT_DIR = packages\core\communicator\content\directory
|
||||
CHROME_L10N_DIR = locales\en-US\communicator\locale\directory
|
||||
|
||||
CHROME_CONTENT = \
|
||||
.\directory.xul \
|
||||
.\directory.js \
|
||||
$(NULL)
|
||||
|
||||
CHROME_L10N = \
|
||||
.\locale\en-US\directory.dtd \
|
||||
$(NULL)
|
||||
|
||||
MODULE=appcomps
|
||||
XPIDL_MODULE=directory
|
||||
XPIDLSRCS = \
|
||||
.\nsIHTTPIndex.idl \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsDirectoryViewer.obj \
|
||||
$(NULL)
|
||||
|
||||
LIBRARY_NAME = directory_s
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user