Compare commits
11 Commits
test
...
XPFE_COMPS
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a8e855d12 | ||
|
|
3d4ac8c185 | ||
|
|
8a84912835 | ||
|
|
249496d785 | ||
|
|
ddff426f5e | ||
|
|
e396a74e7f | ||
|
|
92f64bd30c | ||
|
|
f85ed99294 | ||
|
|
bb4887537b | ||
|
|
e727a49be5 | ||
|
|
7c73e9a7ba |
@@ -1,2 +0,0 @@
|
||||
Clobbering to pick up changes from bug 409803.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#
|
||||
## hostname: fx-linux-tbox
|
||||
## uname: Linux fx-linux-tbox.build.mozilla.org 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 i686 i386 GNU/Linux
|
||||
#
|
||||
|
||||
export CFLAGS="-gstabs+"
|
||||
export CXXFLAGS="-gstabs+"
|
||||
|
||||
mk_add_options MOZ_CO_PROJECT=browser
|
||||
mk_add_options PROFILE_GEN_SCRIPT=@TOPSRCDIR@/build/profile_pageloader.pl
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging mozilla/tools/codesighs"
|
||||
ac_add_options --enable-application=browser
|
||||
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
# Don't add explicit optimize flags here, set them in configure.in, see bug 407794.
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-tests
|
||||
#not yet
|
||||
#ac_add_options --enable-glitz
|
||||
|
||||
ac_add_options --enable-codesighs
|
||||
|
||||
CC=/tools/gcc/bin/gcc
|
||||
CXX=/tools/gcc/bin/g++
|
||||
@@ -1,269 +0,0 @@
|
||||
#
|
||||
## hostname: fx-linux-tbox
|
||||
## uname: Linux fx-linux-tbox.build.mozilla.org 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 i686 i386 GNU/Linux
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{CVS_RSH} = "ssh";
|
||||
$ENV{MOZ_CRASHREPORTER_NO_REPORT} = '1';
|
||||
|
||||
# To ensure Talkback client builds properly on some Linux boxen where LANG
|
||||
# is set to "en_US.UTF-8" by default, override that setting here by setting
|
||||
# it to "en_US.iso885915" (the setting on ocean). Proper fix is to update
|
||||
# where xrestool is called in the build system so that 'LANG=C' in its
|
||||
# environment, according to bryner.
|
||||
$ENV{LANG} = "en_US.iso885915";
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Firefox";
|
||||
$VendorName = 'Mozilla';
|
||||
|
||||
# CONFIG: $RunMozillaTests = %runMozillaTests%;
|
||||
$RunMozillaTests = 1;
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
#$JavaTest = 0;
|
||||
#$ViewerTest = 0;
|
||||
#$BloatTest = 0; # warren memory bloat test
|
||||
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
#$DomToTextConversionTest = 0;
|
||||
#$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 1; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 1; # mZ, require mozilla/tools/codesigns
|
||||
#$MailBloatTest = 0;
|
||||
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
#$QATest = 0;
|
||||
#$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
$GraphNameOverride = 'fx-linux-tbox';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
#$pageload_server = "spider"; # localhost
|
||||
$pageload_server = "pageload.build.mozilla.org";
|
||||
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
#$AliveTestTimeout = 45;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
#$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 15; # seconds
|
||||
#$XULWindowOpenTestTimeout = 150; # seconds
|
||||
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
#$Make = 'gmake'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
#$blat = 'c:/nstools/bin/blat';
|
||||
#$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
# CONFIG: $moz_cvsroot = '%mozillaCvsroot%';
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = 'obj-fx-trunk';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'Nightly';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
# CONFIG: $BuildTree = '%buildTree%';
|
||||
$BuildTree = 'MozillaTest';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox-bin';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = 14;
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
# CONFIG: $ssh_user = "%sshUser%";
|
||||
$ssh_user = "ffxbld";
|
||||
$ssh_key = "'$ENV{HOME}/.ssh/ffxbld_dsa'";
|
||||
# CONFIG: $ssh_server = "%sshServer%";
|
||||
$ssh_server = "stage-old.mozilla.org";
|
||||
$ReleaseGroup = "firefox";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = 'build-announce@mozilla.org';
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 0;
|
||||
$archive = 1;
|
||||
$push_raw_xpis = 0;
|
||||
# CONFIG: $update_aus_host = '%ausServer%';
|
||||
$update_aus_host = 'aus2-staging.mozilla.org';
|
||||
$update_pushinfo = 0;
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "Linux_x86-gcc3";
|
||||
$update_hash = "sha1";
|
||||
# CONFIG: $update_filehost = '%ftpServer%';
|
||||
$update_filehost = 'ftp.mozilla.org';
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$crashreporter_buildsymbols = 1;
|
||||
$crashreporter_pushsymbols = 1;
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_HOST'} = '%symbolServer%';
|
||||
$ENV{'SYMBOL_SERVER_HOST'} = 'dm-symbolpush01.mozilla.org';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_USER'} = '%symbolServerUser%';
|
||||
$ENV{'SYMBOL_SERVER_USER'} = 'ffxbld';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_PATH'} = '%symbolServerPath%';
|
||||
$ENV{'SYMBOL_SERVER_PATH'} = '/mnt/netapp/breakpad/symbols_ffx';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_SSH_KEY'} = '%symbolServerKey%';
|
||||
$ENV{'SYMBOL_SERVER_SSH_KEY'} = '/home/cltbld/.ssh/ffxbld_dsa';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
@@ -1 +0,0 @@
|
||||
trigger a nightly to push the fix to bug 421841 to users
|
||||
@@ -1,28 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xserve08.build.mozilla.org
|
||||
## uname: Darwin bm-xserve08.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
# symbols for breakpad
|
||||
export CFLAGS="-g -gfull"
|
||||
export CXXFLAGS="-g -gfull"
|
||||
|
||||
. $topsrcdir/build/macosx/universal/mozconfig
|
||||
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j4"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging mozilla/tools/codesighs"
|
||||
mk_add_options MOZ_CO_PROJECT="browser"
|
||||
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build/universal
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
# Don't add explicit optimize flags here, set them in configure.in, see bug 407794.
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_app_options ppc --enable-prebinding
|
||||
|
||||
ac_add_options --enable-codesighs
|
||||
@@ -1,269 +0,0 @@
|
||||
#
|
||||
## hostname: bm-xserve08.build.mozilla.org
|
||||
## uname: Darwin bm-xserve08.build.mozilla.org 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 i386
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{NO_EM_RESTART} = "1";
|
||||
$ENV{DYLD_NO_FIX_PREBINDING} = "1";
|
||||
$ENV{LD_PREBIND_ALLOW_OVERLAP} = "1";
|
||||
$ENV{CVS_RSH} = "ssh";
|
||||
$ENV{MOZ_CRASHREPORTER_NO_REPORT} = '1';
|
||||
|
||||
$MacUniversalBinary = 1;
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = 'Minefield';
|
||||
$VendorName = "";
|
||||
|
||||
# CONFIG: $RunMozillaTests = %runMozillaTests%;
|
||||
$RunMozillaTests = 1;
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
#$JavaTest = 0;
|
||||
#$ViewerTest = 0;
|
||||
#$BloatTest = 0; # warren memory bloat test
|
||||
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
#$DomToTextConversionTest = 0;
|
||||
#$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 1; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
#$MailBloatTest = 0;
|
||||
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$LayoutPerformanceLocalTest = 0; # Tp2
|
||||
$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
#$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
|
||||
$GraphNameOverride = 'xserve08.build.mozilla.org_Fx-Trunk';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
#$pageload_server = "spider"; # localhost
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
$AliveTestTimeout = 10;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 300; # entire test, seconds
|
||||
$LayoutPerformanceLocalTestTimeout = 180; # entire test, seconds
|
||||
$DHTMLPerformanceTestTimeout = 180; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 15; # seconds
|
||||
#$XULWindowOpenTestTimeout = 150; # seconds
|
||||
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
#$Make = 'gmake'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
#$blat = 'c:/nstools/bin/blat';
|
||||
#$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
# CONFIG: $moz_cvsroot = '%mozillaCvsroot%';
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = '../build/universal';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'Universal Nightly';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
# CONFIG: $BuildTree = '%buildTree%';
|
||||
$BuildTree = 'MozillaTest';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox-bin';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "14";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
# CONFIG: $ssh_user = "%sshUser%";
|
||||
$ssh_user = "ffxbld";
|
||||
$ssh_key = "'$ENV{HOME}/.ssh/ffxbld_dsa'";
|
||||
# CONFIG: $ssh_server = "%sshServer%";
|
||||
$ssh_server = "stage-old.mozilla.org";
|
||||
$ReleaseGroup = "firefox";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = "build-announce\@mozilla.org";
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 0;
|
||||
$archive = 1;
|
||||
$push_raw_xpis = 0;
|
||||
# CONFIG: $update_aus_host = '%ausServer%';
|
||||
$update_aus_host = 'aus2-staging.mozilla.org';
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "Darwin_Universal-gcc3";
|
||||
$update_hash = "sha1";
|
||||
# CONFIG: $update_filehost = '%ftpServer%';
|
||||
$update_filehost = 'ftp.mozilla.org';
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 1;
|
||||
$crashreporter_pushsymbols = 1;
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_HOST'} = '%symbolServer%';
|
||||
$ENV{'SYMBOL_SERVER_HOST'} = 'dm-symbolpush01.mozilla.org';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_USER'} = '%symbolServerUser%';
|
||||
$ENV{'SYMBOL_SERVER_USER'} = 'ffxbld';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_PATH'} = '%symbolServerPath%';
|
||||
$ENV{'SYMBOL_SERVER_PATH'} = '/mnt/netapp/breakpad/symbols_ffx';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_SSH_KEY'} = '%symbolServerKey%';
|
||||
$ENV{'SYMBOL_SERVER_SSH_KEY'} = '/Users/cltbld/.ssh/ffxbld_dsa';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
@@ -1 +0,0 @@
|
||||
Clobbering to pick up fixes from bug 419319.
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
## hostname: fx-win32-tbox
|
||||
## uname: MINGW32_NT-5.2 FX-WIN32-TBOX 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys
|
||||
#
|
||||
export CFLAGS="-GL -wd4624 -wd4952"
|
||||
export CXXFLAGS="-GL -wd4624 -wd4952"
|
||||
export LDFLAGS="-LTCG"
|
||||
|
||||
mk_add_options MOZ_CO_PROJECT=browser
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j5"
|
||||
mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging"
|
||||
mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-jemalloc
|
||||
@@ -1,264 +0,0 @@
|
||||
#
|
||||
## hostname: fx-win32-tbox
|
||||
## uname: MINGW32_NT-5.2 FX-WIN32-TBOX 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{NO_EM_RESTART} = '1';
|
||||
$ENV{CVS_RSH} = "ssh";
|
||||
$ENV{MOZ_CRASHREPORTER_NO_REPORT} = '1';
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Firefox";
|
||||
$VendorName = "Mozilla";
|
||||
|
||||
# CONFIG: $RunMozillaTests = %runMozillaTests%;
|
||||
$RunMozillaTests = 1;
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
$JavaTest = 0;
|
||||
$ViewerTest = 0;
|
||||
$BloatTest = 0; # warren memory bloat test
|
||||
$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
$DomToTextConversionTest = 0;
|
||||
$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
$MailBloatTest = 0;
|
||||
$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
$NeckoUnitTest = 0;
|
||||
$RenderPerformanceTest = 0; # Tgfx
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
$GraphNameOverride = 'fx-win32-tbox';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
#$AliveTestTimeout = 30;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 800; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 20; # seconds
|
||||
#$XULWindowOpenTestTimeout = 90; # seconds
|
||||
#$NeckoUnitTestTimeout = 30; # seconds
|
||||
$RenderPerformanceTestTimeout = 1800; # seconds
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'make'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
$blat = '/d/mozilla-build/blat261/full/blat';
|
||||
#$use_blat = 1;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
# CONFIG: $moz_cvsroot = '%mozillaCvsroot%';
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = 'obj-fx-trunk';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'Nightly';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
# CONFIG: $BuildTree = '%buildTree%';
|
||||
$BuildTree = 'MozillaTest';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox.exe';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
$ProfiledBuild = 1;
|
||||
# Release build options
|
||||
$ReleaseBuild = 1;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 1; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 1; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "14";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
# CONFIG: $ssh_user = "%sshUser%";
|
||||
$ssh_user = "ffxbld";
|
||||
$ssh_key = "'$ENV{HOME}/.ssh/ffxbld_dsa'";
|
||||
# CONFIG: $ssh_server = "%sshServer%";
|
||||
$ssh_server = "stage-old.mozilla.org";
|
||||
$ReleaseGroup = "firefox";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly/experimental";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/experimental";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = 'build-announce@mozilla.org';
|
||||
$stub_installer = 0;
|
||||
$sea_installer = 1;
|
||||
$archive = 1;
|
||||
$push_raw_xpis = 0;
|
||||
# CONFIG: $update_aus_host = '%ausServer%';
|
||||
$update_aus_host = 'aus2-staging.mozilla.org';
|
||||
$update_package = 1;
|
||||
$update_product = "Firefox";
|
||||
$update_version = "trunk";
|
||||
$update_platform = "WINNT_x86-msvc";
|
||||
$update_hash = "sha1";
|
||||
# CONFIG: $update_filehost = '%ftpServer%';
|
||||
$update_filehost = 'ftp.mozilla.org';
|
||||
$update_ver_file = 'browser/config/version.txt';
|
||||
$update_pushinfo = 0;
|
||||
$crashreporter_buildsymbols = 1;
|
||||
$crashreporter_pushsymbols = 1;
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_HOST'} = '%symbolServer%';
|
||||
$ENV{'SYMBOL_SERVER_HOST'} = 'dm-symbolpush01.mozilla.org';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_USER'} = '%symbolServerUser%';
|
||||
$ENV{'SYMBOL_SERVER_USER'} = 'ffxbld';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_PATH'} = '%symbolServerPath%';
|
||||
$ENV{'SYMBOL_SERVER_PATH'} = '/mnt/netapp/breakpad/symbols_ffx';
|
||||
# CONFIG: $ENV{'SYMBOL_SERVER_SSH_KEY'} = '%symbolServerKey%';
|
||||
$ENV{'SYMBOL_SERVER_SSH_KEY'} = '/c/Documents and Settings/cltbld/.ssh/ffxbld_dsa';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
32
mozilla/xpfe/components/Makefile.in
Normal file
32
mozilla/xpfe/components/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
32
mozilla/xpfe/components/autocomplete/Makefile.in
Normal file
32
mozilla/xpfe/components/autocomplete/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
BIN
mozilla/xpfe/components/autocomplete/macbuild/AutoComplete.mcp
Normal file
BIN
mozilla/xpfe/components/autocomplete/macbuild/AutoComplete.mcp
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
/* -*- 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"
|
||||
@@ -0,0 +1,23 @@
|
||||
/* -*- 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"
|
||||
26
mozilla/xpfe/components/autocomplete/makefile.win
Normal file
26
mozilla/xpfe/components/autocomplete/makefile.win
Normal file
@@ -0,0 +1,26 @@
|
||||
#!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
mozilla/xpfe/components/autocomplete/public/MANIFEST_IDL
Normal file
1
mozilla/xpfe/components/autocomplete/public/MANIFEST_IDL
Normal file
@@ -0,0 +1 @@
|
||||
nsIAutoCompleteSession.idl
|
||||
38
mozilla/xpfe/components/autocomplete/public/Makefile.in
Normal file
38
mozilla/xpfe/components/autocomplete/public/Makefile.in
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
36
mozilla/xpfe/components/autocomplete/public/makefile.win
Normal file
36
mozilla/xpfe/components/autocomplete/public/makefile.win
Normal file
@@ -0,0 +1,36 @@
|
||||
#!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>
|
||||
@@ -0,0 +1,50 @@
|
||||
/* -*- 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;
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
/* -*- 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"
|
||||
%}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/* -*- 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);
|
||||
};
|
||||
32
mozilla/xpfe/components/autocomplete/resources/Makefile.in
Normal file
32
mozilla/xpfe/components/autocomplete/resources/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
autocomplete.xml
|
||||
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# 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
|
||||
@@ -0,0 +1,438 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,32 @@
|
||||
#!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
|
||||
26
mozilla/xpfe/components/autocomplete/resources/makefile.win
Normal file
26
mozilla/xpfe/components/autocomplete/resources/makefile.win
Normal file
@@ -0,0 +1,26 @@
|
||||
#!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>
|
||||
38
mozilla/xpfe/components/autocomplete/src/Makefile.in
Normal file
38
mozilla/xpfe/components/autocomplete/src/Makefile.in
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
60
mozilla/xpfe/components/autocomplete/src/makefile.win
Normal file
60
mozilla/xpfe/components/autocomplete/src/makefile.win
Normal file
@@ -0,0 +1,60 @@
|
||||
#!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
|
||||
165
mozilla/xpfe/components/autocomplete/src/nsAutoComplete.cpp
Normal file
165
mozilla/xpfe/components/autocomplete/src/nsAutoComplete.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- 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;
|
||||
}
|
||||
75
mozilla/xpfe/components/autocomplete/src/nsAutoComplete.h
Normal file
75
mozilla/xpfe/components/autocomplete/src/nsAutoComplete.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* -*- 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
|
||||
136
mozilla/xpfe/components/autocomplete/test/autocomplete_test.xul
Normal file
136
mozilla/xpfe/components/autocomplete/test/autocomplete_test.xul
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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>
|
||||
32
mozilla/xpfe/components/bookmarks/Makefile.in
Normal file
32
mozilla/xpfe/components/bookmarks/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
BIN
mozilla/xpfe/components/bookmarks/macbuild/Bookmarks.mcp
Normal file
BIN
mozilla/xpfe/components/bookmarks/macbuild/Bookmarks.mcp
Normal file
Binary file not shown.
BIN
mozilla/xpfe/components/bookmarks/macbuild/BookmarksIDL.mcp
Normal file
BIN
mozilla/xpfe/components/bookmarks/macbuild/BookmarksIDL.mcp
Normal file
Binary file not shown.
26
mozilla/xpfe/components/bookmarks/macbuild/BookmarksPrefix.h
Normal file
26
mozilla/xpfe/components/bookmarks/macbuild/BookmarksPrefix.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* -*- 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"
|
||||
@@ -0,0 +1,26 @@
|
||||
/* -*- 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"
|
||||
26
mozilla/xpfe/components/bookmarks/makefile.win
Normal file
26
mozilla/xpfe/components/bookmarks/makefile.win
Normal file
@@ -0,0 +1,26 @@
|
||||
#!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
mozilla/xpfe/components/bookmarks/public/MANIFEST_IDL
Normal file
1
mozilla/xpfe/components/bookmarks/public/MANIFEST_IDL
Normal file
@@ -0,0 +1 @@
|
||||
nsIBookmarksService.idl
|
||||
34
mozilla/xpfe/components/bookmarks/public/Makefile.in
Normal file
34
mozilla/xpfe/components/bookmarks/public/Makefile.in
Normal file
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
31
mozilla/xpfe/components/bookmarks/public/makefile.win
Normal file
31
mozilla/xpfe/components/bookmarks/public/makefile.win
Normal file
@@ -0,0 +1,31 @@
|
||||
#!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>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/* -*- 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"
|
||||
|
||||
%}
|
||||
@@ -0,0 +1,9 @@
|
||||
bm-find.js
|
||||
bm-find.xul
|
||||
bm-panel.js
|
||||
bm-panel.xul
|
||||
bm-props.js
|
||||
bm-props.xul
|
||||
bookmarks.js
|
||||
bookmarksDD.js
|
||||
bookmarks.xul
|
||||
53
mozilla/xpfe/components/bookmarks/resources/Makefile.in
Normal file
53
mozilla/xpfe/components/bookmarks/resources/Makefile.in
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
264
mozilla/xpfe/components/bookmarks/resources/bm-find.js
Executable file
264
mozilla/xpfe/components/bookmarks/resources/bm-find.js
Executable file
@@ -0,0 +1,264 @@
|
||||
/* -*- 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);
|
||||
}
|
||||
252
mozilla/xpfe/components/bookmarks/resources/bm-find.xul
Executable file
252
mozilla/xpfe/components/bookmarks/resources/bm-find.xul
Executable file
@@ -0,0 +1,252 @@
|
||||
<?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>
|
||||
122
mozilla/xpfe/components/bookmarks/resources/bm-panel.js
Normal file
122
mozilla/xpfe/components/bookmarks/resources/bm-panel.js
Normal file
@@ -0,0 +1,122 @@
|
||||
/* -*- 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
103
mozilla/xpfe/components/bookmarks/resources/bm-panel.xul
Normal file
103
mozilla/xpfe/components/bookmarks/resources/bm-panel.xul
Normal file
@@ -0,0 +1,103 @@
|
||||
<?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>
|
||||
461
mozilla/xpfe/components/bookmarks/resources/bm-props.js
Normal file
461
mozilla/xpfe/components/bookmarks/resources/bm-props.js
Normal file
@@ -0,0 +1,461 @@
|
||||
/* -*- 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
178
mozilla/xpfe/components/bookmarks/resources/bm-props.xul
Normal file
178
mozilla/xpfe/components/bookmarks/resources/bm-props.xul
Normal file
@@ -0,0 +1,178 @@
|
||||
<?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>
|
||||
1324
mozilla/xpfe/components/bookmarks/resources/bookmarks.js
Normal file
1324
mozilla/xpfe/components/bookmarks/resources/bookmarks.js
Normal file
File diff suppressed because it is too large
Load Diff
351
mozilla/xpfe/components/bookmarks/resources/bookmarks.xul
Normal file
351
mozilla/xpfe/components/bookmarks/resources/bookmarks.xul
Normal file
@@ -0,0 +1,351 @@
|
||||
<?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>
|
||||
|
||||
504
mozilla/xpfe/components/bookmarks/resources/bookmarksDD.js
Normal file
504
mozilla/xpfe/components/bookmarks/resources/bookmarksDD.js
Normal file
@@ -0,0 +1,504 @@
|
||||
/* -*- 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
en-US:bm-find.dtd
|
||||
en-US:bm-props.dtd
|
||||
en-US:bookmarks.dtd
|
||||
en-US:bookmark.properties
|
||||
@@ -0,0 +1,4 @@
|
||||
bm-find.dtd
|
||||
bm-props.dtd
|
||||
bookmark.properties
|
||||
bookmarks.dtd
|
||||
47
mozilla/xpfe/components/bookmarks/resources/locale/en-US/bm-find.dtd
Executable file
47
mozilla/xpfe/components/bookmarks/resources/locale/en-US/bm-find.dtd
Executable file
@@ -0,0 +1,47 @@
|
||||
<!--
|
||||
- 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">
|
||||
@@ -0,0 +1,84 @@
|
||||
<!--
|
||||
- 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">
|
||||
66
mozilla/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties
Executable file
66
mozilla/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties
Executable file
@@ -0,0 +1,66 @@
|
||||
# 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%
|
||||
@@ -0,0 +1,56 @@
|
||||
<!--
|
||||
- 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">
|
||||
@@ -0,0 +1,24 @@
|
||||
#!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>
|
||||
@@ -0,0 +1,27 @@
|
||||
#!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>
|
||||
50
mozilla/xpfe/components/bookmarks/resources/makefile.win
Normal file
50
mozilla/xpfe/components/bookmarks/resources/makefile.win
Normal file
@@ -0,0 +1,50 @@
|
||||
#!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>
|
||||
|
||||
29
mozilla/xpfe/components/bookmarks/resources/manifest.jm
Normal file
29
mozilla/xpfe/components/bookmarks/resources/manifest.jm
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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
|
||||
40
mozilla/xpfe/components/bookmarks/src/Makefile.in
Normal file
40
mozilla/xpfe/components/bookmarks/src/Makefile.in
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
43
mozilla/xpfe/components/bookmarks/src/makefile.win
Normal file
43
mozilla/xpfe/components/bookmarks/src/makefile.win
Normal file
@@ -0,0 +1,43 @@
|
||||
#!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
|
||||
|
||||
4830
mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp
Normal file
4830
mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp
Normal file
File diff suppressed because it is too large
Load Diff
206
mozilla/xpfe/components/bookmarks/src/nsBookmarksService.h
Normal file
206
mozilla/xpfe/components/bookmarks/src/nsBookmarksService.h
Normal file
@@ -0,0 +1,206 @@
|
||||
/* -*- 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___
|
||||
67
mozilla/xpfe/components/build/Makefile.in
Normal file
67
mozilla/xpfe/components/build/Makefile.in
Normal file
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
73
mozilla/xpfe/components/build/makefile.win
Normal file
73
mozilla/xpfe/components/build/makefile.win
Normal file
@@ -0,0 +1,73 @@
|
||||
#!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
|
||||
97
mozilla/xpfe/components/build/nsModule.cpp
Normal file
97
mozilla/xpfe/components/build/nsModule.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
/* -*- 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
mozilla/xpfe/components/console/MANIFEST
Normal file
1
mozilla/xpfe/components/console/MANIFEST
Normal file
@@ -0,0 +1 @@
|
||||
jsconsole-clhandler.js
|
||||
36
mozilla/xpfe/components/console/Makefile.in
Normal file
36
mozilla/xpfe/components/console/Makefile.in
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
114
mozilla/xpfe/components/console/jsconsole-clhandler.js
Normal file
114
mozilla/xpfe/components/console/jsconsole-clhandler.js
Normal file
@@ -0,0 +1,114 @@
|
||||
/* -*- 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:
|
||||
33
mozilla/xpfe/components/console/makefile.win
Normal file
33
mozilla/xpfe/components/console/makefile.win
Normal file
@@ -0,0 +1,33 @@
|
||||
#!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
|
||||
32
mozilla/xpfe/components/console/resources/Makefile.in
Normal file
32
mozilla/xpfe/components/console/resources/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
console.js
|
||||
console.xul
|
||||
console.css
|
||||
consoleBindings.xml
|
||||
@@ -0,0 +1,41 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
289
mozilla/xpfe/components/console/resources/content/console.js
Normal file
289
mozilla/xpfe/components/console/resources/content/console.js
Normal file
@@ -0,0 +1,289 @@
|
||||
/* -*- 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;
|
||||
|
||||
}
|
||||
107
mozilla/xpfe/components/console/resources/content/console.xul
Normal file
107
mozilla/xpfe/components/console/resources/content/console.xul
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,37 @@
|
||||
#!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>
|
||||
|
||||
32
mozilla/xpfe/components/console/resources/locale/Makefile.in
Normal file
32
mozilla/xpfe/components/console/resources/locale/Makefile.in
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
console.dtd
|
||||
console.properties
|
||||
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<!-- 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">
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
allMsgsLabel=All Messages
|
||||
errorsLabel=Errors
|
||||
warningsLabel=Warnings
|
||||
@@ -0,0 +1,35 @@
|
||||
#!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>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!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>
|
||||
|
||||
27
mozilla/xpfe/components/console/resources/makefile.win
Normal file
27
mozilla/xpfe/components/console/resources/makefile.win
Normal file
@@ -0,0 +1,27 @@
|
||||
#!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>
|
||||
|
||||
BIN
mozilla/xpfe/components/directory/Directory.mcp
Normal file
BIN
mozilla/xpfe/components/directory/Directory.mcp
Normal file
Binary file not shown.
BIN
mozilla/xpfe/components/directory/DirectoryIDL.mcp
Normal file
BIN
mozilla/xpfe/components/directory/DirectoryIDL.mcp
Normal file
Binary file not shown.
26
mozilla/xpfe/components/directory/DirectoryPrefix.h
Normal file
26
mozilla/xpfe/components/directory/DirectoryPrefix.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* -*- 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"
|
||||
26
mozilla/xpfe/components/directory/DirectoryPrefix_debug.h
Normal file
26
mozilla/xpfe/components/directory/DirectoryPrefix_debug.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* -*- 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"
|
||||
2
mozilla/xpfe/components/directory/MANIFEST-content
Normal file
2
mozilla/xpfe/components/directory/MANIFEST-content
Normal file
@@ -0,0 +1,2 @@
|
||||
directory.xul
|
||||
directory.js
|
||||
9
mozilla/xpfe/components/directory/MANIFEST-skin
Normal file
9
mozilla/xpfe/components/directory/MANIFEST-skin
Normal file
@@ -0,0 +1,9 @@
|
||||
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
mozilla/xpfe/components/directory/MANIFEST_IDL
Normal file
1
mozilla/xpfe/components/directory/MANIFEST_IDL
Normal file
@@ -0,0 +1 @@
|
||||
nsIHTTPIndex.idl
|
||||
56
mozilla/xpfe/components/directory/Makefile.in
Normal file
56
mozilla/xpfe/components/directory/Makefile.in
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user