From cb0c12a24ca214d0fde125b22c596b866e7079c5 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Sat, 5 Dec 2009 00:02:04 -0500 Subject: [PATCH] emergency move to git and isuckatdomains.net --- bin/.svn/dir-prop-base | 5 + bin/.svn/entries | 198 + bin/.svn/prop-base/bb3.svn-base | 5 + bin/.svn/prop-base/console.svn-base | 5 + bin/.svn/prop-base/evalserver.svn-base | 5 + bin/.svn/text-base/bb3.svn-base | 62 + bin/.svn/text-base/console.svn-base | 36 + bin/.svn/text-base/cpan_fetch.pl.svn-base | 6 + bin/.svn/text-base/evalserver.svn-base | 21 + .../text-base/evalserver_test.pl.svn-base | 23 + bin/bb3 | 62 + bin/console | 36 + bin/cpan_fetch.pl | 6 + bin/evalserver | 21 + bin/evalserver_test.pl | 23 + deps/.svn/dir-prop-base | 5 + deps/.svn/entries | 145 + deps/.svn/prop-base/Geo-IATA.pm.diff.svn-base | 5 + deps/.svn/prop-base/build_deps.sh.svn-base | 5 + deps/.svn/text-base/Geo-IATA.pm.diff.svn-base | 16 + deps/.svn/text-base/build_deps.sh.svn-base | 24 + deps/.svn/text-base/env.js.svn-base | 9895 +++++++++++++++++ deps/Geo-IATA.pm.diff | 16 + deps/IMDB/.svn/entries | 170 + deps/IMDB/.svn/text-base/Changes.svn-base | 6 + deps/IMDB/.svn/text-base/MANIFEST.svn-base | 6 + deps/IMDB/.svn/text-base/Makefile.PL.svn-base | 12 + deps/IMDB/.svn/text-base/README.svn-base | 40 + deps/IMDB/Changes | 6 + deps/IMDB/MANIFEST | 6 + deps/IMDB/Makefile.PL | 12 + deps/IMDB/README | 40 + deps/IMDB/lib/.svn/entries | 62 + deps/IMDB/lib/.svn/text-base/IMDB.pm.svn-base | 241 + deps/IMDB/lib/IMDB.pm | 241 + deps/IMDB/t/.svn/entries | 62 + deps/IMDB/t/.svn/text-base/IMDB.t.svn-base | 17 + deps/IMDB/t/IMDB.t | 17 + .../.svn/entries | 408 + .../.svn/text-base/Changes.svn-base | 94 + .../.svn/text-base/INSTALL.svn-base | 33 + .../.svn/text-base/MANIFEST.SKIP.svn-base | 11 + .../.svn/text-base/MANIFEST.svn-base | 35 + .../.svn/text-base/META.yml.svn-base | 15 + .../.svn/text-base/Makefile.PL.svn-base | 166 + .../.svn/text-base/README.svn-base | 211 + .../.svn/text-base/SpiderMonkey.h.svn-base | 12 + .../.svn/text-base/SpiderMonkey.pm.svn-base | 707 ++ .../.svn/text-base/SpiderMonkey.xs.svn-base | 824 ++ .../.svn/text-base/typemap.svn-base | 17 + .../Changes | 94 + .../INSTALL | 33 + .../MANIFEST | 35 + .../MANIFEST.SKIP | 11 + .../META.yml | 15 + .../Makefile.PL | 166 + .../README | 211 + .../SpiderMonkey.h | 12 + .../SpiderMonkey.pm | 707 ++ .../SpiderMonkey.xs | 824 ++ .../t/.svn/entries | 810 ++ .../t/.svn/prop-base/000readme.t.svn-base | 5 + .../t/.svn/prop-base/001properties.t.svn-base | 5 + .../t/.svn/prop-base/004setget.t.svn-base | 5 + .../t/.svn/prop-base/005error.t.svn-base | 5 + .../t/.svn/prop-base/006objmeth.t.svn-base | 5 + .../t/.svn/prop-base/007funcret.t.svn-base | 5 + .../t/.svn/prop-base/00array.t.svn-base | 5 + .../t/.svn/prop-base/01doc-href.t.svn-base | 5 + .../t/.svn/prop-base/02nav-appv.t.svn-base | 5 + .../t/.svn/prop-base/03doc-write.t.svn-base | 5 + .../t/.svn/prop-base/04loop.t.svn-base | 5 + .../t/.svn/prop-base/05form.t.svn-base | 5 + .../t/.svn/prop-base/06form2.t.svn-base | 5 + .../t/.svn/text-base/000readme.t.svn-base | 33 + .../t/.svn/text-base/001properties.t.svn-base | 63 + .../t/.svn/text-base/002functions.t.svn-base | 60 + .../t/.svn/text-base/003properties.t.svn-base | 25 + .../t/.svn/text-base/004setget.t.svn-base | 119 + .../t/.svn/text-base/005error.t.svn-base | 30 + .../t/.svn/text-base/006objmeth.t.svn-base | 44 + .../t/.svn/text-base/007funcret.t.svn-base | 47 + .../t/.svn/text-base/00array.t.svn-base | 23 + .../t/.svn/text-base/01doc-href.t.svn-base | 24 + .../t/.svn/text-base/02nav-appv.t.svn-base | 21 + .../t/.svn/text-base/03doc-write.t.svn-base | 21 + .../t/.svn/text-base/04loop.t.svn-base | 31 + .../t/.svn/text-base/05form.t.svn-base | 31 + .../t/.svn/text-base/06form2.t.svn-base | 35 + .../t/.svn/text-base/07func.t.svn-base | 27 + .../t/.svn/text-base/08func2.t.svn-base | 29 + .../t/.svn/text-base/09meth.t.svn-base | 30 + .../t/.svn/text-base/10elobj.t.svn-base | 33 + .../t/.svn/text-base/11intret.t.svn-base | 29 + .../t/.svn/text-base/12dblret.t.svn-base | 25 + .../t/.svn/text-base/13strret.t.svn-base | 25 + .../t/.svn/text-base/init.pl.svn-base | 28 + .../t/000readme.t | 33 + .../t/001properties.t | 63 + .../t/002functions.t | 60 + .../t/003properties.t | 25 + .../t/004setget.t | 119 + .../t/005error.t | 30 + .../t/006objmeth.t | 44 + .../t/007funcret.t | 47 + .../t/00array.t | 23 + .../t/01doc-href.t | 24 + .../t/02nav-appv.t | 21 + .../t/03doc-write.t | 21 + .../t/04loop.t | 31 + .../t/05form.t | 31 + .../t/06form2.t | 35 + .../t/07func.t | 27 + .../t/08func2.t | 29 + .../t/09meth.t | 30 + .../t/10elobj.t | 33 + .../t/11intret.t | 29 + .../t/12dblret.t | 25 + .../t/13strret.t | 25 + .../t/init.pl | 28 + .../typemap | 17 + .../util/.svn/entries | 62 + .../util/.svn/prop-base/download.pl.svn-base | 5 + .../util/.svn/text-base/download.pl.svn-base | 30 + .../util/download.pl | 30 + deps/Jplugin/.svn/entries | 238 + deps/Jplugin/.svn/text-base/Changes.svn-base | 6 + .../.svn/text-base/Jplugin.xs.svn-base | 89 + deps/Jplugin/.svn/text-base/MANIFEST.svn-base | 8 + .../.svn/text-base/Makefile.PL.svn-base | 21 + deps/Jplugin/.svn/text-base/README.svn-base | 40 + deps/Jplugin/.svn/text-base/ppport.h.svn-base | 4954 +++++++++ deps/Jplugin/Changes | 6 + deps/Jplugin/Jplugin.xs | 89 + deps/Jplugin/MANIFEST | 8 + deps/Jplugin/Makefile.PL | 21 + deps/Jplugin/README | 40 + deps/Jplugin/lib/.svn/entries | 62 + .../lib/.svn/text-base/Jplugin.pm.svn-base | 78 + deps/Jplugin/lib/Jplugin.pm | 78 + deps/Jplugin/ppport.h | 4954 +++++++++ deps/Jplugin/t/.svn/entries | 62 + .../t/.svn/text-base/Jplugin.t.svn-base | 15 + deps/Jplugin/t/Jplugin.t | 15 + deps/Language-K20/.svn/entries | 445 + .../.svn/text-base/Changes.svn-base | 6 + .../.svn/text-base/K20.xs.svn-base | 36 + .../.svn/text-base/MANIFEST.svn-base | 10 + .../.svn/text-base/Makefile.PL.svn-base | 41 + .../.svn/text-base/Makefile.old.svn-base | 969 ++ .../.svn/text-base/README.svn-base | 40 + .../.svn/text-base/const-c.inc.svn-base | 55 + .../.svn/text-base/const-xs.inc.svn-base | 89 + .../.svn/text-base/k20.h.svn-base | 69 + .../.svn/text-base/ppport.h.svn-base | 6984 ++++++++++++ .../.svn/text-base/stubs_dl.c.svn-base | 3 + .../.svn/text-base/stubs_xs.c.svn-base | 47 + deps/Language-K20/Changes | 6 + deps/Language-K20/K20.xs | 36 + deps/Language-K20/MANIFEST | 10 + deps/Language-K20/Makefile.PL | 41 + deps/Language-K20/Makefile.old | 969 ++ deps/Language-K20/README | 40 + deps/Language-K20/const-c.inc | 55 + deps/Language-K20/const-xs.inc | 89 + deps/Language-K20/fallback/.svn/entries | 96 + .../.svn/text-base/const-c.inc.svn-base | 55 + .../.svn/text-base/const-xs.inc.svn-base | 89 + deps/Language-K20/fallback/const-c.inc | 55 + deps/Language-K20/fallback/const-xs.inc | 89 + deps/Language-K20/k20.h | 69 + deps/Language-K20/lib/.svn/entries | 31 + deps/Language-K20/lib/Language/.svn/entries | 62 + .../Language/.svn/text-base/K20.pm.svn-base | 113 + deps/Language-K20/lib/Language/K20.pm | 113 + deps/Language-K20/ppport.h | 6984 ++++++++++++ deps/Language-K20/stubs_dl.c | 3 + deps/Language-K20/stubs_xs.c | 47 + deps/Language-K20/t/.svn/entries | 62 + .../t/.svn/text-base/Language-K20.t.svn-base | 17 + deps/Language-K20/t/Language-K20.t | 17 + deps/Math/.svn/entries | 65 + .../.svn/text-base/Farnsworth.pm.svn-base | 251 + deps/Math/Farnsworth.pm | 251 + deps/Math/Farnsworth/.svn/entries | 380 + .../.svn/text-base/Dimension.pm.svn-base | 138 + .../.svn/text-base/Error.pm.svn-base | 41 + .../.svn/text-base/Evaluate.pm.svn-base | 759 ++ .../text-base/FunctionDispatch.pm.svn-base | 301 + .../.svn/text-base/Output.pm.svn-base | 660 ++ .../.svn/text-base/Parser.pm.svn-base | 3693 ++++++ .../.svn/text-base/Units.pm.svn-base | 134 + .../.svn/text-base/Value.pm.svn-base | 142 + .../.svn/text-base/Value_old.pm.svn-base | 430 + .../.svn/text-base/Variables.pm.svn-base | 133 + deps/Math/Farnsworth/Dimension.pm | 138 + deps/Math/Farnsworth/Docs/.svn/entries | 96 + .../Docs/.svn/text-base/Functions.pm.svn-base | 276 + .../Docs/.svn/text-base/Syntax.pm.svn-base | 405 + deps/Math/Farnsworth/Docs/Functions.pm | 276 + deps/Math/Farnsworth/Docs/Syntax.pm | 405 + deps/Math/Farnsworth/Error.pm | 41 + deps/Math/Farnsworth/Evaluate.pm | 759 ++ deps/Math/Farnsworth/FunctionDispatch.pm | 301 + deps/Math/Farnsworth/Functions/.svn/entries | 130 + .../text-base/GoogleTranslate.pm.svn-base | 198 + .../.svn/text-base/Standard.pm.svn-base | 458 + .../.svn/text-base/StdMath.pm.svn-base | 453 + .../Farnsworth/Functions/GoogleTranslate.pm | 198 + deps/Math/Farnsworth/Functions/Standard.pm | 458 + deps/Math/Farnsworth/Functions/StdMath.pm | 453 + deps/Math/Farnsworth/Output.pm | 660 ++ deps/Math/Farnsworth/Parser.pm | 3693 ++++++ deps/Math/Farnsworth/Units.pm | 134 + deps/Math/Farnsworth/Units/.svn/entries | 164 + .../Units/.svn/text-base/Currency.pm.svn-base | 79 + .../Units/.svn/text-base/Pi10-6.html.svn-base | 1 + .../Units/.svn/text-base/Standard.pm.svn-base | 4124 +++++++ .../Units/.svn/text-base/e.2mil.svn-base | 1 + deps/Math/Farnsworth/Units/Currency.pm | 79 + deps/Math/Farnsworth/Units/Pi10-6.html | 1 + deps/Math/Farnsworth/Units/Standard.pm | 4124 +++++++ deps/Math/Farnsworth/Units/e.2mil | 1 + deps/Math/Farnsworth/Value.pm | 142 + deps/Math/Farnsworth/Value/.svn/entries | 300 + .../Value/.svn/text-base/Array.pm.svn-base | 227 + .../Value/.svn/text-base/Boolean.pm.svn-base | 198 + .../Value/.svn/text-base/Date.pm.svn-base | 260 + .../Value/.svn/text-base/Lambda.pm.svn-base | 230 + .../Value/.svn/text-base/NewValue.pm.svn-base | 84 + .../Value/.svn/text-base/Pari.pm.svn-base | 271 + .../Value/.svn/text-base/String.pm.svn-base | 232 + .../Value/.svn/text-base/Undef.pm.svn-base | 192 + deps/Math/Farnsworth/Value/Array.pm | 227 + deps/Math/Farnsworth/Value/Boolean.pm | 198 + deps/Math/Farnsworth/Value/Date.pm | 260 + deps/Math/Farnsworth/Value/Lambda.pm | 230 + deps/Math/Farnsworth/Value/NewValue.pm | 84 + deps/Math/Farnsworth/Value/Pari.pm | 271 + deps/Math/Farnsworth/Value/String.pm | 232 + deps/Math/Farnsworth/Value/Undef.pm | 192 + deps/Math/Farnsworth/Value_old.pm | 430 + deps/Math/Farnsworth/Variables.pm | 133 + deps/build_deps.sh | 24 + deps/env.js | 9895 +++++++++++++++++ docs/.svn/dir-prop-base | 5 + docs/.svn/entries | 334 + docs/.svn/text-base/daemons.svn-base | 4 + docs/.svn/text-base/module_list.svn-base | 40 + docs/.svn/text-base/modulelist2.svn-base | 88 + docs/.svn/text-base/pluginmanager.svn-base | 11 + docs/.svn/text-base/plugins.svn-base | 57 + docs/.svn/text-base/quick_start.svn-base | 68 + docs/.svn/text-base/said.svn-base | 37 + docs/.svn/text-base/todo.svn-base | 6 + docs/.svn/text-base/writing_plugins.svn-base | 100 + docs/daemons | 4 + docs/module_list | 40 + docs/modulelist2 | 88 + docs/pluginmanager | 11 + docs/plugins | 57 + docs/quick_start | 68 + docs/said | 37 + docs/todo | 6 + docs/writing_plugins | 100 + etc/.svn/dir-prop-base | 5 + etc/.svn/entries | 96 + etc/.svn/text-base/bb3.conf.svn-base | 83 + etc/.svn/text-base/plugins.conf.svn-base | 13 + etc/bb3.conf | 81 + etc/plugins.conf | 13 + jail/.svn/dir-prop-base | 5 + jail/.svn/entries | 28 + lib/.svn/dir-prop-base | 5 + lib/.svn/entries | 102 + lib/.svn/prop-base/eval.pl.svn-base | 5 + lib/.svn/text-base/EvalServer.pm.svn-base | 238 + lib/.svn/text-base/eval.pl.svn-base | 319 + lib/Bot/.svn/entries | 65 + lib/Bot/.svn/text-base/BB3.pm.svn-base | 280 + lib/Bot/BB3.pm | 280 + lib/Bot/BB3/.svn/entries | 235 + .../.svn/text-base/ConfigParser.pm.svn-base | 66 + lib/Bot/BB3/.svn/text-base/Logger.pm.svn-base | 64 + .../BB3/.svn/text-base/MacroQuote.pm.svn-base | 20 + .../text-base/PluginConfigParser.pm.svn-base | 47 + .../.svn/text-base/PluginManager.pm.svn-base | 771 ++ .../.svn/text-base/PluginWrapper.pm.svn-base | 56 + lib/Bot/BB3/ConfigParser.pm | 66 + lib/Bot/BB3/Logger.pm | 64 + lib/Bot/BB3/MacroQuote.pm | 20 + lib/Bot/BB3/PluginConfigParser.pm | 47 + lib/Bot/BB3/PluginManager.pm | 771 ++ lib/Bot/BB3/PluginWrapper.pm | 56 + lib/Bot/BB3/Roles/.svn/entries | 198 + .../Roles/.svn/prop-base/Console.pm.svn-base | 5 + .../BB3/Roles/.svn/prop-base/IRC.pm.svn-base | 5 + .../BB3/Roles/.svn/prop-base/Web.pm.svn-base | 5 + .../Roles/.svn/text-base/Console.pm.svn-base | 142 + .../BB3/Roles/.svn/text-base/IRC.pm.svn-base | 546 + .../Roles/.svn/text-base/PasteBot.pm.svn-base | 337 + .../text-base/SocketMessageIRC.pm.svn-base | 86 + .../BB3/Roles/.svn/text-base/Web.pm.svn-base | 141 + lib/Bot/BB3/Roles/Console.pm | 142 + lib/Bot/BB3/Roles/IRC.pm | 546 + lib/Bot/BB3/Roles/PasteBot.pm | 337 + lib/Bot/BB3/Roles/SocketMessageIRC.pm | 86 + lib/Bot/BB3/Roles/Web.pm | 141 + lib/EvalServer.pm | 238 + lib/eval.pl | 319 + lib/jail/.svn/entries | 28 + patch | 586 + plugins/.svn/dir-prop-base | 5 + plugins/.svn/entries | 1510 +++ plugins/.svn/prop-base/host.pm.svn-base | 5 + plugins/.svn/prop-base/rss.pm.svn-base | 5 + plugins/.svn/text-base/arg.pm.svn-base | 38 + .../.svn/text-base/cache_check.pm.svn-base | 37 + plugins/.svn/text-base/compose.pm.svn-base | 117 + plugins/.svn/text-base/conf.pm.svn-base | 51 + plugins/.svn/text-base/conf_dump.pm.svn-base | 19 + plugins/.svn/text-base/core.pm.svn-base | 25 + plugins/.svn/text-base/echo.pm.svn-base | 8 + plugins/.svn/text-base/eval.pm.svn-base | 78 + plugins/.svn/text-base/factoids.pm.svn-base | 501 + plugins/.svn/text-base/geoip.pm.svn-base | 18 + plugins/.svn/text-base/head.pm.svn-base | 31 + plugins/.svn/text-base/help.pm.svn-base | 24 + plugins/.svn/text-base/host.pm.svn-base | 47 + .../.svn/text-base/host_lookup.pm.svn-base | 14 + plugins/.svn/text-base/join.pm.svn-base | 13 + plugins/.svn/text-base/karma.pm.svn-base | 42 + .../.svn/text-base/karma_modify.pm.svn-base | 74 + plugins/.svn/text-base/more.pm.svn-base | 63 + .../.svn/text-base/nick_lookup.pm.svn-base | 14 + plugins/.svn/text-base/part.pm.svn-base | 12 + plugins/.svn/text-base/plugins.pm.svn-base | 23 + plugins/.svn/text-base/quote.pm.svn-base | 14 + .../.svn/text-base/reload_plugins.pm.svn-base | 14 + plugins/.svn/text-base/restart.pm.svn-base | 10 + plugins/.svn/text-base/rss.pm.svn-base | 22 + plugins/.svn/text-base/rss_title.pm.svn-base | 20 + plugins/.svn/text-base/rt.pm.svn-base | 27 + .../.svn/text-base/save_config.pm.svn-base | 10 + plugins/.svn/text-base/seen.pm.svn-base | 94 + plugins/.svn/text-base/shorten.pm.svn-base | 11 + plugins/.svn/text-base/spell.pm.svn-base | 67 + plugins/.svn/text-base/unicode.pm.svn-base | 57 + plugins/.svn/text-base/weather.pm.svn-base | 62 + plugins/arg.pm | 38 + plugins/cache_check.pm | 37 + plugins/compose.pm | 117 + plugins/conf.pm | 51 + plugins/conf_dump.pm | 19 + plugins/core.pm | 25 + plugins/echo.pm | 8 + plugins/eval.pm | 78 + plugins/factoids.pm | 501 + plugins/geoip.pm | 18 + plugins/head.pm | 31 + plugins/help.pm | 24 + plugins/host.pm | 47 + plugins/host_lookup.pm | 14 + plugins/join.pm | 13 + plugins/karma.pm | 42 + plugins/karma_modify.pm | 74 + plugins/more.pm | 63 + plugins/nick_lookup.pm | 14 + plugins/part.pm | 12 + plugins/plugins.pm | 23 + plugins/quote.pm | 14 + plugins/reload_plugins.pm | 14 + plugins/restart.pm | 10 + plugins/rss.pm | 22 + plugins/rss_title.pm | 20 + plugins/rt.pm | 27 + plugins/save_config.pm | 10 + plugins/seen.pm | 94 + plugins/shorten.pm | 11 + plugins/spell.pm | 67 + plugins/unicode.pm | 57 + plugins/weather.pm | 62 + var/.svn/dir-prop-base | 5 + var/.svn/entries | 266 + var/.svn/prop-base/factoids.db.svn-base | 5 + .../prop-base/full_units.storable.svn-base | 5 + var/.svn/prop-base/karma.db.svn-base | 5 + var/.svn/prop-base/pastes.db.svn-base | 5 + var/.svn/prop-base/seen.db.svn-base | 5 + var/.svn/prop-base/tell.db.svn-base | 5 + var/.svn/text-base/factoids.db.svn-base | Bin 0 -> 637952 bytes .../text-base/full_units.storable.svn-base | Bin 0 -> 870351 bytes var/.svn/text-base/hosts.db.svn-base | 0 var/.svn/text-base/karma.db.svn-base | Bin 0 -> 724992 bytes var/.svn/text-base/pastes.db.svn-base | Bin 0 -> 3072 bytes var/.svn/text-base/seen.db.svn-base | Bin 0 -> 6144 bytes var/.svn/text-base/tell.db.svn-base | Bin 0 -> 3072 bytes var/_Inline/config | 20 + var/full_units.storable | Bin 0 -> 870351 bytes var/hosts.db | 0 var/import.pl | 65 + var/importkarma.pl | 53 + 402 files changed, 101639 insertions(+) create mode 100644 bin/.svn/dir-prop-base create mode 100644 bin/.svn/entries create mode 100644 bin/.svn/prop-base/bb3.svn-base create mode 100644 bin/.svn/prop-base/console.svn-base create mode 100644 bin/.svn/prop-base/evalserver.svn-base create mode 100644 bin/.svn/text-base/bb3.svn-base create mode 100644 bin/.svn/text-base/console.svn-base create mode 100644 bin/.svn/text-base/cpan_fetch.pl.svn-base create mode 100644 bin/.svn/text-base/evalserver.svn-base create mode 100644 bin/.svn/text-base/evalserver_test.pl.svn-base create mode 100755 bin/bb3 create mode 100755 bin/console create mode 100644 bin/cpan_fetch.pl create mode 100755 bin/evalserver create mode 100644 bin/evalserver_test.pl create mode 100644 deps/.svn/dir-prop-base create mode 100644 deps/.svn/entries create mode 100644 deps/.svn/prop-base/Geo-IATA.pm.diff.svn-base create mode 100644 deps/.svn/prop-base/build_deps.sh.svn-base create mode 100644 deps/.svn/text-base/Geo-IATA.pm.diff.svn-base create mode 100644 deps/.svn/text-base/build_deps.sh.svn-base create mode 100644 deps/.svn/text-base/env.js.svn-base create mode 100755 deps/Geo-IATA.pm.diff create mode 100644 deps/IMDB/.svn/entries create mode 100644 deps/IMDB/.svn/text-base/Changes.svn-base create mode 100644 deps/IMDB/.svn/text-base/MANIFEST.svn-base create mode 100644 deps/IMDB/.svn/text-base/Makefile.PL.svn-base create mode 100644 deps/IMDB/.svn/text-base/README.svn-base create mode 100644 deps/IMDB/Changes create mode 100644 deps/IMDB/MANIFEST create mode 100644 deps/IMDB/Makefile.PL create mode 100644 deps/IMDB/README create mode 100644 deps/IMDB/lib/.svn/entries create mode 100644 deps/IMDB/lib/.svn/text-base/IMDB.pm.svn-base create mode 100644 deps/IMDB/lib/IMDB.pm create mode 100644 deps/IMDB/t/.svn/entries create mode 100644 deps/IMDB/t/.svn/text-base/IMDB.t.svn-base create mode 100644 deps/IMDB/t/IMDB.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/entries create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/Changes.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/INSTALL.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/MANIFEST.SKIP.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/MANIFEST.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/META.yml.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/Makefile.PL.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/README.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/SpiderMonkey.h.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/SpiderMonkey.pm.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/SpiderMonkey.xs.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/.svn/text-base/typemap.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/Changes create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/INSTALL create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/MANIFEST create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/MANIFEST.SKIP create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/META.yml create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/Makefile.PL create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/README create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/SpiderMonkey.h create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/SpiderMonkey.pm create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/SpiderMonkey.xs create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/entries create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/000readme.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/001properties.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/004setget.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/005error.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/006objmeth.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/007funcret.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/00array.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/01doc-href.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/02nav-appv.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/03doc-write.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/04loop.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/05form.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/prop-base/06form2.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/000readme.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/001properties.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/002functions.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/003properties.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/004setget.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/005error.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/006objmeth.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/007funcret.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/00array.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/01doc-href.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/02nav-appv.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/03doc-write.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/04loop.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/05form.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/06form2.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/07func.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/08func2.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/09meth.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/10elobj.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/11intret.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/12dblret.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/13strret.t.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/.svn/text-base/init.pl.svn-base create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/000readme.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/001properties.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/002functions.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/003properties.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/004setget.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/005error.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/006objmeth.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/007funcret.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/00array.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/01doc-href.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/02nav-appv.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/03doc-write.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/04loop.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/05form.t create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/t/06form2.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/07func.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/08func2.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/09meth.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/10elobj.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/11intret.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/12dblret.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/13strret.t create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/t/init.pl create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/typemap create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/util/.svn/entries create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/util/.svn/prop-base/download.pl.svn-base create mode 100644 deps/JavaScript-SpiderMonkey-0.19-patched/util/.svn/text-base/download.pl.svn-base create mode 100755 deps/JavaScript-SpiderMonkey-0.19-patched/util/download.pl create mode 100644 deps/Jplugin/.svn/entries create mode 100644 deps/Jplugin/.svn/text-base/Changes.svn-base create mode 100644 deps/Jplugin/.svn/text-base/Jplugin.xs.svn-base create mode 100644 deps/Jplugin/.svn/text-base/MANIFEST.svn-base create mode 100644 deps/Jplugin/.svn/text-base/Makefile.PL.svn-base create mode 100644 deps/Jplugin/.svn/text-base/README.svn-base create mode 100644 deps/Jplugin/.svn/text-base/ppport.h.svn-base create mode 100644 deps/Jplugin/Changes create mode 100644 deps/Jplugin/Jplugin.xs create mode 100644 deps/Jplugin/MANIFEST create mode 100644 deps/Jplugin/Makefile.PL create mode 100644 deps/Jplugin/README create mode 100644 deps/Jplugin/lib/.svn/entries create mode 100644 deps/Jplugin/lib/.svn/text-base/Jplugin.pm.svn-base create mode 100644 deps/Jplugin/lib/Jplugin.pm create mode 100644 deps/Jplugin/ppport.h create mode 100644 deps/Jplugin/t/.svn/entries create mode 100644 deps/Jplugin/t/.svn/text-base/Jplugin.t.svn-base create mode 100644 deps/Jplugin/t/Jplugin.t create mode 100644 deps/Language-K20/.svn/entries create mode 100644 deps/Language-K20/.svn/text-base/Changes.svn-base create mode 100644 deps/Language-K20/.svn/text-base/K20.xs.svn-base create mode 100644 deps/Language-K20/.svn/text-base/MANIFEST.svn-base create mode 100644 deps/Language-K20/.svn/text-base/Makefile.PL.svn-base create mode 100644 deps/Language-K20/.svn/text-base/Makefile.old.svn-base create mode 100644 deps/Language-K20/.svn/text-base/README.svn-base create mode 100644 deps/Language-K20/.svn/text-base/const-c.inc.svn-base create mode 100644 deps/Language-K20/.svn/text-base/const-xs.inc.svn-base create mode 100644 deps/Language-K20/.svn/text-base/k20.h.svn-base create mode 100644 deps/Language-K20/.svn/text-base/ppport.h.svn-base create mode 100644 deps/Language-K20/.svn/text-base/stubs_dl.c.svn-base create mode 100644 deps/Language-K20/.svn/text-base/stubs_xs.c.svn-base create mode 100644 deps/Language-K20/Changes create mode 100644 deps/Language-K20/K20.xs create mode 100644 deps/Language-K20/MANIFEST create mode 100644 deps/Language-K20/Makefile.PL create mode 100644 deps/Language-K20/Makefile.old create mode 100644 deps/Language-K20/README create mode 100644 deps/Language-K20/const-c.inc create mode 100644 deps/Language-K20/const-xs.inc create mode 100644 deps/Language-K20/fallback/.svn/entries create mode 100644 deps/Language-K20/fallback/.svn/text-base/const-c.inc.svn-base create mode 100644 deps/Language-K20/fallback/.svn/text-base/const-xs.inc.svn-base create mode 100644 deps/Language-K20/fallback/const-c.inc create mode 100644 deps/Language-K20/fallback/const-xs.inc create mode 100644 deps/Language-K20/k20.h create mode 100644 deps/Language-K20/lib/.svn/entries create mode 100644 deps/Language-K20/lib/Language/.svn/entries create mode 100644 deps/Language-K20/lib/Language/.svn/text-base/K20.pm.svn-base create mode 100644 deps/Language-K20/lib/Language/K20.pm create mode 100644 deps/Language-K20/ppport.h create mode 100644 deps/Language-K20/stubs_dl.c create mode 100644 deps/Language-K20/stubs_xs.c create mode 100644 deps/Language-K20/t/.svn/entries create mode 100644 deps/Language-K20/t/.svn/text-base/Language-K20.t.svn-base create mode 100644 deps/Language-K20/t/Language-K20.t create mode 100644 deps/Math/.svn/entries create mode 100644 deps/Math/.svn/text-base/Farnsworth.pm.svn-base create mode 100644 deps/Math/Farnsworth.pm create mode 100644 deps/Math/Farnsworth/.svn/entries create mode 100644 deps/Math/Farnsworth/.svn/text-base/Dimension.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Error.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Evaluate.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/FunctionDispatch.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Output.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Parser.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Units.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Value.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Value_old.pm.svn-base create mode 100644 deps/Math/Farnsworth/.svn/text-base/Variables.pm.svn-base create mode 100644 deps/Math/Farnsworth/Dimension.pm create mode 100644 deps/Math/Farnsworth/Docs/.svn/entries create mode 100644 deps/Math/Farnsworth/Docs/.svn/text-base/Functions.pm.svn-base create mode 100644 deps/Math/Farnsworth/Docs/.svn/text-base/Syntax.pm.svn-base create mode 100644 deps/Math/Farnsworth/Docs/Functions.pm create mode 100644 deps/Math/Farnsworth/Docs/Syntax.pm create mode 100644 deps/Math/Farnsworth/Error.pm create mode 100644 deps/Math/Farnsworth/Evaluate.pm create mode 100644 deps/Math/Farnsworth/FunctionDispatch.pm create mode 100644 deps/Math/Farnsworth/Functions/.svn/entries create mode 100644 deps/Math/Farnsworth/Functions/.svn/text-base/GoogleTranslate.pm.svn-base create mode 100644 deps/Math/Farnsworth/Functions/.svn/text-base/Standard.pm.svn-base create mode 100644 deps/Math/Farnsworth/Functions/.svn/text-base/StdMath.pm.svn-base create mode 100644 deps/Math/Farnsworth/Functions/GoogleTranslate.pm create mode 100644 deps/Math/Farnsworth/Functions/Standard.pm create mode 100644 deps/Math/Farnsworth/Functions/StdMath.pm create mode 100644 deps/Math/Farnsworth/Output.pm create mode 100644 deps/Math/Farnsworth/Parser.pm create mode 100644 deps/Math/Farnsworth/Units.pm create mode 100644 deps/Math/Farnsworth/Units/.svn/entries create mode 100644 deps/Math/Farnsworth/Units/.svn/text-base/Currency.pm.svn-base create mode 100644 deps/Math/Farnsworth/Units/.svn/text-base/Pi10-6.html.svn-base create mode 100644 deps/Math/Farnsworth/Units/.svn/text-base/Standard.pm.svn-base create mode 100644 deps/Math/Farnsworth/Units/.svn/text-base/e.2mil.svn-base create mode 100644 deps/Math/Farnsworth/Units/Currency.pm create mode 100644 deps/Math/Farnsworth/Units/Pi10-6.html create mode 100644 deps/Math/Farnsworth/Units/Standard.pm create mode 100644 deps/Math/Farnsworth/Units/e.2mil create mode 100644 deps/Math/Farnsworth/Value.pm create mode 100644 deps/Math/Farnsworth/Value/.svn/entries create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Array.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Boolean.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Date.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Lambda.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/NewValue.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Pari.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/String.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/.svn/text-base/Undef.pm.svn-base create mode 100644 deps/Math/Farnsworth/Value/Array.pm create mode 100644 deps/Math/Farnsworth/Value/Boolean.pm create mode 100644 deps/Math/Farnsworth/Value/Date.pm create mode 100644 deps/Math/Farnsworth/Value/Lambda.pm create mode 100644 deps/Math/Farnsworth/Value/NewValue.pm create mode 100644 deps/Math/Farnsworth/Value/Pari.pm create mode 100644 deps/Math/Farnsworth/Value/String.pm create mode 100644 deps/Math/Farnsworth/Value/Undef.pm create mode 100644 deps/Math/Farnsworth/Value_old.pm create mode 100644 deps/Math/Farnsworth/Variables.pm create mode 100755 deps/build_deps.sh create mode 100644 deps/env.js create mode 100644 docs/.svn/dir-prop-base create mode 100644 docs/.svn/entries create mode 100644 docs/.svn/text-base/daemons.svn-base create mode 100644 docs/.svn/text-base/module_list.svn-base create mode 100644 docs/.svn/text-base/modulelist2.svn-base create mode 100644 docs/.svn/text-base/pluginmanager.svn-base create mode 100644 docs/.svn/text-base/plugins.svn-base create mode 100644 docs/.svn/text-base/quick_start.svn-base create mode 100644 docs/.svn/text-base/said.svn-base create mode 100644 docs/.svn/text-base/todo.svn-base create mode 100644 docs/.svn/text-base/writing_plugins.svn-base create mode 100644 docs/daemons create mode 100644 docs/module_list create mode 100644 docs/modulelist2 create mode 100644 docs/pluginmanager create mode 100644 docs/plugins create mode 100644 docs/quick_start create mode 100644 docs/said create mode 100644 docs/todo create mode 100644 docs/writing_plugins create mode 100644 etc/.svn/dir-prop-base create mode 100644 etc/.svn/entries create mode 100644 etc/.svn/text-base/bb3.conf.svn-base create mode 100644 etc/.svn/text-base/plugins.conf.svn-base create mode 100644 etc/bb3.conf create mode 100644 etc/plugins.conf create mode 100644 jail/.svn/dir-prop-base create mode 100644 jail/.svn/entries create mode 100644 lib/.svn/dir-prop-base create mode 100644 lib/.svn/entries create mode 100644 lib/.svn/prop-base/eval.pl.svn-base create mode 100644 lib/.svn/text-base/EvalServer.pm.svn-base create mode 100644 lib/.svn/text-base/eval.pl.svn-base create mode 100644 lib/Bot/.svn/entries create mode 100644 lib/Bot/.svn/text-base/BB3.pm.svn-base create mode 100644 lib/Bot/BB3.pm create mode 100644 lib/Bot/BB3/.svn/entries create mode 100644 lib/Bot/BB3/.svn/text-base/ConfigParser.pm.svn-base create mode 100644 lib/Bot/BB3/.svn/text-base/Logger.pm.svn-base create mode 100644 lib/Bot/BB3/.svn/text-base/MacroQuote.pm.svn-base create mode 100644 lib/Bot/BB3/.svn/text-base/PluginConfigParser.pm.svn-base create mode 100644 lib/Bot/BB3/.svn/text-base/PluginManager.pm.svn-base create mode 100644 lib/Bot/BB3/.svn/text-base/PluginWrapper.pm.svn-base create mode 100644 lib/Bot/BB3/ConfigParser.pm create mode 100644 lib/Bot/BB3/Logger.pm create mode 100644 lib/Bot/BB3/MacroQuote.pm create mode 100644 lib/Bot/BB3/PluginConfigParser.pm create mode 100644 lib/Bot/BB3/PluginManager.pm create mode 100644 lib/Bot/BB3/PluginWrapper.pm create mode 100644 lib/Bot/BB3/Roles/.svn/entries create mode 100644 lib/Bot/BB3/Roles/.svn/prop-base/Console.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/prop-base/IRC.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/prop-base/Web.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/text-base/Console.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/text-base/IRC.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/text-base/PasteBot.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/text-base/SocketMessageIRC.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/.svn/text-base/Web.pm.svn-base create mode 100644 lib/Bot/BB3/Roles/Console.pm create mode 100644 lib/Bot/BB3/Roles/IRC.pm create mode 100644 lib/Bot/BB3/Roles/PasteBot.pm create mode 100644 lib/Bot/BB3/Roles/SocketMessageIRC.pm create mode 100644 lib/Bot/BB3/Roles/Web.pm create mode 100644 lib/EvalServer.pm create mode 100755 lib/eval.pl create mode 100644 lib/jail/.svn/entries create mode 100644 patch create mode 100644 plugins/.svn/dir-prop-base create mode 100644 plugins/.svn/entries create mode 100644 plugins/.svn/prop-base/host.pm.svn-base create mode 100644 plugins/.svn/prop-base/rss.pm.svn-base create mode 100644 plugins/.svn/text-base/arg.pm.svn-base create mode 100644 plugins/.svn/text-base/cache_check.pm.svn-base create mode 100644 plugins/.svn/text-base/compose.pm.svn-base create mode 100644 plugins/.svn/text-base/conf.pm.svn-base create mode 100644 plugins/.svn/text-base/conf_dump.pm.svn-base create mode 100644 plugins/.svn/text-base/core.pm.svn-base create mode 100644 plugins/.svn/text-base/echo.pm.svn-base create mode 100644 plugins/.svn/text-base/eval.pm.svn-base create mode 100644 plugins/.svn/text-base/factoids.pm.svn-base create mode 100644 plugins/.svn/text-base/geoip.pm.svn-base create mode 100644 plugins/.svn/text-base/head.pm.svn-base create mode 100644 plugins/.svn/text-base/help.pm.svn-base create mode 100644 plugins/.svn/text-base/host.pm.svn-base create mode 100644 plugins/.svn/text-base/host_lookup.pm.svn-base create mode 100644 plugins/.svn/text-base/join.pm.svn-base create mode 100644 plugins/.svn/text-base/karma.pm.svn-base create mode 100644 plugins/.svn/text-base/karma_modify.pm.svn-base create mode 100644 plugins/.svn/text-base/more.pm.svn-base create mode 100644 plugins/.svn/text-base/nick_lookup.pm.svn-base create mode 100644 plugins/.svn/text-base/part.pm.svn-base create mode 100644 plugins/.svn/text-base/plugins.pm.svn-base create mode 100644 plugins/.svn/text-base/quote.pm.svn-base create mode 100644 plugins/.svn/text-base/reload_plugins.pm.svn-base create mode 100644 plugins/.svn/text-base/restart.pm.svn-base create mode 100644 plugins/.svn/text-base/rss.pm.svn-base create mode 100644 plugins/.svn/text-base/rss_title.pm.svn-base create mode 100644 plugins/.svn/text-base/rt.pm.svn-base create mode 100644 plugins/.svn/text-base/save_config.pm.svn-base create mode 100644 plugins/.svn/text-base/seen.pm.svn-base create mode 100644 plugins/.svn/text-base/shorten.pm.svn-base create mode 100644 plugins/.svn/text-base/spell.pm.svn-base create mode 100644 plugins/.svn/text-base/unicode.pm.svn-base create mode 100644 plugins/.svn/text-base/weather.pm.svn-base create mode 100644 plugins/arg.pm create mode 100644 plugins/cache_check.pm create mode 100644 plugins/compose.pm create mode 100644 plugins/conf.pm create mode 100644 plugins/conf_dump.pm create mode 100644 plugins/core.pm create mode 100644 plugins/echo.pm create mode 100644 plugins/eval.pm create mode 100644 plugins/factoids.pm create mode 100644 plugins/geoip.pm create mode 100644 plugins/head.pm create mode 100644 plugins/help.pm create mode 100755 plugins/host.pm create mode 100644 plugins/host_lookup.pm create mode 100644 plugins/join.pm create mode 100644 plugins/karma.pm create mode 100644 plugins/karma_modify.pm create mode 100644 plugins/more.pm create mode 100644 plugins/nick_lookup.pm create mode 100644 plugins/part.pm create mode 100644 plugins/plugins.pm create mode 100644 plugins/quote.pm create mode 100644 plugins/reload_plugins.pm create mode 100644 plugins/restart.pm create mode 100644 plugins/rss.pm create mode 100644 plugins/rss_title.pm create mode 100644 plugins/rt.pm create mode 100644 plugins/save_config.pm create mode 100644 plugins/seen.pm create mode 100644 plugins/shorten.pm create mode 100644 plugins/spell.pm create mode 100644 plugins/unicode.pm create mode 100644 plugins/weather.pm create mode 100644 var/.svn/dir-prop-base create mode 100644 var/.svn/entries create mode 100644 var/.svn/prop-base/factoids.db.svn-base create mode 100644 var/.svn/prop-base/full_units.storable.svn-base create mode 100644 var/.svn/prop-base/karma.db.svn-base create mode 100644 var/.svn/prop-base/pastes.db.svn-base create mode 100644 var/.svn/prop-base/seen.db.svn-base create mode 100644 var/.svn/prop-base/tell.db.svn-base create mode 100644 var/.svn/text-base/factoids.db.svn-base create mode 100644 var/.svn/text-base/full_units.storable.svn-base create mode 100644 var/.svn/text-base/hosts.db.svn-base create mode 100644 var/.svn/text-base/karma.db.svn-base create mode 100644 var/.svn/text-base/pastes.db.svn-base create mode 100644 var/.svn/text-base/seen.db.svn-base create mode 100644 var/.svn/text-base/tell.db.svn-base create mode 100644 var/_Inline/config create mode 100644 var/full_units.storable create mode 100644 var/hosts.db create mode 100755 var/import.pl create mode 100755 var/importkarma.pl diff --git a/bin/.svn/dir-prop-base b/bin/.svn/dir-prop-base new file mode 100644 index 0000000..3160658 --- /dev/null +++ b/bin/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 13 +svn:mergeinfo +V 0 + +END diff --git a/bin/.svn/entries b/bin/.svn/entries new file mode 100644 index 0000000..a0454c0 --- /dev/null +++ b/bin/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +475 +svn://erxz.com/bb3/branches/perlbuut/bin +svn://erxz.com/bb3 + + + +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + +dcb1cea6-7f7e-4c78-8a22-148ace8ce36e + +console +file + + + + +2009-10-03T22:54:20.000000Z +35d0f0f3f22d1c5c9269a11438e8b9bf +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + + + + + + + + +650 + +cpan_fetch.pl +file + + + + +2009-10-03T22:54:20.000000Z +a060d683a14b4caf9b955835d84928a2 +2009-10-03T22:53:42.528878Z +475 +simcop + + + + + + + + + + + + + + + + + + + + + +190 + +bb3 +file + + + + +2009-10-03T22:54:20.000000Z +19a8492fe2e1f4555b3e0420804bc08e +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + + + + + + + + +1416 + +evalserver_test.pl +file + + + + +2009-10-03T22:54:20.000000Z +6b3a1a206e0f305decc280b74a0a83f3 +2009-10-03T22:53:42.528878Z +475 +simcop + + + + + + + + + + + + + + + + + + + + + +454 + +evalserver +file + + + + +2009-10-03T22:54:20.000000Z +a89e0e8f5969ec905d7641c00a8be339 +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + + + + + + + + +540 + diff --git a/bin/.svn/prop-base/bb3.svn-base b/bin/.svn/prop-base/bb3.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/bin/.svn/prop-base/bb3.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/bin/.svn/prop-base/console.svn-base b/bin/.svn/prop-base/console.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/bin/.svn/prop-base/console.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/bin/.svn/prop-base/evalserver.svn-base b/bin/.svn/prop-base/evalserver.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/bin/.svn/prop-base/evalserver.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/bin/.svn/text-base/bb3.svn-base b/bin/.svn/text-base/bb3.svn-base new file mode 100644 index 0000000..32a15c8 --- /dev/null +++ b/bin/.svn/text-base/bb3.svn-base @@ -0,0 +1,62 @@ +#!/usr/bin/perl +use POSIX qw/setsid/; +use Getopt::Std; + +my %OPTS; +# Localize the @ARGV so we preserve it +# since getopts destructively modifies it +# we need it to be intact so we can restart +# ourselves later. +BEGIN { local @ARGV=@ARGV; getopts("dm:M:c:p:", \%OPTS) }; +# d daemon +# m only this role(s) +# M Every role but this Not Implemented +# c conf file +# p plugin conf file + +# Guess we're being activated inside bin/, so go up a directory. +BEGIN { + if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { + chdir ".."; + } + elsif( my @par_dirs = grep /tmp.*par.*cache-/, @INC ) { + # We're running under PAR! + chdir( ( grep /inc$/, @par_dirs ) [0] ); #Find the one that ends in inc/ + mkdir "var"; # We need one of these.. + } + elsif( $0 =~ '/' and $0 ne 'bin/bb3' ) { + my $path = $0; + $path =~ s{bin/bb3$}{}; + chdir $path; + } +} + +use lib 'lib'; +use Bot::BB3; + +use Data::Dumper; + +Bot::BB3->new( { + main_conf_file => $OPTS{c} || 'etc/bb3.conf', + plugin_conf_file => $OPTS{p} || 'etc/plugins.conf', + only_roles => $OPTS{m}, +} ); + +# Only daemonize if we're asked to. +if( $OPTS{d} ) { + setsid(); + fork and exit; + + open STDOUT, ">var/bb3.stdout" or die "Tried to reopen STDOUT to bb3.stdout: $!"; + open STDERR, ">var/bb3.stderr" or die "Tried to reopen STDERR to bb3.stdout: $!"; + close STDIN; + + open my $fh, ">var/bb3.pid" or die "Failed to open pid file: $!"; + print $fh $$; + close $fh; +} + +POE::Kernel->run; + + +exit; diff --git a/bin/.svn/text-base/console.svn-base b/bin/.svn/text-base/console.svn-base new file mode 100644 index 0000000..1cc673e --- /dev/null +++ b/bin/.svn/text-base/console.svn-base @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +use strict; +use Term::ReadLine; +use IO::Socket::INET; + +use Getopt::Std; + +my %OPTS; +getopts( 'p:', \%OPTS ); + +my $connect_port = $OPTS{p} || 14401; + +my $socket = IO::Socket::INET->new( + PeerHost => '127.0.0.1', + PeerPort => $connect_port, + ReuseAddr => 1, + Proto => 'tcp', + Type => SOCK_STREAM, +) or die "Failed to connect to localhost on $connect_port, try specifying a port with -p"; + +my $term = Term::ReadLine->new( "BB3 Console" ); +my $prompt = "bb3> "; + +while( defined( $_ = $term->readline($prompt) ) ) { + + print $socket "$_\n"; + + my $output; + sysread $socket, $output, 4096; + + $output =~ s/^CC: //; + + + print $output, "\n"; +} diff --git a/bin/.svn/text-base/cpan_fetch.pl.svn-base b/bin/.svn/text-base/cpan_fetch.pl.svn-base new file mode 100644 index 0000000..aacf3f0 --- /dev/null +++ b/bin/.svn/text-base/cpan_fetch.pl.svn-base @@ -0,0 +1,6 @@ +__END__ +http://cpan.mirror.facebook.com/authors/01mailrc.txt.gz +http://cpan.mirror.facebook.com/modules/02packages.details.txt.gz +http://cpan.mirror.facebook.com/modules/03modlist.data.gz + + diff --git a/bin/.svn/text-base/evalserver.svn-base b/bin/.svn/text-base/evalserver.svn-base new file mode 100644 index 0000000..f061926 --- /dev/null +++ b/bin/.svn/text-base/evalserver.svn-base @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +# Guess we're being activated inside bin/, so go up a directory. +BEGIN { if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { chdir ".."; } } + +use lib 'lib'; +use EvalServer; +use POSIX qw/setsid/; + +# Only daemonize if we're asked to. +if( $ARGV[0] eq '-d' ) { + # Crude daemonization + setsid(); + fork and exit; + + open STDOUT, ">var/evalserver.stdout" or die "Tried to reopen STDOUT to bb3.stdout: $!"; + open STDERR, ">var/evalserver.stderr" or die "Tried to reopen STDERR to bb3.stdout: $!"; + close STDIN; +} + +EvalServer->start; diff --git a/bin/.svn/text-base/evalserver_test.pl.svn-base b/bin/.svn/text-base/evalserver_test.pl.svn-base new file mode 100644 index 0000000..007d33c --- /dev/null +++ b/bin/.svn/text-base/evalserver_test.pl.svn-base @@ -0,0 +1,23 @@ + +use POE::Filter::Reference; +use IO::Socket::INET; +use Data::Dumper; + + +my $filter = POE::Filter::Reference->new(); + +while( 1 ) { + print "Code: "; + my $code = ; + + my $socket = IO::Socket::INET->new( PeerAddr => '127.0.0.1', PeerPort => '14400' ); + my $refs = $filter->put( [ { code => "$code" } ] ); + + print $socket $refs->[0]; + + local $/; + my $output = <$socket>; + print "OUTPUT: ", Dumper($filter->get( [ $output ] )), "\n"; + + $socket->close; +} diff --git a/bin/bb3 b/bin/bb3 new file mode 100755 index 0000000..32a15c8 --- /dev/null +++ b/bin/bb3 @@ -0,0 +1,62 @@ +#!/usr/bin/perl +use POSIX qw/setsid/; +use Getopt::Std; + +my %OPTS; +# Localize the @ARGV so we preserve it +# since getopts destructively modifies it +# we need it to be intact so we can restart +# ourselves later. +BEGIN { local @ARGV=@ARGV; getopts("dm:M:c:p:", \%OPTS) }; +# d daemon +# m only this role(s) +# M Every role but this Not Implemented +# c conf file +# p plugin conf file + +# Guess we're being activated inside bin/, so go up a directory. +BEGIN { + if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { + chdir ".."; + } + elsif( my @par_dirs = grep /tmp.*par.*cache-/, @INC ) { + # We're running under PAR! + chdir( ( grep /inc$/, @par_dirs ) [0] ); #Find the one that ends in inc/ + mkdir "var"; # We need one of these.. + } + elsif( $0 =~ '/' and $0 ne 'bin/bb3' ) { + my $path = $0; + $path =~ s{bin/bb3$}{}; + chdir $path; + } +} + +use lib 'lib'; +use Bot::BB3; + +use Data::Dumper; + +Bot::BB3->new( { + main_conf_file => $OPTS{c} || 'etc/bb3.conf', + plugin_conf_file => $OPTS{p} || 'etc/plugins.conf', + only_roles => $OPTS{m}, +} ); + +# Only daemonize if we're asked to. +if( $OPTS{d} ) { + setsid(); + fork and exit; + + open STDOUT, ">var/bb3.stdout" or die "Tried to reopen STDOUT to bb3.stdout: $!"; + open STDERR, ">var/bb3.stderr" or die "Tried to reopen STDERR to bb3.stdout: $!"; + close STDIN; + + open my $fh, ">var/bb3.pid" or die "Failed to open pid file: $!"; + print $fh $$; + close $fh; +} + +POE::Kernel->run; + + +exit; diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..1cc673e --- /dev/null +++ b/bin/console @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +use strict; +use Term::ReadLine; +use IO::Socket::INET; + +use Getopt::Std; + +my %OPTS; +getopts( 'p:', \%OPTS ); + +my $connect_port = $OPTS{p} || 14401; + +my $socket = IO::Socket::INET->new( + PeerHost => '127.0.0.1', + PeerPort => $connect_port, + ReuseAddr => 1, + Proto => 'tcp', + Type => SOCK_STREAM, +) or die "Failed to connect to localhost on $connect_port, try specifying a port with -p"; + +my $term = Term::ReadLine->new( "BB3 Console" ); +my $prompt = "bb3> "; + +while( defined( $_ = $term->readline($prompt) ) ) { + + print $socket "$_\n"; + + my $output; + sysread $socket, $output, 4096; + + $output =~ s/^CC: //; + + + print $output, "\n"; +} diff --git a/bin/cpan_fetch.pl b/bin/cpan_fetch.pl new file mode 100644 index 0000000..aacf3f0 --- /dev/null +++ b/bin/cpan_fetch.pl @@ -0,0 +1,6 @@ +__END__ +http://cpan.mirror.facebook.com/authors/01mailrc.txt.gz +http://cpan.mirror.facebook.com/modules/02packages.details.txt.gz +http://cpan.mirror.facebook.com/modules/03modlist.data.gz + + diff --git a/bin/evalserver b/bin/evalserver new file mode 100755 index 0000000..f061926 --- /dev/null +++ b/bin/evalserver @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +# Guess we're being activated inside bin/, so go up a directory. +BEGIN { if( not -e 'lib' and not -e 'etc' and -e 'bb3' ) { chdir ".."; } } + +use lib 'lib'; +use EvalServer; +use POSIX qw/setsid/; + +# Only daemonize if we're asked to. +if( $ARGV[0] eq '-d' ) { + # Crude daemonization + setsid(); + fork and exit; + + open STDOUT, ">var/evalserver.stdout" or die "Tried to reopen STDOUT to bb3.stdout: $!"; + open STDERR, ">var/evalserver.stderr" or die "Tried to reopen STDERR to bb3.stdout: $!"; + close STDIN; +} + +EvalServer->start; diff --git a/bin/evalserver_test.pl b/bin/evalserver_test.pl new file mode 100644 index 0000000..007d33c --- /dev/null +++ b/bin/evalserver_test.pl @@ -0,0 +1,23 @@ + +use POE::Filter::Reference; +use IO::Socket::INET; +use Data::Dumper; + + +my $filter = POE::Filter::Reference->new(); + +while( 1 ) { + print "Code: "; + my $code = ; + + my $socket = IO::Socket::INET->new( PeerAddr => '127.0.0.1', PeerPort => '14400' ); + my $refs = $filter->put( [ { code => "$code" } ] ); + + print $socket $refs->[0]; + + local $/; + my $output = <$socket>; + print "OUTPUT: ", Dumper($filter->get( [ $output ] )), "\n"; + + $socket->close; +} diff --git a/deps/.svn/dir-prop-base b/deps/.svn/dir-prop-base new file mode 100644 index 0000000..3160658 --- /dev/null +++ b/deps/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 13 +svn:mergeinfo +V 0 + +END diff --git a/deps/.svn/entries b/deps/.svn/entries new file mode 100644 index 0000000..b419b5f --- /dev/null +++ b/deps/.svn/entries @@ -0,0 +1,145 @@ +10 + +dir +475 +svn://erxz.com/bb3/branches/perlbuut/deps +svn://erxz.com/bb3 + + + +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + +dcb1cea6-7f7e-4c78-8a22-148ace8ce36e + +build_deps.sh +file + + + + +2009-10-03T22:54:20.000000Z +d5fe1cfca96d2831d95c75e19e868368 +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + + + + + + + + +401 + +env.js +file + + + + +2009-10-03T22:54:20.000000Z +6ec26ea755ec918c22e6a90982bceb16 +2009-10-03T22:53:42.528878Z +475 +simcop + + + + + + + + + + + + + + + + + + + + + +307353 + +JavaScript-SpiderMonkey-0.19-patched +dir + +Jplugin +dir + +Geo-IATA.pm.diff +file + + + + +2009-10-03T22:54:20.000000Z +e6c1f9d3241046ad61b816ed45a67e1e +2009-10-03T22:53:42.528878Z +475 +simcop +has-props + + + + + + + + + + + + + + + + + + + + +637 + +Math +dir + +IMDB +dir + +Language-K20 +dir + diff --git a/deps/.svn/prop-base/Geo-IATA.pm.diff.svn-base b/deps/.svn/prop-base/Geo-IATA.pm.diff.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/.svn/prop-base/Geo-IATA.pm.diff.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/.svn/prop-base/build_deps.sh.svn-base b/deps/.svn/prop-base/build_deps.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/.svn/prop-base/build_deps.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/.svn/text-base/Geo-IATA.pm.diff.svn-base b/deps/.svn/text-base/Geo-IATA.pm.diff.svn-base new file mode 100644 index 0000000..212d4f3 --- /dev/null +++ b/deps/.svn/text-base/Geo-IATA.pm.diff.svn-base @@ -0,0 +1,16 @@ +--- IATA.pm 2009-06-27 16:45:16.000000000 +0300 ++++ /usr/local/share/perl/5.10.0/Geo/IATA.pm 2009-10-03 13:40:48.000000000 +0300 +@@ -23,7 +23,13 @@ + $db =~s{$}{.pm}xms; + ($path = $INC{$db}) =~ s{.pm$}{}xms; + $path="iata_sqlite.db"; ++ ++ my $sqlite_path = __FILE__; ++ chop $sqlite_path for 1..3; ++ $sqlite_path .= "/$path"; ++ $path = $sqlite_path; + ++ confess "SQLite IATA database not where supposed to be " unless(-f $path); + } + my $dbh = DBI->connect("dbi:SQLite:dbname=$path","","", {RaiseError => 1, unicode=> 1}); + return bless {dbh => $dbh, dbname => $path}, $pkg; diff --git a/deps/.svn/text-base/build_deps.sh.svn-base b/deps/.svn/text-base/build_deps.sh.svn-base new file mode 100644 index 0000000..5519b28 --- /dev/null +++ b/deps/.svn/text-base/build_deps.sh.svn-base @@ -0,0 +1,24 @@ +#!/bin/bash + +#wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz +#tar -xzvf js-1.7.0.tar.gz + +rm js-1.8.0-rc1.tar.gz +rm -rf js/ + +wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz +tar -xzvf js-1.8.0-rc1.tar.gz + +cd js/src +make -f Makefile.ref +cd ../.. + +cd JavaScript-SpiderMonkey-0.19-patched +perl Makefile.PL +make +make test +sudo make install +cd .. + + +sudo cpan Log::Log4perl diff --git a/deps/.svn/text-base/env.js.svn-base b/deps/.svn/text-base/env.js.svn-base new file mode 100644 index 0000000..bb321b9 --- /dev/null +++ b/deps/.svn/text-base/env.js.svn-base @@ -0,0 +1,9895 @@ +/* + * Pure JavaScript Browser Environment + * By John Resig + * Copyright 2008 John Resig, under the MIT License + */ + + +// The Window Object +var __this__ = this; +this.__defineGetter__('window', function(){ + return __this__; +}); + +try{ +(function($w, $env){ + /* +* window.js +* - this file will be wrapped in a closure providing the window object as $w +*/ +// a logger or empty function available to all modules. +var $log = $env.log, + $debug = $env.debug, + $info = $env.info, + $warn = $env.warn, + $error = $env.error; + +//The version of this application +var $version = "0.1"; +//This should be hooked to git or svn or whatever +var $revision = "0.0.0.0"; + +//These descriptions of window properties are taken loosely David Flanagan's +//'JavaScript - The Definitive Guide' (O'Reilly) + +/**> $cookies - see cookie.js <*/ +// read only boolean specifies whether the window has been closed +var $closed = false; + +// a read/write string that specifies the default message that appears in the status line +var $defaultStatus = "Done"; + +// a read-only reference to the Document object belonging to this window +/**> $document - See document.js <*/ + +//IE only, refers to the most recent event object - this maybe be removed after review +var $event = null; + +//A read-only array of window objects +var $frames = []; + +// a read-only reference to the History object +/**> $history - see location.js <**/ + +// read-only properties that specify the height and width, in pixels +var $innerHeight = 600, $innerWidth = 800; + +// a read-only reference to the Location object. the location object does expose read/write properties +/**> $location - see location.js <**/ + +// a read only property specifying the name of the window. Can be set when using open() +// and may be used when specifying the target attribute of links +var $name = 'Resig Env Browser'; + +// a read-only reference to the Navigator object +/**> $navigator - see navigator.js <**/ + +// a read/write reference to the Window object that contained the script that called open() to +//open this browser window. This property is valid only for top-level window objects. +var $opener; + +// Read-only properties that specify the total height and width, in pixels, of the browser window. +// These dimensions include the height and width of the menu bar, toolbars, scrollbars, window +// borders and so on. These properties are not supported by IE and IE offers no alternative +// properties; +var $outerHeight = $innerHeight, $outerWidth = $innerWidth; + +// Read-only properties that specify the number of pixels that the current document has been scrolled +//to the right and down. These are not supported by IE. +var $pageXOffset = 0, $pageYOffset = 0; + +//A read-only reference to the Window object that contains this window or frame. If the window is +// a top-level window, parent refers to the window itself. If this window is a frame, this property +// refers to the window or frame that conatins it. +var $parent; + +// a read-only refernce to the Screen object that specifies information about the screen: +// the number of available pixels and the number of available colors. +/**> $screen - see screen.js <**/ + +// read only properties that specify the coordinates of the upper-left corner of the screen. +var $screenX = 0, $screenY = 0; +var $screenLeft = $screenX, $screenTop = $screenY; + +// a read-only refernce to this window itself. +var $self; + +// a read/write string that specifies the current contents of the status line. +var $status = ''; + +// a read-only reference to the top-level window that contains this window. If this +// window is a top-level window it is simply a refernce to itself. If this window +// is a frame, the top property refers to the top-level window that contains the frame. +var $top; + +// the window property is identical to the self property. +var $window = $w; + +$debug("Initializing Window."); +__extend__($w,{ + get closed(){return $closed;}, + get defaultStatus(){return $defaultStatus;}, + set defaultStatus(_defaultStatus){$defaultStatus = _defaultStatus;}, + //get document(){return $document;}, - see document.js + get event(){return $event;}, + get frames(){return $frames;}, + //get history(){return $history;}, - see location.js + get innerHeight(){return $innerHeight;}, + get innerWidth(){return $innerWidth;}, + get clientHeight(){return $innerHeight;}, + get clientWidth(){return $innerWidth;}, + //get location(){return $location;}, see location.js + get name(){return $name;}, + //get navigator(){return $navigator;}, see navigator.js + get opener(){return $opener;}, + get outerHeight(){return $outerHeight;}, + get outerWidth(){return $outerWidth;}, + get pageXOffest(){return $pageXOffset;}, + get pageYOffset(){return $pageYOffset;}, + get parent(){return $parent;}, + //get screen(){return $screen;}, see screen.js + get screenLeft(){return $screenLeft;}, + get screenTop(){return $screenTop;}, + get screenX(){return $screenX;}, + get screenY(){return $screenY;}, + get self(){return $self;}, + get status(){return $status;}, + set status(_status){$status = _status;}, + get top(){return $top || $window;}, + get window(){return $window;} +}); + +$w.open = function(url, name, features, replace){ + //TODO +}; + +$w.close = function(){ + //TODO +}; + +/* Time related functions - see timer.js +* - clearTimeout +* - clearInterval +* - setTimeout +* - setInterval +*/ + +/* +* Events related functions - see event.js +* - addEventListener +* - attachEvent +* - detachEvent +* - removeEventListener +* +* These functions are identical to the Element equivalents. +*/ + +/* +* UIEvents related functions - see uievent.js +* - blur +* - focus +* +* These functions are identical to the Element equivalents. +*/ + +/* Dialog related functions - see dialog.js +* - alert +* - confirm +* - prompt +*/ + +/* Screen related functions - see screen.js +* - moveBy +* - moveTo +* - print +* - resizeBy +* - resizeTo +* - scrollBy +* - scrollTo +*/ + +/* CSS related functions - see css.js +* - getComputedStyle +*/ + +/* +* Shared utility methods +*/ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) a.__defineGetter__(i, g); + if ( s ) a.__defineSetter__(i, s); + } else + a[i] = b[i]; + } return a; +}; + + +// from ariel flesler http://flesler.blogspot.com/2008/11/fast-trim-function-for-javascript.html +// this might be a good utility function to provide in the env.core +// as in might be useful to the parser and other areas as well +function trim( str ){ + return (str || "").replace( /^\s+|\s+$/g, "" ); + +}; +/*function trim( str ){ + var start = -1, + end = str.length; + /*jsl:ignore* + while( str.charCodeAt(--end) < 33 ); + while( str.charCodeAt(++start) < 33 ); + /*jsl:end* + return str.slice( start, end + 1 ); +};*/ + +//from jQuery +function __setArray__( target, array ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + target.length = 0; + Array.prototype.push.apply( target, array ); +}; + + +$debug("Defining NodeList"); +/* +* NodeList - DOM Level 2 +*/ +/** + * @class DOMNodeList - provides the abstraction of an ordered collection of nodes + * + * @author Jon van Noort (jon@webarcana.com.au) + * + * @param ownerDocument : DOMDocument - the ownerDocument + * @param parentNode : DOMNode - the node that the DOMNodeList is attached to (or null) + */ +var DOMNodeList = function(ownerDocument, parentNode) { + this.length = 0; + this.parentNode = parentNode; + this.ownerDocument = ownerDocument; + + this._readonly = false; + + __setArray__(this, []); +}; +__extend__(DOMNodeList.prototype, { + item : function(index) { + var ret = null; + //$log("NodeList item("+index+") = " + this[index]); + if ((index >= 0) && (index < this.length)) { // bounds check + ret = this[index]; // return selected Node + } + + return ret; // if the index is out of bounds, default value null is returned + }, + get xml() { + var ret = ""; + + // create string containing the concatenation of the string values of each child + for (var i=0; i < this.length; i++) { + if(this[i]){ + if(this[i].nodeType == DOMNode.TEXT_NODE && i>0 && this[i-1].nodeType == DOMNode.TEXT_NODE){ + //add a single space between adjacent text nodes + ret += " "+this[i].xml; + }else{ + ret += this[i].xml; + } + } + } + + return ret; + }, + toArray: function () { + var children = []; + for ( var i=0; i < this.length; i++) { + children.push (this[i]); + } + return children; + }, + toString: function(){ + return "[ "+(this.length > 0?Array.prototype.join.apply(this, [", "]):"Empty NodeList")+" ]"; + } +}); + + +/** + * @method DOMNodeList._findItemIndex - find the item index of the node with the specified internal id + * @author Jon van Noort (jon@webarcana.com.au) + * @param id : int - unique internal id + * @return : int + */ +var __findItemIndex__ = function (nodelist, id) { + var ret = -1; + + // test that id is valid + if (id > -1) { + for (var i=0; i= 0) && (refChildIndex < nodelist.length)) { // bounds check + + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { // node is a DocumentFragment + // append the children of DocumentFragment + Array.prototype.splice.apply(nodelist,[refChildIndex, 0].concat(newChild.childNodes.toArray())); + } + else { + // append the newChild + Array.prototype.splice.apply(nodelist,[refChildIndex, 0, newChild]); + } + } +}; + +/** + * @method DOMNodeList._replaceChild - replace the specified Node in the NodeList at the specified index + * Used by DOMNode.replaceChild(). Note: DOMNode.replaceChild() is responsible for Node Pointer surgery + * DOMNodeList._replaceChild() simply modifies the internal data structure (Array). + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param newChild : DOMNode - the Node to be inserted + * @param refChildIndex : int - the array index to hold the Node + */ +var __replaceChild__ = function(nodelist, newChild, refChildIndex) { + var ret = null; + + if ((refChildIndex >= 0) && (refChildIndex < nodelist.length)) { // bounds check + ret = nodelist[refChildIndex]; // preserve old child for return + + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { // node is a DocumentFragment + // get array containing children prior to refChild + Array.prototype.splice.apply(nodelist,[refChildIndex, 1].concat(newChild.childNodes.toArray())); + } + else { + // simply replace node in array (links between Nodes are made at higher level) + nodelist[refChildIndex] = newChild; + } + } + + return ret; // return replaced node +}; + +/** + * @method DOMNodeList._removeChild - remove the specified Node in the NodeList at the specified index + * Used by DOMNode.removeChild(). Note: DOMNode.removeChild() is responsible for Node Pointer surgery + * DOMNodeList._replaceChild() simply modifies the internal data structure (Array). + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param refChildIndex : int - the array index holding the Node to be removed + */ +var __removeChild__ = function(nodelist, refChildIndex) { + var ret = null; + + if (refChildIndex > -1) { // found it! + ret = nodelist[refChildIndex]; // return removed node + + // rebuild array without removed child + Array.prototype.splice.apply(nodelist,[refChildIndex, 1]); + } + + return ret; // return removed node +}; + +/** + * @method DOMNodeList._appendChild - append the specified Node to the NodeList + * Used by DOMNode.appendChild(). Note: DOMNode.appendChild() is responsible for Node Pointer surgery + * DOMNodeList._appendChild() simply modifies the internal data structure (Array). + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param newChild : DOMNode - the Node to be inserted + */ +var __appendChild__ = function(nodelist, newChild) { + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { // node is a DocumentFragment + // append the children of DocumentFragment + Array.prototype.push.apply(nodelist, newChild.childNodes.toArray() ); + } else { + // simply add node to array (links between Nodes are made at higher level) + Array.prototype.push.apply(nodelist, [newChild]); + } + +}; + +/** + * @method DOMNodeList._cloneNodes - Returns a NodeList containing clones of the Nodes in this NodeList + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param deep : boolean - If true, recursively clone the subtree under each of the nodes; + * if false, clone only the nodes themselves (and their attributes, if it is an Element). + * @param parentNode : DOMNode - the new parent of the cloned NodeList + * @return : DOMNodeList - NodeList containing clones of the Nodes in this NodeList + */ +var __cloneNodes__ = function(nodelist, deep, parentNode) { + var cloneNodeList = new DOMNodeList(nodelist.ownerDocument, parentNode); + + // create list containing clones of each child + for (var i=0; i < nodelist.length; i++) { + __appendChild__(cloneNodeList, nodelist[i].cloneNode(deep)); + } + + return cloneNodeList; +}; + +$w.NodeList = DOMNodeList; + +/** + * @class DOMNamedNodeMap - used to represent collections of nodes that can be accessed by name + * typically a set of Element attributes + * + * @extends DOMNodeList - note W3C spec says that this is not the case, + * but we need an item() method identicle to DOMNodeList's, so why not? + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - the ownerDocument + * @param parentNode : DOMNode - the node that the DOMNamedNodeMap is attached to (or null) + */ +var DOMNamedNodeMap = function(ownerDocument, parentNode) { + //$log("\t\tcreating dom namednodemap"); + this.DOMNodeList = DOMNodeList; + this.DOMNodeList(ownerDocument, parentNode); + __setArray__(this, []); +}; +DOMNamedNodeMap.prototype = new DOMNodeList; +__extend__(DOMNamedNodeMap.prototype, { + getNamedItem : function(name) { + var ret = null; + + // test that Named Node exists + var itemIndex = __findNamedItemIndex__(this, name); + + if (itemIndex > -1) { // found it! + ret = this[itemIndex]; // return NamedNode + } + + return ret; // if node is not found, default value null is returned + }, + setNamedItem : function(arg) { + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if arg was not created by this Document + if (this.ownerDocument != arg.ownerDocument) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if DOMNamedNodeMap is readonly + if (this._readonly || (this.parentNode && this.parentNode._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg is already an attribute of another Element object + if (arg.ownerElement && (arg.ownerElement != this.parentNode)) { + throw(new DOMException(DOMException.INUSE_ATTRIBUTE_ERR)); + } + } + + // get item index + var itemIndex = __findNamedItemIndex__(this, arg.name); + var ret = null; + + if (itemIndex > -1) { // found it! + ret = this[itemIndex]; // use existing Attribute + + // throw Exception if DOMAttr is readonly + if (__ownerDocument__(this).implementation.errorChecking && ret._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } else { + this[itemIndex] = arg; // over-write existing NamedNode + this[arg.name] = arg; + } + } else { + // add new NamedNode + Array.prototype.push.apply(this, [arg]); + this[arg.name] = arg; + } + + arg.ownerElement = this.parentNode; // update ownerElement + + return ret; // return old node or null + }, + removeNamedItem : function(name) { + var ret = null; + // test for exceptions + // throw Exception if DOMNamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && + (this._readonly || (this.parentNode && this.parentNode._readonly))) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = __findNamedItemIndex__(this, name); + + // throw Exception if there is no node named name in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // get Node + var oldNode = this[itemIndex]; + //this[oldNode.name] = undefined; + + // throw Exception if Node is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldNode._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // return removed node + return __removeChild__(this, itemIndex); + }, + getNamedItemNS : function(namespaceURI, localName) { + var ret = null; + + // test that Named Node exists + var itemIndex = __findNamedItemNSIndex__(this, namespaceURI, localName); + + if (itemIndex > -1) { // found it! + ret = this[itemIndex]; // return NamedNode + } + + return ret; // if node is not found, default value null is returned + }, + setNamedItemNS : function(arg) { + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if DOMNamedNodeMap is readonly + if (this._readonly || (this.parentNode && this.parentNode._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(arg)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if arg is already an attribute of another Element object + if (arg.ownerElement && (arg.ownerElement != this.parentNode)) { + throw(new DOMException(DOMException.INUSE_ATTRIBUTE_ERR)); + } + } + + // get item index + var itemIndex = __findNamedItemNSIndex__(this, arg.namespaceURI, arg.localName); + var ret = null; + + if (itemIndex > -1) { // found it! + ret = this[itemIndex]; // use existing Attribute + // throw Exception if DOMAttr is readonly + if (__ownerDocument__(this).implementation.errorChecking && ret._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } else { + this[itemIndex] = arg; // over-write existing NamedNode + } + }else { + // add new NamedNode + Array.prototype.push.apply(this, [arg]); + } + arg.ownerElement = this.parentNode; + + + return ret; // return old node or null + }, + removeNamedItemNS : function(namespaceURI, localName) { + var ret = null; + + // test for exceptions + // throw Exception if DOMNamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && (this._readonly || (this.parentNode && this.parentNode._readonly))) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = __findNamedItemNSIndex__(this, namespaceURI, localName); + + // throw Exception if there is no matching node in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // get Node + var oldNode = this[itemIndex]; + + // throw Exception if Node is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldNode._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + return __removeChild__(this, itemIndex); // return removed node + }, + get xml() { + var ret = ""; + + // create string containing concatenation of all (but last) Attribute string values (separated by spaces) + for (var i=0; i < this.length -1; i++) { + ret += this[i].xml +" "; + } + + // add last Attribute to string (without trailing space) + if (this.length > 0) { + ret += this[this.length -1].xml; + } + + return ret; + } + +}); + +/** + * @method DOMNamedNodeMap._findNamedItemIndex - find the item index of the node with the specified name + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param name : string - the name of the required node + * @param isnsmap : if its a DOMNamespaceNodeMap + * @return : int + */ +var __findNamedItemIndex__ = function(namednodemap, name, isnsmap) { + var ret = -1; + + // loop through all nodes + for (var i=0; i -1) { // found it! + ret = true; // return true + } + + return ret; // if node is not found, default value false is returned +} + +/** + * @method DOMNamedNodeMap._hasAttributeNS - Returns true if specified node exists + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param namespaceURI : string - the namespace URI of the required node + * @param localName : string - the local name of the required node + * @return : boolean + */ +var __hasAttributeNS__ = function(namednodemap, namespaceURI, localName) { + var ret = false; + + // test that Named Node exists + var itemIndex = __findNamedItemNSIndex__(namednodemap, namespaceURI, localName); + + if (itemIndex > -1) { // found it! + ret = true; // return true + } + + return ret; // if node is not found, default value false is returned +} + +/** + * @method DOMNamedNodeMap._cloneNodes - Returns a NamedNodeMap containing clones of the Nodes in this NamedNodeMap + * + * @author Jon van Noort (jon@webarcana.com.au) + * @param parentNode : DOMNode - the new parent of the cloned NodeList + * @param isnsmap : bool - is this a DOMNamespaceNodeMap + * @return : DOMNamedNodeMap - NamedNodeMap containing clones of the Nodes in this DOMNamedNodeMap + */ +var __cloneNamedNodes__ = function(namednodemap, parentNode, isnsmap) { + var cloneNamedNodeMap = isnsmap? + new DOMNamespaceNodeMap(namednodemap.ownerDocument, parentNode): + new DOMNamedNodeMap(namednodemap.ownerDocument, parentNode); + + // create list containing clones of all children + for (var i=0; i < namednodemap.length; i++) { + $debug("cloning node in named node map :" + namednodemap[i]); + __appendChild__(cloneNamedNodeMap, namednodemap[i].cloneNode(false)); + } + + return cloneNamedNodeMap; +}; + + +/** + * @class DOMNamespaceNodeMap - used to represent collections of namespace nodes that can be accessed by name + * typically a set of Element attributes + * + * @extends DOMNamedNodeMap + * + * @author Jon van Noort (jon@webarcana.com.au) + * + * @param ownerDocument : DOMDocument - the ownerDocument + * @param parentNode : DOMNode - the node that the DOMNamespaceNodeMap is attached to (or null) + */ +var DOMNamespaceNodeMap = function(ownerDocument, parentNode) { + //$log("\t\t\tcreating dom namespacednodemap"); + this.DOMNamedNodeMap = DOMNamedNodeMap; + this.DOMNamedNodeMap(ownerDocument, parentNode); + __setArray__(this, []); +}; +DOMNamespaceNodeMap.prototype = new DOMNamedNodeMap; +__extend__(DOMNamespaceNodeMap.prototype, { + get xml() { + var ret = ""; + + // identify namespaces declared local to this Element (ie, not inherited) + for (var ind = 0; ind < this.length; ind++) { + // if namespace declaration does not exist in the containing node's, parentNode's namespaces + var ns = null; + try { + var ns = this.parentNode.parentNode._namespaces. + getNamedItem(this[ind].localName); + } + catch (e) { + //breaking to prevent default namespace being inserted into return value + break; + } + if (!(ns && (""+ ns.nodeValue == ""+ this[ind].nodeValue))) { + // display the namespace declaration + ret += this[ind].xml +" "; + } + } + + return ret; + } +}); +$debug("Defining Node"); +/* +* Node - DOM Level 2 +*/ +/** + * @class DOMNode - The Node interface is the primary datatype for the entire Document Object Model. + * It represents a single node in the document tree. + * @author Jon van Noort (jon@webarcana.com.au), David Joham (djoham@yahoo.com) and Scott Severtson + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMNode = function(ownerDocument) { + if (ownerDocument) { + this._id = ownerDocument._genId(); // generate unique internal id + } + + this.namespaceURI = ""; // The namespace URI of this node (Level 2) + this.prefix = ""; // The namespace prefix of this node (Level 2) + this.localName = ""; // The localName of this node (Level 2) + + this.nodeName = ""; // The name of this node + this.nodeValue = null; // The value of this node + this.className = ""; // The CSS class name of this node. + + // The parent of this node. All nodes, except Document, DocumentFragment, and Attr may have a parent. + // However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null + this.parentNode = null; + + // A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. + // The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object + // that it was created from are immediately reflected in the nodes returned by the NodeList accessors; + // it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method. + this.childNodes = new DOMNodeList(ownerDocument, this); + + this.firstChild = null; // The first child of this node. If there is no such node, this is null + this.lastChild = null; // The last child of this node. If there is no such node, this is null. + this.previousSibling = null; // The node immediately preceding this node. If there is no such node, this is null. + this.nextSibling = null; // The node immediately following this node. If there is no such node, this is null. + + this.ownerDocument = ownerDocument; // The Document object associated with this node + this.attributes = new DOMNamedNodeMap(this.ownerDocument, this); + this._namespaces = new DOMNamespaceNodeMap(ownerDocument, this); // The namespaces in scope for this node + this._readonly = false; +}; + +// nodeType constants +DOMNode.ELEMENT_NODE = 1; +DOMNode.ATTRIBUTE_NODE = 2; +DOMNode.TEXT_NODE = 3; +DOMNode.CDATA_SECTION_NODE = 4; +DOMNode.ENTITY_REFERENCE_NODE = 5; +DOMNode.ENTITY_NODE = 6; +DOMNode.PROCESSING_INSTRUCTION_NODE = 7; +DOMNode.COMMENT_NODE = 8; +DOMNode.DOCUMENT_NODE = 9; +DOMNode.DOCUMENT_TYPE_NODE = 10; +DOMNode.DOCUMENT_FRAGMENT_NODE = 11; +DOMNode.NOTATION_NODE = 12; +DOMNode.NAMESPACE_NODE = 13; + +__extend__(DOMNode.prototype, { + hasAttributes : function() { + if (this.attributes.length == 0) { + return false; + }else{ + return true; + } + }, + insertBefore : function(newChild, refChild) { + var prevNode; + + if(newChild==null || refChild==null){ + return newChild; + } + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if DOMNode is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if newChild was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(newChild)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + if (refChild) { // if refChild is specified, insert before it + // find index of refChild + var itemIndex = __findItemIndex__(this.childNodes, refChild._id); + + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + newChildParent.removeChild(newChild); + } + + // insert newChild into childNodes + __insertBefore__(this.childNodes, newChild, + __findItemIndex__(this.childNodes, refChild._id)); + + // do node pointer surgery + prevNode = refChild.previousSibling; + + // handle DocumentFragment + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { + if (newChild.childNodes.length > 0) { + // set the parentNode of DocumentFragment's children + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + // link refChild to last child of DocumentFragment + refChild.previousSibling = newChild.childNodes[newChild.childNodes.length-1]; + } + }else { + newChild.parentNode = this; // set the parentNode of the newChild + refChild.previousSibling = newChild; // link refChild to newChild + } + }else { // otherwise, append to end + prevNode = this.lastChild; + this.appendChild(newChild); + } + + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for DocumentFragment + if (newChild.childNodes.length > 0) { + if (prevNode) { + prevNode.nextSibling = newChild.childNodes[0]; + }else { // this is the first child in the list + this.firstChild = newChild.childNodes[0]; + } + + newChild.childNodes[0].previousSibling = prevNode; + newChild.childNodes[newChild.childNodes.length-1].nextSibling = refChild; + } + }else { + // do node pointer surgery for newChild + if (prevNode) { + prevNode.nextSibling = newChild; + }else { // this is the first child in the list + this.firstChild = newChild; + } + + newChild.previousSibling = prevNode; + newChild.nextSibling = refChild; + } + + return newChild; + }, + replaceChild : function(newChild, oldChild) { + var ret = null; + + if(newChild==null || oldChild==null){ + return oldChild; + } + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if DOMNode is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if newChild was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(newChild)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + // get index of oldChild + var index = __findItemIndex__(this.childNodes, oldChild._id); + + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (index < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + newChildParent.removeChild(newChild); + } + + // add newChild to childNodes + ret = __replaceChild__(this.childNodes,newChild, index); + + + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for Document Fragment + if (newChild.childNodes.length > 0) { + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = newChild.childNodes[0]; + } else { + this.firstChild = newChild.childNodes[0]; + } + + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = newChild; + } else { + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + } + + newChild.childNodes[0].previousSibling = oldChild.previousSibling; + newChild.childNodes[newChild.childNodes.length-1].nextSibling = oldChild.nextSibling; + } + } else { + // do node pointer surgery for newChild + newChild.parentNode = this; + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = newChild; + }else{ + this.firstChild = newChild; + } + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = newChild; + }else{ + this.lastChild = newChild; + } + newChild.previousSibling = oldChild.previousSibling; + newChild.nextSibling = oldChild.nextSibling; + } + return ret; + }, + removeChild : function(oldChild) { + if(!oldChild){ + return null; + } + // throw Exception if DOMNamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && (this._readonly || oldChild._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get index of oldChild + var itemIndex = __findItemIndex__(this.childNodes, oldChild._id); + + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // remove oldChild from childNodes + __removeChild__(this.childNodes, itemIndex); + + // do node pointer surgery + oldChild.parentNode = null; + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = oldChild.nextSibling; + }else { + this.firstChild = oldChild.nextSibling; + } + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = oldChild.previousSibling; + }else { + this.lastChild = oldChild.previousSibling; + } + + oldChild.previousSibling = null; + oldChild.nextSibling = null; + + return oldChild; + }, + appendChild : function(newChild) { + if(!newChild){ + return null; + } + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(this)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + newChildParent.removeChild(newChild); + } + + // add newChild to childNodes + __appendChild__(this.childNodes, newChild); + + if (newChild.nodeType == DOMNode.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for DocumentFragment + if (newChild.childNodes.length > 0) { + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + if (this.lastChild) { + this.lastChild.nextSibling = newChild.childNodes[0]; + newChild.childNodes[0].previousSibling = this.lastChild; + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + } + else { + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + this.firstChild = newChild.childNodes[0]; + } + } + } + else { + // do node pointer surgery for newChild + newChild.parentNode = this; + if (this.lastChild) { + this.lastChild.nextSibling = newChild; + newChild.previousSibling = this.lastChild; + this.lastChild = newChild; + } + else { + this.lastChild = newChild; + this.firstChild = newChild; + } + } + + return newChild; + }, + hasChildNodes : function() { + return (this.childNodes.length > 0); + }, + cloneNode: function(deep) { + // use importNode to clone this Node + //do not throw any exceptions + try { + return __ownerDocument__(this).importNode(this, deep); + } catch (e) { + //there shouldn't be any exceptions, but if there are, return null + return null; + } + }, + normalize : function() { + var inode; + var nodesToRemove = new DOMNodeList(); + + if (this.nodeType == DOMNode.ELEMENT_NODE || this.nodeType == DOMNode.DOCUMENT_NODE) { + var adjacentTextNode = null; + + // loop through all childNodes + for(var i = 0; i < this.childNodes.length; i++) { + inode = this.childNodes.item(i); + + if (inode.nodeType == DOMNode.TEXT_NODE) { // this node is a text node + if (inode.length < 1) { // this text node is empty + __appendChild__(nodesToRemove, inode); // add this node to the list of nodes to be remove + }else { + if (adjacentTextNode) { // if previous node was also text + adjacentTextNode.appendData(inode.data); // merge the data in adjacent text nodes + __appendChild__(nodesToRemove, inode); // add this node to the list of nodes to be removed + }else { + adjacentTextNode = inode; // remember this node for next cycle + } + } + } else { + adjacentTextNode = null; // (soon to be) previous node is not a text node + inode.normalize(); // normalise non Text childNodes + } + } + + // remove redundant Text Nodes + for(var i = 0; i < nodesToRemove.length; i++) { + inode = nodesToRemove.item(i); + inode.parentNode.removeChild(inode); + } + } + }, + isSupported : function(feature, version) { + // use Implementation.hasFeature to determin if this feature is supported + return __ownerDocument__(this).implementation.hasFeature(feature, version); + }, + getElementsByTagName : function(tagname) { + // delegate to _getElementsByTagNameRecursive + // recurse childNodes + var nodelist = new DOMNodeList(__ownerDocument__(this)); + for(var i = 0; i < this.childNodes.length; i++) { + nodeList = __getElementsByTagNameRecursive__(this.childNodes.item(i), tagname, nodelist); + } + return nodelist; + }, + getElementsByTagNameNS : function(namespaceURI, localName) { + // delegate to _getElementsByTagNameNSRecursive + return __getElementsByTagNameNSRecursive__(this, namespaceURI, localName, + new DOMNodeList(__ownerDocument__(this))); + }, + importNode : function(importedNode, deep) { + + var importNode; + //$debug("importing node " + importedNode.nodeName + "(?deep = "+deep+")"); + //there is no need to perform namespace checks since everything has already gone through them + //in order to have gotten into the DOM in the first place. The following line + //turns namespace checking off in ._isValidNamespace + __ownerDocument__(this)._performingImportNodeOperation = true; + + if (importedNode.nodeType == DOMNode.ELEMENT_NODE) { + if (!__ownerDocument__(this).implementation.namespaceAware) { + // create a local Element (with the name of the importedNode) + importNode = __ownerDocument__(this).createElement(importedNode.tagName); + + // create attributes matching those of the importedNode + for(var i = 0; i < importedNode.attributes.length; i++) { + importNode.setAttribute(importedNode.attributes.item(i).name, importedNode.attributes.item(i).value); + } + }else { + // create a local Element (with the name & namespaceURI of the importedNode) + importNode = __ownerDocument__(this).createElementNS(importedNode.namespaceURI, importedNode.nodeName); + + // create attributes matching those of the importedNode + for(var i = 0; i < importedNode.attributes.length; i++) { + importNode.setAttributeNS(importedNode.attributes.item(i).namespaceURI, + importedNode.attributes.item(i).name, importedNode.attributes.item(i).value); + } + + // create namespace definitions matching those of the importedNode + for(var i = 0; i < importedNode._namespaces.length; i++) { + importNode._namespaces[i] = __ownerDocument__(this).createNamespace(importedNode._namespaces.item(i).localName); + importNode._namespaces[i].value = importedNode._namespaces.item(i).value; + } + } + } else if (importedNode.nodeType == DOMNode.ATTRIBUTE_NODE) { + if (!__ownerDocument__(this).implementation.namespaceAware) { + // create a local Attribute (with the name of the importedAttribute) + importNode = __ownerDocument__(this).createAttribute(importedNode.name); + } else { + // create a local Attribute (with the name & namespaceURI of the importedAttribute) + importNode = __ownerDocument__(this).createAttributeNS(importedNode.namespaceURI, importedNode.nodeName); + + // create namespace definitions matching those of the importedAttribute + for(var i = 0; i < importedNode._namespaces.length; i++) { + importNode._namespaces[i] = __ownerDocument__(this).createNamespace(importedNode._namespaces.item(i).localName); + importNode._namespaces[i].value = importedNode._namespaces.item(i).value; + } + } + + // set the value of the local Attribute to match that of the importedAttribute + importNode.value = importedNode.value; + + } else if (importedNode.nodeType == DOMNode.DOCUMENT_FRAGMENT) { + // create a local DocumentFragment + importNode = __ownerDocument__(this).createDocumentFragment(); + } else if (importedNode.nodeType == DOMNode.NAMESPACE_NODE) { + // create a local NamespaceNode (with the same name & value as the importedNode) + importNode = __ownerDocument__(this).createNamespace(importedNode.nodeName); + importNode.value = importedNode.value; + } else if (importedNode.nodeType == DOMNode.TEXT_NODE) { + // create a local TextNode (with the same data as the importedNode) + importNode = __ownerDocument__(this).createTextNode(importedNode.data); + } else if (importedNode.nodeType == DOMNode.CDATA_SECTION_NODE) { + // create a local CDATANode (with the same data as the importedNode) + importNode = __ownerDocument__(this).createCDATASection(importedNode.data); + } else if (importedNode.nodeType == DOMNode.PROCESSING_INSTRUCTION_NODE) { + // create a local ProcessingInstruction (with the same target & data as the importedNode) + importNode = __ownerDocument__(this).createProcessingInstruction(importedNode.target, importedNode.data); + } else if (importedNode.nodeType == DOMNode.COMMENT_NODE) { + // create a local Comment (with the same data as the importedNode) + importNode = __ownerDocument__(this).createComment(importedNode.data); + } else { // throw Exception if nodeType is not supported + throw(new DOMException(DOMException.NOT_SUPPORTED_ERR)); + } + + if (deep) { // recurse childNodes + for(var i = 0; i < importedNode.childNodes.length; i++) { + importNode.appendChild(__ownerDocument__(this).importNode(importedNode.childNodes.item(i), true)); + } + } + + //reset _performingImportNodeOperation + __ownerDocument__(this)._performingImportNodeOperation = false; + return importNode; + + }, + contains : function(node){ + while(node && node != this ){ + node = node.parentNode; + } + return !!node; + }, + compareDocumentPosition : function(b){ + var a = this; + var number = (a != b && a.contains(b) && 16) + (a != b && b.contains(a) && 8); + //find position of both + var all = document.getElementsByTagName("*"); + var my_location = 0, node_location = 0; + for(var i=0; i < all.length; i++){ + if(all[i] == a) my_location = i; + if(all[i] == b) node_location = i; + if(my_location && node_location) break; + } + number += (my_location < node_location && 4) + number += (my_location > node_location && 2) + return number; + } + +}); + +/** + * @method DOMNode._getElementsByTagNameRecursive - implements getElementsByTagName() + * @param elem : DOMElement - The element which are checking and then recursing into + * @param tagname : string - The name of the tag to match on. The special value "*" matches all tags + * @param nodeList : DOMNodeList - The accumulating list of matching nodes + * + * @return : DOMNodeList + */ +var __getElementsByTagNameRecursive__ = function (elem, tagname, nodeList) { + + if (elem.nodeType == DOMNode.ELEMENT_NODE || elem.nodeType == DOMNode.DOCUMENT_NODE) { + + if(elem.nodeType !== DOMNode.DOCUMENT_NODE && + ((elem.nodeName.toUpperCase() == tagname.toUpperCase()) || + (tagname == "*")) ){ + __appendChild__(nodeList, elem); // add matching node to nodeList + } + + // recurse childNodes + for(var i = 0; i < elem.childNodes.length; i++) { + nodeList = __getElementsByTagNameRecursive__(elem.childNodes.item(i), tagname, nodeList); + } + } + + return nodeList; +}; + +/** + * @method DOMNode._getElementsByTagNameNSRecursive - implements getElementsByTagName() + * + * @param elem : DOMElement - The element which are checking and then recursing into + * @param namespaceURI : string - the namespace URI of the required node + * @param localName : string - the local name of the required node + * @param nodeList : DOMNodeList - The accumulating list of matching nodes + * + * @return : DOMNodeList + */ +var __getElementsByTagNameNSRecursive__ = function(elem, namespaceURI, localName, nodeList) { + if (elem.nodeType == DOMNode.ELEMENT_NODE || elem.nodeType == DOMNode.DOCUMENT_NODE) { + + if (((elem.namespaceURI == namespaceURI) || (namespaceURI == "*")) && ((elem.localName == localName) || (localName == "*"))) { + __appendChild__(nodeList, elem); // add matching node to nodeList + } + + // recurse childNodes + for(var i = 0; i < elem.childNodes.length; i++) { + nodeList = __getElementsByTagNameNSRecursive__(elem.childNodes.item(i), namespaceURI, localName, nodeList); + } + } + + return nodeList; +}; + +/** + * @method DOMNode._isAncestor - returns true if node is ancestor of target + * @param target : DOMNode - The node we are using as context + * @param node : DOMNode - The candidate ancestor node + * @return : boolean + */ +var __isAncestor__ = function(target, node) { + // if this node matches, return true, + // otherwise recurse up (if there is a parentNode) + return ((target == node) || ((target.parentNode) && (__isAncestor__(target.parentNode, node)))); +}; + +var __ownerDocument__ = function(node){ + return (node.nodeType == DOMNode.DOCUMENT_NODE)?node:node.ownerDocument; +}; + +$w.Node = DOMNode; + +/** + * @class DOMNamespace - The Namespace interface represents an namespace in an Element object + * + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMNamespace = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); + + this.name = ""; // the name of this attribute + + // If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false. + // Note that the implementation is in charge of this attribute, not the user. + // If the user changes the value of the attribute (even if it ends up having the same value as the default value) + // then the specified flag is automatically flipped to true + this.specified = false; +}; +DOMNamespace.prototype = new DOMNode; +__extend__(DOMNamespace.prototype, { + get value(){ + // the value of the attribute is returned as a string + return this.nodeValue; + }, + set value(value){ + this.nodeValue = value+''; + }, + get nodeType(){ + return DOMNode.NAMESPACE_NODE; + }, + get xml(){ + var ret = ""; + + // serialize Namespace Declaration + if (this.nodeName != "") { + ret += this.nodeName +"=\""+ __escapeXML__(this.nodeValue) +"\""; + } + else { // handle default namespace + ret += "xmlns=\""+ __escapeXML__(this.nodeValue) +"\""; + } + + return ret; + }, + toString: function(){ + return "Namespace #" + this.id; + } +}); + +$debug("Defining CharacterData"); +/* +* CharacterData - DOM Level 2 +*/ +/** + * @class DOMCharacterData - parent abstract class for DOMText and DOMComment + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMCharacterData = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); +}; +DOMCharacterData.prototype = new DOMNode; +__extend__(DOMCharacterData.prototype,{ + get data(){ + return this.nodeValue; + }, + set data(data){ + this.nodeValue = data; + }, + get length(){return this.nodeValue.length;}, + appendData: function(arg){ + // throw Exception if DOMCharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + // append data + this.data = "" + this.data + arg; + }, + deleteData: function(offset, count){ + // throw Exception if DOMCharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // delete data + if(!count || (offset + count) > this.data.length) { + this.data = this.data.substring(0, offset); + }else { + this.data = this.data.substring(0, offset). + concat(this.data.substring(offset + count)); + } + } + }, + insertData: function(offset, arg){ + // throw Exception if DOMCharacterData is readonly + if(__ownerDocument__(this).implementation.errorChecking && this._readonly){ + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + if(this.data){ + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // insert data + this.data = this.data.substring(0, offset).concat(arg, this.data.substring(offset)); + }else { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && (offset != 0)) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // set data + this.data = arg; + } + }, + replaceData: function(offset, count, arg){ + // throw Exception if DOMCharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // replace data + this.data = this.data.substring(0, offset). + concat(arg, this.data.substring(offset + count)); + }else { + // set data + this.data = arg; + } + }, + substringData: function(offset, count){ + var ret = null; + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + // or the count is negative + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + // if count is not specified + if (!count) { + ret = this.data.substring(offset); // default to 'end of string' + }else{ + ret = this.data.substring(offset, offset + count); + } + } + return ret; + } +}); + +$w.CharacterData = DOMCharacterData;$debug("Defining Text"); +/* +* Text - DOM Level 2 +*/ +/** + * @class DOMText - The Text interface represents the textual content (termed character data in XML) of an Element or Attr. + * If there is no markup inside an element's content, the text is contained in a single object implementing the Text interface + * that is the only child of the element. If there is markup, it is parsed into a list of elements and Text nodes that form the + * list of children of the element. + * @extends DOMCharacterData + * @author Jon van Noort (jon@webarcana.com.au) and David Joham (djoham@yahoo.com) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMText = function(ownerDocument) { + this.DOMCharacterData = DOMCharacterData; + this.DOMCharacterData(ownerDocument); + + this.nodeName = "#text"; +}; +DOMText.prototype = new DOMCharacterData; +__extend__(DOMText.prototype,{ + //Breaks this Text node into two Text nodes at the specified offset, + // keeping both in the tree as siblings. This node then only contains all the content up to the offset point. + // And a new Text node, which is inserted as the next sibling of this node, contains all the content at and after the offset point. + splitText : function(offset) { + var data, inode; + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if offset is negative or greater than the data length, + if ((offset < 0) || (offset > this.data.length)) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + } + + if (this.parentNode) { + // get remaining string (after offset) + data = this.substringData(offset); + + // create new TextNode with remaining string + inode = __ownerDocument__(this).createTextNode(data); + + // attach new TextNode + if (this.nextSibling) { + this.parentNode.insertBefore(inode, this.nextSibling); + } + else { + this.parentNode.appendChild(inode); + } + + // remove remaining string from original TextNode + this.deleteData(offset); + } + + return inode; + }, + get nodeType(){ + return DOMNode.TEXT_NODE; + }, + get xml(){ + return __escapeXML__(""+ this.nodeValue); + }, + toString: function(){ + return "Text #" + this._id; + } +}); + +$w.Text = DOMText;$debug("Defining CDATASection"); +/* +* CDATASection - DOM Level 2 +*/ +/** + * @class DOMCDATASection - CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. + * The only delimiter that is recognized in a CDATA section is the "\]\]\>" string that ends the CDATA section + * @extends DOMCharacterData + * @author Jon van Noort (jon@webarcana.com.au) and David Joham (djoham@yahoo.com) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMCDATASection = function(ownerDocument) { + this.DOMText = DOMText; + this.DOMText(ownerDocument); + + this.nodeName = "#cdata-section"; +}; +DOMCDATASection.prototype = new DOMText; +__extend__(DOMCDATASection.prototype,{ + get nodeType(){ + return DOMNode.CDATA_SECTION_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "CDATA #"+this._id; + } +}); + +$w.CDATASection = DOMCDATASection;$debug("Defining Comment"); +/* +* Comment - DOM Level 2 +*/ +/** + * @class DOMComment - This represents the content of a comment, i.e., all the characters between the starting '' + * @extends DOMCharacterData + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMComment = function(ownerDocument) { + this.DOMCharacterData = DOMCharacterData; + this.DOMCharacterData(ownerDocument); + + this.nodeName = "#comment"; +}; +DOMComment.prototype = new DOMCharacterData; +__extend__(DOMComment.prototype, { + get nodeType(){ + return DOMNode.COMMENT_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "Comment #"+this._id; + } +}); + +$w.Comment = DOMComment; +$debug("Defining DocumentType"); +;/* +* DocumentType - DOM Level 2 +*/ +var DOMDocumentType = function() { + $error("DOMDocumentType.constructor(): Not Implemented" ); +}; + +$w.DocumentType = DOMDocumentType; +$debug("Defining Attr"); +/* +* Attr - DOM Level 2 +*/ +/** + * @class DOMAttr - The Attr interface represents an attribute in an Element object + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMAttr = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); + + this.ownerElement = null; // set when Attr is added to NamedNodeMap +}; +DOMAttr.prototype = new DOMNode; +__extend__(DOMAttr.prototype, { + // the name of this attribute + get name(){ + return this.nodeName; + }, + set name(name){ + this.nodeName = name; + }, + // the value of the attribute is returned as a string + get value(){ + return this.nodeValue; + }, + set value(value){ + // throw Exception if Attribute is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + // delegate to node + this.nodeValue = value; + }, + get specified(){ + return (this.value.length > 0); + }, + get nodeType(){ + return DOMNode.ATTRIBUTE_NODE; + }, + get xml(){ + return this.nodeName + '="' + __escapeXML__(this.nodeValue) + '" '; + }, + toString : function(){ + return "Attr #" + this._id + " " + this.name; + } +}); + +$w.Attr = DOMAttr; +$debug("Defining Element"); +/** + * @class DOMElement - By far the vast majority of objects (apart from text) that authors encounter + * when traversing a document are Element nodes. + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) and David Joham (djoham@yahoo.com) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMElement = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); + this.id = ""; // the ID of the element +}; +DOMElement.prototype = new DOMNode; +__extend__(DOMElement.prototype, { + // The name of the element. + get tagName(){ + return this.nodeName; + }, + set tagName(name){ + this.nodeName = name; + }, + addEventListener : function(){ window.addEventListener.apply(this, arguments) }, + removeEventListener : function(){ window.removeEventListener.apply(this, arguments) }, + dispatchEvent : function(){ window.dispatchEvent.apply(this, arguments) }, + getAttribute: function(name) { + var ret = null; + // if attribute exists, use it + var attr = this.attributes.getNamedItem(name); + if (attr) { + ret = attr.value; + } + return ret; // if Attribute exists, return its value, otherwise, return "" + }, + setAttribute : function (name, value) { + // if attribute exists, use it + var attr = this.attributes.getNamedItem(name); + var value = value+''; + //I had to add this check becuase as the script initializes + //the id may be set in the constructor, and the html element + //overrides the id property with a getter/setter. + if(__ownerDocument__(this)){ + if (!attr) { + attr = __ownerDocument__(this).createAttribute(name); // otherwise create it + } + + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Attribute is readonly + if (attr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if the value string contains an illegal character + if (!__isValidString__(value)) { + throw(new DOMException(DOMException.INVALID_CHARACTER_ERR)); + } + } + + if (__isIdDeclaration__(name)) { + // this.id = value; // cache ID for getElementById() + } + + // assign values to properties (and aliases) + attr.value = value; + + // add/replace Attribute in NamedNodeMap + this.attributes.setNamedItem(attr); + } + }, + removeAttribute : function removeAttribute(name) { + // delegate to DOMNamedNodeMap.removeNamedItem + return this.attributes.removeNamedItem(name); + }, + getAttributeNode : function getAttributeNode(name) { + // delegate to DOMNamedNodeMap.getNamedItem + return this.attributes.getNamedItem(name); + }, + setAttributeNode: function(newAttr) { + // if this Attribute is an ID + if (__isIdDeclaration__(newAttr.name)) { + this.id = newAttr.value; // cache ID for getElementById() + } + // delegate to DOMNamedNodeMap.setNamedItem + return this.attributes.setNamedItem(newAttr); + }, + removeAttributeNode: function(oldAttr) { + // throw Exception if Attribute is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldAttr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = this.attributes._findItemIndex(oldAttr._id); + + // throw Exception if node does not exist in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + return this.attributes._removeChild(itemIndex); + }, + getAttributeNS : function(namespaceURI, localName) { + var ret = ""; + // delegate to DOMNAmedNodeMap.getNamedItemNS + var attr = this.attributes.getNamedItemNS(namespaceURI, localName); + if (attr) { + ret = attr.value; + } + return ret; // if Attribute exists, return its value, otherwise return "" + }, + setAttributeNS : function(namespaceURI, qualifiedName, value) { + // call DOMNamedNodeMap.getNamedItem + var attr = this.attributes.getNamedItem(namespaceURI, qualifiedName); + + if (!attr) { // if Attribute exists, use it + // otherwise create it + attr = __ownerDocument__(this).createAttributeNS(namespaceURI, qualifiedName); + } + + var value = value+''; + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Attribute is readonly + if (attr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if the Namespace is invalid + if (!__isValidNamespace__(namespaceURI, qualifiedName)) { + throw(new DOMException(DOMException.NAMESPACE_ERR)); + } + + // throw Exception if the value string contains an illegal character + if (!__isValidString__(value)) { + throw(new DOMException(DOMException.INVALID_CHARACTER_ERR)); + } + } + + // if this Attribute is an ID + if (__isIdDeclaration__(name)) { + this.id = value; // cache ID for getElementById() + } + + // assign values to properties (and aliases) + attr.value = value; + attr.nodeValue = value; + + // delegate to DOMNamedNodeMap.setNamedItem + this.attributes.setNamedItemNS(attr); + }, + removeAttributeNS : function(namespaceURI, localName) { + // delegate to DOMNamedNodeMap.removeNamedItemNS + return this.attributes.removeNamedItemNS(namespaceURI, localName); + }, + getAttributeNodeNS : function(namespaceURI, localName) { + // delegate to DOMNamedNodeMap.getNamedItemNS + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + setAttributeNodeNS : function(newAttr) { + // if this Attribute is an ID + if ((newAttr.prefix == "") && __isIdDeclaration__(newAttr.name)) { + this.id = newAttr.value+''; // cache ID for getElementById() + } + + // delegate to DOMNamedNodeMap.setNamedItemNS + return this.attributes.setNamedItemNS(newAttr); + }, + hasAttribute : function(name) { + // delegate to DOMNamedNodeMap._hasAttribute + return __hasAttribute__(this.attributes,name); + }, + hasAttributeNS : function(namespaceURI, localName) { + // delegate to DOMNamedNodeMap._hasAttributeNS + return __hasAttributeNS__(this.attributes, namespaceURI, localName); + }, + get nodeType(){ + return DOMNode.ELEMENT_NODE; + }, + get xml() { + var ret = ""; + + // serialize namespace declarations + var ns = this._namespaces.xml; + if (ns.length > 0) ns = " "+ ns; + + // serialize Attribute declarations + var attrs = this.attributes.xml; + if (attrs.length > 0) attrs = " "+ attrs; + + // serialize this Element + ret += "<" + this.nodeName.toLowerCase() + ns + attrs +">"; + ret += this.childNodes.xml; + ret += ""; + + return ret; + }, + toString : function(){ + return "Element #"+this._id + " "+ this.tagName + (this.id?" => "+this.id:''); + } +}); + +$w.Element = DOMElement; +/** + * @class DOMException - raised when an operation is impossible to perform + * @author Jon van Noort (jon@webarcana.com.au) + * @param code : int - the exception code (one of the DOMException constants) + */ +var DOMException = function(code) { + this.code = code; +}; + +// DOMException constants +// Introduced in DOM Level 1: +DOMException.INDEX_SIZE_ERR = 1; +DOMException.DOMSTRING_SIZE_ERR = 2; +DOMException.HIERARCHY_REQUEST_ERR = 3; +DOMException.WRONG_DOCUMENT_ERR = 4; +DOMException.INVALID_CHARACTER_ERR = 5; +DOMException.NO_DATA_ALLOWED_ERR = 6; +DOMException.NO_MODIFICATION_ALLOWED_ERR = 7; +DOMException.NOT_FOUND_ERR = 8; +DOMException.NOT_SUPPORTED_ERR = 9; +DOMException.INUSE_ATTRIBUTE_ERR = 10; + +// Introduced in DOM Level 2: +DOMException.INVALID_STATE_ERR = 11; +DOMException.SYNTAX_ERR = 12; +DOMException.INVALID_MODIFICATION_ERR = 13; +DOMException.NAMESPACE_ERR = 14; +DOMException.INVALID_ACCESS_ERR = 15; +$debug("Defining DocumentFragment"); +/* +* DocumentFragment - DOM Level 2 +*/ +/** + * @class DOMDocumentFragment - DocumentFragment is a "lightweight" or "minimal" Document object. + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) and David Joham (djoham@yahoo.com) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMDocumentFragment = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); + this.nodeName = "#document-fragment"; +}; +DOMDocumentFragment.prototype = new DOMNode; +__extend__(DOMDocumentFragment.prototype,{ + get nodeType(){ + return DOMNode.DOCUMENT_FRAGMENT_NODE; + }, + get xml(){ + var xml = "", + count = this.childNodes.length; + + // create string concatenating the serialized ChildNodes + for (var i = 0; i < count; i++) { + xml += this.childNodes.item(i).xml; + } + + return xml; + }, + toString : function(){ + return "DocumentFragment #"+this._id; + } +}); + +$w.DocumentFragment = DOMDocumentFragment; +$debug("Defining ProcessingInstruction"); +/* +* ProcessingInstruction - DOM Level 2 +*/ +/** + * @class DOMProcessingInstruction - The ProcessingInstruction interface represents a "processing instruction", + * used in XML as a way to keep processor-specific information in the text of the document + * @extends DOMNode + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : DOMDocument - The Document object associated with this node. + */ +var DOMProcessingInstruction = function(ownerDocument) { + this.DOMNode = DOMNode; + this.DOMNode(ownerDocument); +}; +DOMProcessingInstruction.prototype = new DOMNode; +__extend__(DOMProcessingInstruction.prototype, { + get data(){ + return this.nodeValue; + }, + set data(data){ + // throw Exception if DOMNode is readonly + if (__ownerDocument__(this).errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + this.nodeValue = data; + }, + get target(){ + // The target of this processing instruction. + // XML defines this as being the first token following the markup that begins the processing instruction. + // The content of this processing instruction. + return this.nodeName; + }, + get nodeType(){ + return DOMNode.PROCESSING_INSTRUCTION_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "ProcessingInstruction #"+this._id; + } +}); + +$w.ProcessesingInstruction = DOMProcessingInstruction; +$debug("Defining DOMParser"); +/* +* DOMParser +*/ + +var DOMParser = function(){}; +__extend__(DOMParser.prototype,{ + parseFromString: function(xmlString){ + //$log("Parsing XML String: " +xmlString); + return document.implementation.createDocument().loadXML(xmlString); + } +}); + +$debug("Initializing Internal DOMParser."); +//keep one around for internal use +$domparser = new DOMParser(); + +$w.DOMParser = DOMParser; +// ========================================================================= +// +// xmlsax.js - an XML SAX parser in JavaScript. +// +// version 3.1 +// +// ========================================================================= +// +// Copyright (C) 2001 - 2002 David Joham (djoham@yahoo.com) and Scott Severtson +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// Visit the XML for