diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-06-08 09:01:43 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-06-08 09:01:43 +0200 |
commit | d1fa08fdc9cb11dccee76d668ff85df30458c295 (patch) | |
tree | 1d19df6405103577d872902486792e8c23bce711 /infrastructure | |
parent | d7c5ad7d6263fd1baf9bfdbaa4c50b70ef2fbdb2 (diff) | |
parent | 70d1f9d6fcaefe611e778b8dbf3bafea8934aa08 (diff) | |
download | etherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.tar.gz etherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.tar.xz etherpad-d1fa08fdc9cb11dccee76d668ff85df30458c295.zip |
Merge remote branch 'upstream/master'
Conflicts:
etherpad/src/etherpad/control/pro/admin/pro_admin_control.js
etherpad/src/etherpad/control/pro/pro_main_control.js
etherpad/src/etherpad/control/pro_help_control.js
etherpad/src/etherpad/globals.js
etherpad/src/etherpad/legacy_urls.js
etherpad/src/etherpad/pne/pne_utils.js
etherpad/src/etherpad/pro/pro_utils.js
etherpad/src/main.js
etherpad/src/plugins/fileUpload/templates/fileUpload.ejs
etherpad/src/plugins/testplugin/templates/page.ejs
etherpad/src/static/css/pad2_ejs.css
etherpad/src/static/css/pro-help.css
etherpad/src/static/img/jun09/pad/protop.gif
etherpad/src/static/js/store.js
etherpad/src/themes/default/templates/framed/framedheader-pro.ejs
etherpad/src/themes/default/templates/main/home.ejs
etherpad/src/themes/default/templates/pro-help/main.ejs
etherpad/src/themes/default/templates/pro-help/pro-help-template.ejs
infrastructure/com.etherpad/licensing.scala
trunk/etherpad/src/etherpad/collab/ace/contentcollector.js
trunk/etherpad/src/etherpad/collab/ace/linestylefilter.js
trunk/etherpad/src/static/css/home-opensource.css
trunk/etherpad/src/static/js/ace.js
trunk/etherpad/src/static/js/linestylefilter_client.js
trunk/etherpad/src/templates/email/eepnet_license_info.ejs
trunk/etherpad/src/templates/pad/pad_body2.ejs
trunk/etherpad/src/templates/pad/pad_content.ejs
trunk/etherpad/src/templates/pad/padfull_body.ejs
trunk/etherpad/src/templates/pro/admin/pne-license-manager.ejs
Diffstat (limited to '')
-rw-r--r-- | infrastructure/.gitignore (renamed from trunk/infrastructure/.gitignore) | 0 | ||||
-rw-r--r-- | infrastructure/ace/.gitignore (renamed from trunk/infrastructure/ace/.gitignore) | 0 | ||||
-rw-r--r-- | infrastructure/ace/README (renamed from trunk/infrastructure/ace/README) | 0 | ||||
-rwxr-xr-x | infrastructure/ace/bin/make | 339 | ||||
-rwxr-xr-x | infrastructure/ace/bin/serve (renamed from trunk/infrastructure/ace/bin/serve) | 0 | ||||
-rw-r--r-- | infrastructure/ace/blog.txt (renamed from trunk/infrastructure/ace/blog.txt) | 0 | ||||
-rw-r--r-- | infrastructure/ace/build/.gitignore (renamed from trunk/infrastructure/ace/build/.gitignore) | 0 | ||||
-rw-r--r-- | infrastructure/ace/build/index.html (renamed from trunk/infrastructure/ace/build/index.html) | 0 | ||||
-rw-r--r-- | infrastructure/ace/build/jquery-1.2.1.js (renamed from trunk/infrastructure/ace/build/jquery-1.2.1.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/build/testcode.js (renamed from trunk/infrastructure/ace/build/testcode.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/easysync-notes.txt (renamed from trunk/infrastructure/ace/easysync-notes.txt) | 0 | ||||
l--------- | infrastructure/ace/lib/rhino-js-1.7r1.jar (renamed from trunk/infrastructure/ace/lib/rhino-js-1.7r1.jar) | 0 | ||||
l--------- | infrastructure/ace/lib/yuicompressor-2.4-appjet.jar (renamed from trunk/infrastructure/ace/lib/yuicompressor-2.4-appjet.jar) | 0 | ||||
-rw-r--r-- | infrastructure/ace/notes.txt (renamed from trunk/infrastructure/ace/notes.txt) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/ace2_common.js (renamed from trunk/infrastructure/ace/www/ace2_common.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/ace2_common_dev.js (renamed from trunk/infrastructure/ace/www/ace2_common_dev.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/ace2_inner.js | 4809 | ||||
-rw-r--r-- | infrastructure/ace/www/ace2_outer.js | 234 | ||||
-rw-r--r-- | infrastructure/ace/www/ace2_wrapper.js (renamed from trunk/infrastructure/ace/www/ace2_wrapper.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/bbtree.js (renamed from trunk/infrastructure/ace/www/bbtree.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/changesettracker.js (renamed from trunk/infrastructure/ace/www/changesettracker.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/colorutils.js (renamed from trunk/infrastructure/ace/www/colorutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/contentcollector.js (renamed from trunk/infrastructure/ace/www/contentcollector.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/cssmanager.js (renamed from trunk/infrastructure/ace/www/cssmanager.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/dev.html (renamed from trunk/infrastructure/ace/www/dev.html) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/domline.js | 232 | ||||
-rw-r--r-- | infrastructure/ace/www/easy_sync.js (renamed from trunk/infrastructure/ace/www/easy_sync.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/easysync2.js (renamed from trunk/infrastructure/ace/www/easysync2.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/easysync2_tests.js (renamed from trunk/infrastructure/ace/www/easysync2_tests.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/editor.css (renamed from trunk/infrastructure/ace/www/editor.css) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/firebug/errorIcon.png (renamed from trunk/infrastructure/ace/www/firebug/errorIcon.png) | bin | 457 -> 457 bytes | |||
-rw-r--r-- | infrastructure/ace/www/firebug/firebug.css (renamed from trunk/infrastructure/ace/www/firebug/firebug.css) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/firebug/firebug.html (renamed from trunk/infrastructure/ace/www/firebug/firebug.html) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/firebug/firebug.js (renamed from trunk/infrastructure/ace/www/firebug/firebug.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/firebug/firebugx.js (renamed from trunk/infrastructure/ace/www/firebug/firebugx.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/firebug/infoIcon.png (renamed from trunk/infrastructure/ace/www/firebug/infoIcon.png) | bin | 524 -> 524 bytes | |||
-rw-r--r-- | infrastructure/ace/www/firebug/warningIcon.png (renamed from trunk/infrastructure/ace/www/firebug/warningIcon.png) | bin | 516 -> 516 bytes | |||
-rw-r--r-- | infrastructure/ace/www/index.html (renamed from trunk/infrastructure/ace/www/index.html) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/inner.css (renamed from trunk/infrastructure/ace/www/inner.css) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/jquery-1.2.1.js (renamed from trunk/infrastructure/ace/www/jquery-1.2.1.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/lang_html.js (renamed from trunk/infrastructure/ace/www/lang_html.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/lang_js.js (renamed from trunk/infrastructure/ace/www/lang_js.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/lexer_support.js (renamed from trunk/infrastructure/ace/www/lexer_support.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/linestylefilter.js | 287 | ||||
-rw-r--r-- | infrastructure/ace/www/magicdom.js (renamed from trunk/infrastructure/ace/www/magicdom.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/multilang_lexer.js (renamed from trunk/infrastructure/ace/www/multilang_lexer.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/processing.js (renamed from trunk/infrastructure/ace/www/processing.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/profiler.js (renamed from trunk/infrastructure/ace/www/profiler.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/skiplist.js (renamed from trunk/infrastructure/ace/www/skiplist.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/spanlist.js (renamed from trunk/infrastructure/ace/www/spanlist.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/syntax-new.css (renamed from trunk/infrastructure/ace/www/syntax-new.css) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/syntax.css (renamed from trunk/infrastructure/ace/www/syntax.css) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/test.html (renamed from trunk/infrastructure/ace/www/test.html) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/testcode.js (renamed from trunk/infrastructure/ace/www/testcode.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/toSource.js (renamed from trunk/infrastructure/ace/www/toSource.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/undomodule.js (renamed from trunk/infrastructure/ace/www/undomodule.js) | 0 | ||||
-rw-r--r-- | infrastructure/ace/www/virtual_lines.js (renamed from trunk/infrastructure/ace/www/virtual_lines.js) | 0 | ||||
-rwxr-xr-x | infrastructure/bin/classpath.sh (renamed from trunk/infrastructure/bin/classpath.sh) | 0 | ||||
-rwxr-xr-x | infrastructure/bin/comp.sh (renamed from trunk/infrastructure/bin/comp.sh) | 0 | ||||
-rwxr-xr-x | infrastructure/bin/compilecache.sh | 66 | ||||
-rwxr-xr-x | infrastructure/bin/jscomp.sh (renamed from trunk/infrastructure/bin/jscomp.sh) | 0 | ||||
-rwxr-xr-x | infrastructure/bin/makejar.sh | 74 | ||||
-rwxr-xr-x | infrastructure/bin/makesars.sh (renamed from trunk/infrastructure/bin/makesars.sh) | 0 | ||||
-rwxr-xr-x | infrastructure/bin/run.sh (renamed from trunk/infrastructure/bin/run.sh) | 0 | ||||
-rw-r--r-- | infrastructure/com.etherpad.openofficeservice/importexport.scala | 287 | ||||
-rw-r--r-- | infrastructure/com.etherpad/easysync2support.scala (renamed from trunk/infrastructure/com.etherpad/easysync2support.scala) | 0 | ||||
-rw-r--r-- | infrastructure/com.etherpad/licensing.scala | 169 | ||||
-rw-r--r-- | infrastructure/com.etherpad/main.scala (renamed from trunk/infrastructure/com.etherpad/main.scala) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/atomfeed.js (renamed from trunk/infrastructure/framework-src/modules/atomfeed.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/blob.js (renamed from trunk/infrastructure/framework-src/modules/blob.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/cache_utils.js (renamed from trunk/infrastructure/framework-src/modules/cache_utils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/comet.js (renamed from trunk/infrastructure/framework-src/modules/comet.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/dateutils.js (renamed from trunk/infrastructure/framework-src/modules/dateutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/dispatch.js (renamed from trunk/infrastructure/framework-src/modules/dispatch.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/ejs.js | 477 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/email.js (renamed from trunk/infrastructure/framework-src/modules/email.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/exceptionutils.js (renamed from trunk/infrastructure/framework-src/modules/exceptionutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/execution.js | 61 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/fastJSON.js (renamed from trunk/infrastructure/framework-src/modules/fastJSON.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/faststatic.js | 342 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/fileutils.js (renamed from trunk/infrastructure/framework-src/modules/fileutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/funhtml.js (renamed from trunk/infrastructure/framework-src/modules/funhtml.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/global/appjet.js (renamed from trunk/infrastructure/framework-src/modules/global/appjet.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/global/request.js (renamed from trunk/infrastructure/framework-src/modules/global/request.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/global/response.js (renamed from trunk/infrastructure/framework-src/modules/global/response.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/image.js (renamed from trunk/infrastructure/framework-src/modules/image.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/jsutils.js (renamed from trunk/infrastructure/framework-src/modules/jsutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/netutils.js (renamed from trunk/infrastructure/framework-src/modules/netutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/process.js | 91 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/profiler.js (renamed from trunk/infrastructure/framework-src/modules/profiler.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sessions.js (renamed from trunk/infrastructure/framework-src/modules/sessions.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sqlbase/persistent_vars.js (renamed from trunk/infrastructure/framework-src/modules/sqlbase/persistent_vars.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sqlbase/sqlbase.js (renamed from trunk/infrastructure/framework-src/modules/sqlbase/sqlbase.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sqlbase/sqlcommon.js (renamed from trunk/infrastructure/framework-src/modules/sqlbase/sqlcommon.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sqlbase/sqlobj.js | 551 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/stringutils.js (renamed from trunk/infrastructure/framework-src/modules/stringutils.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/sync.js (renamed from trunk/infrastructure/framework-src/modules/sync.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/timer.js (renamed from trunk/infrastructure/framework-src/modules/timer.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/varz.js (renamed from trunk/infrastructure/framework-src/modules/varz.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/yuicompressor.js (renamed from trunk/infrastructure/framework-src/modules/yuicompressor.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/oncomet.js (renamed from trunk/infrastructure/framework-src/oncomet.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onerror.js (renamed from trunk/infrastructure/framework-src/onerror.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onprint.js (renamed from trunk/infrastructure/framework-src/onprint.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onrequest.js (renamed from trunk/infrastructure/framework-src/onrequest.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onreset.js (renamed from trunk/infrastructure/framework-src/onreset.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onsars.js (renamed from trunk/infrastructure/framework-src/onsars.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onscheduledtask.js (renamed from trunk/infrastructure/framework-src/onscheduledtask.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onshutdown.js (renamed from trunk/infrastructure/framework-src/onshutdown.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onstartup.js (renamed from trunk/infrastructure/framework-src/onstartup.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/onsyntaxerror.js (renamed from trunk/infrastructure/framework-src/onsyntaxerror.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/postamble.js (renamed from trunk/infrastructure/framework-src/postamble.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/preamble.js (renamed from trunk/infrastructure/framework-src/preamble.js) | 0 | ||||
-rw-r--r-- | infrastructure/framework-src/syntaxerror.js (renamed from trunk/infrastructure/framework-src/syntaxerror.js) | 0 | ||||
-rw-r--r-- | infrastructure/lib/activation.jar (renamed from trunk/infrastructure/lib/activation.jar) | bin | 56290 -> 56290 bytes | |||
-rw-r--r-- | infrastructure/lib/c3p0-0.9.1.2.jar (renamed from trunk/infrastructure/lib/c3p0-0.9.1.2.jar) | bin | 610790 -> 610790 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-fileupload-1.2.1-javadoc.jar | bin | 0 -> 275779 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-fileupload-1.2.1-sources.jar | bin | 0 -> 73721 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-fileupload-1.2.1.jar | bin | 0 -> 57779 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-io-1.4-javadoc.jar | bin | 0 -> 499643 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-io-1.4-sources.jar | bin | 0 -> 163177 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-io-1.4.jar | bin | 0 -> 109043 bytes | |||
-rw-r--r-- | infrastructure/lib/commons-lang-2.4.jar (renamed from trunk/infrastructure/lib/commons-lang-2.4.jar) | bin | 261809 -> 261809 bytes | |||
-rw-r--r-- | infrastructure/lib/derby-10.5.1.1.jar (renamed from trunk/infrastructure/lib/derby-10.5.1.1.jar) | bin | 2513361 -> 2513361 bytes | |||
-rw-r--r-- | infrastructure/lib/derbytools.jar (renamed from trunk/infrastructure/lib/derbytools.jar) | bin | 155796 -> 155796 bytes | |||
-rw-r--r-- | infrastructure/lib/dnsjava-2.0.6.jar (renamed from trunk/infrastructure/lib/dnsjava-2.0.6.jar) | bin | 268823 -> 268823 bytes | |||
-rw-r--r-- | infrastructure/lib/java_uno-3.2.0.jar | bin | 0 -> 4205 bytes | |||
-rw-r--r-- | infrastructure/lib/jetty-6.1.20.jar (renamed from trunk/infrastructure/lib/jetty-6.1.20.jar) | bin | 533605 -> 533605 bytes | |||
-rw-r--r-- | infrastructure/lib/jetty-sslengine-6.1.20.jar (renamed from trunk/infrastructure/lib/jetty-sslengine-6.1.20.jar) | bin | 18285 -> 18285 bytes | |||
-rw-r--r-- | infrastructure/lib/jetty-util-6.1.20.jar (renamed from trunk/infrastructure/lib/jetty-util-6.1.20.jar) | bin | 176016 -> 176016 bytes | |||
-rw-r--r-- | infrastructure/lib/json.jar (renamed from trunk/infrastructure/lib/json.jar) | bin | 42335 -> 42335 bytes | |||
-rw-r--r-- | infrastructure/lib/juh-3.2.0.jar | bin | 0 -> 55517 bytes | |||
-rw-r--r-- | infrastructure/lib/jurt-3.2.0.jar | bin | 0 -> 108138 bytes | |||
-rw-r--r-- | infrastructure/lib/mail.jar (renamed from trunk/infrastructure/lib/mail.jar) | bin | 356519 -> 356519 bytes | |||
-rw-r--r-- | infrastructure/lib/manifest (renamed from trunk/infrastructure/lib/manifest) | 0 | ||||
-rw-r--r-- | infrastructure/lib/rhino-js-1.7r1.jar (renamed from trunk/infrastructure/lib/rhino-js-1.7r1.jar) | bin | 769000 -> 769000 bytes | |||
-rw-r--r-- | infrastructure/lib/ridl-3.2.0.jar | bin | 0 -> 256497 bytes | |||
-rw-r--r-- | infrastructure/lib/sanselan-0.94aj.jar (renamed from trunk/infrastructure/lib/sanselan-0.94aj.jar) | bin | 390426 -> 390426 bytes | |||
-rw-r--r-- | infrastructure/lib/servlet-api-2.5-20081211.jar (renamed from trunk/infrastructure/lib/servlet-api-2.5-20081211.jar) | bin | 134190 -> 134190 bytes | |||
-rw-r--r-- | infrastructure/lib/tagsoup-1.2.jar (renamed from trunk/infrastructure/lib/tagsoup-1.2.jar) | bin | 90023 -> 90023 bytes | |||
-rw-r--r-- | infrastructure/lib/unoil-3.2.0.jar | bin | 0 -> 1415707 bytes | |||
-rw-r--r-- | infrastructure/lib/yuicompressor-2.4-appjet.jar (renamed from trunk/infrastructure/lib/yuicompressor-2.4-appjet.jar) | bin | 574932 -> 574932 bytes | |||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/ajstdlib.scala (renamed from trunk/infrastructure/net.appjet.ajstdlib/ajstdlib.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/sqlbase.scala (renamed from trunk/infrastructure/net.appjet.ajstdlib/sqlbase.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/streaming-client.js (renamed from trunk/infrastructure/net.appjet.ajstdlib/streaming-client.js) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/streaming-iframe.html (renamed from trunk/infrastructure/net.appjet.ajstdlib/streaming-iframe.html) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/streaming.scala (renamed from trunk/infrastructure/net.appjet.ajstdlib/streaming.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.ajstdlib/timer.scala (renamed from trunk/infrastructure/net.appjet.ajstdlib/timer.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.bodylock/bodylock.scala (renamed from trunk/infrastructure/net.appjet.bodylock/bodylock.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.bodylock/compressor.scala (renamed from trunk/infrastructure/net.appjet.bodylock/compressor.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common.cli/cli.scala (renamed from trunk/infrastructure/net.appjet.common.cli/cli.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common.sars/sars.scala (renamed from trunk/infrastructure/net.appjet.common.sars/sars.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common.sars/sha1.scala (renamed from trunk/infrastructure/net.appjet.common.sars/sha1.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/rhino/rhinospect.scala (renamed from trunk/infrastructure/net.appjet.common/rhino/rhinospect.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/BCrypt.java (renamed from trunk/infrastructure/net.appjet.common/util/BCrypt.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/BetterFile.java (renamed from trunk/infrastructure/net.appjet.common/util/BetterFile.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/ClassReload.java (renamed from trunk/infrastructure/net.appjet.common/util/ClassReload.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/ExpiringMapping.java (renamed from trunk/infrastructure/net.appjet.common/util/ExpiringMapping.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/HttpServletRequestFactory.java (renamed from trunk/infrastructure/net.appjet.common/util/HttpServletRequestFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/LenientFormatter.java (renamed from trunk/infrastructure/net.appjet.common/util/LenientFormatter.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.common/util/LimitedSizeMapping.java (renamed from trunk/infrastructure/net.appjet.common/util/LimitedSizeMapping.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/ConfigParam.java (renamed from trunk/infrastructure/net.appjet.oui/ConfigParam.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/FastJSON.scala (renamed from trunk/infrastructure/net.appjet.oui/FastJSON.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/GeneratedConfigParam.java (renamed from trunk/infrastructure/net.appjet.oui/GeneratedConfigParam.java) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/config.scala | 245 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/dynamicvar.scala (renamed from trunk/infrastructure/net.appjet.oui/dynamicvar.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/encryption.scala (renamed from trunk/infrastructure/net.appjet.oui/encryption.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/execution.scala | 660 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/files.scala (renamed from trunk/infrastructure/net.appjet.oui/files.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/logging.scala (renamed from trunk/infrastructure/net.appjet.oui/logging.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/main.scala | 388 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/monitoring.scala (renamed from trunk/infrastructure/net.appjet.oui/monitoring.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/network.scala (renamed from trunk/infrastructure/net.appjet.oui/network.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/servermodel.scala (renamed from trunk/infrastructure/net.appjet.oui/servermodel.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/stats.scala (renamed from trunk/infrastructure/net.appjet.oui/stats.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/synchronizer.scala (renamed from trunk/infrastructure/net.appjet.oui/synchronizer.scala) | 0 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/util.scala (renamed from trunk/infrastructure/net.appjet.oui/util.scala) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/apiClasses.properties (renamed from trunk/infrastructure/rhino1_7R1/apiClasses.properties) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/build-date (renamed from trunk/infrastructure/rhino1_7R1/build-date) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/build.properties (renamed from trunk/infrastructure/rhino1_7R1/build.properties) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/build.xml (renamed from trunk/infrastructure/rhino1_7R1/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/build.xml (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java (renamed from trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/Control.java (renamed from trunk/infrastructure/rhino1_7R1/examples/Control.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/Counter.java (renamed from trunk/infrastructure/rhino1_7R1/examples/Counter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/CounterTest.java (renamed from trunk/infrastructure/rhino1_7R1/examples/CounterTest.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/DynamicScopes.java (renamed from trunk/infrastructure/rhino1_7R1/examples/DynamicScopes.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/E4X/e4x_example.js (renamed from trunk/infrastructure/rhino1_7R1/examples/E4X/e4x_example.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/File.java (renamed from trunk/infrastructure/rhino1_7R1/examples/File.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/Foo.java (renamed from trunk/infrastructure/rhino1_7R1/examples/Foo.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/Matrix.java (renamed from trunk/infrastructure/rhino1_7R1/examples/Matrix.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/NervousText.html (renamed from trunk/infrastructure/rhino1_7R1/examples/NervousText.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/NervousText.js (renamed from trunk/infrastructure/rhino1_7R1/examples/NervousText.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java (renamed from trunk/infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/RunScript.java (renamed from trunk/infrastructure/rhino1_7R1/examples/RunScript.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/RunScript2.java (renamed from trunk/infrastructure/rhino1_7R1/examples/RunScript2.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/RunScript3.java (renamed from trunk/infrastructure/rhino1_7R1/examples/RunScript3.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/RunScript4.java (renamed from trunk/infrastructure/rhino1_7R1/examples/RunScript4.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/Shell.java (renamed from trunk/infrastructure/rhino1_7R1/examples/Shell.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/SwingApplication.js (renamed from trunk/infrastructure/rhino1_7R1/examples/SwingApplication.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/checkParam.js (renamed from trunk/infrastructure/rhino1_7R1/examples/checkParam.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/enum.js (renamed from trunk/infrastructure/rhino1_7R1/examples/enum.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/jsdoc.js (renamed from trunk/infrastructure/rhino1_7R1/examples/jsdoc.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/liveConnect.js (renamed from trunk/infrastructure/rhino1_7R1/examples/liveConnect.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/examples/unique.js (renamed from trunk/infrastructure/rhino1_7R1/examples/unique.js) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/allclasses-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/allclasses-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/constant-values.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/constant-values.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/deprecated-list.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/deprecated-list.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/help-doc.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/help-doc.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/index-all.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/index-all.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/index.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/index.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/overview-frame.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/overview-frame.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/overview-summary.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/overview-summary.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/overview-tree.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/overview-tree.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/package-list (renamed from trunk/infrastructure/rhino1_7R1/javadoc/package-list) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/resources/inherit.gif (renamed from trunk/infrastructure/rhino1_7R1/javadoc/resources/inherit.gif) | bin | 57 -> 57 bytes | |||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/serialized-form.html (renamed from trunk/infrastructure/rhino1_7R1/javadoc/serialized-form.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/javadoc/stylesheet.css (renamed from trunk/infrastructure/rhino1_7R1/javadoc/stylesheet.css) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar (renamed from trunk/infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar) | bin | 23630 -> 23630 bytes | |||
-rw-r--r-- | infrastructure/rhino1_7R1/lib/xbean.jar (renamed from trunk/infrastructure/rhino1_7R1/lib/xbean.jar) | bin | 2664574 -> 2664574 bytes | |||
-rw-r--r-- | infrastructure/rhino1_7R1/src/build.xml (renamed from trunk/infrastructure/rhino1_7R1/src/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/manifest (renamed from trunk/infrastructure/rhino1_7R1/src/manifest) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java (renamed from trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/base.skip (renamed from trunk/infrastructure/rhino1_7R1/testsrc/base.skip) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/build.xml (renamed from trunk/infrastructure/rhino1_7R1/testsrc/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/opt1.skip (renamed from trunk/infrastructure/rhino1_7R1/testsrc/opt1.skip) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java (renamed from trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/build.xml (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java (renamed from trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/build.xml (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/build.xml) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java) | 0 | ||||
-rw-r--r-- | infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java (renamed from trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/lib/jargs-1.0.jar (renamed from trunk/infrastructure/yuicompressor/lib/jargs-1.0.jar) | bin | 11406 -> 11406 bytes | |||
-rw-r--r-- | infrastructure/yuicompressor/lib/rhino-yuicompressor.jar (renamed from trunk/infrastructure/yuicompressor/lib/rhino-yuicompressor.jar) | bin | 538064 -> 538064 bytes | |||
-rwxr-xr-x | infrastructure/yuicompressor/make.sh (renamed from trunk/infrastructure/yuicompressor/make.sh) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java (renamed from trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java (renamed from trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java (renamed from trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java (renamed from trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java) | 0 | ||||
-rw-r--r-- | infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java (renamed from trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java) | 0 |
457 files changed, 9312 insertions, 0 deletions
diff --git a/trunk/infrastructure/.gitignore b/infrastructure/.gitignore index 8cde493..8cde493 100644 --- a/trunk/infrastructure/.gitignore +++ b/infrastructure/.gitignore diff --git a/trunk/infrastructure/ace/.gitignore b/infrastructure/ace/.gitignore index 4083037..4083037 100644 --- a/trunk/infrastructure/ace/.gitignore +++ b/infrastructure/ace/.gitignore diff --git a/trunk/infrastructure/ace/README b/infrastructure/ace/README index 275684f..275684f 100644 --- a/trunk/infrastructure/ace/README +++ b/infrastructure/ace/README diff --git a/infrastructure/ace/bin/make b/infrastructure/ace/bin/make new file mode 100755 index 0000000..98a48f4 --- /dev/null +++ b/infrastructure/ace/bin/make @@ -0,0 +1,339 @@ +#!/bin/sh +mkdir -p ../../etherpad/src/etherpad/collab/ace +mkdir -p ../../etherpad/src/static/js +exec scala -classpath lib/yuicompressor-2.4-appjet.jar:lib/rhino-js-1.7r1.jar $0 $@ +!# + +import java.io._; + +def superpack(input: String): String = { + // this function is self-contained; takes a string, returns an expression + // that evaluates to that string + // XXX (This compresses well but decompression is too slow) + + // constraints on special chars: + // - this string must be able to go in a character class + // - each char must be able to go in single quotes + val specialChars = "-~@%$#*^_`()|abcdefghijklmnopqrstuvwxyz=!+,.;:?{}"; + val specialCharsSet:Set[Char] = Set(specialChars:_*); + def containsSpecialChar(str: String) = str.exists(specialCharsSet.contains(_)); + + val toks:Array[String] = ( + "@|[a-zA-Z0-9]+|[^@a-zA-Z0-9]{1,3}").r.findAllIn(input).collect.toArray; + + val stringCounts = { + val m = new scala.collection.mutable.HashMap[String,Int]; + def incrementCount(s: String) = { m(s) = m.getOrElse(s, 0) + 1; } + for(s <- toks) incrementCount(s); + m; + } + + val estimatedSavings = scala.util.Sorting.stableSort( + for((s,n) <- stringCounts.toArray; savings = s.length*n + if (savings > 8 || containsSpecialChar(s))) + yield (s,n,savings), + (x:(String,Int,Int))=> -x._3); + + def strLast(str: String, n: Int) = str.substring(str.length - n, str.length); + // order of encodeNames is very important! + val encodeNames = for(n <- 0 until (36*36); c <- specialChars) yield c.toString+strLast("0"+Integer.toString(n, 36).toUpperCase, 2); + + val thingsToReplace:Seq[String] = estimatedSavings.map(_._1); + assert(encodeNames.length >= thingsToReplace.length); + + val replacements = Map(thingsToReplace.elements.zipWithIndex.map({ + case (str, i) => (str, encodeNames(i)); + }).collect:_*); + def encode(tk: String) = if (replacements.contains(tk)) replacements(tk) else tk; + + val afterReplace = toks.map(encode(_)).mkString.replaceAll( + "(["+specialChars+"])(?=..[^0-9A-Z])(00|0)", "$1"); + + def makeSingleQuotedContents(str: String): String = { + str.replace("\\", "\\\\").replace("'", "\\'").replace("<", "\\x3c").replace("\n", "\\n"). + replace("\r", "\\n").replace("\t", "\\t"); + } + + val expansionMap = new scala.collection.mutable.HashMap[Char,scala.collection.mutable.ArrayBuffer[String]]; + for(i <- 0 until thingsToReplace.length; sc = encodeNames(i).charAt(0); + e = thingsToReplace(i)) { + expansionMap.getOrElseUpdate(sc, new scala.collection.mutable.ArrayBuffer[String]) += + (if (e == "@") "" else e); + } + val expansionMapLiteral = "{"+(for((sc,strs) <- expansionMap) yield { + "'"+sc+"':'"+makeSingleQuotedContents(strs.mkString("@"))+"'"; + }).mkString(",")+"}"; + + val expr = ("(function(m){m="+expansionMapLiteral+ + ";for(var k in m){if(m.hasOwnProperty(k))m[k]=m[k].split('@')};return '"+ + makeSingleQuotedContents(afterReplace)+ + "'.replace(/(["+specialChars+ + "])([0-9A-Z]{0,2})/g,function(a,b,c){return m[b][parseInt(c||'0',36)]||'@'})}())"); + /*val expr = ("(function(m){m="+expansionMapLiteral+ + ";for(var k in m){if(m.hasOwnProperty(k))m[k]=m[k].split('@')};"+ + "var result=[];var i=0;var s='"+makeSingleQuotedContents(afterReplace)+ + "';var len=s.length;while (i<len) {var x=s.charAt(i); var L=m[x],a = s.charAt(i+1),b = s.charAt(i+2);if (L) { var c;if (!(a >= 'A' && a <= 'Z' || a >= '0' && a <= '9')) {c=L[0];i++} else if (!(b >= 'A' && b <= 'Z' || b >= '0' && b <= '9')) {c = L[parseInt(a,36)]; i+=2} else {c = L[parseInt(a+b,36)]; i+=3}; result.push(c||'@'); } else {result.push(x); i++} }; return result.join(''); }())");*/ + + def evaluateString(js: String): String = { + import org.mozilla.javascript._; + ContextFactory.getGlobal.call(new ContextAction { + def run(cx: Context) = { + val scope = cx.initStandardObjects; + cx.evaluateString(scope, js, "<cmd>", 1, null) } }).asInstanceOf[String]; + } + + def putFile(str: String, path: String): Unit = { + import java.io._; + val writer = new FileWriter(path); + writer.write(str); + writer.close; + } + + val exprOut = evaluateString(expr); + if (exprOut != input) { + putFile(input, "/tmp/superpack.input"); + putFile(expr, "/tmp/superpack.expr"); + putFile(exprOut, "/tmp/superpack.output"); + error("Superpacked string does not evaluate to original string; check /tmp/superpack.*"); + } + + val singleLiteral = "'"+makeSingleQuotedContents(input)+"'"; + if (singleLiteral.length < expr.length) { + singleLiteral; + } + else { + expr; + } +} + +def doMake { + + lazy val isEtherPad = (args.length >= 2 && args(1) == "etherpad"); + lazy val isNoHelma = (args.length >= 2 && args(1) == "nohelma"); + + def getFile(path:String): String = { + val builder = new StringBuilder(1000); + val reader = new BufferedReader(new FileReader(path)); + val buf = new Array[Char](1024); + var numRead = 0; + while({ numRead = reader.read(buf); numRead } != -1) { + builder.append(buf, 0, numRead); + } + reader.close; + return builder.toString; + } + + def putFile(str: String, path: String): Unit = { + val writer = new FileWriter(path); + writer.write(str); + writer.close; + } + + def writeToString(func:(Writer=>Unit)): String = { + val writer = new StringWriter; + func(writer); + return writer.toString; + } + + def compressJS(code: String, wrap: Boolean): String = { + import yuicompressor.org.mozilla.javascript.{ErrorReporter, EvaluatorException}; + object MyErrorReporter extends ErrorReporter { + def warning(message:String, sourceName:String, line:Int, lineSource:String, lineOffset:Int) { + if (message startsWith "Try to use a single 'var' statement per scope.") return; + if (line < 0) System.err.println("\n[WARNING] " + message); + else System.err.println("\n[WARNING] " + line + ':' + lineOffset + ':' + message); + } + def error(message:String, sourceName:String, line:Int, lineSource:String, lineOffset:Int) { + if (line < 0) System.err.println("\n[ERROR] " + message); + else System.err.println("\n[ERROR] " + line + ':' + lineOffset + ':' + message); + } + def runtimeError(message:String, sourceName:String, line:Int, lineSource:String, lineOffset:Int): EvaluatorException = { + error(message, sourceName, line, lineSource, lineOffset); + return new EvaluatorException(message); + } + } + + val munge = true; + val verbose = false; + val optimize = true; + val compressor = new com.yahoo.platform.yui.compressor.JavaScriptCompressor(new StringReader(code), MyErrorReporter); + return writeToString(compressor.compress(_, if (wrap) 100 else -1, munge, verbose, true, !optimize)); + } + + def compressCSS(code: String, wrap: Boolean): String = { + val compressor = new com.yahoo.platform.yui.compressor.CssCompressor(new StringReader(code)); + return writeToString(compressor.compress(_, if (wrap) 100 else -1)); + } + + import java.util.regex.{Pattern, Matcher, MatchResult}; + + def stringReplace(orig: String, regex: String, groupReferences:Boolean, func:(MatchResult=>String)): String = { + val buf = new StringBuffer; + val m = Pattern.compile(regex).matcher(orig); + while (m.find) { + var str = func(m); + if (! groupReferences) { + str = str.replace("\\", "\\\\").replace("$", "\\$"); + } + m.appendReplacement(buf, str); + } + m.appendTail(buf); + return buf.toString; + } + + def stringToExpression(str: String): String = { + var contents = str.replace("\\", "\\\\").replace("'", "\\'").replace("<", "\\x3c").replace("\n", "\\n"). + replace("\r", "\\n").replace("\t", "\\t"); + contents = contents.replace("\\/", "\\\\x2f"); // for Norton Internet Security + val result = "'"+contents+"'"; + result; + } + + val srcDir = "www"; + val destDir = "build"; + var code = getFile(srcDir+"/ace2_outer.js"); + + val useCompression = true; //if (isEtherPad) false else true; + + code = stringReplace(code, "\\$\\$INCLUDE_([A-Z_]+)\\([\"']([^\"']+)[\"']\\)", false, (m:MatchResult) => { + val includeType = m.group(1); + val paths = m.group(2); + val pathsArray = paths.replaceAll("""/\*.*?\*/""", "").split(" +").filter(_.length > 0); + def getSubcode = pathsArray.map(p => getFile(srcDir+"/"+p)).mkString("\n"); + val doPack = (stringToExpression _); + includeType match { + case "JS" => { + var subcode = getSubcode; + subcode = subcode.replaceAll("var DEBUG=true;//\\$\\$[^\n\r]*", "var DEBUG=false;"); + if (useCompression) subcode = compressJS(subcode, true); + "('\\x3cscript type=\"text/javascript\">//<!--\\n'+" + doPack(subcode) + + "+'//-->\\n</script>')"; + } + case "CSS" => { + var subcode = getSubcode; + if (useCompression) subcode = compressCSS(subcode, false); + "('<style type=\"text/css\">'+" + doPack(subcode) + "+'</style>')"; + } + case "JS_Q" => { + var subcode = getSubcode + subcode = subcode.replaceAll("var DEBUG=true;//\\$\\$[^\n\r]*", "var DEBUG=false;"); + if (useCompression) subcode = compressJS(subcode, true); + "('(\\'\\\\x3cscript type=\"text/javascript\">//<!--\\\\n\\'+'+" + + doPack(stringToExpression(subcode)) + + "+'+\\'//-->\\\\n\\\\x3c/script>\\')')"; + } + case "CSS_Q" => { + var subcode = getSubcode; + if (useCompression) subcode = compressCSS(subcode, false); + "('(\\'<style type=\"text/css\">\\'+'+" + doPack(stringToExpression(subcode)) + + "+'+\\'\\\\x3c/style>\\')')"; + } + case ("JS_DEV" | "CSS_DEV") => "''"; + case ("JS_Q_DEV" | "CSS_Q_DEV") => "'\\'\\''"; + //case _ => "$$INCLUDE_"+includeType+"(\"../www/"+path+"\")"; + } + }); + + if (useCompression) code = compressJS(code, true); + + putFile(code, destDir+"/ace2bare.js"); + + //var wrapper = getFile(srcDir+"/ace2_wrapper.js"); + //if (useCompression) wrapper = compressJS(wrapper, true); + putFile(/*wrapper+"\n"+*/code, destDir+"/ace2.js"); + + var index = getFile(srcDir+"/index.html"); + index = index.replaceAll("<!--\\s*DEBUG\\s*-->\\s*([\\s\\S]+?)\\s*<!--\\s*/DEBUG\\s*-->", ""); + index = index.replaceAll("<!--\\s*PROD:\\s*([\\s\\S]+?)\\s*-->", "$1"); + putFile(index, destDir+"/index.html"); + + putFile(getFile(srcDir+"/testcode.js"), destDir+"/testcode.js"); + + def copyFile(fromFile: String, toFile: String) { + if (0 != Runtime.getRuntime.exec("cp "+fromFile+" "+toFile).waitFor) { + printf("copy failed (%s -> %s).\n", fromFile, toFile); + } + } + + def replaceFirstLine(txt: String, newFirstLine: String): String = { + var newlinePos = txt.indexOf('\n'); + newFirstLine + txt.substring(newlinePos); + } + + if (isEtherPad) { + copyFile("build/ace2.js", "../../etherpad/src/static/js/ace.js"); + + def copyFileToEtherpad(fromName: String, toName: String) { + var code = getFile(srcDir+"/"+fromName); + code = "// DO NOT EDIT THIS FILE, edit "+ + "infrastructure/ace/www/"+fromName+"\n"+code; + code = code.replaceAll("""(?<=\n)\s*//\s*%APPJET%:\s*""", ""); + putFile(code, "../../etherpad/src/etherpad/collab/ace/"+toName); + } + def copyFileToClientSide(fromName: String, toName: String) { + var code = getFile(srcDir+"/"+fromName); + code = "// DO NOT EDIT THIS FILE, edit "+ + "infrastructure/ace/www/"+fromName+"\n"+code; + code = code.replaceAll("""(?<=\n)\s*//\s*%APPJET%:.*?\n""", ""); + code = code.replaceAll("""(?<=\n)\s*//\s*%CLIENT FILE ENDS HERE%[\s\S]*""", + ""); + putFile(code, "../../etherpad/src/static/js/"+toName); + } + + copyFileToEtherpad("easy_sync.js", "easysync1.js"); + copyFileToEtherpad("easysync2.js", "easysync2.js"); + copyFileToEtherpad("contentcollector.js", "contentcollector.js"); + copyFileToEtherpad("easysync2_tests.js", "easysync2_tests.js"); + copyFileToClientSide("colorutils.js", "colorutils.js"); + copyFileToClientSide("easysync2.js", "easysync2_client.js"); + copyFileToEtherpad("linestylefilter.js", "linestylefilter.js"); + copyFileToClientSide("linestylefilter.js", "linestylefilter_client.js"); + copyFileToEtherpad("domline.js", "domline.js"); + copyFileToClientSide("domline.js", "domline_client.js"); + copyFileToClientSide("cssmanager.js", "cssmanager_client.js"); + } + /*else if (! isNoHelma) { + copyFile("build/ace2.js", "../helma_apps/appjet/protectedStatic/js/ace.js"); + }*/ +} + +def remakeLoop { + + def getStamp: Long = { + return (new java.io.File("www").listFiles. + filter(! _.getName.endsWith("~")). + filter(! _.getName.endsWith("#")). + filter(! _.getName.startsWith(".")).map(_.lastModified). + reduceLeft(Math.max(_:Long,_:Long))); + } + + var madeStamp:Long = 0; + var errorStamp:Long = 0; + while (true) { + Thread.sleep(500); + val s = getStamp; + if (s > madeStamp && s != errorStamp) { + Thread.sleep(1000); + if (getStamp == s) { + madeStamp = s; + print("Remaking... "); + try { + doMake; + println("OK"); + } + catch { case e => { + println("ERROR"); + errorStamp = s; + } } + } + } + } + +} + +if (args.length >= 1 && args(0) == "auto") { + remakeLoop; +} +else { + doMake; +} diff --git a/trunk/infrastructure/ace/bin/serve b/infrastructure/ace/bin/serve index e02e042..e02e042 100755 --- a/trunk/infrastructure/ace/bin/serve +++ b/infrastructure/ace/bin/serve diff --git a/trunk/infrastructure/ace/blog.txt b/infrastructure/ace/blog.txt index 0b095a2..0b095a2 100644 --- a/trunk/infrastructure/ace/blog.txt +++ b/infrastructure/ace/blog.txt diff --git a/trunk/infrastructure/ace/build/.gitignore b/infrastructure/ace/build/.gitignore index 4dc709e..4dc709e 100644 --- a/trunk/infrastructure/ace/build/.gitignore +++ b/infrastructure/ace/build/.gitignore diff --git a/trunk/infrastructure/ace/build/index.html b/infrastructure/ace/build/index.html index b8c8505..b8c8505 100644 --- a/trunk/infrastructure/ace/build/index.html +++ b/infrastructure/ace/build/index.html diff --git a/trunk/infrastructure/ace/build/jquery-1.2.1.js b/infrastructure/ace/build/jquery-1.2.1.js index b4eb132..b4eb132 100644 --- a/trunk/infrastructure/ace/build/jquery-1.2.1.js +++ b/infrastructure/ace/build/jquery-1.2.1.js diff --git a/trunk/infrastructure/ace/build/testcode.js b/infrastructure/ace/build/testcode.js index f393335..f393335 100644 --- a/trunk/infrastructure/ace/build/testcode.js +++ b/infrastructure/ace/build/testcode.js diff --git a/trunk/infrastructure/ace/easysync-notes.txt b/infrastructure/ace/easysync-notes.txt index 6808f40..6808f40 100644 --- a/trunk/infrastructure/ace/easysync-notes.txt +++ b/infrastructure/ace/easysync-notes.txt diff --git a/trunk/infrastructure/ace/lib/rhino-js-1.7r1.jar b/infrastructure/ace/lib/rhino-js-1.7r1.jar index f41e23b..f41e23b 120000 --- a/trunk/infrastructure/ace/lib/rhino-js-1.7r1.jar +++ b/infrastructure/ace/lib/rhino-js-1.7r1.jar diff --git a/trunk/infrastructure/ace/lib/yuicompressor-2.4-appjet.jar b/infrastructure/ace/lib/yuicompressor-2.4-appjet.jar index 3953af5..3953af5 120000 --- a/trunk/infrastructure/ace/lib/yuicompressor-2.4-appjet.jar +++ b/infrastructure/ace/lib/yuicompressor-2.4-appjet.jar diff --git a/trunk/infrastructure/ace/notes.txt b/infrastructure/ace/notes.txt index d9e1fda..d9e1fda 100644 --- a/trunk/infrastructure/ace/notes.txt +++ b/infrastructure/ace/notes.txt diff --git a/trunk/infrastructure/ace/www/ace2_common.js b/infrastructure/ace/www/ace2_common.js index 4a08de6..4a08de6 100644 --- a/trunk/infrastructure/ace/www/ace2_common.js +++ b/infrastructure/ace/www/ace2_common.js diff --git a/trunk/infrastructure/ace/www/ace2_common_dev.js b/infrastructure/ace/www/ace2_common_dev.js index 8fb88b0..8fb88b0 100644 --- a/trunk/infrastructure/ace/www/ace2_common_dev.js +++ b/infrastructure/ace/www/ace2_common_dev.js diff --git a/infrastructure/ace/www/ace2_inner.js b/infrastructure/ace/www/ace2_inner.js new file mode 100644 index 0000000..33c13e8 --- /dev/null +++ b/infrastructure/ace/www/ace2_inner.js @@ -0,0 +1,4809 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function OUTER(gscope) { + + var DEBUG=true;//$$ build script replaces the string "var DEBUG=true;//$$" with "var DEBUG=false;" + + var isSetUp = false; + + var THE_TAB = ' ';//4 + var MAX_LIST_LEVEL = 8; + + var LINE_NUMBER_PADDING_RIGHT = 4; + var LINE_NUMBER_PADDING_LEFT = 4; + var MIN_LINEDIV_WIDTH = 20; + var EDIT_BODY_PADDING_TOP = 8; + var EDIT_BODY_PADDING_LEFT = 8; + + var caughtErrors = []; + + var thisAuthor = ''; + + var disposed = false; + + var editorInfo = parent.editorInfo; + + var iframe = window.frameElement; + var outerWin = iframe.ace_outerWin; + iframe.ace_outerWin = null; // prevent IE 6 memory leak + var sideDiv = iframe.nextSibling; + var lineMetricsDiv = sideDiv.nextSibling; + var overlaysdiv = lineMetricsDiv.nextSibling; + initLineNumbers(); + + var outsideKeyDown = function(evt) {}; + var outsideKeyPress = function(evt) { return true; }; + var outsideNotifyDirty = function() {}; + + // selFocusAtStart -- determines whether the selection extends "backwards", so that the focus + // point (controlled with the arrow keys) is at the beginning; not supported in IE, though + // native IE selections have that behavior (which we try not to interfere with). + // Must be false if selection is collapsed! + var rep = { lines: newSkipList(), selStart: null, selEnd: null, selFocusAtStart: false, + alltext: "", alines: [], + apool: new AttribPool() }; + // lines, alltext, alines, and DOM are set up in setup() + if (undoModule.enabled) { + undoModule.apool = rep.apool; + } + + var root, doc; // set in setup() + + var isEditable = true; + var doesWrap = true; + var hasLineNumbers = true; + var isStyled = true; + + // space around the innermost iframe element + var iframePadLeft = MIN_LINEDIV_WIDTH + LINE_NUMBER_PADDING_RIGHT + EDIT_BODY_PADDING_LEFT; + var iframePadTop = EDIT_BODY_PADDING_TOP; + var iframePadBottom = 0, iframePadRight = 0; + + var console = (DEBUG && top.console); + if (! console) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + console = {}; + for (var i = 0; i < names.length; ++i) + console[names[i]] = function() {}; + //console.error = function(str) { alert(str); }; + } + var PROFILER = window.PROFILER; + if (!PROFILER) { + PROFILER = function() { return {start:noop, mark:noop, literal:noop, end:noop, cancel:noop}; }; + } + function noop() {} + function identity(x) { return x; } + + // "dmesg" is for displaying messages in the in-page output pane + // visible when "?djs=1" is appended to the pad URL. It generally + // remains a no-op unless djs is enabled, but we make a habit of + // only calling it in error cases or while debugging. + var dmesg = noop; + window.dmesg = noop; + + var scheduler = parent; + + var textFace = 'monospace'; + var textSize = 12; + function textLineHeight() { return Math.round(textSize * 4/3); } + + var dynamicCSS = null; + function initDynamicCSS() { + dynamicCSS = makeCSSManager("dynamicsyntax"); + } + + var changesetTracker = makeChangesetTracker(scheduler, rep.apool, { + withCallbacks: function(operationName, f) { + inCallStackIfNecessary(operationName, function() { + fastIncorp(1); + f({ + setDocumentAttributedText: function(atext) { + setDocAText(atext); + }, + applyChangesetToDocument: function(changeset, preferInsertionAfterCaret) { + var oldEventType = currentCallStack.editEvent.eventType; + currentCallStack.startNewEvent("nonundoable"); + + performDocumentApplyChangeset(changeset, preferInsertionAfterCaret); + + currentCallStack.startNewEvent(oldEventType); + } + }); + }); + } + }); + + var authorInfos = {}; // presence of key determines if author is present in doc + + function setAuthorInfo(author, info) { + if ((typeof author) != "string") { + throw new Error("setAuthorInfo: author ("+author+") is not a string"); + } + if (! info) { + delete authorInfos[author]; + if (dynamicCSS) { + dynamicCSS.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author))); + } + } + else { + authorInfos[author] = info; + if (info.bgcolor) { + if (dynamicCSS) { + var bgcolor = info.bgcolor; + if ((typeof info.fade) == "number") { + bgcolor = fadeColor(bgcolor, info.fade); + } + + dynamicCSS.selectorStyle(getAuthorColorClassSelector( + getAuthorClassName(author))).backgroundColor = bgcolor; + } + } + } + } + + function getAuthorClassName(author) { + return "author-"+author.replace(/[^a-y0-9]/g, function(c) { + if (c == ".") return "-"; + return 'z'+c.charCodeAt(0)+'z'; + }); + } + function className2Author(className) { + if (className.substring(0,7) == "author-") { + return className.substring(7).replace(/[a-y0-9]+|-|z.+?z/g, function(cc) { + if (cc == '-') return '.'; + else if (cc.charAt(0) == 'z') { + return String.fromCharCode(Number(cc.slice(1,-1))); + } + else { + return cc; + } + }); + } + return null; + } + function getAuthorColorClassSelector(oneClassName) { + return ".authorColors ."+oneClassName; + } + function setUpTrackingCSS() { + if (dynamicCSS) { + var backgroundHeight = lineMetricsDiv.offsetHeight; + var lineHeight = textLineHeight(); + var extraBodding = 0; + var extraTodding = 0; + if (backgroundHeight < lineHeight) { + extraBodding = Math.ceil((lineHeight - backgroundHeight)/2); + extraTodding = lineHeight - backgroundHeight - extraBodding; + } + var spanStyle = dynamicCSS.selectorStyle("#innerdocbody span"); + spanStyle.paddingTop = extraTodding+"px"; + spanStyle.paddingBottom = extraBodding+"px"; + } + } + function boldColorFromColor(lightColorCSS) { + var color = colorutils.css2triple(lightColorCSS); + + // amp up the saturation to full + color = colorutils.saturate(color); + + // normalize brightness based on luminosity + color = colorutils.scaleColor(color, 0, 0.5 / colorutils.luminosity(color)); + + return colorutils.triple2css(color); + } + function fadeColor(colorCSS, fadeFrac) { + var color = colorutils.css2triple(colorCSS); + color = colorutils.blend(color, [1,1,1], fadeFrac); + return colorutils.triple2css(color); + } + + function doAlert(str) { + scheduler.setTimeout(function() { alert(str); }, 0); + } + + var currentCallStack = null; + function inCallStack(type, action) { + if (disposed) return; + + if (currentCallStack) { + console.error("Can't enter callstack "+type+", already in "+ + currentCallStack.type); + } + + var profiling = false; + function profileRest() { + profiling = true; + console.profile(); + } + + function newEditEvent(eventType) { + return {eventType:eventType, backset: null}; + } + + function submitOldEvent(evt) { + if (rep.selStart && rep.selEnd) { + var selStartChar = + rep.lines.offsetOfIndex(rep.selStart[0]) + rep.selStart[1]; + var selEndChar = + rep.lines.offsetOfIndex(rep.selEnd[0]) + rep.selEnd[1]; + evt.selStart = selStartChar; + evt.selEnd = selEndChar; + evt.selFocusAtStart = rep.selFocusAtStart; + } + if (undoModule.enabled) { + var undoWorked = false; + try { + if (evt.eventType == "setup" || evt.eventType == "importText" || + evt.eventType == "setBaseText") { + undoModule.clearHistory(); + } + else if (evt.eventType == "nonundoable") { + if (evt.changeset) { + undoModule.reportExternalChange(evt.changeset); + } + } + else { + undoModule.reportEvent(evt); + } + undoWorked = true; + } + finally { + if (! undoWorked) { + undoModule.enabled = false; // for safety + } + } + } + } + + function startNewEvent(eventType, dontSubmitOld) { + var oldEvent = currentCallStack.editEvent; + if (! dontSubmitOld) { + submitOldEvent(oldEvent); + } + currentCallStack.editEvent = newEditEvent(eventType); + return oldEvent; + } + + currentCallStack = {type: type, docTextChanged: false, selectionAffected: false, + userChangedSelection: false, + domClean: false, profileRest:profileRest, + isUserChange: false, // is this a "user change" type of call-stack + repChanged: false, editEvent: newEditEvent(type), + startNewEvent:startNewEvent}; + var cleanExit = false; + var result; + try { + result = action(); + //console.log("Just did action for: "+type); + cleanExit = true; + } + catch (e) { + caughtErrors.push({error: e, time: +new Date()}); + dmesg(e.toString()); + throw e; + } + finally { + var cs = currentCallStack; + //console.log("Finished action for: "+type); + if (cleanExit) { + submitOldEvent(cs.editEvent); + if (cs.domClean && cs.type != "setup") { + if (cs.isUserChange) { + if (cs.repChanged) parenModule.notifyChange(); + else parenModule.notifyTick(); + } + recolorModule.recolorLines(); + if (cs.selectionAffected) { + updateBrowserSelectionFromRep(); + } + if ((cs.docTextChanged || cs.userChangedSelection) && cs.type != "applyChangesToBase") { + scrollSelectionIntoView(); + } + if (cs.docTextChanged && cs.type.indexOf("importText") < 0) { + outsideNotifyDirty(); + } + } + } + else { + // non-clean exit + if (currentCallStack.type == "idleWorkTimer") { + idleWorkTimer.atLeast(1000); + } + } + currentCallStack = null; + if (profiling) console.profileEnd(); + } + return result; + } + + function inCallStackIfNecessary(type, action) { + if (! currentCallStack) { + inCallStack(type, action); + } + else { + action(); + } + } + + function recolorLineByKey(key) { + if (rep.lines.containsKey(key)) { + var offset = rep.lines.offsetOfKey(key); + var width = rep.lines.atKey(key).width; + recolorLinesInRange(offset, offset + width); + } + } + + function getLineKeyForOffset(charOffset) { + return rep.lines.atOffset(charOffset).key; + } + + var recolorModule = (function() { + var dirtyLineKeys = {}; + + var module = {}; + module.setCharNeedsRecoloring = function(offset) { + if (offset >= rep.alltext.length) { + offset = rep.alltext.length-1; + } + dirtyLineKeys[getLineKeyForOffset(offset)] = true; + } + + module.setCharRangeNeedsRecoloring = function(offset1, offset2) { + if (offset1 >= rep.alltext.length) { + offset1 = rep.alltext.length-1; + } + if (offset2 >= rep.alltext.length) { + offset2 = rep.alltext.length-1; + } + var firstEntry = rep.lines.atOffset(offset1); + var lastKey = rep.lines.atOffset(offset2).key; + dirtyLineKeys[lastKey] = true; + var entry = firstEntry; + while (entry && entry.key != lastKey) { + dirtyLineKeys[entry.key] = true; + entry = rep.lines.next(entry); + } + } + + module.recolorLines = function() { + for(var k in dirtyLineKeys) { + recolorLineByKey(k); + } + dirtyLineKeys = {}; + } + + return module; + })(); + + var parenModule = (function() { + var module = {}; + module.notifyTick = function() { handleFlashing(false); }; + module.notifyChange = function() { handleFlashing(true); }; + module.shouldNormalizeOnChar = function (c) { + if (parenFlashRep.active) { + // avoid highlight style from carrying on to typed text + return true; + } + c = String.fromCharCode(c); + return !! (bracketMap[c]); + } + + var parenFlashRep = { active: false, whichChars: null, whichLineKeys: null, expireTime: null }; + var bracketMap = {'(': 1, ')':-1, '[':2, ']':-2, '{':3, '}':-3}; + var bracketRegex = /[{}\[\]()]/g; + function handleFlashing(docChanged) { + function getSearchRange(aroundLoc) { + var rng = getVisibleCharRange(); + var d = 100; // minimum radius + var e = 3000; // maximum radius; + if (rng[0] > aroundLoc-d) rng[0] = aroundLoc-d; + if (rng[0] < aroundLoc-e) rng[0] = aroundLoc-e; + if (rng[0] < 0) rng[0] = 0; + if (rng[1] < aroundLoc+d) rng[1] = aroundLoc+d; + if (rng[1] > aroundLoc+e) rng[1] = aroundLoc+e; + if (rng[1] > rep.lines.totalWidth()) rng[1] = rep.lines.totalWidth(); + return rng; + } + function findMatchingVisibleBracket(startLoc, forwards) { + var rng = getSearchRange(startLoc); + var str = rep.alltext.substring(rng[0], rng[1]); + var bstr = str.replace(bracketRegex, '('); // handy for searching + var loc = startLoc - rng[0]; + var bracketState = []; + var foundParen = false; + var goodParen = false; + function nextLoc() { + if (loc < 0) return; + if (forwards) loc++; else loc--; + if (loc < 0 || loc >= str.length) loc = -1; + if (loc >= 0) { + if (forwards) loc = bstr.indexOf('(', loc); + else loc = bstr.lastIndexOf('(', loc); + } + } + while ((! foundParen) && (loc >= 0)) { + if (getCharType(loc + rng[0]) == "p") { + var b = bracketMap[str.charAt(loc)]; // -1, 1, -2, 2, -3, 3 + var into = forwards; + var typ = b; + if (typ < 0) { into = ! into; typ = -typ; } + if (into) bracketState.push(typ); + else { + var recent = bracketState.pop(); + if (recent != typ) { + foundParen = true; goodParen = false; + } + else if (bracketState.length == 0) { + foundParen = true; goodParen = true; + } + } + } + //console.log(bracketState.toSource()); + if ((! foundParen) && (loc >= 0)) nextLoc(); + } + if (! foundParen) return null; + return {chr: (loc + rng[0]), good: goodParen}; + } + + var r = parenFlashRep; + var charsToHighlight = null; + var linesToUnhighlight = null; + if (r.active && (docChanged || (now() > r.expireTime))) { + linesToUnhighlight = r.whichLineKeys; + r.active = false; + } + if ((! r.active) && docChanged && isCaret() && caretColumn() > 0) { + var caret = caretDocChar(); + if (caret > 0 && getCharType(caret-1) == "p") { + var charBefore = rep.alltext.charAt(caret-1); + if (bracketMap[charBefore]) { + var lookForwards = (bracketMap[charBefore] > 0); + var findResult = findMatchingVisibleBracket(caret-1, lookForwards); + if (findResult) { + var mateLoc = findResult.chr; + var mateGood = findResult.good; + r.active = true; + charsToHighlight = {}; + charsToHighlight[caret-1] = 'flash'; + charsToHighlight[mateLoc] = (mateGood ? 'flash' : 'flashbad'); + r.whichLineKeys = []; + r.whichLineKeys.push(getLineKeyForOffset(caret-1)); + r.whichLineKeys.push(getLineKeyForOffset(mateLoc)); + r.expireTime = now() + 4000; + newlyActive = true; + } + } + } + + } + if (linesToUnhighlight) { + recolorLineByKey(linesToUnhighlight[0]); + recolorLineByKey(linesToUnhighlight[1]); + } + if (r.active && charsToHighlight) { + function f(txt, cls, next, ofst) { + var flashClass = charsToHighlight[ofst]; + if (cls) { + next(txt, cls+" "+flashClass); + } + else next(txt, cls); + } + for(var c in charsToHighlight) { + recolorLinesInRange((+c), (+c)+1, null, f); + } + } + } + + return module; + })(); + + function dispose() { + disposed = true; + if (idleWorkTimer) idleWorkTimer.never(); + teardown(); + } + + function checkALines() { + return; // disable for speed + function error() { throw new Error("checkALines"); } + if (rep.alines.length != rep.lines.length()) { + error(); + } + for(var i=0;i<rep.alines.length;i++) { + var aline = rep.alines[i]; + var lineText = rep.lines.atIndex(i).text+"\n"; + var lineTextLength = lineText.length; + var opIter = Changeset.opIterator(aline); + var alineLength = 0; + while (opIter.hasNext()) { + var o = opIter.next(); + alineLength += o.chars; + if (opIter.hasNext()) { + if (o.lines != 0) error(); + } + else { + if (o.lines != 1) error(); + } + } + if (alineLength != lineTextLength) { + error(); + } + } + } + + function setWraps(newVal) { + doesWrap = newVal; + var dwClass = "doesWrap"; + setClassPresence(root, "doesWrap", doesWrap); + scheduler.setTimeout(function() { + inCallStackIfNecessary("setWraps", function() { + fastIncorp(7); + recreateDOM(); + fixView(); + }); + }, 0); + } + + function setStyled(newVal) { + var oldVal = isStyled; + isStyled = !!newVal; + + if (newVal != oldVal) { + if (! newVal) { + // clear styles + inCallStackIfNecessary("setStyled", function() { + fastIncorp(12); + var clearStyles = []; + for(var k in STYLE_ATTRIBS) { + clearStyles.push([k,'']); + } + performDocumentApplyAttributesToCharRange(0, rep.alltext.length, clearStyles); + }); + } + } + } + + function setTextFace(face) { + textFace = face; + root.style.fontFamily = textFace; + lineMetricsDiv.style.fontFamily = textFace; + scheduler.setTimeout(function() { + setUpTrackingCSS(); + }, 0); + } + + function setTextSize(size) { + textSize = size; + root.style.fontSize = textSize+"px"; + root.style.lineHeight = textLineHeight()+"px"; + sideDiv.style.lineHeight = textLineHeight()+"px"; + lineMetricsDiv.style.fontSize = textSize+"px"; + scheduler.setTimeout(function() { + setUpTrackingCSS(); + }, 0); + } + + function recreateDOM() { + // precond: normalized + recolorLinesInRange(0, rep.alltext.length); + } + + function setEditable(newVal) { + isEditable = newVal; + + // the following may fail, e.g. if iframe is hidden + if (! isEditable) { + setDesignMode(false); + } + else { + setDesignMode(true); + } + setClassPresence(root, "static", ! isEditable); + } + + function enforceEditability() { + setEditable(isEditable); + } + + function importText(text, undoable, dontProcess) { + var lines; + if (dontProcess) { + if (text.charAt(text.length-1) != "\n") { + throw new Error("new raw text must end with newline"); + } + if (/[\r\t\xa0]/.exec(text)) { + throw new Error("new raw text must not contain CR, tab, or nbsp"); + } + lines = text.substring(0, text.length-1).split('\n'); + } + else { + lines = map(text.split('\n'), textify); + } + var newText = "\n"; + if (lines.length > 0) { + newText = lines.join('\n')+'\n'; + } + + inCallStackIfNecessary("importText"+(undoable?"Undoable":""), function() { + setDocText(newText); + }); + + if (dontProcess && rep.alltext != text) { + throw new Error("mismatch error setting raw text in importText"); + } + } + + function importAText(atext, apoolJsonObj, undoable) { + atext = Changeset.cloneAText(atext); + if (apoolJsonObj) { + var wireApool = (new AttribPool()).fromJsonable(apoolJsonObj); + atext.attribs = Changeset.moveOpsToNewPool(atext.attribs, wireApool, rep.apool); + } + inCallStackIfNecessary("importText"+(undoable?"Undoable":""), function() { + setDocAText(atext); + }); + } + + function setDocAText(atext) { + fastIncorp(8); + + var oldLen = rep.lines.totalWidth(); + var numLines = rep.lines.length(); + var upToLastLine = rep.lines.offsetOfIndex(numLines-1); + var lastLineLength = rep.lines.atIndex(numLines-1).text.length; + var assem = Changeset.smartOpAssembler(); + var o = Changeset.newOp('-'); + o.chars = upToLastLine; + o.lines = numLines-1; + assem.append(o); + o.chars = lastLineLength; + o.lines = 0; + assem.append(o); + Changeset.appendATextToAssembler(atext, assem); + var newLen = oldLen + assem.getLengthChange(); + var changeset = Changeset.checkRep( + Changeset.pack(oldLen, newLen, assem.toString(), + atext.text.slice(0, -1))); + performDocumentApplyChangeset(changeset); + + performSelectionChange([0,rep.lines.atIndex(0).lineMarker], + [0,rep.lines.atIndex(0).lineMarker]); + + idleWorkTimer.atMost(100); + + if (rep.alltext != atext.text) { + dmesg(htmlPrettyEscape(rep.alltext)); + dmesg(htmlPrettyEscape(atext.text)); + throw new Error("mismatch error setting raw text in setDocAText"); + } + } + + function setDocText(text) { + setDocAText(Changeset.makeAText(text)); + } + + function getDocText() { + var alltext = rep.alltext; + var len = alltext.length; + if (len > 0) len--; // final extra newline + return alltext.substring(0, len); + } + + function exportText() { + if (currentCallStack && ! currentCallStack.domClean) { + inCallStackIfNecessary("exportText", function() { fastIncorp(2); }); + } + return getDocText(); + } + + function editorChangedSize() { + fixView(); + } + + function setOnKeyPress(handler) { + outsideKeyPress = handler; + } + + function setOnKeyDown(handler) { + outsideKeyDown = handler; + } + + function setNotifyDirty(handler) { + outsideNotifyDirty = handler; + } + + function getFormattedCode() { + if (currentCallStack && ! currentCallStack.domClean) { + inCallStackIfNecessary("getFormattedCode", incorporateUserChanges); + } + var buf = []; + if (rep.lines.length() > 0) { + // should be the case, even for empty file + var entry = rep.lines.atIndex(0); + while (entry) { + var domInfo = entry.domInfo; + buf.push((domInfo && domInfo.getInnerHTML()) || + domline.processSpaces(domline.escapeHTML(entry.text), + doesWrap) || + ' ' /*empty line*/); + entry = rep.lines.next(entry); + } + } + return '<div class="syntax"><div>'+buf.join('</div>\n<div>')+ + '</div></div>'; + } + + var CMDS = { + bold: function() { toggleAttributeOnSelection('bold'); }, + italic: function() { toggleAttributeOnSelection('italic'); }, + underline: function() { toggleAttributeOnSelection('underline'); }, + strikethrough: function() { toggleAttributeOnSelection('strikethrough'); }, + h1: function() { toggleAttributeOnSelection('h1'); }, + h2: function() { toggleAttributeOnSelection('h2'); }, + h3: function() { toggleAttributeOnSelection('h3'); }, + h4: function() { toggleAttributeOnSelection('h4'); }, + h5: function() { toggleAttributeOnSelection('h5'); }, + h6: function() { toggleAttributeOnSelection('h6'); }, + undo: function() { doUndoRedo('undo'); }, + redo: function() { doUndoRedo('redo'); }, + clearauthorship: function(prompt) { + if ((!(rep.selStart && rep.selEnd)) || isCaret()) { + if (prompt) { + prompt(); + } + else { + performDocumentApplyAttributesToCharRange(0, rep.alltext.length, + [['author', '']]); + } + } + else { + setAttributeOnSelection('author', ''); + } + }, + insertunorderedlist: doInsertUnorderedList, + indent: function() { + if (! doIndentOutdent(false)) { + doInsertUnorderedList(); + } + }, + outdent: function() { doIndentOutdent(true); } + }; + + function execCommand(cmd) { + cmd = cmd.toLowerCase(); + var cmdArgs = Array.prototype.slice.call(arguments, 1); + if (CMDS[cmd]) { + inCallStack(cmd, function() { + fastIncorp(9); + CMDS[cmd].apply(CMDS, cmdArgs); + }); + } + } + + editorInfo.ace_focus = focus; + editorInfo.ace_importText = importText; + editorInfo.ace_importAText = importAText; + editorInfo.ace_exportText = exportText; + editorInfo.ace_editorChangedSize = editorChangedSize; + editorInfo.ace_setOnKeyPress = setOnKeyPress; + editorInfo.ace_setOnKeyDown = setOnKeyDown; + editorInfo.ace_setNotifyDirty = setNotifyDirty; + editorInfo.ace_dispose = dispose; + editorInfo.ace_getFormattedCode = getFormattedCode; + editorInfo.ace_setEditable = setEditable; + editorInfo.ace_execCommand = execCommand; + + editorInfo.ace_setProperty = function(key, value) { + var k = key.toLowerCase(); + if (k == "wraps") { + setWraps(value); + } + else if (k == "showsauthorcolors") { + setClassPresence(root, "authorColors", !!value); + } + else if (k == "showsuserselections") { + setClassPresence(root, "userSelections", !!value); + } + else if (k == "showslinenumbers") { + hasLineNumbers = !!value; + setClassPresence(sideDiv, "sidedivhidden", ! hasLineNumbers); + fixView(); + } + else if (k == "grayedout") { + setClassPresence(outerWin.document.body, "grayedout", !!value); + } + else if (k == "dmesg") { + dmesg = value; + window.dmesg = value; + } + else if (k == 'userauthor') { + thisAuthor = String(value); + } + else if (k == 'styled') { + setStyled(value); + } + else if (k == 'textface') { + setTextFace(value); + } + else if (k == 'textsize') { + setTextSize(value); + } + } + + editorInfo.ace_setBaseText = function(txt) { + changesetTracker.setBaseText(txt); + }; + editorInfo.ace_setBaseAttributedText = function(atxt, apoolJsonObj) { + setUpTrackingCSS(); + changesetTracker.setBaseAttributedText(atxt, apoolJsonObj); + }; + editorInfo.ace_applyChangesToBase = function(c, optAuthor, apoolJsonObj) { + changesetTracker.applyChangesToBase(c, optAuthor, apoolJsonObj); + }; + editorInfo.ace_prepareUserChangeset = function() { + return changesetTracker.prepareUserChangeset(); + }; + editorInfo.ace_applyPreparedChangesetToBase = function() { + changesetTracker.applyPreparedChangesetToBase(); + }; + editorInfo.ace_setUserChangeNotificationCallback = function(f) { + changesetTracker.setUserChangeNotificationCallback(f); + }; + editorInfo.ace_setAuthorInfo = function(author, info) { + setAuthorInfo(author, info); + }; + editorInfo.ace_setAuthorSelectionRange = function(author, start, end) { + changesetTracker.setAuthorSelectionRange(author, start, end); + }; + + editorInfo.ace_getUnhandledErrors = function() { + return caughtErrors.slice(); + }; + + editorInfo.ace_getDebugProperty = function(prop) { + if (prop == "debugger") { + // obfuscate "eval" so as not to scare yuicompressor + window['ev'+'al']("debugger"); + } + else if (prop == "rep") { + return rep; + } + else if (prop == "window") { + return window; + } + else if (prop == "document") { + return document; + } + return undefined; + }; + + function now() { return (new Date()).getTime(); } + + function newTimeLimit(ms) { + //console.debug("new time limit"); + var startTime = now(); + var lastElapsed = 0; + var exceededAlready = false; + var printedTrace = false; + var isTimeUp = function () { + if (exceededAlready) { + if ((! printedTrace)) {// && now() - startTime - ms > 300) { + //console.trace(); + printedTrace = true; + } + return true; + } + var elapsed = now() - startTime; + if (elapsed > ms) { + exceededAlready = true; + //console.debug("time limit hit, before was %d/%d", lastElapsed, ms); + //console.trace(); + return true; + } + else { + lastElapsed = elapsed; + return false; + } + } + isTimeUp.elapsed = function() { return now() - startTime; } + return isTimeUp; + } + + + function makeIdleAction(func) { + var scheduledTimeout = null; + var scheduledTime = 0; + function unschedule() { + if (scheduledTimeout) { + scheduler.clearTimeout(scheduledTimeout); + scheduledTimeout = null; + } + } + function reschedule(time) { + unschedule(); + scheduledTime = time; + var delay = time - now(); + if (delay < 0) delay = 0; + scheduledTimeout = scheduler.setTimeout(callback, delay); + } + function callback() { + scheduledTimeout = null; + // func may reschedule the action + func(); + } + return { + atMost: function (ms) { + var latestTime = now() + ms; + if ((! scheduledTimeout) || scheduledTime > latestTime) { + reschedule(latestTime); + } + }, + // atLeast(ms) will schedule the action if not scheduled yet. + // In other words, "infinity" is replaced by ms, even though + // it is technically larger. + atLeast: function (ms) { + var earliestTime = now()+ms; + if ((! scheduledTimeout) || scheduledTime < earliestTime) { + reschedule(earliestTime); + } + }, + never: function() { + unschedule(); + } + } + } + + function fastIncorp(n) { + // normalize but don't do any lexing or anything + incorporateUserChanges(newTimeLimit(0)); + } + + function incorpIfQuick() { + var me = incorpIfQuick; + var failures = (me.failures || 0); + if (failures < 5) { + var isTimeUp = newTimeLimit(40); + var madeChanges = incorporateUserChanges(isTimeUp); + if (isTimeUp()) { + me.failures = failures+1; + } + return true; + } + else { + var skipCount = (me.skipCount || 0); + skipCount++; + if (skipCount == 20) { + skipCount = 0; + me.failures = 0; + } + me.skipCount = skipCount; + } + return false; + } + + var idleWorkTimer = makeIdleAction(function() { + + //if (! top.BEFORE) top.BEFORE = []; + //top.BEFORE.push(magicdom.root.dom.innerHTML); + + if (! isEditable) return; // and don't reschedule + + if (inInternationalComposition) { + // don't do idle input incorporation during international input composition + idleWorkTimer.atLeast(500); + return; + } + + inCallStack("idleWorkTimer", function() { + + var isTimeUp = newTimeLimit(250); + + //console.time("idlework"); + + var finishedImportantWork = false; + var finishedWork = false; + + try { + + // isTimeUp() is a soft constraint for incorporateUserChanges, + // which always renormalizes the DOM, no matter how long it takes, + // but doesn't necessarily lex and highlight it + incorporateUserChanges(isTimeUp); + + if (isTimeUp()) return; + + updateLineNumbers(); // update line numbers if any time left + + if (isTimeUp()) return; + + var visibleRange = getVisibleCharRange(); + var docRange = [0, rep.lines.totalWidth()]; + //console.log("%o %o", docRange, visibleRange); + + finishedImportantWork = true; + finishedWork = true; + } + finally { + //console.timeEnd("idlework"); + if (finishedWork) { + idleWorkTimer.atMost(1000); + } + else if (finishedImportantWork) { + // if we've finished highlighting the view area, + // more highlighting could be counter-productive, + // e.g. if the user just opened a triple-quote and will soon close it. + idleWorkTimer.atMost(500); + } + else { + var timeToWait = Math.round(isTimeUp.elapsed() / 2); + if (timeToWait < 100) timeToWait = 100; + idleWorkTimer.atMost(timeToWait); + } + } + }); + + //if (! top.AFTER) top.AFTER = []; + //top.AFTER.push(magicdom.root.dom.innerHTML); + + }); + + var _nextId = 1; + function uniqueId(n) { + // not actually guaranteed to be unique, e.g. if user copy-pastes + // nodes with ids + var nid = n.id; + if (nid) return nid; + return (n.id = "magicdomid"+(_nextId++)); + } + + + function recolorLinesInRange(startChar, endChar, isTimeUp, optModFunc) { + if (endChar <= startChar) return; + if (startChar < 0 || startChar >= rep.lines.totalWidth()) return; + var lineEntry = rep.lines.atOffset(startChar); // rounds down to line boundary + var lineStart = rep.lines.offsetOfEntry(lineEntry); + var lineIndex = rep.lines.indexOfEntry(lineEntry); + var selectionNeedsResetting = false; + var firstLine = null; + var lastLine = null; + isTimeUp = (isTimeUp || noop); + + // tokenFunc function; accesses current value of lineEntry and curDocChar, + // also mutates curDocChar + var curDocChar; + var tokenFunc = function(tokenText, tokenClass) { + lineEntry.domInfo.appendSpan(tokenText, tokenClass); + }; + if (optModFunc) { + var f = tokenFunc; + tokenFunc = function(tokenText, tokenClass) { + optModFunc(tokenText, tokenClass, f, curDocChar); + curDocChar += tokenText.length; + }; + } + + while (lineEntry && lineStart < endChar && ! isTimeUp()) { + //var timer = newTimeLimit(200); + var lineEnd = lineStart + lineEntry.width; + + curDocChar = lineStart; + lineEntry.domInfo.clearSpans(); + getSpansForLine(lineEntry, tokenFunc, lineStart); + lineEntry.domInfo.finishUpdate(); + + markNodeClean(lineEntry.lineNode); + + if (rep.selStart && rep.selStart[0] == lineIndex || + rep.selEnd && rep.selEnd[0] == lineIndex) { + selectionNeedsResetting = true; + } + + //if (timer()) console.dirxml(lineEntry.lineNode.dom); + + if (firstLine === null) firstLine = lineIndex; + lastLine = lineIndex; + lineStart = lineEnd; + lineEntry = rep.lines.next(lineEntry); + lineIndex++; + } + if (selectionNeedsResetting) { + currentCallStack.selectionAffected = true; + } + //console.debug("Recolored line range %d-%d", firstLine, lastLine); + } + + // like getSpansForRange, but for a line, and the func takes (text,class) + // instead of (width,class); excludes the trailing '\n' from + // consideration by func + function getSpansForLine(lineEntry, textAndClassFunc, lineEntryOffsetHint) { + var lineEntryOffset = lineEntryOffsetHint; + if ((typeof lineEntryOffset) != "number") { + lineEntryOffset = rep.lines.offsetOfEntry(lineEntry); + } + var text = lineEntry.text; + var width = lineEntry.width; // text.length+1 + + if (text.length == 0) { + // allow getLineStyleFilter to set line-div styles + var func = linestylefilter.getLineStyleFilter( + 0, '', textAndClassFunc, rep.apool); + func('', ''); + } + else { + var offsetIntoLine = 0; + var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, browser); + var lineNum = rep.lines.indexOfEntry(lineEntry); + var aline = rep.alines[lineNum]; + filteredFunc = linestylefilter.getLineStyleFilter( + text.length, aline, filteredFunc, rep.apool); + filteredFunc(text, ''); + } + } + + + function getCharType(charIndex) { + return ''; + } + + var observedChanges; + function clearObservedChanges() { + observedChanges = { cleanNodesNearChanges: {} }; + } + clearObservedChanges(); + + function getCleanNodeByKey(key) { + var p = PROFILER("getCleanNodeByKey", false); + p.extra = 0; + var n = doc.getElementById(key); + // copying and pasting can lead to duplicate ids + while (n && isNodeDirty(n)) { + p.extra++; + n.id = ""; + n = doc.getElementById(key); + } + p.literal(p.extra, "extra"); + p.end(); + return n; + } + + function observeChangesAroundNode(node) { + // Around this top-level DOM node, look for changes to the document + // (from how it looks in our representation) and record them in a way + // that can be used to "normalize" the document (apply the changes to our + // representation, and put the DOM in a canonical form). + + //top.console.log("observeChangesAroundNode(%o)", node); + + var cleanNode; + var hasAdjacentDirtyness; + if (! isNodeDirty(node)) { + cleanNode = node; + var prevSib = cleanNode.previousSibling; + var nextSib = cleanNode.nextSibling; + hasAdjacentDirtyness = ((prevSib && isNodeDirty(prevSib)) + || (nextSib && isNodeDirty(nextSib))); + } + else { + // node is dirty, look for clean node above + var upNode = node.previousSibling; + while (upNode && isNodeDirty(upNode)) { + upNode = upNode.previousSibling; + } + if (upNode) { + cleanNode = upNode; + } + else { + var downNode = node.nextSibling; + while (downNode && isNodeDirty(downNode)) { + downNode = downNode.nextSibling; + } + if (downNode) { + cleanNode = downNode; + } + } + if (! cleanNode) { + // Couldn't find any adjacent clean nodes! + // Since top and bottom of doc is dirty, the dirty area will be detected. + return; + } + hasAdjacentDirtyness = true; + } + + if (hasAdjacentDirtyness) { + // previous or next line is dirty + observedChanges.cleanNodesNearChanges['$'+uniqueId(cleanNode)] = true; + } + else { + // next and prev lines are clean (if they exist) + var lineKey = uniqueId(cleanNode); + var prevSib = cleanNode.previousSibling; + var nextSib = cleanNode.nextSibling; + var actualPrevKey = ((prevSib && uniqueId(prevSib)) || null); + var actualNextKey = ((nextSib && uniqueId(nextSib)) || null); + var repPrevEntry = rep.lines.prev(rep.lines.atKey(lineKey)); + var repNextEntry = rep.lines.next(rep.lines.atKey(lineKey)); + var repPrevKey = ((repPrevEntry && repPrevEntry.key) || null); + var repNextKey = ((repNextEntry && repNextEntry.key) || null); + if (actualPrevKey != repPrevKey || actualNextKey != repNextKey) { + observedChanges.cleanNodesNearChanges['$'+uniqueId(cleanNode)] = true; + } + } + } + + function observeChangesAroundSelection() { + if (currentCallStack.observedSelection) return; + currentCallStack.observedSelection = true; + + var p = PROFILER("getSelection", false); + var selection = getSelection(); + p.end(); + if (selection) { + function topLevel(n) { + if ((!n) || n == root) return null; + while (n.parentNode != root) { + n = n.parentNode; + } + return n; + } + var node1 = topLevel(selection.startPoint.node); + var node2 = topLevel(selection.endPoint.node); + if (node1) observeChangesAroundNode(node1); + if (node2 && node1 != node2) { + observeChangesAroundNode(node2); + } + } + } + + function observeSuspiciousNodes() { + // inspired by Firefox bug #473255, where pasting formatted text + // causes the cursor to jump away, making the new HTML never found. + if (root.getElementsByTagName) { + var nds = root.getElementsByTagName("style"); + for(var i=0;i<nds.length;i++) { + var n = nds[i]; + while (n.parentNode && n.parentNode != root) { + n = n.parentNode; + } + if (n.parentNode == root) { + observeChangesAroundNode(n); + } + } + } + } + + function incorporateUserChanges(isTimeUp) { + + if (currentCallStack.domClean) return false; + + inInternationalComposition = false; // if we need the document normalized, so be it + + currentCallStack.isUserChange = true; + + isTimeUp = (isTimeUp || function() { return false; }); + + if (DEBUG && top.DONT_INCORP || window.DEBUG_DONT_INCORP) return false; + + var p = PROFILER("incorp", false); + + //if (doc.body.innerHTML.indexOf("AppJet") >= 0) + //dmesg(htmlPrettyEscape(doc.body.innerHTML)); + //if (top.RECORD) top.RECORD.push(doc.body.innerHTML); + + // returns true if dom changes were made + + if (! root.firstChild) { + root.innerHTML = "<div><!-- --></div>"; + } + + p.mark("obs"); + observeChangesAroundSelection(); + observeSuspiciousNodes(); + p.mark("dirty"); + var dirtyRanges = getDirtyRanges(); + //console.log("dirtyRanges: "+toSource(dirtyRanges)); + + var dirtyRangesCheckOut = true; + var j = 0; + var a,b; + while (j < dirtyRanges.length) { + a = dirtyRanges[j][0]; + b = dirtyRanges[j][1]; + if (! ((a == 0 || getCleanNodeByKey(rep.lines.atIndex(a-1).key)) && + (b == rep.lines.length() || getCleanNodeByKey(rep.lines.atIndex(b).key)))) { + dirtyRangesCheckOut = false; + break; + } + j++; + } + if (! dirtyRangesCheckOut) { + var numBodyNodes = root.childNodes.length; + for(var k=0;k<numBodyNodes;k++) { + var bodyNode = root.childNodes.item(k); + if ((bodyNode.tagName) && ((! bodyNode.id) || (! rep.lines.containsKey(bodyNode.id)))) { + observeChangesAroundNode(bodyNode); + } + } + dirtyRanges = getDirtyRanges(); + } + + clearObservedChanges(); + + p.mark("getsel"); + var selection = getSelection(); + + //console.log(magicdom.root.dom.innerHTML); + //console.log("got selection: %o", selection); + var selStart, selEnd; // each one, if truthy, has [line,char] needed to set selection + + var i = 0; + var splicesToDo = []; + var netNumLinesChangeSoFar = 0; + var toDeleteAtEnd = []; + p.mark("ranges"); + p.literal(dirtyRanges.length, "numdirt"); + var domInsertsNeeded = []; // each entry is [nodeToInsertAfter, [info1, info2, ...]] + while (i < dirtyRanges.length) { + var range = dirtyRanges[i]; + a = range[0]; + b = range[1]; + var firstDirtyNode = (((a == 0) && root.firstChild) || + getCleanNodeByKey(rep.lines.atIndex(a-1).key).nextSibling); + firstDirtyNode = (firstDirtyNode && isNodeDirty(firstDirtyNode) && firstDirtyNode); + var lastDirtyNode = (((b == rep.lines.length()) && root.lastChild) || + getCleanNodeByKey(rep.lines.atIndex(b).key).previousSibling); + lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode); + if (firstDirtyNode && lastDirtyNode) { + var cc = makeContentCollector(isStyled, browser, rep.apool, null, + className2Author); + cc.notifySelection(selection); + var dirtyNodes = []; + for(var n = firstDirtyNode; n && ! (n.previousSibling && + n.previousSibling == lastDirtyNode); + n = n.nextSibling) { + if (browser.msie) { + // try to undo IE's pesky and overzealous linkification + try { n.createTextRange().execCommand("unlink", false, null); } + catch (e) {} + } + cc.collectContent(n); + dirtyNodes.push(n); + } + cc.notifyNextNode(lastDirtyNode.nextSibling); + var lines = cc.getLines(); + if ((lines.length <= 1 || lines[lines.length-1] !== "") + && lastDirtyNode.nextSibling) { + // dirty region doesn't currently end a line, even taking the following node + // (or lack of node) into account, so include the following clean node. + // It could be SPAN or a DIV; basically this is any case where the contentCollector + // decides it isn't done. + // Note that this clean node might need to be there for the next dirty range. + //console.log("inclusive of "+lastDirtyNode.next().dom.tagName); + b++; + var cleanLine = lastDirtyNode.nextSibling; + cc.collectContent(cleanLine); + toDeleteAtEnd.push(cleanLine); + cc.notifyNextNode(cleanLine.nextSibling); + } + + var ccData = cc.finish(); + var ss = ccData.selStart; + var se = ccData.selEnd; + lines = ccData.lines; + var lineAttribs = ccData.lineAttribs; + var linesWrapped = ccData.linesWrapped; + + if (linesWrapped > 0) { + doAlert("Editor warning: "+linesWrapped+" long line"+ + (linesWrapped == 1 ? " was" : "s were")+" hard-wrapped into "+ + ccData.numLinesAfter + +" lines."); + } + + if (ss[0] >= 0) selStart = [ss[0]+a+netNumLinesChangeSoFar, ss[1]]; + if (se[0] >= 0) selEnd = [se[0]+a+netNumLinesChangeSoFar, se[1]]; + + /*var oldLines = rep.alltext.substring(rep.lines.offsetOfIndex(a), + rep.lines.offsetOfIndex(b)); + var newLines = lines.join('\n')+'\n'; + dmesg("OLD: "+htmlPrettyEscape(oldLines)); + dmesg("NEW: "+htmlPrettyEscape(newLines));*/ + + var entries = []; + var nodeToAddAfter = lastDirtyNode; + var lineNodeInfos = new Array(lines.length); + for(var k=0;k<lines.length;k++) { + var lineString = lines[k]; + var newEntry = createDomLineEntry(lineString); + entries.push(newEntry); + lineNodeInfos[k] = newEntry.domInfo; + } + //var fragment = magicdom.wrapDom(document.createDocumentFragment()); + domInsertsNeeded.push([nodeToAddAfter, lineNodeInfos]); + forEach(dirtyNodes, function (n) { toDeleteAtEnd.push(n); }); + var spliceHints = {}; + if (selStart) spliceHints.selStart = selStart; + if (selEnd) spliceHints.selEnd = selEnd; + splicesToDo.push([a+netNumLinesChangeSoFar, b-a, entries, lineAttribs, spliceHints]); + netNumLinesChangeSoFar += (lines.length - (b-a)); + } + else if (b > a) { + splicesToDo.push([a+netNumLinesChangeSoFar, b-a, [], []]); + } + i++; + } + + var domChanges = (splicesToDo.length > 0); + + // update the representation + p.mark("splice"); + forEach(splicesToDo, function (splice) { + doIncorpLineSplice(splice[0], splice[1], splice[2], splice[3], splice[4]); + }); + + //p.mark("relex"); + //rep.lexer.lexCharRange(getVisibleCharRange(), function() { return false; }); + //var isTimeUp = newTimeLimit(100); + + // do DOM inserts + p.mark("insert"); + forEach(domInsertsNeeded, function (ins) { + insertDomLines(ins[0], ins[1], isTimeUp); + }); + + p.mark("del"); + // delete old dom nodes + forEach(toDeleteAtEnd, function (n) { + //var id = n.uniqueId(); + + // parent of n may not be "root" in IE due to non-tree-shaped DOM (wtf) + n.parentNode.removeChild(n); + + //dmesg(htmlPrettyEscape(htmlForRemovedChild(n))); + //console.log("removed: "+id); + }); + + p.mark("findsel"); + // if the nodes that define the selection weren't encountered during + // content collection, figure out where those nodes are now. + if (selection && !selStart) { + //if (domChanges) dmesg("selection not collected"); + selStart = getLineAndCharForPoint(selection.startPoint); + } + if (selection && !selEnd) { + selEnd = getLineAndCharForPoint(selection.endPoint); + } + + // selection from content collection can, in various ways, extend past final + // BR in firefox DOM, so cap the line + var numLines = rep.lines.length(); + if (selStart && selStart[0] >= numLines) { + selStart[0] = numLines-1; + selStart[1] = rep.lines.atIndex(selStart[0]).text.length; + } + if (selEnd && selEnd[0] >= numLines) { + selEnd[0] = numLines-1; + selEnd[1] = rep.lines.atIndex(selEnd[0]).text.length; + } + + p.mark("repsel"); + // update rep + repSelectionChange(selStart, selEnd, selection && selection.focusAtStart); + // update browser selection + p.mark("browsel"); + if (selection && (domChanges || isCaret())) { + // if no DOM changes (not this case), want to treat range selection delicately, + // e.g. in IE not lose which end of the selection is the focus/anchor; + // on the other hand, we may have just noticed a press of PageUp/PageDown + currentCallStack.selectionAffected = true; + } + + currentCallStack.domClean = true; + + p.mark("fixview"); + + fixView(); + + p.end("END"); + + return domChanges; + } + + function htmlForRemovedChild(n) { + var div = doc.createElement("DIV"); + div.appendChild(n); + return div.innerHTML; + } + + var STYLE_ATTRIBS = {bold: true, italic: true, underline: true, + strikethrough: true, h1: true, h2: true, + h3: true, h4: true, h5: true, h6: true, + list: true}; + var OTHER_INCORPED_ATTRIBS = {insertorder: true, author: true}; + + function isStyleAttribute(aname) { + return !! STYLE_ATTRIBS[aname]; + } + function isIncorpedAttribute(aname) { + return (!! STYLE_ATTRIBS[aname]) || (!! OTHER_INCORPED_ATTRIBS[aname]); + } + + function insertDomLines(nodeToAddAfter, infoStructs, isTimeUp) { + isTimeUp = (isTimeUp || function() { return false; }); + + var lastEntry; + var lineStartOffset; + if (infoStructs.length < 1) return; + var startEntry = rep.lines.atKey(uniqueId(infoStructs[0].node)); + var endEntry = rep.lines.atKey(uniqueId(infoStructs[infoStructs.length-1].node)); + var charStart = rep.lines.offsetOfEntry(startEntry); + var charEnd = rep.lines.offsetOfEntry(endEntry) + endEntry.width; + + //rep.lexer.lexCharRange([charStart, charEnd], isTimeUp); + + forEach(infoStructs, function (info) { + var p2 = PROFILER("insertLine", false); + var node = info.node; + var key = uniqueId(node); + var entry; + p2.mark("findEntry"); + if (lastEntry) { + // optimization to avoid recalculation + var next = rep.lines.next(lastEntry); + if (next && next.key == key) { + entry = next; + lineStartOffset += lastEntry.width; + } + } + if (! entry) { + p2.literal(1, "nonopt"); + entry = rep.lines.atKey(key); + lineStartOffset = rep.lines.offsetOfKey(key); + } + else p2.literal(0, "nonopt"); + lastEntry = entry; + p2.mark("spans"); + getSpansForLine(entry, function (tokenText, tokenClass) { + info.appendSpan(tokenText, tokenClass); + }, lineStartOffset, isTimeUp()); + //else if (entry.text.length > 0) { + //info.appendSpan(entry.text, 'dirty'); + //} + p2.mark("addLine"); + info.prepareForAdd(); + entry.lineMarker = info.lineMarker; + if (! nodeToAddAfter) { + root.insertBefore(node, root.firstChild); + } + else { + root.insertBefore(node, nodeToAddAfter.nextSibling); + } + nodeToAddAfter = node; + info.notifyAdded(); + p2.mark("markClean"); + markNodeClean(node); + p2.end(); + }); + } + + function isCaret() { + return (rep.selStart && rep.selEnd && rep.selStart[0] == rep.selEnd[0] && + rep.selStart[1] == rep.selEnd[1]); + } + + // prereq: isCaret() + function caretLine() { return rep.selStart[0]; } + function caretColumn() { return rep.selStart[1]; } + function caretDocChar() { + return rep.lines.offsetOfIndex(caretLine()) + caretColumn(); + } + + function handleReturnIndentation() { + // on return, indent to level of previous line + if (isCaret() && caretColumn() == 0 && caretLine() > 0) { + var lineNum = caretLine(); + var thisLine = rep.lines.atIndex(lineNum); + var prevLine = rep.lines.prev(thisLine); + var prevLineText = prevLine.text; + var theIndent = /^ *(?:)/.exec(prevLineText)[0]; + if (/[\[\(\{]\s*$/.exec(prevLineText)) theIndent += THE_TAB; + var cs = Changeset.builder(rep.lines.totalWidth()).keep( + rep.lines.offsetOfIndex(lineNum), lineNum).insert( + theIndent, [['author',thisAuthor]], rep.apool).toString(); + performDocumentApplyChangeset(cs); + performSelectionChange([lineNum, theIndent.length], [lineNum, theIndent.length]); + } + } + + + function setupMozillaCaretHack(lineNum) { + // This is really ugly, but by god, it works! + // Fixes annoying Firefox caret artifact (observed in 2.0.0.12 + // and unfixed in Firefox 2 as of now) where mutating the DOM + // and then moving the caret to the beginning of a line causes + // an image of the caret to be XORed at the top of the iframe. + // The previous solution involved remembering to set the selection + // later, in response to the next event in the queue, which was hugely + // annoying. + // This solution: add a space character (0x20) to the beginning of the line. + // After setting the selection, remove the space. + var lineNode = rep.lines.atIndex(lineNum).lineNode; + + var fc = lineNode.firstChild; + while (isBlockElement(fc) && fc.firstChild) { + fc = fc.firstChild; + } + var textNode; + if (isNodeText(fc)) { + fc.nodeValue = " "+fc.nodeValue; + textNode = fc; + } + else { + textNode = doc.createTextNode(" "); + fc.parentNode.insertBefore(textNode, fc); + } + markNodeClean(lineNode); + return { unhack: function() { + if (textNode.nodeValue == " ") { + textNode.parentNode.removeChild(textNode); + } + else { + textNode.nodeValue = textNode.nodeValue.substring(1); + } + markNodeClean(lineNode); + } }; + } + + + function getPointForLineAndChar(lineAndChar) { + var line = lineAndChar[0]; + var charsLeft = lineAndChar[1]; + //console.log("line: %d, key: %s, node: %o", line, rep.lines.atIndex(line).key, + //getCleanNodeByKey(rep.lines.atIndex(line).key)); + var lineEntry = rep.lines.atIndex(line); + charsLeft -= lineEntry.lineMarker; + if (charsLeft < 0) { + charsLeft = 0; + } + var lineNode = lineEntry.lineNode; + var n = lineNode; + var after = false; + if (charsLeft == 0) { + var index = 0; + if (browser.msie && line == (rep.lines.length()-1) && lineNode.childNodes.length == 0) { + // best to stay at end of last empty div in IE + index = 1; + } + return {node: lineNode, index:index, maxIndex:1}; + } + while (!(n == lineNode && after)) { + if (after) { + if (n.nextSibling) { + n = n.nextSibling; + after = false; + } + else n = n.parentNode; + } + else { + if (isNodeText(n)) { + var len = n.nodeValue.length; + if (charsLeft <= len) { + return {node: n, index:charsLeft, maxIndex:len}; + } + charsLeft -= len; + after = true; + } + else { + if (n.firstChild) n = n.firstChild; + else after = true; + } + } + } + return {node: lineNode, index:1, maxIndex:1}; + } + + function nodeText(n) { + return n.innerText || n.textContent || n.nodeValue || ''; + } + + function getLineAndCharForPoint(point) { + // Turn DOM node selection into [line,char] selection. + // This method has to work when the DOM is not pristine, + // assuming the point is not in a dirty node. + if (point.node == root) { + if (point.index == 0) { + return [0, 0]; + } + else { + var N = rep.lines.length(); + var ln = rep.lines.atIndex(N-1); + return [N-1, ln.text.length]; + } + } + else { + var n = point.node; + var col = 0; + // if this part fails, it probably means the selection node + // was dirty, and we didn't see it when collecting dirty nodes. + if (isNodeText(n)) { + col = point.index; + } + else if (point.index > 0) { + col = nodeText(n).length; + } + var parNode, prevSib; + while ((parNode = n.parentNode) != root) { + if ((prevSib = n.previousSibling)) { + n = prevSib; + col += nodeText(n).length; + } + else { + n = parNode; + } + } + if (n.id == "") console.debug("BAD"); + if (n.firstChild && isBlockElement(n.firstChild)) { + col += 1; // lineMarker + } + var lineEntry = rep.lines.atKey(n.id); + var lineNum = rep.lines.indexOfEntry(lineEntry); + return [lineNum, col]; + } + } + + function createDomLineEntry(lineString) { + var info = doCreateDomLine(lineString.length > 0); + var newNode = info.node; + return {key: uniqueId(newNode), text: lineString, lineNode: newNode, + domInfo: info, lineMarker: 0}; + } + + function canApplyChangesetToDocument(changes) { + return Changeset.oldLen(changes) == rep.alltext.length; + } + + function performDocumentApplyChangeset(changes, insertsAfterSelection) { + doRepApplyChangeset(changes, insertsAfterSelection); + + var requiredSelectionSetting = null; + if (rep.selStart && rep.selEnd) { + var selStartChar = rep.lines.offsetOfIndex(rep.selStart[0]) + rep.selStart[1]; + var selEndChar = rep.lines.offsetOfIndex(rep.selEnd[0]) + rep.selEnd[1]; + var result = Changeset.characterRangeFollow(changes, selStartChar, selEndChar, + insertsAfterSelection); + requiredSelectionSetting = [result[0], result[1], rep.selFocusAtStart]; + } + + var linesMutatee = { + splice: function(start, numRemoved, newLinesVA) { + domAndRepSplice(start, numRemoved, + map(Array.prototype.slice.call(arguments, 2), + function(s) { return s.slice(0,-1); }), + null); + }, + get: function(i) { return rep.lines.atIndex(i).text+'\n'; }, + length: function() { return rep.lines.length(); }, + slice_notused: function(start, end) { + return map(rep.lines.slice(start, end), function(e) { return e.text+'\n'; }); + } + }; + + Changeset.mutateTextLines(changes, linesMutatee); + + checkALines(); + + if (requiredSelectionSetting) { + performSelectionChange(lineAndColumnFromChar(requiredSelectionSetting[0]), + lineAndColumnFromChar(requiredSelectionSetting[1]), + requiredSelectionSetting[2]); + } + + function domAndRepSplice(startLine, deleteCount, newLineStrings, isTimeUp) { + // dgreensp 3/2009: the spliced lines may be in the middle of a dirty region, + // so if no explicit time limit, don't spend a lot of time highlighting + isTimeUp = (isTimeUp || newTimeLimit(50)); + + var keysToDelete = []; + if (deleteCount > 0) { + var entryToDelete = rep.lines.atIndex(startLine); + for(var i=0;i<deleteCount;i++) { + keysToDelete.push(entryToDelete.key); + entryToDelete = rep.lines.next(entryToDelete); + } + } + + var lineEntries = map(newLineStrings, createDomLineEntry); + + doRepLineSplice(startLine, deleteCount, lineEntries); + + var nodeToAddAfter; + if (startLine > 0) { + nodeToAddAfter = getCleanNodeByKey(rep.lines.atIndex(startLine-1).key); + } + else nodeToAddAfter = null; + + insertDomLines(nodeToAddAfter, map(lineEntries, function (entry) { return entry.domInfo; }), + isTimeUp); + + forEach(keysToDelete, function (k) { + var n = doc.getElementById(k); + n.parentNode.removeChild(n); + }); + + if ((rep.selStart && rep.selStart[0] >= startLine && rep.selStart[0] <= startLine+deleteCount) || + (rep.selEnd && rep.selEnd[0] >= startLine && rep.selEnd[0] <= startLine+deleteCount)) { + currentCallStack.selectionAffected = true; + } + } + } + + function checkChangesetLineInformationAgainstRep(changes) { + return true; // disable for speed + var opIter = Changeset.opIterator(Changeset.unpack(changes).ops); + var curOffset = 0; + var curLine = 0; + var curCol = 0; + while (opIter.hasNext()) { + var o = opIter.next(); + if (o.opcode == '-' || o.opcode == '=') { + curOffset += o.chars; + if (o.lines) { + curLine += o.lines; + curCol = 0; + } + else { + curCol += o.chars; + } + } + var calcLine = rep.lines.indexOfOffset(curOffset); + var calcLineStart = rep.lines.offsetOfIndex(calcLine); + var calcCol = curOffset - calcLineStart; + if (calcCol != curCol || calcLine != curLine) { + return false; + } + } + return true; + } + + function doRepApplyChangeset(changes, insertsAfterSelection) { + Changeset.checkRep(changes); + + if (Changeset.oldLen(changes) != rep.alltext.length) + throw new Error("doRepApplyChangeset length mismatch: "+ + Changeset.oldLen(changes)+"/"+rep.alltext.length); + + if (! checkChangesetLineInformationAgainstRep(changes)) { + throw new Error("doRepApplyChangeset line break mismatch"); + } + + (function doRecordUndoInformation(changes) { + var editEvent = currentCallStack.editEvent; + if (editEvent.eventType == "nonundoable") { + if (! editEvent.changeset) { + editEvent.changeset = changes; + } + else { + editEvent.changeset = Changeset.compose(editEvent.changeset, changes, + rep.apool); + } + } + else { + var inverseChangeset = Changeset.inverse(changes, {get: function(i) { + return rep.lines.atIndex(i).text+'\n'; + }, length: function() { return rep.lines.length(); }}, + rep.alines, rep.apool); + + if (! editEvent.backset) { + editEvent.backset = inverseChangeset; + } + else { + editEvent.backset = Changeset.compose(inverseChangeset, + editEvent.backset, rep.apool); + } + } + })(changes); + + //rep.alltext = Changeset.applyToText(changes, rep.alltext); + Changeset.mutateAttributionLines(changes, rep.alines, rep.apool); + + if (changesetTracker.isTracking()) { + changesetTracker.composeUserChangeset(changes); + } + + } + + function lineAndColumnFromChar(x) { + var lineEntry = rep.lines.atOffset(x); + var lineStart = rep.lines.offsetOfEntry(lineEntry); + var lineNum = rep.lines.indexOfEntry(lineEntry); + return [lineNum, x - lineStart]; + } + + function performDocumentReplaceCharRange(startChar, endChar, newText) { + if (startChar == endChar && newText.length == 0) { + return; + } + // Requires that the replacement preserve the property that the + // internal document text ends in a newline. Given this, we + // rewrite the splice so that it doesn't touch the very last + // char of the document. + if (endChar == rep.alltext.length) { + if (startChar == endChar) { + // an insert at end + startChar--; + endChar--; + newText = '\n'+newText.substring(0, newText.length-1); + } + else if (newText.length == 0) { + // a delete at end + startChar--; + endChar--; + } + else { + // a replace at end + endChar--; + newText = newText.substring(0, newText.length-1); + } + } + performDocumentReplaceRange(lineAndColumnFromChar(startChar), + lineAndColumnFromChar(endChar), + newText); + } + + function performDocumentReplaceRange(start, end, newText) { + //dmesg(String([start.toSource(),end.toSource(),newText.toSource()])); + + // start[0]: <--- start[1] --->CCCCCCCCCCC\n + // CCCCCCCCCCCCCCCCCCCC\n + // CCCC\n + // end[0]: <CCC end[1] CCC>-------\n + + var builder = Changeset.builder(rep.lines.totalWidth()); + buildKeepToStartOfRange(builder, start); + buildRemoveRange(builder, start, end); + builder.insert(newText, [['author',thisAuthor]], rep.apool); + var cs = builder.toString(); + + performDocumentApplyChangeset(cs); + } + + function performDocumentApplyAttributesToCharRange(start, end, attribs) { + if (end >= rep.alltext.length) { + end = rep.alltext.length-1; + } + performDocumentApplyAttributesToRange(lineAndColumnFromChar(start), + lineAndColumnFromChar(end), attribs); + } + + function performDocumentApplyAttributesToRange(start, end, attribs) { + var builder = Changeset.builder(rep.lines.totalWidth()); + buildKeepToStartOfRange(builder, start); + buildKeepRange(builder, start, end, attribs, rep.apool); + var cs = builder.toString(); + performDocumentApplyChangeset(cs); + } + + function buildKeepToStartOfRange(builder, start) { + var startLineOffset = rep.lines.offsetOfIndex(start[0]); + + builder.keep(startLineOffset, start[0]); + builder.keep(start[1]); + } + function buildRemoveRange(builder, start, end) { + var startLineOffset = rep.lines.offsetOfIndex(start[0]); + var endLineOffset = rep.lines.offsetOfIndex(end[0]); + + if (end[0] > start[0]) { + builder.remove(endLineOffset - startLineOffset - start[1], end[0] - start[0]); + builder.remove(end[1]); + } + else { + builder.remove(end[1] - start[1]); + } + } + function buildKeepRange(builder, start, end, attribs, pool) { + var startLineOffset = rep.lines.offsetOfIndex(start[0]); + var endLineOffset = rep.lines.offsetOfIndex(end[0]); + + if (end[0] > start[0]) { + builder.keep(endLineOffset - startLineOffset - start[1], end[0] - start[0], attribs, pool); + builder.keep(end[1], 0, attribs, pool); + } + else { + builder.keep(end[1] - start[1], 0, attribs, pool); + } + } + + function setAttributeOnSelection(attributeName, attributeValue) { + if (!(rep.selStart && rep.selEnd)) return; + + performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, + [[attributeName, attributeValue]]); + } + + function toggleAttributeOnSelection(attributeName) { + if (!(rep.selStart && rep.selEnd)) return; + + var selectionAllHasIt = true; + var withIt = Changeset.makeAttribsString('+', [[attributeName, 'true']], rep.apool); + var withItRegex = new RegExp(withIt.replace(/\*/g,'\\*')+"(\\*|$)"); + function hasIt(attribs) { return withItRegex.test(attribs); } + + var selStartLine = rep.selStart[0]; + var selEndLine = rep.selEnd[0]; + for(var n=selStartLine; n<=selEndLine; n++) { + var opIter = Changeset.opIterator(rep.alines[n]); + var indexIntoLine = 0; + var selectionStartInLine = 0; + var selectionEndInLine = rep.lines.atIndex(n).text.length; // exclude newline + if (n == selStartLine) { + selectionStartInLine = rep.selStart[1]; + } + if (n == selEndLine) { + selectionEndInLine = rep.selEnd[1]; + } + while (opIter.hasNext()) { + var op = opIter.next(); + var opStartInLine = indexIntoLine; + var opEndInLine = opStartInLine + op.chars; + if (! hasIt(op.attribs)) { + // does op overlap selection? + if (! (opEndInLine <= selectionStartInLine || opStartInLine >= selectionEndInLine)) { + selectionAllHasIt = false; + break; + } + } + indexIntoLine = opEndInLine; + } + if (! selectionAllHasIt) { + break; + } + } + + if (selectionAllHasIt) { + performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, + [[attributeName,'']]); + } + else { + var settings = [[attributeName, 'true']]; + + if (attributeName == 'h1' || attributeName == 'h2' || attributeName == 'h3' || + attributeName == 'h4' || attributeName == 'h5' || attributeName == 'h6') { + + settings = [['h1',''], ['h2',''], ['h3',''], + ['h4',''], ['h5',''], ['h6','']]; + if (attributeName == 'h1') { + settings[0] = [attributeName, 'true']; + } + else if (attributeName == 'h2') { + settings[1] = [attributeName, 'true']; + } + else if (attributeName == 'h3') { + settings[2] = [attributeName, 'true']; + } + else if (attributeName == 'h4') { + settings[3] = [attributeName, 'true']; + } + else if (attributeName == 'h5') { + settings[4] = [attributeName, 'true']; + } + else if (attributeName == 'h6') { + settings[5] = [attributeName, 'true']; + } + } + + performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, settings); + } + } + + function performDocumentReplaceSelection(newText) { + if (!(rep.selStart && rep.selEnd)) return; + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + } + + // Change the abstract representation of the document to have a different set of lines. + // Must be called after rep.alltext is set. + function doRepLineSplice(startLine, deleteCount, newLineEntries) { + + forEach(newLineEntries, function (entry) { entry.width = entry.text.length+1; }); + + var startOldChar = rep.lines.offsetOfIndex(startLine); + var endOldChar = rep.lines.offsetOfIndex(startLine+deleteCount); + + var oldRegionStart = rep.lines.offsetOfIndex(startLine); + var oldRegionEnd = rep.lines.offsetOfIndex(startLine+deleteCount); + rep.lines.splice(startLine, deleteCount, newLineEntries); + currentCallStack.docTextChanged = true; + currentCallStack.repChanged = true; + var newRegionEnd = rep.lines.offsetOfIndex(startLine + newLineEntries.length); + + var newText = map(newLineEntries, function (e) { return e.text+'\n'; }).join(''); + + rep.alltext = rep.alltext.substring(0, startOldChar) + newText + + rep.alltext.substring(endOldChar, rep.alltext.length); + + //var newTotalLength = rep.alltext.length; + + //rep.lexer.updateBuffer(rep.alltext, oldRegionStart, oldRegionEnd - oldRegionStart, + //newRegionEnd - oldRegionStart); + } + + function doIncorpLineSplice(startLine, deleteCount, newLineEntries, lineAttribs, hints) { + + var startOldChar = rep.lines.offsetOfIndex(startLine); + var endOldChar = rep.lines.offsetOfIndex(startLine+deleteCount); + + var oldRegionStart = rep.lines.offsetOfIndex(startLine); + + var selStartHintChar, selEndHintChar; + if (hints && hints.selStart) { + selStartHintChar = rep.lines.offsetOfIndex(hints.selStart[0]) + hints.selStart[1] - + oldRegionStart; + } + if (hints && hints.selEnd) { + selEndHintChar = rep.lines.offsetOfIndex(hints.selEnd[0]) + hints.selEnd[1] - + oldRegionStart; + } + + var newText = map(newLineEntries, function (e) { return e.text+'\n'; }).join(''); + var oldText = rep.alltext.substring(startOldChar, endOldChar); + var oldAttribs = rep.alines.slice(startLine, startLine+deleteCount).join(''); + var newAttribs = lineAttribs.join('|1+1')+'|1+1'; // not valid in a changeset + var analysis = analyzeChange(oldText, newText, oldAttribs, newAttribs, + selStartHintChar, selEndHintChar); + var commonStart = analysis[0]; + var commonEnd = analysis[1]; + var shortOldText = oldText.substring(commonStart, oldText.length - commonEnd); + var shortNewText = newText.substring(commonStart, newText.length - commonEnd); + var spliceStart = startOldChar+commonStart; + var spliceEnd = endOldChar-commonEnd; + var shiftFinalNewlineToBeforeNewText = false; + + // adjust the splice to not involve the final newline of the document; + // be very defensive + if (shortOldText.charAt(shortOldText.length-1) == '\n' && + shortNewText.charAt(shortNewText.length-1) == '\n') { + // replacing text that ends in newline with text that also ends in newline + // (still, after analysis, somehow) + shortOldText = shortOldText.slice(0,-1); + shortNewText = shortNewText.slice(0,-1); + spliceEnd--; + commonEnd++; + } + if (shortOldText.length == 0 && spliceStart == rep.alltext.length + && shortNewText.length > 0) { + // inserting after final newline, bad + spliceStart--; + spliceEnd--; + shortNewText = '\n'+shortNewText.slice(0,-1); + shiftFinalNewlineToBeforeNewText = true; + } + if (spliceEnd == rep.alltext.length && shortOldText.length > 0 && + shortNewText.length == 0) { + // deletion at end of rep.alltext + if (rep.alltext.charAt(spliceStart-1) == '\n') { + // (if not then what the heck? it will definitely lead + // to a rep.alltext without a final newline) + spliceStart--; + spliceEnd--; + } + } + + if (! (shortOldText.length == 0 && shortNewText.length == 0)) { + var oldDocText = rep.alltext; + var oldLen = oldDocText.length; + + var spliceStartLine = rep.lines.indexOfOffset(spliceStart); + var spliceStartLineStart = rep.lines.offsetOfIndex(spliceStartLine); + function startBuilder() { + var builder = Changeset.builder(oldLen); + builder.keep(spliceStartLineStart, spliceStartLine); + builder.keep(spliceStart - spliceStartLineStart); + return builder; + } + + function eachAttribRun(attribs, func/*(startInNewText, endInNewText, attribs)*/) { + var attribsIter = Changeset.opIterator(attribs); + var textIndex = 0; + var newTextStart = commonStart; + var newTextEnd = newText.length - commonEnd - (shiftFinalNewlineToBeforeNewText ? 1 : 0); + while (attribsIter.hasNext()) { + var op = attribsIter.next(); + var nextIndex = textIndex + op.chars; + if (!(nextIndex <= newTextStart || textIndex >= newTextEnd)) { + func(Math.max(newTextStart, textIndex), Math.min(newTextEnd, nextIndex), op.attribs); + } + textIndex = nextIndex; + } + } + + var justApplyStyles = (shortNewText == shortOldText); + var theChangeset; + + if (justApplyStyles) { + // create changeset that clears the incorporated styles on + // the existing text. we compose this with the + // changeset the applies the styles found in the DOM. + // This allows us to incorporate, e.g., Safari's native "unbold". + + var incorpedAttribClearer = cachedStrFunc(function (oldAtts) { + return Changeset.mapAttribNumbers(oldAtts, function(n) { + var k = rep.apool.getAttribKey(n); + if (isStyleAttribute(k)) { + return rep.apool.putAttrib([k,'']); + } + return false; + }); + }); + + var builder1 = startBuilder(); + if (shiftFinalNewlineToBeforeNewText) { + builder1.keep(1, 1); + } + eachAttribRun(oldAttribs, function(start, end, attribs) { + builder1.keepText(newText.substring(start, end), incorpedAttribClearer(attribs)); + }); + var clearer = builder1.toString(); + + var builder2 = startBuilder(); + if (shiftFinalNewlineToBeforeNewText) { + builder2.keep(1, 1); + } + eachAttribRun(newAttribs, function(start, end, attribs) { + builder2.keepText(newText.substring(start, end), attribs); + }); + var styler = builder2.toString(); + + theChangeset = Changeset.compose(clearer, styler, rep.apool); + } + else { + var builder = startBuilder(); + + var spliceEndLine = rep.lines.indexOfOffset(spliceEnd); + var spliceEndLineStart = rep.lines.offsetOfIndex(spliceEndLine); + if (spliceEndLineStart > spliceStart) { + builder.remove(spliceEndLineStart - spliceStart, spliceEndLine - spliceStartLine); + builder.remove(spliceEnd - spliceEndLineStart); + } + else { + builder.remove(spliceEnd - spliceStart); + } + + var isNewTextMultiauthor = false; + var authorAtt = Changeset.makeAttribsString( + '+', (thisAuthor ? [['author', thisAuthor]] : []), rep.apool); + var authorizer = cachedStrFunc(function(oldAtts) { + if (isNewTextMultiauthor) { + // prefer colors from DOM + return Changeset.composeAttributes(authorAtt, oldAtts, true, rep.apool); + } + else { + // use this author's color + return Changeset.composeAttributes(oldAtts, authorAtt, true, rep.apool); + } + }); + + var foundDomAuthor = ''; + eachAttribRun(newAttribs, function(start, end, attribs) { + var a = Changeset.attribsAttributeValue(attribs, 'author', rep.apool); + if (a && a != foundDomAuthor) { + if (! foundDomAuthor) { + foundDomAuthor = a; + } + else { + isNewTextMultiauthor = true; // multiple authors in DOM! + } + } + }); + + if (shiftFinalNewlineToBeforeNewText) { + builder.insert('\n', authorizer('')); + } + + eachAttribRun(newAttribs, function(start, end, attribs) { + builder.insert(newText.substring(start, end), authorizer(attribs)); + }); + theChangeset = builder.toString(); + } + + //dmesg(htmlPrettyEscape(theChangeset)); + + doRepApplyChangeset(theChangeset); + } + + // do this no matter what, because we need to get the right + // line keys into the rep. + doRepLineSplice(startLine, deleteCount, newLineEntries); + + checkALines(); + } + + function cachedStrFunc(func) { + var cache = {}; + return function(s) { + if (! cache[s]) { + cache[s] = func(s); + } + return cache[s]; + }; + } + + function analyzeChange(oldText, newText, oldAttribs, newAttribs, optSelStartHint, optSelEndHint) { + function incorpedAttribFilter(anum) { + return isStyleAttribute(rep.apool.getAttribKey(anum)); + } + function attribRuns(attribs) { + var lengs = []; + var atts = []; + var iter = Changeset.opIterator(attribs); + while (iter.hasNext()) { + var op = iter.next(); + lengs.push(op.chars); + atts.push(op.attribs); + } + return [lengs,atts]; + } + function attribIterator(runs, backward) { + var lengs = runs[0]; + var atts = runs[1]; + var i = (backward ? lengs.length-1 : 0); + var j = 0; + return function next() { + while (j >= lengs[i]) { + if (backward) i--; else i++; + j = 0; + } + var a = atts[i]; + j++; + return a; + }; + } + + var oldLen = oldText.length; + var newLen = newText.length; + var minLen = Math.min(oldLen, newLen); + + var oldARuns = attribRuns(Changeset.filterAttribNumbers(oldAttribs, incorpedAttribFilter)); + var newARuns = attribRuns(Changeset.filterAttribNumbers(newAttribs, incorpedAttribFilter)); + + var commonStart = 0; + var oldStartIter = attribIterator(oldARuns, false); + var newStartIter = attribIterator(newARuns, false); + while (commonStart < minLen) { + if (oldText.charAt(commonStart) == newText.charAt(commonStart) && + oldStartIter() == newStartIter()) { + commonStart++; + } + else break; + } + + var commonEnd = 0; + var oldEndIter = attribIterator(oldARuns, true); + var newEndIter = attribIterator(newARuns, true); + while (commonEnd < minLen) { + if (commonEnd == 0) { + // assume newline in common + oldEndIter(); newEndIter(); + commonEnd++; + } + else if (oldText.charAt(oldLen-1-commonEnd) == newText.charAt(newLen-1-commonEnd) && + oldEndIter() == newEndIter()) { + commonEnd++; + } + else break; + } + + var hintedCommonEnd = -1; + if ((typeof optSelEndHint) == "number") { + hintedCommonEnd = newLen - optSelEndHint; + } + + + if (commonStart + commonEnd > oldLen) { + // ambiguous insertion + var minCommonEnd = oldLen - commonStart; + var maxCommonEnd = commonEnd; + if (hintedCommonEnd >= minCommonEnd && hintedCommonEnd <= maxCommonEnd) { + commonEnd = hintedCommonEnd; + } + else { + commonEnd = minCommonEnd; + } + commonStart = oldLen - commonEnd; + } + if (commonStart + commonEnd > newLen) { + // ambiguous deletion + var minCommonEnd = newLen - commonStart; + var maxCommonEnd = commonEnd; + if (hintedCommonEnd >= minCommonEnd && hintedCommonEnd <= maxCommonEnd) { + commonEnd = hintedCommonEnd; + } + else { + commonEnd = minCommonEnd; + } + commonStart = newLen - commonEnd; + } + + return [commonStart, commonEnd]; + } + + function equalLineAndChars(a, b) { + if (!a) return !b; + if (!b) return !a; + return (a[0] == b[0] && a[1] == b[1]); + } + + function performSelectionChange(selectStart, selectEnd, focusAtStart) { + if (repSelectionChange(selectStart, selectEnd, focusAtStart)) { + currentCallStack.selectionAffected = true; + } + } + + // Change the abstract representation of the document to have a different selection. + // Should not rely on the line representation. Should not affect the DOM. + function repSelectionChange(selectStart, selectEnd, focusAtStart) { + focusAtStart = !! focusAtStart; + + var newSelFocusAtStart = (focusAtStart && + ((! selectStart) || (! selectEnd) || + (selectStart[0] != selectEnd[0]) || + (selectStart[1] != selectEnd[1]))); + + if ((! equalLineAndChars(rep.selStart, selectStart)) || + (! equalLineAndChars(rep.selEnd, selectEnd)) || + (rep.selFocusAtStart != newSelFocusAtStart)) { + rep.selStart = selectStart; + rep.selEnd = selectEnd; + rep.selFocusAtStart = newSelFocusAtStart; + if (mozillaFakeArrows) mozillaFakeArrows.notifySelectionChanged(); + currentCallStack.repChanged = true; + + return true; + //console.log("selStart: %o, selEnd: %o, focusAtStart: %s", rep.selStart, rep.selEnd, + //String(!!rep.selFocusAtStart)); + } + return false; + //console.log("%o %o %s", rep.selStart, rep.selEnd, rep.selFocusAtStart); + } + + /*function escapeHTML(s) { + var re = /[&<>'"]/g; /']/; // stupid indentation thing + if (! re.MAP) { + // persisted across function calls! + re.MAP = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + } + return s.replace(re, function(c) { return re.MAP[c]; }); + }*/ + + function doCreateDomLine(nonEmpty) { + if (browser.msie && (! nonEmpty)) { + var result = { node: null, + appendSpan: noop, + prepareForAdd: noop, + notifyAdded: noop, + clearSpans: noop, + finishUpdate: noop, + lineMarker: 0 }; + + var lineElem = doc.createElement("div"); + result.node = lineElem; + + result.notifyAdded = function() { + // magic -- settng an empty div's innerHTML to the empty string + // keeps it from collapsing. Apparently innerHTML must be set *after* + // adding the node to the DOM. + // Such a div is what IE 6 creates naturally when you make a blank line + // in a document of divs. However, when copy-and-pasted the div will + // contain a space, so we note its emptiness with a property. + lineElem.innerHTML = ""; + // a primitive-valued property survives copy-and-paste + setAssoc(lineElem, "shouldBeEmpty", true); + // an object property doesn't + setAssoc(lineElem, "unpasted", {}); + }; + var lineClass = 'ace-line'; + result.appendSpan = function(txt, cls) { + if ((! txt) && cls) { + // gain a whole-line style (currently to show insertion point in CSS) + lineClass = domline.addToLineClass(lineClass, cls); + } + // otherwise, ignore appendSpan, this is an empty line + }; + result.clearSpans = function() { + lineClass = ''; // non-null to cause update + }; + function writeClass() { + if (lineClass !== null) lineElem.className = lineClass; + } + result.prepareForAdd = writeClass; + result.finishUpdate = writeClass; + result.getInnerHTML = function() { return ""; }; + + return result; + } + else { + return domline.createDomLine(nonEmpty, doesWrap, browser, doc); + } + } + + function textify(str) { + return str.replace(/[\n\r ]/g, ' ').replace(/\xa0/g, ' ').replace(/\t/g, ' '); + } + + var _blockElems = { "div":1, "p":1, "pre":1, "li":1, "ol":1, "ul":1 }; + function isBlockElement(n) { + return !!_blockElems[(n.tagName || "").toLowerCase()]; + } + + function getDirtyRanges() { + // based on observedChanges, return a list of ranges of original lines + // that need to be removed or replaced with new user content to incorporate + // the user's changes into the line representation. ranges may be zero-length, + // indicating inserted content. for example, [0,0] means content was inserted + // at the top of the document, while [3,4] means line 3 was deleted, modified, + // or replaced with one or more new lines of content. ranges do not touch. + + var p = PROFILER("getDirtyRanges", false); + p.forIndices = 0; + p.consecutives = 0; + p.corrections = 0; + + var cleanNodeForIndexCache = {}; + var N = rep.lines.length(); // old number of lines + function cleanNodeForIndex(i) { + // if line (i) in the un-updated line representation maps to a clean node + // in the document, return that node. + // if (i) is out of bounds, return true. else return false. + if (cleanNodeForIndexCache[i] === undefined) { + p.forIndices++; + var result; + if (i < 0 || i >= N) { + result = true; // truthy, but no actual node + } + else { + var key = rep.lines.atIndex(i).key; + result = (getCleanNodeByKey(key) || false); + } + cleanNodeForIndexCache[i] = result; + } + return cleanNodeForIndexCache[i]; + } + var isConsecutiveCache = {}; + function isConsecutive(i) { + if (isConsecutiveCache[i] === undefined) { + p.consecutives++; + isConsecutiveCache[i] = (function() { + // returns whether line (i) and line (i-1), assumed to be map to clean DOM nodes, + // or document boundaries, are consecutive in the changed DOM + var a = cleanNodeForIndex(i-1); + var b = cleanNodeForIndex(i); + if ((!a) || (!b)) return false; // violates precondition + if ((a === true) && (b === true)) return ! root.firstChild; + if ((a === true) && b.previousSibling) return false; + if ((b === true) && a.nextSibling) return false; + if ((a === true) || (b === true)) return true; + return a.nextSibling == b; + })(); + } + return isConsecutiveCache[i]; + } + function isClean(i) { + // returns whether line (i) in the un-updated representation maps to a clean node, + // or is outside the bounds of the document + return !! cleanNodeForIndex(i); + } + // list of pairs, each representing a range of lines that is clean and consecutive + // in the changed DOM. lines (-1) and (N) are always clean, but may or may not + // be consecutive with lines in the document. pairs are in sorted order. + var cleanRanges = [[-1,N+1]]; + function rangeForLine(i) { + // returns index of cleanRange containing i, or -1 if none + var answer = -1; + forEach(cleanRanges, function (r, idx) { + if (i >= r[1]) return false; // keep looking + if (i < r[0]) return true; // not found, stop looking + answer = idx; + return true; // found, stop looking + }); + return answer; + } + function removeLineFromRange(rng, line) { + // rng is index into cleanRanges, line is line number + // precond: line is in rng + var a = cleanRanges[rng][0]; + var b = cleanRanges[rng][1]; + if ((a+1) == b) cleanRanges.splice(rng, 1); + else if (line == a) cleanRanges[rng][0]++; + else if (line == (b-1)) cleanRanges[rng][1]--; + else cleanRanges.splice(rng, 1, [a,line], [line+1,b]); + } + function splitRange(rng, pt) { + // precond: pt splits cleanRanges[rng] into two non-empty ranges + var a = cleanRanges[rng][0]; + var b = cleanRanges[rng][1]; + cleanRanges.splice(rng, 1, [a,pt], [pt,b]); + } + var correctedLines = {}; + function correctlyAssignLine(line) { + if (correctedLines[line]) return true; + p.corrections++; + correctedLines[line] = true; + // "line" is an index of a line in the un-updated rep. + // returns whether line was already correctly assigned (i.e. correctly + // clean or dirty, according to cleanRanges, and if clean, correctly + // attached or not attached (i.e. in the same range as) the prev and next lines). + //console.log("correctly assigning: %d", line); + var rng = rangeForLine(line); + var lineClean = isClean(line); + if (rng < 0) { + if (lineClean) { + console.debug("somehow lost clean line"); + } + return true; + } + if (! lineClean) { + // a clean-range includes this dirty line, fix it + removeLineFromRange(rng, line); + return false; + } + else { + // line is clean, but could be wrongly connected to a clean line + // above or below + var a = cleanRanges[rng][0]; + var b = cleanRanges[rng][1]; + var didSomething = false; + // we'll leave non-clean adjacent nodes in the clean range for the caller to + // detect and deal with. we deal with whether the range should be split + // just above or just below this line. + if (a < line && isClean(line-1) && ! isConsecutive(line)) { + splitRange(rng, line); + didSomething = true; + } + if (b > (line+1) && isClean(line+1) && ! isConsecutive(line+1)) { + splitRange(rng, line+1); + didSomething = true; + } + return ! didSomething; + } + } + function detectChangesAroundLine(line, reqInARow) { + // make sure cleanRanges is correct about line number "line" and the surrounding + // lines; only stops checking at end of document or after no changes need + // making for several consecutive lines. note that iteration is over old lines, + // so this operation takes time proportional to the number of old lines + // that are changed or missing, not the number of new lines inserted. + var correctInARow = 0; + var currentIndex = line; + while (correctInARow < reqInARow && currentIndex >= 0) { + if (correctlyAssignLine(currentIndex)) { + correctInARow++; + } + else correctInARow = 0; + currentIndex--; + } + correctInARow = 0; + currentIndex = line; + while (correctInARow < reqInARow && currentIndex < N) { + if (correctlyAssignLine(currentIndex)) { + correctInARow++; + } + else correctInARow = 0; + currentIndex++; + } + } + + if (N == 0) { + p.cancel(); + if (! isConsecutive(0)) { + splitRange(0, 0); + } + } + else { + p.mark("topbot"); + detectChangesAroundLine(0,1); + detectChangesAroundLine(N-1,1); + + p.mark("obs"); + //console.log("observedChanges: "+toSource(observedChanges)); + for (var k in observedChanges.cleanNodesNearChanges) { + var key = k.substring(1); + if (rep.lines.containsKey(key)) { + var line = rep.lines.indexOfKey(key); + detectChangesAroundLine(line,2); + } + } + p.mark("stats&calc"); + p.literal(p.forIndices, "byidx"); + p.literal(p.consecutives, "cons"); + p.literal(p.corrections, "corr"); + } + + var dirtyRanges = []; + for(var r=0;r<cleanRanges.length-1;r++) { + dirtyRanges.push([cleanRanges[r][1], cleanRanges[r+1][0]]); + } + + p.end(); + + return dirtyRanges; + } + + function markNodeClean(n) { + // clean nodes have knownHTML that matches their innerHTML + var dirtiness = {}; + dirtiness.nodeId = uniqueId(n); + dirtiness.knownHTML = n.innerHTML; + if (browser.msie) { + // adding a space to an "empty" div in IE designMode doesn't + // change the innerHTML of the div's parent; also, other + // browsers don't support innerText + dirtiness.knownText = n.innerText; + } + setAssoc(n, "dirtiness", dirtiness); + } + + function isNodeDirty(n) { + var p = PROFILER("cleanCheck", false); + if (n.parentNode != root) return true; + var data = getAssoc(n, "dirtiness"); + if (!data) return true; + if (n.id !== data.nodeId) return true; + if (browser.msie) { + if (n.innerText !== data.knownText) return true; + } + if (n.innerHTML !== data.knownHTML) return true; + p.end(); + return false; + } + + function getLineEntryTopBottom(entry, destObj) { + var dom = entry.lineNode; + var top = dom.offsetTop; + var height = dom.offsetHeight; + var obj = (destObj || {}); + obj.top = top; + obj.bottom = (top+height); + return obj; + } + + function getViewPortTopBottom() { + var theTop = getScrollY(); + var doc = outerWin.document; + var height = doc.documentElement.clientHeight; + return {top:theTop, bottom:(theTop+height)}; + } + + function getVisibleLineRange() { + var viewport = getViewPortTopBottom(); + //console.log("viewport top/bottom: %o", viewport); + var obj = {}; + var start = rep.lines.search(function (e) { + return getLineEntryTopBottom(e, obj).bottom > viewport.top; + }); + var end = rep.lines.search(function(e) { + return getLineEntryTopBottom(e, obj).top >= viewport.bottom; + }); + if (end < start) end = start; // unlikely + //console.log(start+","+end); + return [start,end]; + } + + function getVisibleCharRange() { + var lineRange = getVisibleLineRange(); + return [rep.lines.offsetOfIndex(lineRange[0]), + rep.lines.offsetOfIndex(lineRange[1])]; + } + + function handleClick(evt) { + inCallStack("handleClick", function() { + idleWorkTimer.atMost(200); + }); + + // only want to catch left-click + if ((! evt.ctrlKey) && (evt.button != 2) && (evt.button != 3)) { + // find A tag with HREF + function isLink(n) { return (n.tagName||'').toLowerCase() == "a" && n.href; } + var n = evt.target; + while (n && n.parentNode && ! isLink(n)) { n = n.parentNode; } + if (n && isLink(n)) { + try { + var newWindow = window.open(n.href, '_blank'); + newWindow.focus(); + } + catch (e) { + // absorb "user canceled" error in IE for certain prompts + } + evt.preventDefault(); + } + } + } + + function doReturnKey() { + if (! (rep.selStart && rep.selEnd)) { + return; + } + var lineNum = rep.selStart[0]; + var listType = getLineListType(lineNum); + + performDocumentReplaceSelection('\n'); + if (listType) { + if (lineNum+1 < rep.lines.length()) { + setLineListType(lineNum+1, listType); + } + } + else { + handleReturnIndentation(); + } + } + + function doIndentOutdent(isOut) { + if (! (rep.selStart && rep.selEnd)) { + return false; + } + + var firstLine, lastLine; + firstLine = rep.selStart[0]; + lastLine = Math.max(firstLine, + rep.selEnd[0] - ((rep.selEnd[1] == 0) ? 1 : 0)); + + var mods = []; + var foundLists = false; + for(var n=firstLine;n<=lastLine;n++) { + var listType = getLineListType(n); + if (listType) { + listType = /([a-z]+)([12345678])/.exec(listType); + if (listType) { + foundLists = true; + var t = listType[1]; + var level = Number(listType[2]); + var newLevel = + Math.max(1, Math.min(MAX_LIST_LEVEL, + level + (isOut ? -1 : 1))); + if (level != newLevel) { + mods.push([n, t+newLevel]); + } + } + } + } + + if (mods.length > 0) { + setLineListTypes(mods); + } + + return foundLists; + } + + function doTabKey(shiftDown) { + if (! doIndentOutdent(shiftDown)) { + performDocumentReplaceSelection(THE_TAB); + } + } + + function doDeleteKey(optEvt) { + var evt = optEvt || {}; + var handled = false; + if (rep.selStart) { + if (isCaret()) { + var lineNum = caretLine(); + var col = caretColumn(); + var lineEntry = rep.lines.atIndex(lineNum); + var lineText = lineEntry.text; + var lineMarker = lineEntry.lineMarker; + if (/^ +$/.exec(lineText.substring(lineMarker, col))) { + var col2 = col - lineMarker; + var tabSize = THE_TAB.length; + var toDelete = ((col2 - 1) % tabSize)+1; + performDocumentReplaceRange([lineNum,col-toDelete], + [lineNum,col], ''); + //scrollSelectionIntoView(); + handled = true; + } + } + if (! handled) { + if (isCaret()) { + var theLine = caretLine(); + var lineEntry = rep.lines.atIndex(theLine); + if (caretColumn() <= lineEntry.lineMarker) { + // delete at beginning of line + var action = 'delete_newline'; + var prevLineListType = + (theLine > 0 ? getLineListType(theLine-1) : ''); + var thisLineListType = getLineListType(theLine); + var prevLineEntry = (theLine > 0 && + rep.lines.atIndex(theLine-1)); + var prevLineBlank = (prevLineEntry && + prevLineEntry.text.length == + prevLineEntry.lineMarker); + if (thisLineListType) { + // this line is a list + /*if (prevLineListType) { + // prev line is a list too, remove this bullet + performDocumentReplaceRange([theLine-1, prevLineEntry.text.length], + [theLine, lineEntry.lineMarker], ''); + } + else*/ if (prevLineBlank && ! prevLineListType) { + // previous line is blank, remove it + performDocumentReplaceRange([theLine-1, prevLineEntry.text.length], + [theLine, 0], ''); + } + else { + // delistify + performDocumentReplaceRange([theLine, 0], + [theLine, lineEntry.lineMarker], ''); + } + } + else if (theLine > 0) { + // remove newline + performDocumentReplaceRange([theLine-1, prevLineEntry.text.length], + [theLine, 0], ''); + } + } + else { + var docChar = caretDocChar(); + if (docChar > 0) { + if (evt.metaKey || evt.ctrlKey || evt.altKey) { + // delete as many unicode "letters or digits" in a row as possible; + // always delete one char, delete further even if that first char + // isn't actually a word char. + var deleteBackTo = docChar-1; + while (deleteBackTo > lineEntry.lineMarker && + isWordChar(rep.alltext.charAt(deleteBackTo-1))) { + deleteBackTo--; + } + performDocumentReplaceCharRange(deleteBackTo, docChar, ''); + } + else { + // normal delete + performDocumentReplaceCharRange(docChar-1, docChar, ''); + } + } + } + } + else { + performDocumentReplaceSelection(''); + } + } + } + } + + // set of "letter or digit" chars is based on section 20.5.16 of the original Java Language Spec + var REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/; + var REGEX_SPACE = /\s/; + + function isWordChar(c) { + return !! REGEX_WORDCHAR.exec(c); + } + function isSpaceChar(c) { + return !! REGEX_SPACE.exec(c); + } + + function moveByWordInLine(lineText, initialIndex, forwardNotBack) { + var i = initialIndex; + function nextChar() { + if (forwardNotBack) return lineText.charAt(i); + else return lineText.charAt(i-1); + } + function advance() { if (forwardNotBack) i++; else i--; } + function isDone() { + if (forwardNotBack) return i >= lineText.length; + else return i <= 0; + } + + // On Mac and Linux, move right moves to end of word and move left moves to start; + // on Windows, always move to start of word. + // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). + if (browser.windows && forwardNotBack) { + while ((! isDone()) && isWordChar(nextChar())) { advance(); } + while ((! isDone()) && ! isWordChar(nextChar())) { advance(); } + } + else { + while ((! isDone()) && ! isWordChar(nextChar())) { advance(); } + while ((! isDone()) && isWordChar(nextChar())) { advance(); } + } + + return i; + } + + function handleKeyEvent(evt) { + if (DEBUG && top.DONT_INCORP) return; + + /*if (evt.which == 48) { + //setEditable(! isEditable); + //doAlert(getInnerWidth()); + //doAlert(doc.documentElement.innerWidth) + alert(eval(prompt())); + evt.preventDefault(); + return; + }*/ + /*if (evt.which == 48) { + alert(doc.body.innerHTML); + }*/ + /*if (evt.which == 48 && evt.type == "keydown") { + var lineHeights = []; + function eachChild(node, func) { + if (node.firstChild) { + var n = node.firstChild; + while (n) { + func(n); + n = n.nextSibling; + } + } + } + eachChild(doc.body, function (n) { + if (n.clientHeight) { + lineHeights.push(n.clientHeight); + } + }); + alert(lineHeights.join(',')); + }*/ + /*if (evt.which == 48) { + top.DONT_INCORP = true; + var cmdTarget = doc; + if (browser.msie) { + if (doc.selection) { + cmdTarget = doc.selection.createRange(); + } + else cmdTarget = null; + } + if (cmdTarget) { + cmdTarget.execCommand("Bold", false, null); + } + alert(doc.body.innerHTML); + evt.preventDefault(); + return; + }*/ + /*if (evt.which == 48) { + if (evt.type == "keypress") { + top.console.log(window.getSelection().getRangeAt(0)); + evt.preventDefault(); + } + return; + }*/ + /*if (evt.which == 48) { + if (evt.type == "keypress") { + inCallStack("bold", function() { + fastIncorp(9); + toggleAttributeOnSelection('bold'); + }); + evt.preventDefault(); + } + return; + }*/ + /*if (evt.which == 48) { + if (evt.type == "keypress") { + inCallStack("insertunorderedlist", function() { + fastIncorp(9); + doInsertUnorderedList(); + }); + evt.preventDefault(); + } + return; + }*/ + + if (! isEditable) return; + + var type = evt.type; + var charCode = evt.charCode; + var keyCode = evt.keyCode; + var mods = ""; + if (evt.altKey) mods = mods+"A"; + if (evt.ctrlKey) mods = mods+"C"; + if (evt.shiftKey) mods = mods+"S"; + if (evt.metaKey) mods = mods+"M"; + var modsPrfx = ""; + if (mods) modsPrfx = mods+"-"; + var which = evt.which; + + //dmesg("keyevent type: "+type+", which: "+which); + + // Don't take action based on modifier keys going up and down. + // Modifier keys do not generate "keypress" events. + // 224 is the command-key under Mac Firefox. + // 91 is the Windows key in IE; it is ASCII for open-bracket but isn't the keycode for that key + // 20 is capslock in IE. + var isModKey = ((!charCode) && + ((type == "keyup") || (type == "keydown")) && + (keyCode == 16 || keyCode == 17 || keyCode == 18 || keyCode == 20 || keyCode == 224 + || keyCode == 91)); + if (isModKey) return; + + var specialHandled = false; + var isTypeForSpecialKey = ((browser.msie || browser.safari) ? + (type == "keydown") : (type == "keypress")); + var isTypeForCmdKey = ((browser.msie || browser.safari) ? (type == "keydown") : (type == "keypress")); + + var stopped = false; + + inCallStack("handleKeyEvent", function() { + + if (type == "keypress" || + (isTypeForSpecialKey && keyCode == 13/*return*/)) { + // in IE, special keys don't send keypress, the keydown does the action + if (! outsideKeyPress(evt)) { + evt.preventDefault(); + stopped = true; + } + } + else if (type == "keydown") { + outsideKeyDown(evt); + } + + if (! stopped) { + if (isTypeForSpecialKey && keyCode == 8) { + // "delete" key; in mozilla, if we're at the beginning of a line, normalize now, + // or else deleting a blank line can take two delete presses. + // -- + // we do deletes completely customly now: + // - allows consistent (and better) meta-delete behavior + // - normalizing and then allowing default behavior confused IE + // - probably eliminates a few minor quirks + fastIncorp(3); + evt.preventDefault(); + doDeleteKey(evt); + specialHandled = true; + } + if ((!specialHandled) && isTypeForSpecialKey && keyCode == 13) { + // return key, handle specially; + // note that in mozilla we need to do an incorporation for proper return behavior anyway. + fastIncorp(4); + evt.preventDefault(); + doReturnKey(); + //scrollSelectionIntoView(); + scheduler.setTimeout(function() {outerWin.scrollBy(-100,0);}, 0); + specialHandled = true; + } + if ((!specialHandled) && isTypeForSpecialKey && keyCode == 9 && + ! (evt.metaKey || evt.ctrlKey)) { + // tab + fastIncorp(5); + evt.preventDefault(); + doTabKey(evt.shiftKey); + //scrollSelectionIntoView(); + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "z" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-Z (undo) + fastIncorp(6); + evt.preventDefault(); + if (evt.shiftKey) { + doUndoRedo("redo"); + } + else { + doUndoRedo("undo"); + } + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "y" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-Y (redo) + fastIncorp(10); + evt.preventDefault(); + doUndoRedo("redo"); + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "b" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-B (bold) + fastIncorp(13); + evt.preventDefault(); + toggleAttributeOnSelection('bold'); + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "i" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-I (italic) + fastIncorp(14); + evt.preventDefault(); + toggleAttributeOnSelection('italic'); + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "u" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-U (underline) + fastIncorp(15); + evt.preventDefault(); + toggleAttributeOnSelection('underline'); + specialHandled = true; + } + if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "h" && + (evt.ctrlKey)) { + // cmd-H (backspace) + fastIncorp(20); + evt.preventDefault(); + doDeleteKey(); + specialHandled = true; + } + /*if ((!specialHandled) && isTypeForCmdKey && + String.fromCharCode(which).toLowerCase() == "u" && + (evt.metaKey || evt.ctrlKey)) { + // cmd-U + doc.body.innerHTML = ''; + evt.preventDefault(); + specialHandled = true; + }*/ + + if (mozillaFakeArrows && mozillaFakeArrows.handleKeyEvent(evt)) { + evt.preventDefault(); + specialHandled = true; + } + } + + if (type == "keydown") { + idleWorkTimer.atLeast(500); + } + else if (type == "keypress") { + if ((! specialHandled) && parenModule.shouldNormalizeOnChar(charCode)) { + idleWorkTimer.atMost(0); + } + else { + idleWorkTimer.atLeast(500); + } + } + else if (type == "keyup") { + var wait = 200; + idleWorkTimer.atLeast(wait); + idleWorkTimer.atMost(wait); + } + + // Is part of multi-keystroke international character on Firefox Mac + var isFirefoxHalfCharacter = + (browser.mozilla && evt.altKey && charCode == 0 && keyCode == 0); + + // Is part of multi-keystroke international character on Safari Mac + var isSafariHalfCharacter = + (browser.safari && evt.altKey && keyCode == 229); + + if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter) { + idleWorkTimer.atLeast(3000); // give user time to type + // if this is a keydown, e.g., the keyup shouldn't trigger a normalize + thisKeyDoesntTriggerNormalize = true; + } + + if ((! specialHandled) && (! thisKeyDoesntTriggerNormalize) && + (! inInternationalComposition)) { + if (type != "keyup" || ! incorpIfQuick()) { + observeChangesAroundSelection(); + } + } + + if (type == "keyup") { + thisKeyDoesntTriggerNormalize = false; + } + }); + } + + var thisKeyDoesntTriggerNormalize = false; + + function doUndoRedo(which) { + // precond: normalized DOM + if (undoModule.enabled) { + var whichMethod; + if (which == "undo") whichMethod = 'performUndo'; + if (which == "redo") whichMethod = 'performRedo'; + if (whichMethod) { + var oldEventType = currentCallStack.editEvent.eventType; + currentCallStack.startNewEvent(which); + undoModule[whichMethod](function(backset, selectionInfo) { + if (backset) { + performDocumentApplyChangeset(backset); + } + if (selectionInfo) { + performSelectionChange(lineAndColumnFromChar(selectionInfo.selStart), + lineAndColumnFromChar(selectionInfo.selEnd), + selectionInfo.selFocusAtStart); + } + var oldEvent = currentCallStack.startNewEvent(oldEventType, true); + return oldEvent; + }); + } + } + } + + /*function enforceNewTextTypedStyle() { + var sel = getSelection(); + var n = (sel && sel.startPoint && sel.startPoint.node); + if (!n) return; + var isInOurNode = false; + while (n) { + if (n.tagName) { + var tag = n.tagName.toLowerCase(); + if (tag == "b" || tag == "strong") { + isInOurNode = true; + break; + } + if (((typeof n.className) == "string") && + n.className.toLowerCase().indexOf("Apple-style-span") >= 0) { + isInOurNode = true; + break; + } + } + n = n.parentNode; + } + + if (! isInOurNode) { + doc.execCommand("Bold", false, null); + } + + if (! browser.msie) { + var browserSelection = window.getSelection(); + if (browserSelection && browserSelection.type != "None" && + browserSelection.rangeCount !== 0) { + var range = browserSelection.getRangeAt(0); + var surrounder = doc.createElement("B"); + range.surroundContents(surrounder); + range.selectNodeContents(surrounder); + browserSelection.removeAllRanges(); + browserSelection.addRange(range); + } + } + }*/ + + function updateBrowserSelectionFromRep() { + // requires normalized DOM! + var selStart = rep.selStart, selEnd = rep.selEnd; + + if (!(selStart && selEnd)) { + setSelection(null); + return; + } + + var mozillaCaretHack = (false && browser.mozilla && selStart && selEnd && + selStart[0] == selEnd[0] + && selStart[1] == rep.lines.atIndex(selStart[0]).lineMarker + && selEnd[1] == rep.lines.atIndex(selEnd[0]).lineMarker && + setupMozillaCaretHack(selStart[0])); + + var selection = {}; + + var ss = [selStart[0], selStart[1]]; + if (mozillaCaretHack) ss[1] += 1; + selection.startPoint = getPointForLineAndChar(ss); + + var se = [selEnd[0], selEnd[1]]; + if (mozillaCaretHack) se[1] += 1; + selection.endPoint = getPointForLineAndChar(se); + + selection.focusAtStart = !!rep.selFocusAtStart; + + setSelection(selection); + + if (mozillaCaretHack) { + mozillaCaretHack.unhack(); + } + } + + function getRepHTML() { + /*function lineWithSelection(text, lineNum) { + var haveSelStart = (rep.selStart && rep.selStart[0] == lineNum); + var haveSelEnd = (rep.selEnd && rep.selEnd[0] == lineNum); + var startCol = (haveSelStart && rep.selStart[1]); + var endCol = (haveSelEnd && rep.selEnd[1]); + var len = text.length; + if (haveSelStart && haveSelEnd && startCol == endCol) { + var color = "#000"; + if (endCol == len) { + return '<span style="border-right: 1px solid '+color+'">'+ + htmlEscape(text)+'</span>'; + } + else { + return htmlEscape + } + } + }*/ + + return map(rep.lines.slice(), function (entry) { + var text = entry.text; + var content; + if (text.length == 0) { + content = '<span style="color: #aaa">--</span>'; + } + else { + content = htmlPrettyEscape(text); + } + return '<div><code>'+content+'</div></code>'; + }).join(''); + } + + function nodeMaxIndex(nd) { + if (isNodeText(nd)) return nd.nodeValue.length; + else return 1; + } + + function hasIESelection() { + var browserSelection; + try { browserSelection = doc.selection; } catch (e) {} + if (! browserSelection) return false; + var origSelectionRange; + try { origSelectionRange = browserSelection.createRange(); } catch (e) {} + if (! origSelectionRange) return false; + var selectionParent = origSelectionRange.parentElement(); + if (selectionParent.ownerDocument != doc) return false; + return true; + } + + function getSelection() { + // returns null, or a structure containing startPoint and endPoint, + // each of which has node (a magicdom node), index, and maxIndex. If the node + // is a text node, maxIndex is the length of the text; else maxIndex is 1. + // index is between 0 and maxIndex, inclusive. + if (browser.msie) { + var browserSelection; + try { browserSelection = doc.selection; } catch (e) {} + if (! browserSelection) return null; + var origSelectionRange; + try { origSelectionRange = browserSelection.createRange(); } catch (e) {} + if (! origSelectionRange) return null; + var selectionParent = origSelectionRange.parentElement(); + if (selectionParent.ownerDocument != doc) return null; + function newRange() { + return doc.body.createTextRange(); + } + function rangeForElementNode(nd) { + var rng = newRange(); + // doesn't work on text nodes + rng.moveToElementText(nd); + return rng; + } + function pointFromCollapsedRange(rng) { + var parNode = rng.parentElement(); + var elemBelow = -1; + var elemAbove = parNode.childNodes.length; + var rangeWithin = rangeForElementNode(parNode); + + if (rng.compareEndPoints("StartToStart", rangeWithin) == 0) { + return {node:parNode, index:0, maxIndex:1}; + } + else if (rng.compareEndPoints("EndToEnd", rangeWithin) == 0) { + if (isBlockElement(parNode) && parNode.nextSibling) { + // caret after block is not consistent across browsers + // (same line vs next) so put caret before next node + return {node:parNode.nextSibling, index:0, maxIndex:1}; + } + return {node:parNode, index:1, maxIndex:1}; + } + else if (parNode.childNodes.length == 0) { + return {node:parNode, index:0, maxIndex:1}; + } + + for(var i=0;i<parNode.childNodes.length;i++) { + var n = parNode.childNodes.item(i); + if (! isNodeText(n)) { + var nodeRange = rangeForElementNode(n); + var startComp = rng.compareEndPoints("StartToStart", nodeRange); + var endComp = rng.compareEndPoints("EndToEnd", nodeRange); + if (startComp >= 0 && endComp <= 0) { + var index = 0; + if (startComp > 0) { + index = 1; + } + return {node:n, index:index, maxIndex:1}; + } + else if (endComp > 0) { + if (i > elemBelow) { + elemBelow = i; + rangeWithin.setEndPoint("StartToEnd", nodeRange); + } + } + else if (startComp < 0) { + if (i < elemAbove) { + elemAbove = i; + rangeWithin.setEndPoint("EndToStart", nodeRange); + } + } + } + } + if ((elemAbove - elemBelow) == 1) { + if (elemBelow >= 0) { + return {node:parNode.childNodes.item(elemBelow), index:1, maxIndex:1}; + } + else { + return {node:parNode.childNodes.item(elemAbove), index:0, maxIndex:1}; + } + } + var idx = 0; + var r = rng.duplicate(); + // infinite stateful binary search! call function for values 0 to inf, + // expecting the answer to be about 40. return index of smallest + // true value. + var indexIntoRange = binarySearchInfinite(40, function (i) { + // the search algorithm whips the caret back and forth, + // though it has to be moved relatively and may hit + // the end of the buffer + var delta = i-idx; + var moved = Math.abs(r.move("character", -delta)); + // next line is work-around for fact that when moving left, the beginning + // of a text node is considered to be after the start of the parent element: + if (r.move("character", -1)) r.move("character", 1); + if (delta < 0) idx -= moved; + else idx += moved; + return (r.compareEndPoints("StartToStart", rangeWithin) <= 0); + }); + // iterate over consecutive text nodes, point is in one of them + var textNode = elemBelow+1; + var indexLeft = indexIntoRange; + while (textNode < elemAbove) { + var tn = parNode.childNodes.item(textNode); + if (indexLeft <= tn.nodeValue.length) { + return {node:tn, index:indexLeft, maxIndex:tn.nodeValue.length}; + } + indexLeft -= tn.nodeValue.length; + textNode++; + } + var tn = parNode.childNodes.item(textNode-1); + return {node:tn, index:tn.nodeValue.length, maxIndex:tn.nodeValue.length}; + } + var selection = {}; + if (origSelectionRange.compareEndPoints("StartToEnd", origSelectionRange) == 0) { + // collapsed + var pnt = pointFromCollapsedRange(origSelectionRange); + selection.startPoint = pnt; + selection.endPoint = {node:pnt.node, index:pnt.index, maxIndex:pnt.maxIndex}; + } + else { + var start = origSelectionRange.duplicate(); + start.collapse(true); + var end = origSelectionRange.duplicate(); + end.collapse(false); + selection.startPoint = pointFromCollapsedRange(start); + selection.endPoint = pointFromCollapsedRange(end); + /*if ((!selection.startPoint.node.isText) && (!selection.endPoint.node.isText)) { + console.log(selection.startPoint.node.uniqueId()+","+ + selection.startPoint.index+" / "+ + selection.endPoint.node.uniqueId()+","+ + selection.endPoint.index); + }*/ + } + return selection; + } + else { + // non-IE browser + var browserSelection = window.getSelection(); + if (browserSelection && browserSelection.type != "None" && + browserSelection.rangeCount !== 0) { + var range = browserSelection.getRangeAt(0); + function isInBody(n) { + while (n && ! (n.tagName && n.tagName.toLowerCase() == "body")) { + n = n.parentNode; + } + return !!n; + } + function pointFromRangeBound(container, offset) { + if (! isInBody(container)) { + // command-click in Firefox selects whole document, HEAD and BODY! + return {node:root, index:0, maxIndex:1}; + } + var n = container; + var childCount = n.childNodes.length; + if (isNodeText(n)) { + return {node:n, index:offset, maxIndex:n.nodeValue.length}; + } + else if (childCount == 0) { + return {node:n, index:0, maxIndex:1}; + } + // treat point between two nodes as BEFORE the second (rather than after the first) + // if possible; this way point at end of a line block-element is treated as + // at beginning of next line + else if (offset == childCount) { + var nd = n.childNodes.item(childCount-1); + var max = nodeMaxIndex(nd); + return {node:nd, index:max, maxIndex:max}; + } + else { + var nd = n.childNodes.item(offset); + var max = nodeMaxIndex(nd); + return {node:nd, index:0, maxIndex:max}; + } + } + var selection = {}; + selection.startPoint = pointFromRangeBound(range.startContainer, range.startOffset); + selection.endPoint = pointFromRangeBound(range.endContainer, range.endOffset); + selection.focusAtStart = (((range.startContainer != range.endContainer) || + (range.startOffset != range.endOffset)) && + browserSelection.anchorNode && + (browserSelection.anchorNode == range.endContainer) && + (browserSelection.anchorOffset == range.endOffset)); + return selection; + } + else return null; + } + } + + function setSelection(selection) { + function copyPoint(pt) { + return {node:pt.node, index:pt.index, maxIndex:pt.maxIndex}; + } + if (browser.msie) { + // Oddly enough, accessing scrollHeight fixes return key handling on IE 8, + // presumably by forcing some kind of internal DOM update. + doc.body.scrollHeight; + + function moveToElementText(s, n) { + while (n.firstChild && ! isNodeText(n.firstChild)) { + n = n.firstChild; + } + s.moveToElementText(n); + } + function newRange() { + return doc.body.createTextRange(); + } + function setCollapsedBefore(s, n) { + // s is an IE TextRange, n is a dom node + if (isNodeText(n)) { + // previous node should not also be text, but prevent inf recurs + if (n.previousSibling && ! isNodeText(n.previousSibling)) { + setCollapsedAfter(s, n.previousSibling); + } + else { + setCollapsedBefore(s, n.parentNode); + } + } + else { + moveToElementText(s, n); + // work around for issue that caret at beginning of line + // somehow ends up at end of previous line + if (s.move('character', 1)) { + s.move('character', -1); + } + s.collapse(true); // to start + } + } + function setCollapsedAfter(s, n) { + // s is an IE TextRange, n is a magicdom node + if (isNodeText(n)) { + // can't use end of container when no nextSibling (could be on next line), + // so use previousSibling or start of container and move forward. + setCollapsedBefore(s, n); + s.move("character", n.nodeValue.length); + } + else { + moveToElementText(s, n); + s.collapse(false); // to end + } + } + function getPointRange(point) { + var s = newRange(); + var n = point.node; + if (isNodeText(n)) { + setCollapsedBefore(s, n); + s.move("character", point.index); + } + else if (point.index == 0) { + setCollapsedBefore(s, n); + } + else { + setCollapsedAfter(s, n); + } + return s; + } + + if (selection) { + if (! hasIESelection()) { + return; // don't steal focus + } + + var startPoint = copyPoint(selection.startPoint); + var endPoint = copyPoint(selection.endPoint); + + // fix issue where selection can't be extended past end of line + // with shift-rightarrow or shift-downarrow + if (endPoint.index == endPoint.maxIndex && endPoint.node.nextSibling) { + endPoint.node = endPoint.node.nextSibling; + endPoint.index = 0; + endPoint.maxIndex = nodeMaxIndex(endPoint.node); + } + var range = getPointRange(startPoint); + range.setEndPoint("EndToEnd", getPointRange(endPoint)); + + // setting the selection in IE causes everything to scroll + // so that the selection is visible. if setting the selection + // definitely accomplishes nothing, don't do it. + function isEqualToDocumentSelection(rng) { + var browserSelection; + try { browserSelection = doc.selection; } catch (e) {} + if (! browserSelection) return false; + var rng2 = browserSelection.createRange(); + if (rng2.parentElement().ownerDocument != doc) return false; + if (rng.compareEndPoints("StartToStart", rng2) !== 0) return false; + if (rng.compareEndPoints("EndToEnd", rng2) !== 0) return false; + return true; + } + if (! isEqualToDocumentSelection(range)) { + //dmesg(toSource(selection)); + //dmesg(escapeHTML(doc.body.innerHTML)); + range.select(); + } + } + else { + try { doc.selection.empty(); } catch (e) {} + } + } + else { + // non-IE browser + var isCollapsed; + function pointToRangeBound(pt) { + var p = copyPoint(pt); + // Make sure Firefox cursor is deep enough; fixes cursor jumping when at top level, + // and also problem where cut/copy of a whole line selected with fake arrow-keys + // copies the next line too. + if (isCollapsed) { + function diveDeep() { + while (p.node.childNodes.length > 0) { + //&& (p.node == root || p.node.parentNode == root)) { + if (p.index == 0) { + p.node = p.node.firstChild; + p.maxIndex = nodeMaxIndex(p.node); + } + else if (p.index == p.maxIndex) { + p.node = p.node.lastChild; + p.maxIndex = nodeMaxIndex(p.node); + p.index = p.maxIndex; + } + else break; + } + } + // now fix problem where cursor at end of text node at end of span-like element + // with background doesn't seem to show up... + if (isNodeText(p.node) && p.index == p.maxIndex) { + var n = p.node; + while ((! n.nextSibling) && (n != root) && (n.parentNode != root)) { + n = n.parentNode; + } + if (n.nextSibling && + (! ((typeof n.nextSibling.tagName) == "string" && + n.nextSibling.tagName.toLowerCase() == "br")) && + (n != p.node) && (n != root) && (n.parentNode != root)) { + // found a parent, go to next node and dive in + p.node = n.nextSibling; + p.maxIndex = nodeMaxIndex(p.node); + p.index = 0; + diveDeep(); + } + } + // try to make sure insertion point is styled; + // also fixes other FF problems + if (! isNodeText(p.node)) { + diveDeep(); + } + } + /*// make sure Firefox cursor is shallow enough; + // to fix problem where "return" between two spans doesn't move the caret to + // the next line + // (decided against) + while (!(p.node.isRoot || p.node.parent().isRoot || p.node.parent().parent().isRoot)) { + if (p.index == 0 && ! p.node.prev()) { + p.node = p.node.parent(); + p.maxIndex = 1; + } + else if (p.index == p.maxIndex && ! p.node.next()) { + p.node = p.node.parent(); + p.maxIndex = 1; + p.index = 1; + } + else break; + } + if ((! p.node.isRoot) && (!p.node.parent().isRoot) && + (p.index == p.maxIndex) && p.node.next()) { + p.node = p.node.next(); + p.maxIndex = nodeMaxIndex(p.node); + p.index = 0; + }*/ + if (isNodeText(p.node)) { + return { container: p.node, offset: p.index }; + } + else { + // p.index in {0,1} + return { container: p.node.parentNode, offset: childIndex(p.node) + p.index }; + } + } + var browserSelection = window.getSelection(); + if (browserSelection) { + browserSelection.removeAllRanges(); + if (selection) { + isCollapsed = (selection.startPoint.node === selection.endPoint.node && + selection.startPoint.index === selection.endPoint.index); + var start = pointToRangeBound(selection.startPoint); + var end = pointToRangeBound(selection.endPoint); + + if ((!isCollapsed) && selection.focusAtStart && browserSelection.collapse && browserSelection.extend) { + // can handle "backwards"-oriented selection, shift-arrow-keys move start + // of selection + browserSelection.collapse(end.container, end.offset); + //console.trace(); + //console.log(htmlPrettyEscape(rep.alltext)); + //console.log("%o %o", rep.selStart, rep.selEnd); + //console.log("%o %d", start.container, start.offset); + browserSelection.extend(start.container, start.offset); + } + else { + var range = doc.createRange(); + range.setStart(start.container, start.offset); + range.setEnd(end.container, end.offset); + browserSelection.removeAllRanges(); + browserSelection.addRange(range); + } + } + } + } + } + + function childIndex(n) { + var idx = 0; + while (n.previousSibling) { + idx++; + n = n.previousSibling; + } + return idx; + } + + function fixView() { + // calling this method repeatedly should be fast + + if (getInnerWidth() == 0 || getInnerHeight() == 0) { + return; + } + + function setIfNecessary(obj, prop, value) { + if (obj[prop] != value) { + obj[prop] = value; + } + } + + var lineNumberWidth = sideDiv.firstChild.offsetWidth; + var newSideDivWidth = lineNumberWidth + LINE_NUMBER_PADDING_LEFT; + if (newSideDivWidth < MIN_LINEDIV_WIDTH) newSideDivWidth = MIN_LINEDIV_WIDTH; + iframePadLeft = EDIT_BODY_PADDING_LEFT; + if (hasLineNumbers) iframePadLeft += newSideDivWidth + LINE_NUMBER_PADDING_RIGHT; + setIfNecessary(iframe.style, "left", iframePadLeft+"px"); + setIfNecessary(sideDiv.style, "width", newSideDivWidth+"px"); + + for(var i=0;i<2;i++) { + var newHeight = root.clientHeight; + var newWidth = (browser.msie ? root.createTextRange().boundingWidth : root.clientWidth); + var viewHeight = getInnerHeight() - iframePadBottom - iframePadTop; + var viewWidth = getInnerWidth() - iframePadLeft - iframePadRight; + if (newHeight < viewHeight) { + newHeight = viewHeight; + if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); + } + else { + if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); + } + if (doesWrap) { + newWidth = viewWidth; + } + else { + if (newWidth < viewWidth) newWidth = viewWidth; + } + if (newHeight > 32000) newHeight = 32000; + if (newWidth > 32000) newWidth = 32000; + setIfNecessary(iframe.style, "height", newHeight+"px"); + setIfNecessary(iframe.style, "width", newWidth+"px"); + setIfNecessary(sideDiv.style, "height", newHeight+"px"); + } + if (browser.mozilla) { + if (! doesWrap) { + // the body:display:table-cell hack makes mozilla do scrolling + // correctly by shrinking the <body> to fit around its content, + // but mozilla won't act on clicks below the body. We keep the + // style.height property set to the viewport height (editor height + // not including scrollbar), so it will never shrink so that part of + // the editor isn't clickable. + var body = root; + var styleHeight = viewHeight+"px"; + setIfNecessary(body.style, "height", styleHeight); + } + else { + setIfNecessary(root.style, "height", ""); + } + } + // if near edge, scroll to edge + var scrollX = getScrollX(); + var scrollY = getScrollY(); + var win = outerWin; + var r = 20; + /*if (scrollX <= iframePadLeft+r) win.scrollBy(-iframePadLeft-r, 0); + else if (getPageWidth() - scrollX - getInnerWidth() <= iframePadRight+r) + scrollBy(iframePadRight+r, 0);*/ + /*if (scrollY <= iframePadTop+r) win.scrollBy(0, -iframePadTop-r); + else if (getPageHeight() - scrollY - getInnerHeight() <= iframePadBottom+r) + scrollBy(0, iframePadBottom+r);*/ + + enforceEditability(); + + addClass(sideDiv, 'sidedivdelayed'); + } + + function getScrollXY() { + var win = outerWin; + var odoc = outerWin.document; + if (typeof(win.pageYOffset) == "number") { + return {x: win.pageXOffset, y: win.pageYOffset}; + } + var docel = odoc.documentElement; + if (docel && typeof(docel.scrollTop) == "number") { + return {x:docel.scrollLeft, y:docel.scrollTop}; + } + } + + function getScrollX() { + return getScrollXY().x; + } + + function getScrollY() { + return getScrollXY().y; + } + + function setScrollX(x) { + outerWin.scrollTo(x, getScrollY()); + } + + function setScrollY(y) { + outerWin.scrollTo(getScrollX(), y); + } + + function setScrollXY(x, y) { + outerWin.scrollTo(x, y); + } + + var _teardownActions = []; + function teardown() { + forEach(_teardownActions, function (a) { a(); }); + } + + bindEventHandler(window, "load", setup); + + function setDesignMode(newVal) { + try { + function setIfNecessary(target, prop, val) { + if (String(target[prop]).toLowerCase() != val) { + target[prop] = val; + return true; + } + return false; + } + if (browser.msie || browser.safari) { + setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false')); + } + else { + var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off')); + if (wasSet && newVal && browser.opera) { + // turning on designMode clears event handlers + bindTheEventHandlers(); + } + } + return true; + } + catch (e) { + return false; + } + } + + var iePastedLines = null; + function handleIEPaste(evt) { + // Pasting in IE loses blank lines in a way that loses information; + // "one\n\ntwo\nthree" becomes "<p>one</p><p>two</p><p>three</p>", + // which becomes "one\ntwo\nthree". We can get the correct text + // from the clipboard directly, but we still have to let the paste + // happen to get the style information. + + var clipText = window.clipboardData && window.clipboardData.getData("Text"); + if (clipText && doc.selection) { + // this "paste" event seems to mess with the selection whether we try to + // stop it or not, so can't really do document-level manipulation now + // or in an idle call-stack. instead, use IE native manipulation + //function escapeLine(txt) { + //return processSpaces(escapeHTML(textify(txt))); + //} + //var newHTML = map(clipText.replace(/\r/g,'').split('\n'), escapeLine).join('<br>'); + //doc.selection.createRange().pasteHTML(newHTML); + //evt.preventDefault(); + + //iePastedLines = map(clipText.replace(/\r/g,'').split('\n'), textify); + } + } + + var inInternationalComposition = false; + + function handleCompositionEvent(evt) { + // international input events, fired in FF3, at least; allow e.g. Japanese input + if (evt.type == "compositionstart") { + inInternationalComposition = true; + } + else if (evt.type == "compositionend") { + inInternationalComposition = false; + } + } + + /*function handleTextEvent(evt) { + top.console.log("TEXT EVENT"); + inCallStackIfNecessary("handleTextEvent", function() { + observeChangesAroundSelection(); + }); + }*/ + + function bindTheEventHandlers() { + bindEventHandler(window, "unload", teardown); + bindEventHandler(document, "keydown", handleKeyEvent); + bindEventHandler(document, "keypress", handleKeyEvent); + bindEventHandler(document, "keyup", handleKeyEvent); + bindEventHandler(document, "click", handleClick); + bindEventHandler(root, "blur", handleBlur); + if (browser.msie) { + bindEventHandler(document, "click", handleIEOuterClick); + } + if (browser.msie) bindEventHandler(root, "paste", handleIEPaste); + if ((! browser.msie) && document.documentElement) { + bindEventHandler(document.documentElement, "compositionstart", handleCompositionEvent); + bindEventHandler(document.documentElement, "compositionend", handleCompositionEvent); + } + + /*bindEventHandler(window, "mousemove", function(e) { + if (e.pageX < 10) { + window.DEBUG_DONT_INCORP = (e.pageX < 2); + } + });*/ + } + + function handleIEOuterClick(evt) { + if ((evt.target.tagName||'').toLowerCase() != "html") { + return; + } + if (!(evt.pageY > root.clientHeight)) { + return; + } + + // click below the body + inCallStack("handleOuterClick", function() { + // put caret at bottom of doc + fastIncorp(11); + if (isCaret()) { // don't interfere with drag + var lastLine = rep.lines.length()-1; + var lastCol = rep.lines.atIndex(lastLine).text.length; + performSelectionChange([lastLine,lastCol],[lastLine,lastCol]); + } + }); + } + + function getClassArray(elem, optFilter) { + var bodyClasses = []; + (elem.className || '').replace(/\S+/g, function (c) { + if ((! optFilter) || (optFilter(c))) { + bodyClasses.push(c); + } + }); + return bodyClasses; + } + function setClassArray(elem, array) { + elem.className = array.join(' '); + } + function addClass(elem, className) { + var seen = false; + var cc = getClassArray(elem, function(c) { if (c == className) seen = true; return true; }); + if (! seen) { + cc.push(className); + setClassArray(elem, cc); + } + } + function removeClass(elem, className) { + var seen = false; + var cc = getClassArray(elem, function(c) { + if (c == className) { seen = true; return false; } return true; }); + if (seen) { + setClassArray(elem, cc); + } + } + function setClassPresence(elem, className, present) { + if (present) addClass(elem, className); + else removeClass(elem, className); + } + + function setup() { + doc = document; // defined as a var in scope outside + inCallStack("setup", function() { + var body = doc.getElementById("innerdocbody"); + root = body; // defined as a var in scope outside + + if (browser.mozilla) addClass(root, "mozilla"); + if (browser.safari) addClass(root, "safari"); + if (browser.msie) addClass(root, "msie"); + if (browser.msie) { + // cache CSS background images + try { + doc.execCommand("BackgroundImageCache", false, true); + } + catch (e) { + /* throws an error in some IE 6 but not others! */ + } + } + setClassPresence(root, "authorColors", true); + setClassPresence(root, "doesWrap", doesWrap); + + initDynamicCSS(); + + enforceEditability(); + + // set up dom and rep + while (root.firstChild) root.removeChild(root.firstChild); + var oneEntry = createDomLineEntry(""); + doRepLineSplice(0, rep.lines.length(), [oneEntry]); + insertDomLines(null, [oneEntry.domInfo], null); + rep.alines = Changeset.splitAttributionLines( + Changeset.makeAttribution("\n"), "\n"); + + bindTheEventHandlers(); + + }); + + scheduler.setTimeout(function() { + parent.readyFunc(); // defined in code that sets up the inner iframe + }, 0); + + isSetUp = true; + } + + function focus() { + window.focus(); + } + + function handleBlur(evt) { + if (browser.msie) { + // a fix: in IE, clicking on a control like a button outside the + // iframe can "blur" the editor, causing it to stop getting + // events, though typing still affects it(!). + setSelection(null); + } + } + + function bindEventHandler(target, type, func) { + var handler; + if ((typeof func._wrapper) != "function") { + func._wrapper = function(event) { + func(fixEvent(event || window.event || {})); + } + } + var handler = func._wrapper; + if (target.addEventListener) + target.addEventListener(type, handler, false); + else + target.attachEvent("on" + type, handler); + _teardownActions.push(function() { + unbindEventHandler(target, type, func); + }); + } + + function unbindEventHandler(target, type, func) { + var handler = func._wrapper; + if (target.removeEventListener) + target.removeEventListener(type, handler, false); + else + target.detachEvent("on" + type, handler); + } + + /*forEach(['rep', 'getCleanNodeByKey', 'getDirtyRanges', 'isNodeDirty', + 'getSelection', 'setSelection', 'updateBrowserSelectionFromRep', + 'makeRecentSet', 'resetProfiler', 'getScrollXY', 'makeIdleAction'], function (k) { + top['_'+k] = eval(k); + });*/ + + function getSelectionPointX(point) { + // doesn't work in wrap-mode + var node = point.node; + var index = point.index; + function leftOf(n) { return n.offsetLeft; } + function rightOf(n) { return n.offsetLeft + n.offsetWidth; } + if (! isNodeText(node)) { + if (index == 0) return leftOf(node); + else return rightOf(node); + } + else { + // we can get bounds of element nodes, so look for those. + // allow consecutive text nodes for robustness. + var charsToLeft = index; + var charsToRight = node.nodeValue.length - index; + var n; + for(n = node.previousSibling; n && isNodeText(n); n = n.previousSibling) + charsToLeft += n.nodeValue; + var leftEdge = (n ? rightOf(n) : leftOf(node.parentNode)); + for(n = node.nextSibling; n && isNodeText(n); n = n.nextSibling) + charsToRight += n.nodeValue; + var rightEdge = (n ? leftOf(n) : rightOf(node.parentNode)); + var frac = (charsToLeft / (charsToLeft + charsToRight)); + var pixLoc = leftEdge + frac*(rightEdge - leftEdge); + return Math.round(pixLoc); + } + } + + function getPageHeight() { + var win = outerWin; + var odoc = win.document; + if (win.innerHeight && win.scrollMaxY) return win.innerHeight + win.scrollMaxY; + else if (odoc.body.scrollHeight > odoc.body.offsetHeight) return odoc.body.scrollHeight; + else return odoc.body.offsetHeight; + } + + function getPageWidth() { + var win = outerWin; + var odoc = win.document; + if (win.innerWidth && win.scrollMaxX) return win.innerWidth + win.scrollMaxX; + else if (odoc.body.scrollWidth > odoc.body.offsetWidth) return odoc.body.scrollWidth; + else return odoc.body.offsetWidth; + } + + function getInnerHeight() { + var win = outerWin; + var odoc = win.document; + var h; + if (browser.opera) h = win.innerHeight; + else h = odoc.documentElement.clientHeight; + if (h) return h; + + // deal with case where iframe is hidden, hope that + // style.height of iframe container is set in px + return Number(editorInfo.frame.parentNode.style.height.replace(/[^0-9]/g,'') + || 0); + } + + function getInnerWidth() { + var win = outerWin; + var odoc = win.document; + return odoc.documentElement.clientWidth; + } + + function scrollNodeVerticallyIntoView(node) { + // requires element (non-text) node; + // if node extends above top of viewport or below bottom of viewport (or top of scrollbar), + // scroll it the minimum distance needed to be completely in view. + var win = outerWin; + var odoc = outerWin.document; + var distBelowTop = node.offsetTop + iframePadTop - win.scrollY; + var distAboveBottom = win.scrollY + getInnerHeight() - + (node.offsetTop +iframePadTop + node.offsetHeight); + + if (distBelowTop < 0) { + win.scrollBy(0, distBelowTop); + } + else if (distAboveBottom < 0) { + win.scrollBy(0, -distAboveBottom); + } + } + + function scrollXHorizontallyIntoView(pixelX) { + var win = outerWin; + var odoc = outerWin.document; + pixelX += iframePadLeft; + var distInsideLeft = pixelX - win.scrollX; + var distInsideRight = win.scrollX + getInnerWidth() - pixelX; + if (distInsideLeft < 0) { + win.scrollBy(distInsideLeft, 0); + } + else if (distInsideRight < 0) { + win.scrollBy(-distInsideRight+1, 0); + } + } + + function scrollSelectionIntoView() { + if (! rep.selStart) return; + fixView(); + var focusLine = (rep.selFocusAtStart ? rep.selStart[0] : rep.selEnd[0]); + scrollNodeVerticallyIntoView(rep.lines.atIndex(focusLine).lineNode); + if (! doesWrap) { + var browserSelection = getSelection(); + if (browserSelection) { + var focusPoint = (browserSelection.focusAtStart ? browserSelection.startPoint : + browserSelection.endPoint); + var selectionPointX = getSelectionPointX(focusPoint); + scrollXHorizontallyIntoView(selectionPointX); + fixView(); + } + } + } + + function getLineListType(lineNum) { + // get "list" attribute of first char of line + var aline = rep.alines[lineNum]; + if (aline) { + var opIter = Changeset.opIterator(aline); + if (opIter.hasNext()) { + return Changeset.opAttributeValue(opIter.next(), 'list', rep.apool) || ''; + } + } + return ''; + } + + function setLineListType(lineNum, listType) { + setLineListTypes([[lineNum, listType]]); + } + + function setLineListTypes(lineNumTypePairsInOrder) { + var loc = [0,0]; + var builder = Changeset.builder(rep.lines.totalWidth()); + for(var i=0;i<lineNumTypePairsInOrder.length;i++) { + var pair = lineNumTypePairsInOrder[i]; + var lineNum = pair[0]; + var listType = pair[1]; + buildKeepRange(builder, loc, (loc = [lineNum,0])); + if (getLineListType(lineNum)) { + // already a line marker + if (listType) { + // make different list type + buildKeepRange(builder, loc, (loc = [lineNum,1]), + [['list',listType]], rep.apool); + } + else { + // remove list marker + buildRemoveRange(builder, loc, (loc = [lineNum,1])); + } + } + else { + // currently no line marker + if (listType) { + // add a line marker + builder.insert('*', [['author', thisAuthor], + ['insertorder', 'first'], + ['list', listType]], rep.apool); + } + } + } + + var cs = builder.toString(); + if (! Changeset.isIdentity(cs)) { + performDocumentApplyChangeset(cs); + } + } + + function doInsertUnorderedList() { + if (! (rep.selStart && rep.selEnd)) { + return; + } + + var firstLine, lastLine; + firstLine = rep.selStart[0]; + lastLine = Math.max(firstLine, + rep.selEnd[0] - ((rep.selEnd[1] == 0) ? 1 : 0)); + + var allLinesAreList = true; + for(var n=firstLine;n<=lastLine;n++) { + if (! getLineListType(n)) { + allLinesAreList = false; + break; + } + } + + var mods = []; + for(var n=firstLine;n<=lastLine;n++) { + var t = getLineListType(n); + mods.push([n, allLinesAreList ? '' : (t ? t : 'bullet1')]); + } + setLineListTypes(mods); + } + + var mozillaFakeArrows = (browser.mozilla && (function() { + // In Firefox 2, arrow keys are unstable while DOM-manipulating + // operations are going on. Specifically, if an operation + // (computation that ties up the event queue) is going on (in the + // call-stack of some event, like a timeout) that at some point + // mutates nodes involved in the selection, then the arrow + // keypress may (randomly) move the caret to the beginning or end + // of the document. If the operation also mutates the selection + // range, the old selection or the new selection may be used, or + // neither. + + // As long as the arrow is pressed during the busy operation, it + // doesn't seem to matter that the keydown and keypress events + // aren't generated until afterwards, or that the arrow movement + // can still be stopped (meaning it hasn't been performed yet); + // Firefox must be preserving some old information about the + // selection or the DOM from when the key was initially pressed. + // However, it also doesn't seem to matter when the key was + // actually pressed relative to the time of the mutation within + // the prolonged operation. Also, even in very controlled tests + // (like a mutation followed by a long period of busyWaiting), the + // problem shows up often but not every time, with no discernable + // pattern. Who knows, it could have something to do with the + // caret-blinking timer, or DOM changes not being applied + // immediately. + + // This problem, mercifully, does not show up at all in IE or + // Safari. My solution is to have my own, full-featured arrow-key + // implementation for Firefox. + + // Note that the problem addressed here is potentially very subtle, + // especially if the operation is quick and is timed to usually happen + // when the user is idle. + + // features: + // - 'up' and 'down' arrows preserve column when passing through shorter lines + // - shift-arrows extend the "focus" point, which may be start or end of range + // - the focus point is kept horizontally and vertically scrolled into view + // - arrows without shift cause caret to move to beginning or end of selection (left,right) + // or move focus point up or down a line (up,down) + // - command-(left,right,up,down) on Mac acts like (line-start, line-end, doc-start, doc-end) + // - takes wrapping into account when doesWrap is true, i.e. up-arrow and down-arrow move + // between the virtual lines within a wrapped line; this was difficult, and unfortunately + // requires mutating the DOM to get the necessary information + + var savedFocusColumn = 0; // a value of 0 has no effect + var updatingSelectionNow = false; + + function getVirtualLineView(lineNum) { + var lineNode = rep.lines.atIndex(lineNum).lineNode; + while (lineNode.firstChild && isBlockElement(lineNode.firstChild)) { + lineNode = lineNode.firstChild; + } + return makeVirtualLineView(lineNode); + } + + function markerlessLineAndChar(line, chr) { + return [line, chr - rep.lines.atIndex(line).lineMarker]; + } + function markerfulLineAndChar(line, chr) { + return [line, chr + rep.lines.atIndex(line).lineMarker]; + } + + return { + notifySelectionChanged: function() { + if (! updatingSelectionNow) { + savedFocusColumn = 0; + } + }, + handleKeyEvent: function(evt) { + // returns "true" if handled + if (evt.type != "keypress") return false; + var keyCode = evt.keyCode; + if (keyCode < 37 || keyCode > 40) return false; + incorporateUserChanges(); + + if (!(rep.selStart && rep.selEnd)) return true; + + // {byWord,toEnd,normal} + var moveMode = (evt.altKey ? "byWord" : + (evt.ctrlKey ? "byWord" : + (evt.metaKey ? "toEnd" : + "normal"))); + + var anchorCaret = + markerlessLineAndChar(rep.selStart[0], rep.selStart[1]); + var focusCaret = + markerlessLineAndChar(rep.selEnd[0], rep.selEnd[1]); + var wasCaret = isCaret(); + if (rep.selFocusAtStart) { + var tmp = anchorCaret; anchorCaret = focusCaret; focusCaret = tmp; + } + var K_UP = 38, K_DOWN = 40, K_LEFT = 37, K_RIGHT = 39; + var dontMove = false; + if (wasCaret && ! evt.shiftKey) { + // collapse, will mutate both together + anchorCaret = focusCaret; + } + else if ((! wasCaret) && (! evt.shiftKey)) { + if (keyCode == K_LEFT) { + // place caret at beginning + if (rep.selFocusAtStart) anchorCaret = focusCaret; + else focusCaret = anchorCaret; + if (moveMode == "normal") dontMove = true; + } + else if (keyCode == K_RIGHT) { + // place caret at end + if (rep.selFocusAtStart) focusCaret = anchorCaret; + else anchorCaret = focusCaret; + if (moveMode == "normal") dontMove = true; + } + else { + // collapse, will mutate both together + anchorCaret = focusCaret; + } + } + if (! dontMove) { + function lineLength(i) { + var entry = rep.lines.atIndex(i); + return entry.text.length - entry.lineMarker; + } + function lineText(i) { + var entry = rep.lines.atIndex(i); + return entry.text.substring(entry.lineMarker); + } + + if (keyCode == K_UP || keyCode == K_DOWN) { + var up = (keyCode == K_UP); + var canChangeLines = ((up && focusCaret[0]) || + ((!up) && focusCaret[0] < rep.lines.length()-1)); + var virtualLineView, virtualLineSpot, canChangeVirtualLines = false; + if (doesWrap) { + virtualLineView = getVirtualLineView(focusCaret[0]); + virtualLineSpot = virtualLineView.getVLineAndOffsetForChar(focusCaret[1]); + canChangeVirtualLines = ((up && virtualLineSpot.vline > 0) || + ((!up) && virtualLineSpot.vline < ( + virtualLineView.getNumVirtualLines() - 1))); + } + var newColByVirtualLineChange; + if (moveMode == "toEnd") { + if (up) { + focusCaret[0] = 0; + focusCaret[1] = 0; + } + else { + focusCaret[0] = rep.lines.length()-1; + focusCaret[1] = lineLength(focusCaret[0]); + } + } + else if (moveMode == "byWord") { + // move by "paragraph", a feature that Firefox lacks but IE and Safari both have + if (up) { + if (focusCaret[1] == 0 && canChangeLines) { + focusCaret[0]--; + focusCaret[1] = 0; + } + else focusCaret[1] = 0; + } + else { + var lineLen = lineLength(focusCaret[0]); + if (browser.windows) { + if (canChangeLines) { + focusCaret[0]++; + focusCaret[1] = 0; + } + else { + focusCaret[1] = lineLen; + } + } + else { + if (focusCaret[1] == lineLen && canChangeLines) { + focusCaret[0]++; + focusCaret[1] = lineLength(focusCaret[0]); + } + else { + focusCaret[1] = lineLen; + } + } + } + savedFocusColumn = 0; + } + else if (canChangeVirtualLines) { + var vline = virtualLineSpot.vline; + var offset = virtualLineSpot.offset; + if (up) vline--; + else vline++; + if (savedFocusColumn > offset) offset = savedFocusColumn; + else { + savedFocusColumn = offset; + } + var newSpot = virtualLineView.getCharForVLineAndOffset(vline, offset); + focusCaret[1] = newSpot.lineChar; + } + else if (canChangeLines) { + if (up) focusCaret[0]--; + else focusCaret[0]++; + var offset = focusCaret[1]; + if (doesWrap) { + offset = virtualLineSpot.offset; + } + if (savedFocusColumn > offset) offset = savedFocusColumn; + else { + savedFocusColumn = offset; + } + if (doesWrap) { + var newLineView = getVirtualLineView(focusCaret[0]); + var vline = (up ? newLineView.getNumVirtualLines()-1 : 0); + var newSpot = newLineView.getCharForVLineAndOffset(vline, offset); + focusCaret[1] = newSpot.lineChar; + } + else { + var lineLen = lineLength(focusCaret[0]); + if (offset > lineLen) offset = lineLen; + focusCaret[1] = offset; + } + } + else { + if (up) focusCaret[1] = 0; + else focusCaret[1] = lineLength(focusCaret[0]); + savedFocusColumn = 0; + } + } + else if (keyCode == K_LEFT || keyCode == K_RIGHT) { + var left = (keyCode == K_LEFT); + if (left) { + if (moveMode == "toEnd") focusCaret[1] = 0; + else if (focusCaret[1] > 0) { + if (moveMode == "byWord") { + focusCaret[1] = moveByWordInLine(lineText(focusCaret[0]), focusCaret[1], false); + } + else { + focusCaret[1]--; + } + } + else if (focusCaret[0] > 0) { + focusCaret[0]--; + focusCaret[1] = lineLength(focusCaret[0]); + if (moveMode == "byWord") { + focusCaret[1] = moveByWordInLine(lineText(focusCaret[0]), focusCaret[1], false); + } + } + } + else { + var lineLen = lineLength(focusCaret[0]); + if (moveMode == "toEnd") focusCaret[1] = lineLen; + else if (focusCaret[1] < lineLen) { + if (moveMode == "byWord") { + focusCaret[1] = moveByWordInLine(lineText(focusCaret[0]), focusCaret[1], true); + } + else { + focusCaret[1]++; + } + } + else if (focusCaret[0] < rep.lines.length()-1) { + focusCaret[0]++; + focusCaret[1] = 0; + if (moveMode == "byWord") { + focusCaret[1] = moveByWordInLine(lineText(focusCaret[0]), focusCaret[1], true); + } + } + } + savedFocusColumn = 0; + } + } + + var newSelFocusAtStart = ((focusCaret[0] < anchorCaret[0]) || + (focusCaret[0] == anchorCaret[0] && + focusCaret[1] < anchorCaret[1])); + var newSelStart = (newSelFocusAtStart ? focusCaret : anchorCaret); + var newSelEnd = (newSelFocusAtStart ? anchorCaret : focusCaret); + updatingSelectionNow = true; + performSelectionChange(markerfulLineAndChar(newSelStart[0], + newSelStart[1]), + markerfulLineAndChar(newSelEnd[0], + newSelEnd[1]), + newSelFocusAtStart); + updatingSelectionNow = false; + currentCallStack.userChangedSelection = true; + return true; + } + }; + })()); + + + // stolen from jquery-1.2.1 + function fixEvent(event) { + // store a copy of the original event object + // and clone to set read-only properties + var originalEvent = event; + event = extend({}, originalEvent); + + // add preventDefault and stopPropagation since + // they will not work on the clone + event.preventDefault = function() { + // if preventDefault exists run it on the original event + if (originalEvent.preventDefault) + originalEvent.preventDefault(); + // otherwise set the returnValue property of the original event to false (IE) + originalEvent.returnValue = false; + }; + event.stopPropagation = function() { + // if stopPropagation exists run it on the original event + if (originalEvent.stopPropagation) + originalEvent.stopPropagation(); + // otherwise set the cancelBubble property of the original event to true (IE) + originalEvent.cancelBubble = true; + }; + + // Fix target property, if necessary + if ( !event.target && event.srcElement ) + event.target = event.srcElement; + + // check if target is a textnode (safari) + if (browser.safari && event.target.nodeType == 3) + event.target = originalEvent.target.parentNode; + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) + event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var e = document.documentElement, b = document.body; + event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft || 0); + event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop || 0); + } + + // Add which for key events + if ( !event.which && (event.charCode || event.keyCode) ) + event.which = event.charCode || event.keyCode; + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) + event.metaKey = event.ctrlKey; + + // Add which for click: 1 == left; 2 == middle; 3 == right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button ) + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + + return event; + } + + var lineNumbersShown; + var sideDivInner; + function initLineNumbers() { + lineNumbersShown = 1; + sideDiv.innerHTML = + '<table border="0" cellpadding="0" cellspacing="0" align="right">'+ + '<tr><td id="sidedivinner"><div>1</div></td></tr></table>'; + sideDivInner = outerWin.document.getElementById("sidedivinner"); + } + + function updateLineNumbers() { + var newNumLines = rep.lines.length(); + if (newNumLines < 1) newNumLines = 1; + if (newNumLines != lineNumbersShown) { + var container = sideDivInner; + var odoc = outerWin.document; + while (lineNumbersShown < newNumLines) { + lineNumbersShown++; + var n = lineNumbersShown; + var div = odoc.createElement("DIV"); + div.appendChild(odoc.createTextNode(String(n))); + container.appendChild(div); + } + while (lineNumbersShown > newNumLines) { + container.removeChild(container.lastChild); + lineNumbersShown--; + } + } + + if (currentCallStack && currentCallStack.domClean) { + var a = sideDivInner.firstChild; + var b = doc.body.firstChild; + while (a && b) { + var h = (b.clientHeight || b.offsetHeight); + if (b.nextSibling) { + // when text is zoomed in mozilla, divs have fractional + // heights (though the properties are always integers) + // and the line-numbers don't line up unless we pay + // attention to where the divs are actually placed... + // (also: padding on TTs/SPANs in IE...) + h = b.nextSibling.offsetTop - b.offsetTop; + } + if (h) { + var hpx = h+"px"; + if (a.style.height != hpx) + a.style.height = hpx; + } + a = a.nextSibling; + b = b.nextSibling; + } + + // fix if first line has margin (f.e. h1 in first line) + sideDivInner.firstChild.style.marginTop = + (doc.body.firstChild.offsetTop - sideDivInner.firstChild.offsetTop + + parseInt(sideDivInner.firstChild.style.marginTop + "0")) + "px"; + } + } + +}; + +OUTER(this); diff --git a/infrastructure/ace/www/ace2_outer.js b/infrastructure/ace/www/ace2_outer.js new file mode 100644 index 0000000..f947534 --- /dev/null +++ b/infrastructure/ace/www/ace2_outer.js @@ -0,0 +1,234 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// requires: top +// requires: plugins +// requires: undefined + + +Ace2Editor.registry = { nextId: 1 }; + +function Ace2Editor() { + var thisFunctionsName = "Ace2Editor"; + var ace2 = Ace2Editor; + + var editor = {}; + var info = { editor: editor, id: (ace2.registry.nextId++) }; + var loaded = false; + + var actionsPendingInit = []; + function pendingInit(func, optDoNow) { + return function() { + var that = this; + var args = arguments; + function action() { + func.apply(that, args); + } + if (optDoNow) { + optDoNow.apply(that, args); + } + if (loaded) { + action(); + } + else { + actionsPendingInit.push(action); + } + }; + } + function doActionsPendingInit() { + for(var i=0;i<actionsPendingInit.length;i++) { + actionsPendingInit[i](); + } + actionsPendingInit = []; + } + + ace2.registry[info.id] = info; + + editor.importText = pendingInit(function(newCode, undoable) { + info.ace_importText(newCode, undoable); }); + editor.importAText = pendingInit(function(newCode, apoolJsonObj, undoable) { + info.ace_importAText(newCode, apoolJsonObj, undoable); }); + editor.exportText = function() { + if (! loaded) return "(awaiting init)\n"; + return info.ace_exportText(); + }; + editor.getFrame = function() { return info.frame || null; }; + editor.focus = pendingInit(function() { info.ace_focus(); }); + editor.adjustSize = pendingInit(function() { + var frameParent = info.frame.parentNode; + var parentHeight = frameParent.clientHeight; + // deal with case where iframe is hidden, no clientHeight + info.frame.style.height = (parentHeight ? parentHeight+"px" : + frameParent.style.height); + info.ace_editorChangedSize(); + }); + editor.setEditable = pendingInit(function(newVal) { info.ace_setEditable(newVal); }); + editor.getFormattedCode = function() { return info.ace_getFormattedCode(); }; + editor.setOnKeyPress = pendingInit(function (handler) { info.ace_setOnKeyPress(handler); }); + editor.setOnKeyDown = pendingInit(function (handler) { info.ace_setOnKeyDown(handler); }); + editor.setNotifyDirty = pendingInit(function (handler) { info.ace_setNotifyDirty(handler); }); + + editor.setProperty = pendingInit(function(key, value) { info.ace_setProperty(key, value); }); + editor.getDebugProperty = function(prop) { return info.ace_getDebugProperty(prop); }; + + editor.setBaseText = pendingInit(function(txt) { info.ace_setBaseText(txt); }); + editor.setBaseAttributedText = pendingInit(function(atxt, apoolJsonObj) { + info.ace_setBaseAttributedText(atxt, apoolJsonObj); }); + editor.applyChangesToBase = pendingInit(function (changes, optAuthor,apoolJsonObj) { + info.ace_applyChangesToBase(changes, optAuthor, apoolJsonObj); }); + // prepareUserChangeset: + // Returns null if no new changes or ACE not ready. Otherwise, bundles up all user changes + // to the latest base text into a Changeset, which is returned (as a string if encodeAsString). + // If this method returns a truthy value, then applyPreparedChangesetToBase can be called + // at some later point to consider these changes part of the base, after which prepareUserChangeset + // must be called again before applyPreparedChangesetToBase. Multiple consecutive calls + // to prepareUserChangeset will return an updated changeset that takes into account the + // latest user changes, and modify the changeset to be applied by applyPreparedChangesetToBase + // accordingly. + editor.prepareUserChangeset = function() { + if (! loaded) return null; + return info.ace_prepareUserChangeset(); + }; + editor.applyPreparedChangesetToBase = pendingInit( + function() { info.ace_applyPreparedChangesetToBase(); }); + editor.setUserChangeNotificationCallback = pendingInit(function(callback) { + info.ace_setUserChangeNotificationCallback(callback); + }); + editor.setAuthorInfo = pendingInit(function(author, authorInfo) { + info.ace_setAuthorInfo(author, authorInfo); + }); + editor.setAuthorSelectionRange = pendingInit(function(author, start, end) { + info.ace_setAuthorSelectionRange(author, start, end); + }); + + editor.getUnhandledErrors = function() { + if (! loaded) return []; + // returns array of {error: <browser Error object>, time: +new Date()} + return info.ace_getUnhandledErrors(); + }; + editor.execCommand = pendingInit(function(cmd, arg1) { + info.ace_execCommand(cmd, arg1); + }); + + // calls to these functions ($$INCLUDE_...) are replaced when this file is processed + // and compressed, putting the compressed code from the named file directly into the + // source here. + + var $$INCLUDE_CSS = function(fileName) { + return '<link rel="stylesheet" type="text/css" href="'+fileName+'"/>'; + }; + var $$INCLUDE_JS = function(fileName) { + return '\x3cscript type="text/javascript" src="'+fileName+'">\x3c/script>'; + }; + var $$INCLUDE_JS_DEV = $$INCLUDE_JS; + var $$INCLUDE_CSS_DEV = $$INCLUDE_CSS; + + var $$INCLUDE_CSS_Q = function(fileName) { + return '\'<link rel="stylesheet" type="text/css" href="'+fileName+'"/>\''; + }; + var $$INCLUDE_JS_Q = function(fileName) { + return '\'\\x3cscript type="text/javascript" src="'+fileName+'">\\x3c/script>\''; + }; + var $$INCLUDE_JS_Q_DEV = $$INCLUDE_JS_Q; + var $$INCLUDE_CSS_Q_DEV = $$INCLUDE_CSS_Q; + + editor.destroy = pendingInit(function() { + info.ace_dispose(); + info.frame.parentNode.removeChild(info.frame); + delete ace2.registry[info.id]; + info = null; // prevent IE 6 closure memory leaks + }); + + editor.init = function(containerId, initialCode, doneFunc) { + + editor.importText(initialCode); + + info.onEditorReady = function() { + loaded = true; + doActionsPendingInit(); + doneFunc(); + }; + + (function() { + var doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '+ + '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; + + var iframeHTML = ["'"+doctype+"<html><head>'"]; + + plugins.callHook( + "aceInitInnerdocbodyHead", {iframeHTML:iframeHTML}); + + // these lines must conform to a specific format because they are passed by the build script: + iframeHTML.push($$INCLUDE_CSS_Q("editor.css syntax.css inner.css")); + //iframeHTML.push(INCLUDE_JS_Q_DEV("ace2_common_dev.js")); + //iframeHTML.push(INCLUDE_JS_Q_DEV("profiler.js")); + iframeHTML.push($$INCLUDE_JS_Q("ace2_common.js skiplist.js virtual_lines.js easysync2.js cssmanager.js colorutils.js undomodule.js contentcollector.js changesettracker.js linestylefilter.js domline.js")); + iframeHTML.push($$INCLUDE_JS_Q("ace2_inner.js")); + iframeHTML.push('\'\\n<style type="text/css" title="dynamicsyntax"></style>\\n\''); + iframeHTML.push('\'</head><body id="innerdocbody" class="syntax" spellcheck="false"> </body></html>\''); + + var outerScript = 'editorId = "'+info.id+'"; editorInfo = parent.'+ + thisFunctionsName+'.registry[editorId]; '+ + 'window.onload = function() '+ + '{ window.onload = null; setTimeout'+ + '(function() '+ + '{ var iframe = document.createElement("IFRAME"); '+ + 'iframe.scrolling = "no"; var outerdocbody = document.getElementById("outerdocbody"); '+ + 'iframe.frameBorder = 0; iframe.allowTransparency = true; '+ // for IE + 'outerdocbody.insertBefore(iframe, outerdocbody.firstChild); '+ + 'iframe.ace_outerWin = window; '+ + 'readyFunc = function() { editorInfo.onEditorReady(); readyFunc = null; editorInfo = null; }; '+ + 'var doc = iframe.contentWindow.document; doc.open(); doc.write('+ + iframeHTML.join('+')+'); doc.close(); '+ + '}, 0); }'; + + var outerHTML = [doctype, '<html><head>', + $$INCLUDE_CSS("editor.css"), + // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly + // (throbs busy while typing) + '<link rel="stylesheet" type="text/css" href="data:text/css,"/>', + '\x3cscript>', outerScript, '\x3c/script>', + '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>']; + + + if (!Array.prototype.map) Array.prototype.map = function(fun) { //needed for IE + if (typeof fun != "function") throw new TypeError(); + var len = this.length; + var res = new Array(len); + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in this) res[i] = fun.call(thisp, this[i], i, this); + } + return res; + }; + + var outerFrame = document.createElement("IFRAME"); + outerFrame.frameBorder = 0; // for IE + info.frame = outerFrame; + document.getElementById(containerId).appendChild(outerFrame); + + var editorDocument = outerFrame.contentWindow.document; + + editorDocument.open(); + editorDocument.write(outerHTML.join('')); + editorDocument.close(); + + editor.adjustSize(); + })(); + }; + + return editor; +} diff --git a/trunk/infrastructure/ace/www/ace2_wrapper.js b/infrastructure/ace/www/ace2_wrapper.js index b62e09d..b62e09d 100644 --- a/trunk/infrastructure/ace/www/ace2_wrapper.js +++ b/infrastructure/ace/www/ace2_wrapper.js diff --git a/trunk/infrastructure/ace/www/bbtree.js b/infrastructure/ace/www/bbtree.js index 70cb8c0..70cb8c0 100644 --- a/trunk/infrastructure/ace/www/bbtree.js +++ b/infrastructure/ace/www/bbtree.js diff --git a/trunk/infrastructure/ace/www/changesettracker.js b/infrastructure/ace/www/changesettracker.js index d6fe018..d6fe018 100644 --- a/trunk/infrastructure/ace/www/changesettracker.js +++ b/infrastructure/ace/www/changesettracker.js diff --git a/trunk/infrastructure/ace/www/colorutils.js b/infrastructure/ace/www/colorutils.js index bb61de3..bb61de3 100644 --- a/trunk/infrastructure/ace/www/colorutils.js +++ b/infrastructure/ace/www/colorutils.js diff --git a/trunk/infrastructure/ace/www/contentcollector.js b/infrastructure/ace/www/contentcollector.js index 573672e..573672e 100644 --- a/trunk/infrastructure/ace/www/contentcollector.js +++ b/infrastructure/ace/www/contentcollector.js diff --git a/trunk/infrastructure/ace/www/cssmanager.js b/infrastructure/ace/www/cssmanager.js index a5c549b..a5c549b 100644 --- a/trunk/infrastructure/ace/www/cssmanager.js +++ b/infrastructure/ace/www/cssmanager.js diff --git a/trunk/infrastructure/ace/www/dev.html b/infrastructure/ace/www/dev.html index 0a9768e..0a9768e 100644 --- a/trunk/infrastructure/ace/www/dev.html +++ b/infrastructure/ace/www/dev.html diff --git a/infrastructure/ace/www/domline.js b/infrastructure/ace/www/domline.js new file mode 100644 index 0000000..f1d19e4 --- /dev/null +++ b/infrastructure/ace/www/domline.js @@ -0,0 +1,232 @@ +// THIS FILE IS ALSO AN APPJET MODULE: etherpad.collab.ace.domline +// %APPJET%: import("etherpad.admin.plugins"); + +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// requires: top +// requires: plugins +// requires: undefined + +var domline = {}; +domline.noop = function() {}; +domline.identity = function(x) { return x; }; + +domline.addToLineClass = function(lineClass, cls) { + // an "empty span" at any point can be used to add classes to + // the line, using line:className. otherwise, we ignore + // the span. + cls.replace(/\S+/g, function (c) { + if (c.indexOf("line:") == 0) { + // add class to line + lineClass = (lineClass ? lineClass+' ' : '')+c.substring(5); + } + }); + return lineClass; +} + +// if "document" is falsy we don't create a DOM node, just +// an object with innerHTML and className +domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { + var result = { node: null, + appendSpan: domline.noop, + prepareForAdd: domline.noop, + notifyAdded: domline.noop, + clearSpans: domline.noop, + finishUpdate: domline.noop, + lineMarker: 0 }; + + var browser = (optBrowser || {}); + var document = optDocument; + + if (document) { + result.node = document.createElement("div"); + } + else { + result.node = {innerHTML: '', className: ''}; + } + + var html = []; + var preHtml, postHtml; + var curHTML = null; + function processSpaces(s) { + return domline.processSpaces(s, doesWrap); + } + var identity = domline.identity; + var perTextNodeProcess = (doesWrap ? identity : processSpaces); + var perHtmlLineProcess = (doesWrap ? processSpaces : identity); + var lineClass = 'ace-line'; + result.appendSpan = function(txt, cls) { + if (cls.indexOf('list') >= 0) { + var listType = /(?:^| )list:(\S+)/.exec(cls); + if (listType) { + listType = listType[1]; + if (listType) { + preHtml = '<ul class="list-'+listType+'"><li>'; + postHtml = '</li></ul>'; + } + result.lineMarker += txt.length; + return; // don't append any text + } + } + var href = null; + var simpleTags = null; + if (cls.indexOf('url') >= 0) { + cls = cls.replace(/(^| )url:(\S+)/g, function(x0, space, url) { + href = url; + return space+"url"; + }); + } + if (cls.indexOf('tag') >= 0) { + cls = cls.replace(/(^| )tag:(\S+)/g, function(x0, space, tag) { + if (! simpleTags) simpleTags = []; + simpleTags.push(tag.toLowerCase()); + return space+tag; + }); + } + + var extraOpenTags = ""; + var extraCloseTags = ""; + + var plugins_; + if (typeof(plugins)!='undefined') { + plugins_ = plugins; + } else { + plugins_ = parent.parent.plugins; + } + + plugins_.callHook( + "aceCreateDomLine", {domline:domline, cls:cls} + ).map(function (modifier) { + cls = modifier.cls; + extraOpenTags = extraOpenTags+modifier.extraOpenTags; + extraCloseTags = modifier.extraCloseTags+extraCloseTags; + }); + + if ((! txt) && cls) { + lineClass = domline.addToLineClass(lineClass, cls); + } + else if (txt) { + if (href) { + extraOpenTags = extraOpenTags+'<a href="'+ + href.replace(/\"/g, '"')+'">'; + extraCloseTags = '</a>'+extraCloseTags; + } + if (simpleTags) { + simpleTags.sort(); + extraOpenTags = extraOpenTags+'<'+simpleTags.join('><')+'>'; + simpleTags.reverse(); + extraCloseTags = '</'+simpleTags.join('></')+'>'+extraCloseTags; + } + html.push('<span class="',cls||'','">',extraOpenTags, + perTextNodeProcess(domline.escapeHTML(txt)), + extraCloseTags,'</span>'); + } + }; + result.clearSpans = function() { + html = []; + lineClass = ''; // non-null to cause update + result.lineMarker = 0; + }; + function writeHTML() { + var newHTML = perHtmlLineProcess(html.join('')); + if (! newHTML) { + if ((! document) || (! optBrowser)) { + newHTML += ' '; + } + else if (! browser.msie) { + newHTML += '<br/>'; + } + } + if (nonEmpty) { + newHTML = (preHtml||'')+newHTML+(postHtml||''); + } + html = preHtml = postHtml = null; // free memory + if (newHTML !== curHTML) { + curHTML = newHTML; + result.node.innerHTML = curHTML; + } + if (lineClass !== null) result.node.className = lineClass; + } + result.prepareForAdd = writeHTML; + result.finishUpdate = writeHTML; + result.getInnerHTML = function() { return curHTML || ''; }; + + return result; +}; + +domline.escapeHTML = function(s) { + var re = /[&<>'"]/g; /']/; // stupid indentation thing + if (! re.MAP) { + // persisted across function calls! + re.MAP = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + } + return s.replace(re, function(c) { return re.MAP[c]; }); +}; + +domline.processSpaces = function(s, doesWrap) { + if (s.indexOf("<") < 0 && ! doesWrap) { + // short-cut + return s.replace(/ /g, ' '); + } + var parts = []; + s.replace(/<[^>]*>?| |[^ <]+/g, function(m) { parts.push(m); }); + if (doesWrap) { + var endOfLine = true; + var beforeSpace = false; + // last space in a run is normal, others are nbsp, + // end of line is nbsp + for(var i=parts.length-1;i>=0;i--) { + var p = parts[i]; + if (p == " ") { + if (endOfLine || beforeSpace) + parts[i] = ' '; + endOfLine = false; + beforeSpace = true; + } + else if (p.charAt(0) != "<") { + endOfLine = false; + beforeSpace = false; + } + } + // beginning of line is nbsp + for(var i=0;i<parts.length;i++) { + var p = parts[i]; + if (p == " ") { + parts[i] = ' '; + break; + } + else if (p.charAt(0) != "<") { + break; + } + } + } + else { + for(var i=0;i<parts.length;i++) { + var p = parts[i]; + if (p == " ") { + parts[i] = ' '; + } + } + } + return parts.join(''); +}; diff --git a/trunk/infrastructure/ace/www/easy_sync.js b/infrastructure/ace/www/easy_sync.js index 86a4327..86a4327 100644 --- a/trunk/infrastructure/ace/www/easy_sync.js +++ b/infrastructure/ace/www/easy_sync.js diff --git a/trunk/infrastructure/ace/www/easysync2.js b/infrastructure/ace/www/easysync2.js index efc5b99..efc5b99 100644 --- a/trunk/infrastructure/ace/www/easysync2.js +++ b/infrastructure/ace/www/easysync2.js diff --git a/trunk/infrastructure/ace/www/easysync2_tests.js b/infrastructure/ace/www/easysync2_tests.js index 2fcf202..2fcf202 100644 --- a/trunk/infrastructure/ace/www/easysync2_tests.js +++ b/infrastructure/ace/www/easysync2_tests.js diff --git a/trunk/infrastructure/ace/www/editor.css b/infrastructure/ace/www/editor.css index 9df127d..9df127d 100644 --- a/trunk/infrastructure/ace/www/editor.css +++ b/infrastructure/ace/www/editor.css diff --git a/trunk/infrastructure/ace/www/firebug/errorIcon.png b/infrastructure/ace/www/firebug/errorIcon.png Binary files differindex 2d75261..2d75261 100644 --- a/trunk/infrastructure/ace/www/firebug/errorIcon.png +++ b/infrastructure/ace/www/firebug/errorIcon.png diff --git a/trunk/infrastructure/ace/www/firebug/firebug.css b/infrastructure/ace/www/firebug/firebug.css index 1f041c4..1f041c4 100644 --- a/trunk/infrastructure/ace/www/firebug/firebug.css +++ b/infrastructure/ace/www/firebug/firebug.css diff --git a/trunk/infrastructure/ace/www/firebug/firebug.html b/infrastructure/ace/www/firebug/firebug.html index 861e639..861e639 100644 --- a/trunk/infrastructure/ace/www/firebug/firebug.html +++ b/infrastructure/ace/www/firebug/firebug.html diff --git a/trunk/infrastructure/ace/www/firebug/firebug.js b/infrastructure/ace/www/firebug/firebug.js index d3c1978..d3c1978 100644 --- a/trunk/infrastructure/ace/www/firebug/firebug.js +++ b/infrastructure/ace/www/firebug/firebug.js diff --git a/trunk/infrastructure/ace/www/firebug/firebugx.js b/infrastructure/ace/www/firebug/firebugx.js index b2cc49c..b2cc49c 100644 --- a/trunk/infrastructure/ace/www/firebug/firebugx.js +++ b/infrastructure/ace/www/firebug/firebugx.js diff --git a/trunk/infrastructure/ace/www/firebug/infoIcon.png b/infrastructure/ace/www/firebug/infoIcon.png Binary files differindex da1e533..da1e533 100644 --- a/trunk/infrastructure/ace/www/firebug/infoIcon.png +++ b/infrastructure/ace/www/firebug/infoIcon.png diff --git a/trunk/infrastructure/ace/www/firebug/warningIcon.png b/infrastructure/ace/www/firebug/warningIcon.png Binary files differindex de51084..de51084 100644 --- a/trunk/infrastructure/ace/www/firebug/warningIcon.png +++ b/infrastructure/ace/www/firebug/warningIcon.png diff --git a/trunk/infrastructure/ace/www/index.html b/infrastructure/ace/www/index.html index a1e6e96..a1e6e96 100644 --- a/trunk/infrastructure/ace/www/index.html +++ b/infrastructure/ace/www/index.html diff --git a/trunk/infrastructure/ace/www/inner.css b/infrastructure/ace/www/inner.css index 7479cfe..7479cfe 100644 --- a/trunk/infrastructure/ace/www/inner.css +++ b/infrastructure/ace/www/inner.css diff --git a/trunk/infrastructure/ace/www/jquery-1.2.1.js b/infrastructure/ace/www/jquery-1.2.1.js index b4eb132..b4eb132 100644 --- a/trunk/infrastructure/ace/www/jquery-1.2.1.js +++ b/infrastructure/ace/www/jquery-1.2.1.js diff --git a/trunk/infrastructure/ace/www/lang_html.js b/infrastructure/ace/www/lang_html.js index f9eff8e..f9eff8e 100644 --- a/trunk/infrastructure/ace/www/lang_html.js +++ b/infrastructure/ace/www/lang_html.js diff --git a/trunk/infrastructure/ace/www/lang_js.js b/infrastructure/ace/www/lang_js.js index 4bbc5b4..4bbc5b4 100644 --- a/trunk/infrastructure/ace/www/lang_js.js +++ b/infrastructure/ace/www/lang_js.js diff --git a/trunk/infrastructure/ace/www/lexer_support.js b/infrastructure/ace/www/lexer_support.js index 3d54f5c..3d54f5c 100644 --- a/trunk/infrastructure/ace/www/lexer_support.js +++ b/infrastructure/ace/www/lexer_support.js diff --git a/infrastructure/ace/www/linestylefilter.js b/infrastructure/ace/www/linestylefilter.js new file mode 100644 index 0000000..f772ce3 --- /dev/null +++ b/infrastructure/ace/www/linestylefilter.js @@ -0,0 +1,287 @@ +// THIS FILE IS ALSO AN APPJET MODULE: etherpad.collab.ace.linestylefilter +// %APPJET%: import("etherpad.collab.ace.easysync2.Changeset"); +// %APPJET%: import("etherpad.admin.plugins"); + +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// requires: easysync2.Changeset +// requires: top +// requires: plugins +// requires: undefined + +var linestylefilter = {}; + +linestylefilter.ATTRIB_CLASSES = { + 'bold':'tag:b', + 'italic':'tag:i', + 'underline':'tag:u', + 'strikethrough':'tag:s', + 'h1':'tag:h1', + 'h2':'tag:h2', + 'h3':'tag:h3', + 'h4':'tag:h4', + 'h5':'tag:h5', + 'h6':'tag:h6' +}; + +linestylefilter.getAuthorClassName = function(author) { + return "author-"+author.replace(/[^a-y0-9]/g, function(c) { + if (c == ".") return "-"; + return 'z'+c.charCodeAt(0)+'z'; + }); +}; + +// lineLength is without newline; aline includes newline, +// but may be falsy if lineLength == 0 +linestylefilter.getLineStyleFilter = function(lineLength, aline, + textAndClassFunc, apool) { + + if (lineLength == 0) return textAndClassFunc; + + var nextAfterAuthorColors = textAndClassFunc; + + var authorColorFunc = (function() { + var lineEnd = lineLength; + var curIndex = 0; + var extraClasses; + var leftInAuthor; + + function attribsToClasses(attribs) { + var classes = ''; + Changeset.eachAttribNumber(attribs, function(n) { + var key = apool.getAttribKey(n); + if (key) { + var value = apool.getAttribValue(n); + if (value) { + if (key == 'author') { + classes += ' '+linestylefilter.getAuthorClassName(value); + } + else if (key == 'list') { + classes += ' list:'+value; + } + else if (linestylefilter.ATTRIB_CLASSES[key]) { + classes += ' '+linestylefilter.ATTRIB_CLASSES[key]; + } + } + } + }); + return classes.substring(1); + } + + var attributionIter = Changeset.opIterator(aline); + var nextOp, nextOpClasses; + function goNextOp() { + nextOp = attributionIter.next(); + nextOpClasses = (nextOp.opcode && attribsToClasses(nextOp.attribs)); + } + goNextOp(); + function nextClasses() { + if (curIndex < lineEnd) { + extraClasses = nextOpClasses; + leftInAuthor = nextOp.chars; + goNextOp(); + while (nextOp.opcode && nextOpClasses == extraClasses) { + leftInAuthor += nextOp.chars; + goNextOp(); + } + } + } + nextClasses(); + + return function(txt, cls) { + while (txt.length > 0) { + if (leftInAuthor <= 0) { + // prevent infinite loop if something funny's going on + return nextAfterAuthorColors(txt, cls); + } + var spanSize = txt.length; + if (spanSize > leftInAuthor) { + spanSize = leftInAuthor; + } + var curTxt = txt.substring(0, spanSize); + txt = txt.substring(spanSize); + nextAfterAuthorColors(curTxt, (cls&&cls+" ")+extraClasses); + curIndex += spanSize; + leftInAuthor -= spanSize; + if (leftInAuthor == 0) { + nextClasses(); + } + } + }; + })(); + return authorColorFunc; +}; + +linestylefilter.getAtSignSplitterFilter = function(lineText, + textAndClassFunc) { + var at = /@/g; + at.lastIndex = 0; + var splitPoints = null; + var execResult; + while ((execResult = at.exec(lineText))) { + if (! splitPoints) { + splitPoints = []; + } + splitPoints.push(execResult.index); + } + + if (! splitPoints) return textAndClassFunc; + + return linestylefilter.textAndClassFuncSplitter(textAndClassFunc, + splitPoints); +}; + +linestylefilter.getRegexpFilter = function (regExp, tag) { + return function (lineText, textAndClassFunc) { + regExp.lastIndex = 0; + var regExpMatchs = null; + var splitPoints = null; + var execResult; + while ((execResult = regExp.exec(lineText))) { + if (! regExpMatchs) { + regExpMatchs = []; + splitPoints = []; + } + var startIndex = execResult.index; + var regExpMatch = execResult[0]; + regExpMatchs.push([startIndex, regExpMatch]); + splitPoints.push(startIndex, startIndex + regExpMatch.length); + } + + if (! regExpMatchs) return textAndClassFunc; + + function regExpMatchForIndex(idx) { + for(var k=0; k<regExpMatchs.length; k++) { + var u = regExpMatchs[k]; + if (idx >= u[0] && idx < u[0]+u[1].length) { + return u[1]; + } + } + return false; + } + + var handleRegExpMatchsAfterSplit = (function() { + var curIndex = 0; + return function(txt, cls) { + var txtlen = txt.length; + var newCls = cls; + var regExpMatch = regExpMatchForIndex(curIndex); + if (regExpMatch) { + newCls += " "+tag+":"+regExpMatch; + } + textAndClassFunc(txt, newCls); + curIndex += txtlen; + }; + })(); + + return linestylefilter.textAndClassFuncSplitter(handleRegExpMatchsAfterSplit, + splitPoints); + }; +}; + + +linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/; +linestylefilter.REGEX_URLCHAR = new RegExp('('+/[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source+'|'+linestylefilter.REGEX_WORDCHAR.source+')'); +linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:)/.source+linestylefilter.REGEX_URLCHAR.source+'*(?![:.,;])'+linestylefilter.REGEX_URLCHAR.source, 'g'); +linestylefilter.getURLFilter = linestylefilter.getRegexpFilter( + linestylefilter.REGEX_URL, 'url'); + +linestylefilter.textAndClassFuncSplitter = function(func, splitPointsOpt) { + var nextPointIndex = 0; + var idx = 0; + + // don't split at 0 + while (splitPointsOpt && + nextPointIndex < splitPointsOpt.length && + splitPointsOpt[nextPointIndex] == 0) { + nextPointIndex++; + } + + function spanHandler(txt, cls) { + if ((! splitPointsOpt) || nextPointIndex >= splitPointsOpt.length) { + func(txt, cls); + idx += txt.length; + } + else { + var splitPoints = splitPointsOpt; + var pointLocInSpan = splitPoints[nextPointIndex] - idx; + var txtlen = txt.length; + if (pointLocInSpan >= txtlen) { + func(txt, cls); + idx += txt.length; + if (pointLocInSpan == txtlen) { + nextPointIndex++; + } + } + else { + if (pointLocInSpan > 0) { + func(txt.substring(0, pointLocInSpan), cls); + idx += pointLocInSpan; + } + nextPointIndex++; + // recurse + spanHandler(txt.substring(pointLocInSpan), cls); + } + } + } + return spanHandler; +}; + +linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser) { + var func = linestylefilter.getURLFilter(lineText, textAndClassFunc); + + var plugins_; + if (typeof(plugins)!='undefined') { + plugins_ = plugins; + } else { + plugins_ = parent.parent.plugins; + } + + var hookFilters = plugins_.callHook( + "aceGetFilterStack", {linestylefilter:linestylefilter, browser:browser}); + hookFilters.map(function (hookFilter) { + func = hookFilter(lineText, func); + }); + + if (browser !== undefined && browser.msie) { + // IE7+ will take an e-mail address like <foo@bar.com> and linkify it to foo@bar.com. + // We then normalize it back to text with no angle brackets. It's weird. So always + // break spans at an "at" sign. + func = linestylefilter.getAtSignSplitterFilter( + lineText, func); + } + return func; +}; + +// domLineObj is like that returned by domline.createDomLine +linestylefilter.populateDomLine = function(textLine, aline, apool, + domLineObj) { + // remove final newline from text if any + var text = textLine; + if (text.slice(-1) == '\n') { + text = text.substring(0, text.length-1); + } + + function textAndClassFunc(tokenText, tokenClass) { + domLineObj.appendSpan(tokenText, tokenClass); + } + + var func = linestylefilter.getFilterStack(text, textAndClassFunc); + func = linestylefilter.getLineStyleFilter(text.length, aline, + func, apool); + func(text, ''); +}; diff --git a/trunk/infrastructure/ace/www/magicdom.js b/infrastructure/ace/www/magicdom.js index 4bad3d4..4bad3d4 100644 --- a/trunk/infrastructure/ace/www/magicdom.js +++ b/infrastructure/ace/www/magicdom.js diff --git a/trunk/infrastructure/ace/www/multilang_lexer.js b/infrastructure/ace/www/multilang_lexer.js index 9617981..9617981 100644 --- a/trunk/infrastructure/ace/www/multilang_lexer.js +++ b/infrastructure/ace/www/multilang_lexer.js diff --git a/trunk/infrastructure/ace/www/processing.js b/infrastructure/ace/www/processing.js index 988ef76..988ef76 100644 --- a/trunk/infrastructure/ace/www/processing.js +++ b/infrastructure/ace/www/processing.js diff --git a/trunk/infrastructure/ace/www/profiler.js b/infrastructure/ace/www/profiler.js index 24b68a2..24b68a2 100644 --- a/trunk/infrastructure/ace/www/profiler.js +++ b/infrastructure/ace/www/profiler.js diff --git a/trunk/infrastructure/ace/www/skiplist.js b/infrastructure/ace/www/skiplist.js index e6c2e04..e6c2e04 100644 --- a/trunk/infrastructure/ace/www/skiplist.js +++ b/infrastructure/ace/www/skiplist.js diff --git a/trunk/infrastructure/ace/www/spanlist.js b/infrastructure/ace/www/spanlist.js index 756a411..756a411 100644 --- a/trunk/infrastructure/ace/www/spanlist.js +++ b/infrastructure/ace/www/spanlist.js diff --git a/trunk/infrastructure/ace/www/syntax-new.css b/infrastructure/ace/www/syntax-new.css index 30f1823..30f1823 100644 --- a/trunk/infrastructure/ace/www/syntax-new.css +++ b/infrastructure/ace/www/syntax-new.css diff --git a/trunk/infrastructure/ace/www/syntax.css b/infrastructure/ace/www/syntax.css index e018320..e018320 100644 --- a/trunk/infrastructure/ace/www/syntax.css +++ b/infrastructure/ace/www/syntax.css diff --git a/trunk/infrastructure/ace/www/test.html b/infrastructure/ace/www/test.html index 73fa45c..73fa45c 100644 --- a/trunk/infrastructure/ace/www/test.html +++ b/infrastructure/ace/www/test.html diff --git a/trunk/infrastructure/ace/www/testcode.js b/infrastructure/ace/www/testcode.js index f393335..f393335 100644 --- a/trunk/infrastructure/ace/www/testcode.js +++ b/infrastructure/ace/www/testcode.js diff --git a/trunk/infrastructure/ace/www/toSource.js b/infrastructure/ace/www/toSource.js index bf96df7..bf96df7 100644 --- a/trunk/infrastructure/ace/www/toSource.js +++ b/infrastructure/ace/www/toSource.js diff --git a/trunk/infrastructure/ace/www/undomodule.js b/infrastructure/ace/www/undomodule.js index b8a56f9..b8a56f9 100644 --- a/trunk/infrastructure/ace/www/undomodule.js +++ b/infrastructure/ace/www/undomodule.js diff --git a/trunk/infrastructure/ace/www/virtual_lines.js b/infrastructure/ace/www/virtual_lines.js index 86e3dea..86e3dea 100644 --- a/trunk/infrastructure/ace/www/virtual_lines.js +++ b/infrastructure/ace/www/virtual_lines.js diff --git a/trunk/infrastructure/bin/classpath.sh b/infrastructure/bin/classpath.sh index b1d297c..b1d297c 100755 --- a/trunk/infrastructure/bin/classpath.sh +++ b/infrastructure/bin/classpath.sh diff --git a/trunk/infrastructure/bin/comp.sh b/infrastructure/bin/comp.sh index 5f65c2f..5f65c2f 100755 --- a/trunk/infrastructure/bin/comp.sh +++ b/infrastructure/bin/comp.sh diff --git a/infrastructure/bin/compilecache.sh b/infrastructure/bin/compilecache.sh new file mode 100755 index 0000000..6e42a50 --- /dev/null +++ b/infrastructure/bin/compilecache.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# Copyright 2009 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CP_CMD="cp -R -u" +if [ `uname` == "Darwin" ]; then + CP_CMD="/bin/cp -R -n" +elif [ `uname` == "SunOS" ]; then + CP_CMD="cp -R" #Solaris cp does not have '-u' +fi + +function cacheonfiles { + NAME=$1; FILES=$2; FUNC=$3; NOCOPY=1; + if [ -z "$4" ]; then + NOCOPY=0 + fi + REBUILD=0 + BPATH=buildcache/$NAME + FILETEST=$BPATH/t + if [ ! -f $FILETEST ]; then + REBUILD=1 + else + for a in $FILES; do + if [ $FILETEST -ot $a ]; then + echo $a has changed, rebuilding $NAME + REBUILD=1 + fi + done + fi + if [ $REBUILD -eq 1 ]; then + if [ -d $BPATH ]; then + rm -rf $BPATH + fi + mkdir -p $BPATH + $FUNC $BPATH + pushd $BPATH >> /dev/null + touch t + popd >> /dev/null + else + echo using cached $NAME... + fi + if [ $NOCOPY -ne 1 ]; then + for a in $BPATH/*; do + if [ -d $a ]; then + $CP_CMD $a build/ + elif [ -f $a ]; then + cp $a build/ + else + echo unknown file type $a + exit 1 + fi + done + fi +} diff --git a/trunk/infrastructure/bin/jscomp.sh b/infrastructure/bin/jscomp.sh index 3f5bc51..3f5bc51 100755 --- a/trunk/infrastructure/bin/jscomp.sh +++ b/infrastructure/bin/jscomp.sh diff --git a/infrastructure/bin/makejar.sh b/infrastructure/bin/makejar.sh new file mode 100755 index 0000000..46b4609 --- /dev/null +++ b/infrastructure/bin/makejar.sh @@ -0,0 +1,74 @@ +#!/bin/bash -e + +# Copyright 2009 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ -z "$JAR" ]; then + JAR=jar +else + echo "using JAR $JAR..." +fi + +cp ${MYSQL_CONNECTOR_JAR} lib/ + +source bin/compilecache.sh + +if [ "$1" == "clearcache" ]; then + echo "CLEARING BUILD CACHE" + rm -rf buildcache + shift; +fi + +TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s` + +JARFILES=`echo $SCALA_LIBRARY_JAR lib/*.jar lib/manifest` +function genjar { + echo "unzipping JARs..." + pushd $1 >> /dev/null + $JAR xf $SCALA_LIBRARY_JAR + rm -rf META-INF + for a in ../../lib/*.jar; do + $JAR xf $a + rm -rf META-INF/{MANIFEST.MF,NOTICE{,.txt},LICENSE{,.txt},INDEX.LIST,SUN_MICR.{RSA,SF},maven} + done + + echo "making cached JAR...." + $JAR -cfm appjet.jar ../../lib/manifest . + mv appjet.jar /tmp/appjet.jar + rm -rf * + mv /tmp/appjet.jar ./ + + popd >> /dev/null +} +cacheonfiles JAR "$JARFILES" genjar 1 + +echo "compiling..." +bin/comp.sh $@ + +pushd build >> /dev/null + +echo "copying cached JAR..." +cp ../buildcache/JAR/appjet.jar ./ + +echo "making JAR..." +mv appjet.jar /tmp/appjet.jar +$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala dojox +mv /tmp/appjet.jar ./ + +echo "cleaning up..." +rm -rf $TMPSTORE + +popd >> /dev/null + +echo "done." diff --git a/trunk/infrastructure/bin/makesars.sh b/infrastructure/bin/makesars.sh index 541b04a..541b04a 100755 --- a/trunk/infrastructure/bin/makesars.sh +++ b/infrastructure/bin/makesars.sh diff --git a/trunk/infrastructure/bin/run.sh b/infrastructure/bin/run.sh index cf918d4..cf918d4 100755 --- a/trunk/infrastructure/bin/run.sh +++ b/infrastructure/bin/run.sh diff --git a/infrastructure/com.etherpad.openofficeservice/importexport.scala b/infrastructure/com.etherpad.openofficeservice/importexport.scala new file mode 100644 index 0000000..606cff9 --- /dev/null +++ b/infrastructure/com.etherpad.openofficeservice/importexport.scala @@ -0,0 +1,287 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.etherpad.openofficeservice; + +import net.appjet.common.sars.{SarsServer,SarsMessageHandler}; + +import java.io.{DataInputStream,DataOutputStream}; +import java.io.{File,FileOutputStream,ByteArrayInputStream,ByteArrayOutputStream}; + +/* Libraries needed for OO.org Conversion */ +import com.sun.star.bridge.{XBridge,XBridgeFactory}; +import com.sun.star.beans.{PropertyValue,XPropertySet}; +import com.sun.star.connection.{NoConnectException,XConnection,XConnector}; +import com.sun.star.container.XNamed; +import com.sun.star.document.{XExporter,XFilter}; +import com.sun.star.frame.{XComponentLoader,XStorable}; +import com.sun.star.lang.{XComponent,XMultiComponentFactory}; +import com.sun.star.uno.{UnoRuntime,XComponentContext}; + +class OOSException(m: String) extends RuntimeException(m); +class UnsupportedFormatException(format: String) extends OOSException("Unsupported format: "+format); +object TemporaryFailure extends OOSException("Temporary failure"); + +object OpenOfficeServerUtility { + def checkServerAvailability(host: String, port: Int): Boolean = { + // Assume the server is running; this is the responsibility of the user + return true; + } + def runOpenOfficeServer(path: String, host: String, port: Int, timeout: Int, wait: Boolean) { + // nothing + } +} + +class OpenOfficeFileConverter { + var host: String = "localhost"; + var port: Int = 8100; + + def setOpenOfficeServerDetails(host: String, port: Int) { + this.host = host; + this.port = port; + } + + def convertFile(src: File, dst: File, converter: String, extension: String): Boolean = { + try { + val fromFile: String = "file:///" + src.getAbsolutePath(); + val toFile: String = "file:///" + dst.getAbsolutePath(); + + val cnx: String = "socket,host="+this.host+",port="+this.port+""; + val xRemoteContext: XComponentContext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null); + val x: Object = xRemoteContext.getServiceManager().createInstanceWithContext("com.sun.star.connection.Connector", xRemoteContext); + val xConnector: XConnector = UnoRuntime.queryInterface(classOf[XConnector], x).asInstanceOf[XConnector]; + val connection: XConnection = xConnector.connect(cnx); + + if(connection == null) { + throw new OOSException("Connection failure"); + } + val x2: Object = xRemoteContext.getServiceManager().createInstanceWithContext("com.sun.star.bridge.BridgeFactory", xRemoteContext); + val xBridgeFactory: XBridgeFactory = UnoRuntime.queryInterface(classOf[XBridgeFactory], x2).asInstanceOf[XBridgeFactory]; + val xBridge: XBridge = xBridgeFactory.createBridge("", "urp", connection, null); + val x3: Object = xBridge.getInstance("StarOffice.ServiceManager"); + if (x3 == null) { + throw new OOSException("Failed to get bridge"); + } + + val xMultiComponentFactory: XMultiComponentFactory = UnoRuntime.queryInterface(classOf[XMultiComponentFactory], x3).asInstanceOf[XMultiComponentFactory]; + val xProperySet: XPropertySet = UnoRuntime.queryInterface(classOf[XPropertySet], xMultiComponentFactory).asInstanceOf[XPropertySet]; + val oDefaultContext: Object = xProperySet.getPropertyValue("DefaultContext"); + val xComponentContext: XComponentContext = UnoRuntime.queryInterface(classOf[XComponentContext], oDefaultContext).asInstanceOf[XComponentContext]; + + val desktopObj: Object = xMultiComponentFactory.createInstanceWithContext("com.sun.star.frame.Desktop", xComponentContext); + val xcomponentloader: XComponentLoader = UnoRuntime.queryInterface(classOf[XComponentLoader], desktopObj).asInstanceOf[XComponentLoader]; + + if(xcomponentloader == null) { + throw new OOSException("XComponent Loader could not be loaded"); + } + + val loadProps: Array[PropertyValue] = new Array[PropertyValue](2); + loadProps(0) = new PropertyValue(); + loadProps(0).Name = "Hidden"; + loadProps(0).Value = boolean2Boolean(false); + + loadProps(1) = new PropertyValue(); + loadProps(1).Name = "UpdateDocMode"; + loadProps(1).Value = "1"; + + val component: XComponent = xcomponentloader.loadComponentFromURL(fromFile,"_blank", 0, loadProps); + + if (component == null) { + throw new OOSException("Failed to load document"); + } + + val convProps: Array[PropertyValue] = new Array[PropertyValue](2); + convProps(0) = new PropertyValue(); + convProps(0).Name = "FilterName"; + convProps(0).Value = converter; + + val xstorable: XStorable = UnoRuntime.queryInterface(classOf[XStorable],component).asInstanceOf[XStorable]; + if (xstorable == null) { + throw new OOSException("Storable could not be loaded"); + } + xstorable.storeToURL(toFile, convProps); + component.dispose(); + return true; + } + catch { + case e => { + e.printStackTrace(); + throw new OOSException("Unknown exception occurred: "+e.getMessage()); + } + } + } +} + +object OpenOfficeService { + val formats = Map( + "pdf" -> "writer_pdf_Export", + "doc" -> "MS Word 97", + "html" -> "HTML (StarWriter)", + "odt" -> "writer8", + //"html" -> "XHTML Writer File", + "txt" -> "Text" + ); + + def createTempFile(bytes: Array[byte], suffix: String) = { + var f = File.createTempFile("ooconvert-", if (suffix == null) { null } else if (suffix == "") { "" } else { "."+suffix }); + if (bytes != null) { + val fos = new FileOutputStream(f); + fos.write(bytes); + } + f; + } + + var soffice = "soffice"; + def setExecutable(exec: String) { + soffice = exec; + } + + var openOfficeServerHost: String = "localhost"; + var openOfficeServerPort: Int = 8100; + + def setOpenOfficeServer(host: String, port: Int) { + openOfficeServerHost = host; + openOfficeServerPort = port; + } + + def convertFile(from: String, to: String, bytes: Array[byte]): Array[byte] = { + if (from == to) { + return bytes; + } + + val tempFile = createTempFile(bytes, from); + val outFile = createTempFile(null, to); + + /* + Just hardcoding server and port here. + If you intend to use an Openoffice.org instance on a network machine, + do it at your risk. + + Just, remember to setOpenOfficeServer from etherpad/importexport/importexport.js, + Also, remember that OO.org is reading and writing files over file:/// URI. So, make sure that + you can access the files from network machine. Hint, NFS. Not Need for Speed game, you idiot, + Network File System. + + */ + + if (! OpenOfficeServerUtility.checkServerAvailability(openOfficeServerHost, openOfficeServerPort)) { + try { + OpenOfficeServerUtility.runOpenOfficeServer(soffice, openOfficeServerHost, openOfficeServerPort, 20000, true); + } catch { + case e: java.io.IOException => { + e.printStackTrace(); + throw TemporaryFailure; + } + } + } + var converter = new OpenOfficeFileConverter(); + converter.setOpenOfficeServerDetails(openOfficeServerHost, openOfficeServerPort); + var status = false; + try { + status = converter.convertFile(tempFile, outFile, formats(to), to); + } catch { + case e => { + e.printStackTrace(); + throw new OOSException("Unknown exception occurred: "+e.getMessage()); + } + } + if (status == false) { + throw new UnsupportedFormatException(from); + } + net.appjet.common.util.BetterFile.getFileBytes(outFile); + } + + def main(args: Array[String]) { + if (args.length > 0) { + soffice = args(0); + if (soffice.length == 0) { + exit(1); + } + } + + // Query format: + // from: String, to: String, count: Int, bytes: Array[byte] + // Response format: + // status: Int, <data> + // status 0 (success) - <data>: count: Int, bytes: Array[byte] + // status 1 (temporary failure) - <data>: <none> + // status 2 (permanent failure) - <data>: type: Int + // type - 0: unknown failure. + // - 1: unsupported format + val handler = new SarsMessageHandler { + override def handle(b: Array[byte]): Option[Array[byte]] = { + val is = new DataInputStream(new ByteArrayInputStream(b)); + val from = is.readUTF; + val to = is.readUTF; + val len = is.readInt; + val bytes = new Array[byte](len); + is.readFully(bytes); + var status = 0; + var permfailuretype = 0; + + println("Converting "+from+" -> "+to+" ("+len+" bytes)"); + + val output = try { + convertFile(from, to, bytes); + } catch { + case TemporaryFailure => { + status = 1; + null; + } + case e: UnsupportedFormatException => { + status = 2; + permfailuretype = 1; + null; + } + case e => { + status = 2; + permfailuretype = 0; + e.printStackTrace(); + null; + } + } + + val retBytes = new ByteArrayOutputStream(); + val ret = new DataOutputStream(retBytes); + if (status != 0) { + ret.writeInt(status); // error + status match { + case 2 => { + ret.writeInt(permfailuretype); + } + case _ => { } + } + } else { + ret.writeInt(0); // success + ret.writeInt(output.length); + ret.write(output, 0, output.length); + } + Some(retBytes.toByteArray()); + } + } + + val server = new SarsServer("ooffice-password", handler, None, 8101); + server.start(); + println("Server running..."); + server.join(); + println("Server quitting..."); + } +} + + + + + diff --git a/trunk/infrastructure/com.etherpad/easysync2support.scala b/infrastructure/com.etherpad/easysync2support.scala index 9f1c527..9f1c527 100644 --- a/trunk/infrastructure/com.etherpad/easysync2support.scala +++ b/infrastructure/com.etherpad/easysync2support.scala diff --git a/infrastructure/com.etherpad/licensing.scala b/infrastructure/com.etherpad/licensing.scala new file mode 100644 index 0000000..68019f5 --- /dev/null +++ b/infrastructure/com.etherpad/licensing.scala @@ -0,0 +1,169 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.etherpad; + +import net.appjet.oui.{Encryptomatic, config}; +import net.appjet.common.util.BetterFile; + +import java.io.{FileInputStream, FileOutputStream, ByteArrayInputStream, ByteArrayOutputStream, PrintWriter} + +import java.security._; +import java.security.spec._; + +object Licensing { + val publicKey = "s0dD94jKFjlSHIumgDQ4ldcyIyna1vMHmG5tsgkP987eBTW88XeEIUTo5JtWOjPzb252GURUrr7MReTqMz6NnsOupeJMqtXgjuVxcXbK8AnckxkxhRqMiFfBW39T9NzPgq09yBdH4tKGlPZQmgaBvjFI8cXTYa7a64LrDnrzrpDhDdJsZPZI2kE7G4vBCGijuhsZpyowK8zT5y2cKqIgIdLxUnXNFtayDi0oyuX1ywfBds2OEil9fEUQOQvkcHAt6kYfPXkE2XgQZFasAv0DPeWMUEtaHTbMaQn1U6BsfmsKjHlLhM3oWEzp0wEwUWxCC39iHYjxa5QKtxm5BNvUTTqJgkoEvk7Uu08j8jhFeCFosph6igDWPmyfAPKTnETXJobO2VON83bVHlX8UfKonnalMy0Hnw2C0I7c0UE0MtMIRtJxtwU62a311Ohp1EVrY4LwKIFfqRMVWKDP0cjXDkJyjJS58rC1DRU7SfPspgfuOy5YZo9sLKztXfzAPzNbXerQ24m2AjmYLV4JQked7MnaKQ6VfyZbFBK5th9NFcJwY1bGbIHW2EsKmiKUoNjPKRJ6VMC7odUCIXQyE9J"; + + val pkhash = "f7a3dd5940a3f79904b81e4d32a08e2efaa0b2ab"; + val keyVersion = 2.toByte; + + def thanksForStealingFromPoorHackersTryingToEkeAMeagerLivingFromThisCruelWorld = + Encryptomatic.bytesToAscii(MessageDigest.getInstance("SHA1").digest(publicKey.getBytes())) == pkhash; + def sha1(b: Array[Byte]): String = Encryptomatic.bytesToAscii(MessageDigest.getInstance("SHA1").digest(b)); + def sha1(s: String): String = sha1(s.getBytes("UTF-8")); + + def toBytes(i: Int): Array[Byte] = + Array((i >> 24).toByte, + (i >> 16).toByte, + (i >> 8).toByte, + i.toByte); + def toByte(i: Int): Array[Byte] = + Array(i.toByte); + def toBytes(l: Long): Array[Byte] = + Array((l >> 56).toByte, + (l >> 48).toByte, + (l >> 40).toByte, + (l >> 32).toByte, + (l >> 24).toByte, + (l >> 16).toByte, + (l >> 8).toByte, + l.toByte); + + def toInt(b0: Array[Byte]): Int = { + val b = b0.map(_.toInt & 0x00FF); + (b(0) << 24) | (b(1) << 16) | (b(2) << 8) | b(3); + } + def toInt(b: Byte): Int = b.toInt & 0x00FF; + + def toLong(b0: Array[Byte]): Long = { + val b = b0.map(_.toLong & 0x000000FF); + (b(0) << 56) | (b(1) << 48) | (b(2) << 40) | (b(3) << 32) | (b(4) << 24) | (b(5) << 16) | (b(6) << 8) | b(7); + } + + def generateKey(personName: String, organizationName: String, expiresDate: Long, editionId: Int, userQuota: Int, majorVersion: Int, minorVersion: Int, patchVersion: Int) = { + if (config.licenseGeneratorKey == null) { + throw new RuntimeException("No private key available to generate license key."); + } + def privateKey = Encryptomatic.readPrivateKey("DSA", new FileInputStream(config.licenseGeneratorKey)); + def clean(s: String) = s.replaceAll(":", "-"); + val keyPrefix = + List(personName, organizationName, expiresDate.toString, editionId.toString, userQuota.toString, majorVersion.toString, minorVersion.toString, patchVersion.toString).map(clean).mkString(":"); + val sig = Encryptomatic.sign(new ByteArrayInputStream(keyPrefix.getBytes("UTF-8")), privateKey) + + List(personName, organizationName).mkString(":") + ":" + + Encryptomatic.bytesToAscii( + Array.concat[Byte](Array(keyVersion), // don't want BigInt dropping bytes, that'd be sad. :( + toBytes(expiresDate), + toBytes(editionId), + toBytes(userQuota), + toByte(majorVersion), + toByte(minorVersion), + toByte(patchVersion), + sig)); + } + + def decodeKey(key: String) = try { + val Array(personName0, organizationName0, sigAndInfo) = key.split(":"); + val sigAndInfoBytes = Encryptomatic.asciiToBytes(sigAndInfo); + val thisKeyVersion = toInt(sigAndInfoBytes(0)); + val expiresDate0 = toLong(sigAndInfoBytes.slice(1, 9)); + val editionId0 = toInt(sigAndInfoBytes.slice(9, 13)); + val userQuota0 = toInt(sigAndInfoBytes.slice(13, 17)); + val (majorVersion0, minorVersion0, patchVersion0) = + if (thisKeyVersion >= 2) { + (toInt(sigAndInfoBytes(17)), toInt(sigAndInfoBytes(18)), toInt(sigAndInfoBytes(19))); + } else { + (0, 0, 0); + } + val sig = sigAndInfoBytes.drop(if (thisKeyVersion >= 2) 20 else 17); + val keyPrefix = { + var a = Seq(personName0, organizationName0, expiresDate0.toString, editionId0.toString, userQuota0.toString); + if (thisKeyVersion >= 2) { + a = a ++ Seq(majorVersion0.toString, minorVersion0.toString, patchVersion0.toString); + } + a.mkString(":"); + } + if (! Encryptomatic.verify(new ByteArrayInputStream(keyPrefix.getBytes("UTF-8")), + Encryptomatic.readPublicKey("DSA", + new ByteArrayInputStream(publicKey.getBytes())), sig)) { + null; + } else { + new { + def personName = personName0; + def organizationName = organizationName0; + def expiresDate = expiresDate0; + def editionId = editionId0; + def userQuota = userQuota0; + def majorVersion = majorVersion0; + def minorVersion = minorVersion0; + def patchVersion = patchVersion0; + } + } + } catch { + case e => null; + } + + def main(args: Array[String]) { + args(0) match { + case "genkeypair" => { + println("Generating keypair..."); + Encryptomatic.writeKeyPair(Encryptomatic.generateKeyPair("DSA"), args(1), args(2)); + println("Done."); + } + case "genmainkey" => { + println("Generating main key..."); + config.values("licenseGeneratorKey") = args(1); + val out = new PrintWriter(new FileOutputStream(args(2))); + out.print(generateKey("etherpad", "AppJet", -1, 0, -1, 0, 0, 0)) + out.close(); + println("Done."); + } + case "test" => { + println("Testing key generation."); + config.values("licenseGeneratorKey") = args(1); + val key = generateKey("Foo Bar", "Baz, Inc.", System.currentTimeMillis() + 86400*1000, 0, 100, 1, 2, 3); + println("Key is: "+key); + val obj = decodeKey(key); + println(List(obj.personName, obj.organizationName, obj.expiresDate, obj.editionId, obj.userQuota, obj.majorVersion, obj.minorVersion, obj.patchVersion).mkString(", ")); + } + case "parsekey" => { + println("Testing key decode."); + val obj = decodeKey(args(1)); + println("Key: "+List(obj.personName, obj.organizationName, obj.expiresDate, obj.editionId, obj.userQuota, obj.majorVersion, obj.minorVersion, obj.patchVersion).mkString(", ")); + } + case "testascii" => { + val one = 17; + val two = -1L; + val three = (Math.random*Math.pow(10, (Math.random*10).toInt)).toInt; + println(List(one, two, three).mkString(", ")); + println(List(toInt(toBytes(one)), toLong(toBytes(two)), toInt(toBytes(three))).mkString(", ")); + val bytes = Encryptomatic.asciiToBytes(Encryptomatic.bytesToAscii(Array.concat[Byte](Array(1.toByte), toBytes(one), toBytes(two), toBytes(three)))); + println("I can has bytes: "+bytes.length); + println(List(toInt(bytes.slice(1, 5)), toLong(bytes.slice(5, 13)), toInt(bytes.slice(13, 17))).mkString(", ")); + } + } + } +} diff --git a/trunk/infrastructure/com.etherpad/main.scala b/infrastructure/com.etherpad/main.scala index 5110aba..5110aba 100644 --- a/trunk/infrastructure/com.etherpad/main.scala +++ b/infrastructure/com.etherpad/main.scala diff --git a/trunk/infrastructure/framework-src/modules/atomfeed.js b/infrastructure/framework-src/modules/atomfeed.js index 4b86eeb..4b86eeb 100644 --- a/trunk/infrastructure/framework-src/modules/atomfeed.js +++ b/infrastructure/framework-src/modules/atomfeed.js diff --git a/trunk/infrastructure/framework-src/modules/blob.js b/infrastructure/framework-src/modules/blob.js index af788a0..af788a0 100644 --- a/trunk/infrastructure/framework-src/modules/blob.js +++ b/infrastructure/framework-src/modules/blob.js diff --git a/trunk/infrastructure/framework-src/modules/cache_utils.js b/infrastructure/framework-src/modules/cache_utils.js index f2a360c..f2a360c 100644 --- a/trunk/infrastructure/framework-src/modules/cache_utils.js +++ b/infrastructure/framework-src/modules/cache_utils.js diff --git a/trunk/infrastructure/framework-src/modules/comet.js b/infrastructure/framework-src/modules/comet.js index 2331f8b..2331f8b 100644 --- a/trunk/infrastructure/framework-src/modules/comet.js +++ b/infrastructure/framework-src/modules/comet.js diff --git a/trunk/infrastructure/framework-src/modules/dateutils.js b/infrastructure/framework-src/modules/dateutils.js index 72e87c8..72e87c8 100644 --- a/trunk/infrastructure/framework-src/modules/dateutils.js +++ b/infrastructure/framework-src/modules/dateutils.js diff --git a/trunk/infrastructure/framework-src/modules/dispatch.js b/infrastructure/framework-src/modules/dispatch.js index e7e3ef0..e7e3ef0 100644 --- a/trunk/infrastructure/framework-src/modules/dispatch.js +++ b/infrastructure/framework-src/modules/dispatch.js diff --git a/infrastructure/framework-src/modules/ejs.js b/infrastructure/framework-src/modules/ejs.js new file mode 100644 index 0000000..58c67bc --- /dev/null +++ b/infrastructure/framework-src/modules/ejs.js @@ -0,0 +1,477 @@ +/*-------------------------------------------------------------------------- + * EJS - Embedded JavaScript, version 0.1.0 + * Copyright (c) 2007 Edward Benson + * http://www.edwardbenson.com/projects/ejs + * ------------------------------------------------------------------------ + * + * EJS is freely distributable under the terms of an MIT-style license. + * + * EJS is a client-side preprocessing engine written in and for JavaScript. + * If you have used PHP, ASP, JSP, or ERB then you get the idea: code embedded + * in <% // Code here %> tags will be executed, and code embedded in <%= .. %> + * tags will be evaluated and appended to the output. + * + * This is essentially a direct JavaScript port of Masatoshi Seki's erb.rb + * from the Ruby Core, though it contains a subset of ERB's functionality. + * + * Requirements: + * prototype.js + * + * Usage: + * // source should be either a string or a DOM node whose innerHTML + * // contains EJB source. + * var source = "<% var ejb="EJB"; %><h1>Hello, <%= ejb %>!</h1>"; + * var compiler = new EjsCompiler(source); + * compiler.compile(); + * var output = eval(compiler.out); + * alert(output); // -> "<h1>Hello, EJB!</h1>" + * + * For a demo: see demo.html + * For the license: see license.txt + * + *--------------------------------------------------------------------------*/ + +import("jsutils.*"); +import("funhtml"); +import("etherpad.log"); + +jimport("java.lang.System.out.println"); +jimport("net.appjet.ajstdlib.execution.executeCodeInNewScope"); + +/* Make a split function like Ruby's: "abc".split(/b/) -> ['a', 'b', 'c'] */ +function rsplit(x, regex) { + var item = x; + var result = regex.exec(item); + var retArr = new Array(); + while (result != null) + { + var first_idx = result.index; + var last_idx = regex.lastIndex; + if ((first_idx) != 0) + { + var first_bit = item.substring(0,first_idx); + retArr.push(item.substring(0,first_idx)); + item = item.slice(first_idx); + } + retArr.push(result[0]); + item = item.slice(result[0].length); + result = regex.exec(item); + } + if (! item == '') + { + retArr.push(item); + } + return retArr; +}; + +/* Chop is nice to have too */ +function chop(x) { + return x.substr(0, x.length - 1); +} + +/* Adaptation from the Scanner of erb.rb */ +var EjsScanner = function(source, left, right) { + this.left_delimiter = left +'%'; //<% + this.right_delimiter = '%'+right; //> + this.double_left = left+'%%'; + this.double_right = '%%'+right; + this.left_equal = left+'%='; + this.left_colon = left+'%:'; + this.left_comment = left+'%#'; + if(left=='[') { + this.SplitRegexp = /(\[%%)|(%%\])|(\[%:)|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/; + } + else { + this.SplitRegexp = new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_colon+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)') + } + + this.source = source; + this.stag = null; + this.lines = 0; +}; +EjsView = function(data) { + this.data = data; +}; +EjsView.prototype.partial = function(options, data){ + if(!data) data = this.data; + return new EJS(options).render(data); +}; + +EjsScanner.to_text = function(input){ + if(input == null || input === undefined) + return ''; + if(input instanceof Date) + return input.toDateString(); + if(input.toString) + return input.toString(); + return ''; +} + +EjsScanner.prototype = { + + /* For each line, scan! */ + scan: function(block) { + scanline = this.scanline; + regex = this.SplitRegexp; + if (! this.source == '') + { + var source_split = rsplit(this.source, /\n/); + for(var i=0; i<source_split.length; i++) { + var item = source_split[i]; + this.scanline(item, regex, block); + } + } + }, + + /* For each token, block! */ + scanline: function(line, regex, block) { + this.lines++; + var line_split = rsplit(line, regex); + for(var i=0; i<line_split.length; i++) { + var token = line_split[i]; + if (token != null) { + try{ + block(token, this); + }catch(e){ + throw {type: 'EjsScanner', line: this.lines}; + } + } + } + } +}; + +/* Adaptation from the Buffer of erb.rb */ +var EjsBuffer = function(pre_cmd, post_cmd) { + this.line = new Array(); + this.script = ""; + this.pre_cmd = pre_cmd; + this.post_cmd = post_cmd; + + for (var i=0; i<this.pre_cmd.length; i++) + { + this.push(pre_cmd[i]); + } +} +EjsBuffer.prototype = { + + push: function(cmd) { + this.line.push(cmd); + }, + + cr: function() { + this.script = this.script + this.line.join('; '); + this.line = new Array(); + this.script = this.script + "\n"; + }, + + close: function() { + if (this.line.length > 0) + { + for (var i=0; i<this.post_cmd.length; i++) + { + this.push(pre_cmd[i]); + } + this.script = this.script + this.line.join('; '); + line = null; + } + } + +}; + +/* Adaptation from the Compiler of erb.rb */ +EjsCompiler = function(source, left) { + this.pre_cmd = ['var ejs_data = "";']; + this.post_cmd = new Array(); + this.source = ' '; + if (source != null) + { + if (typeof source == 'string') + { + source = source.replace(/\r\n/g, "\n"); + source = source.replace(/\r/g, "\n"); + this.source = source; + } + else if (source.innerHTML) + { + this.source = source.innerHTML; + } + if (typeof this.source != 'string') + { + this.source = ""; + } + } + left = left || '<' + var right = '>' + switch(left) { + case '[': + right = ']' + break; + case '<': + break; + default: + throw left+' is not a supported deliminator' + break; + } + this.scanner = new EjsScanner(this.source, left, right); + this.out = ''; +} +EjsCompiler.prototype = { + compile: function(options) { + options = options || {}; + this.out = ''; + var put_cmd = "ejs_data += "; + var insert_cmd = put_cmd; + var buff = new EjsBuffer(this.pre_cmd, this.post_cmd); + var content = ''; + var clean = function(content) + { + content = content.replace(/\\/g, '\\\\'); + content = content.replace(/\n/g, '\\n'); + content = content.replace(/\"/g, '\\"'); + return content; + }; + this.scanner.scan(function(token, scanner) { + if (scanner.stag == null) + { + //alert(token+'|'+(token == "\n")) + switch(token) { + case '\n': + content = content + "\n"; + buff.push(put_cmd + '"' + clean(content) + '";'); + buff.cr(); + content = ''; + break; + case scanner.left_delimiter: + case scanner.left_equal: + case scanner.left_colon: + case scanner.left_comment: + scanner.stag = token; + if (content.length > 0) + { + // Chould be content.dump in Ruby + + buff.push(put_cmd + '"' + clean(content) + '"'); + } + content = ''; + break; + case scanner.double_left: + content = content + scanner.left_delimiter; + break; + default: + content = content + token; + break; + } + } + else { + switch(token) { + case scanner.right_delimiter: + switch(scanner.stag) { + case scanner.left_delimiter: + if (content[content.length - 1] == '\n') + { + content = chop(content); + buff.push(content); + buff.cr(); + } + else { + buff.push(content); + } + break; + case scanner.left_equal: + buff.push(insert_cmd + "(EjsScanner.to_text(" + content + "))"); + break; + case scanner.left_colon: + buff.push(insert_cmd + content); + break; + } + scanner.stag = null; + content = ''; + break; + case scanner.double_right: + content = content + scanner.right_delimiter; + break; + default: + content = content + token; + break; + } + } + }); + if (content.length > 0) + { + // Chould be content.dump in Ruby + buff.push(put_cmd + '"' + clean(content) + '"'); + } + buff.close(); + this.out = buff.script + ";"; + var to_be_evaled = [ + 'var process = function(_CONTEXT,_VIEW) {', + ' with(_VIEW) {', + ' with (_CONTEXT) {', + this.out, + ' return ejs_data;', + ' }', + ' }', + '};' + ].join(''); + // make funhtml.* available in parent scope. + var parentScope = {}; + parentScope.EjsScanner = EjsScanner; + keys(funhtml).forEach(function(k) { + parentScope[k] = funhtml[k]; + }); + var ret = executeCodeInNewScope( + parentScope, + to_be_evaled, + (options.name || "template"), + 1 + ); + this.process = ret.process; + } +} + + +//type, cache, folder +EJS = function( options ){ + this.set_options(options); + + if(options.url){ + var template = EJS.get(options.url, this.cache); + if (template) return template; + if (template == EJS.INVALID_PATH) return null; + this.text = EJS.request(options.url); + if(this.text == null){ + //EJS.update(options.url, this.INVALID_PATH); + throw 'There is no template at '+options.url; + } + this.name = options.url; + }else if(options.element) + { + if(typeof options.element == 'string'){ + var name = options.element; + options.element = document.getElementById( options.element ); + if(options.element == null) throw name+'does not exist!'; + } + if(options.element.value){ + this.text = options.element.value; + }else{ + this.text = options.element.innerHTML; + } + this.name = options.element.id; + this.type = '['; + } + var template = new EjsCompiler(this.text, this.type); + + template.compile(options); + + + EJS.update(this.name, this); + this.template = template; +}; +EJS.config = function(options){ + EJS.cache = options.cache != null ? options.cache : EJS.cache; + EJS.type = options.type != null ? options.type : EJS.type; + var templates_directory = {}; //nice and private container + + EJS.get = function(path, cache){ + if(cache == false) return null; + if(templates_directory[path]) return templates_directory[path]; + return null; + }; + + EJS.update = function(path, template) { + if(path == null) return; + templates_directory[path] = template; + }; + + EJS.INVALID_PATH = -1; + + +}; +EJS.config( {cache: true, type: '<' } ); + +EJS.prototype = { + render : function(object){ + var v = new EjsView(object); + return this.template.process.call(v, object, v); + }, + out : function(){ + return this.template.out; + }, + set_options : function(options){ + this.type = options.type != null ? options.type : EJS.type; + this.cache = options.cache != null ? options.cache : EJS.cache; + this.text = options.text != null ? options.text : null; + this.name = options.name != null ? options.name : null; + }, + // called without options, returns a function that takes the object + // called with options being a string, uses that as a url + // called with options as an object + update : function(element, options){ + if(typeof element == 'string'){ + element = document.getElementById(element); + } + if(options == null){ + _template = this; + return function(object){ + EJS.prototype.update.call(_template, element, object); + }; + } + if(typeof options == 'string'){ + params = {}; + params.url = options; + _template = this; + params.onComplete = function(request){ + var object = eval( request.responseText ); + EJS.prototype.update.call(_template, element, object); + }; + EJS.ajax_request(params); + }else + { + element.innerHTML = this.render(options); + } + } +}; + + EJS.newRequest = function(){ + var factories = [function() { return new ActiveXObject("Msxml2.XMLHTTP"); },function() { return new XMLHttpRequest(); },function() { return new ActiveXObject("Microsoft.XMLHTTP"); }]; + for(var i = 0; i < factories.length; i++) { + try { + var request = factories[i](); + if (request != null) return request; + } + catch(e) { continue;} + } + }; + + EJS.request = function(path){ + var request = new EJS.newRequest(); + request.open("GET", path, false); + + try{request.send(null);} + catch(e){return null;} + + if ( request.status == 404 || request.status == 2 ||(request.status == 0 && request.responseText == '') ) return null; + + return request.responseText + }; + EJS.ajax_request = function(params){ + params.method = ( params.method ? params.method : 'GET'); + + var request = new EJS.newRequest(); + request.onreadystatechange = function(){ + if(request.readyState == 4){ + if(request.status == 200){ + params.onComplete(request); + }else + { + params.onComplete(request); + } + } + }; + request.open(params.method, params.url); + request.send(null); + }; + +//} + + diff --git a/trunk/infrastructure/framework-src/modules/email.js b/infrastructure/framework-src/modules/email.js index 2d81dc3..2d81dc3 100644 --- a/trunk/infrastructure/framework-src/modules/email.js +++ b/infrastructure/framework-src/modules/email.js diff --git a/trunk/infrastructure/framework-src/modules/exceptionutils.js b/infrastructure/framework-src/modules/exceptionutils.js index b572a3a..b572a3a 100644 --- a/trunk/infrastructure/framework-src/modules/exceptionutils.js +++ b/infrastructure/framework-src/modules/exceptionutils.js diff --git a/infrastructure/framework-src/modules/execution.js b/infrastructure/framework-src/modules/execution.js new file mode 100644 index 0000000..2f9d933 --- /dev/null +++ b/infrastructure/framework-src/modules/execution.js @@ -0,0 +1,61 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import("jsutils.{scalaF0,scalaF1}"); + +/** + * Asynchronously call a function as soon as the current request completes. + **/ +function async(f) { + Packages.net.appjet.ajstdlib.execution.runAsync(appjet.context, f); +} + +function initTaskThreadPool(name, poolSize) { + Packages.net.appjet.ajstdlib.execution.createNamedTaskThreadPool(name, poolSize); +} + +function scheduleTask(poolName, taskName, delayMillis, args) { + return Packages.net.appjet.ajstdlib.execution.scheduleTaskInPool(poolName, taskName, delayMillis, args); +} + +function shutdownAndWaitOnTaskThreadPool(poolName, timeoutMillis) { + return Packages.net.appjet.ajstdlib.execution.shutdownAndWaitOnTaskThreadPool(poolName, timeoutMillis); +} + +function fancyAssEval(initCode, mainCode) { + function init(runner) { + Packages.net.appjet.bodylock.BodyLock.evaluateString( + runner.globalScope(), + initCode, + "eval'd code imports", + 1); + } + var runner = Packages.net.appjet.oui.ScopeReuseManager.getEmpty(scalaF1(init)); + var requestWrapper = null; + if (request.underlying !== undefined) + requestWrapper = new Packages.net.appjet.oui.RequestWrapper(request.underlying); + var ec = new Packages.net.appjet.oui.ExecutionContext( + requestWrapper, + null, runner); + return Packages.net.appjet.oui.ExecutionContextUtils.withContext(ec, + scalaF0(function() { + return Packages.net.appjet.bodylock.BodyLock.evaluateString( + runner.globalScope(), + mainCode, + "eval'd code main", + 1); + })); +}
\ No newline at end of file diff --git a/trunk/infrastructure/framework-src/modules/fastJSON.js b/infrastructure/framework-src/modules/fastJSON.js index 3198b96..3198b96 100644 --- a/trunk/infrastructure/framework-src/modules/fastJSON.js +++ b/infrastructure/framework-src/modules/fastJSON.js diff --git a/infrastructure/framework-src/modules/faststatic.js b/infrastructure/framework-src/modules/faststatic.js new file mode 100644 index 0000000..920be8c --- /dev/null +++ b/infrastructure/framework-src/modules/faststatic.js @@ -0,0 +1,342 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @fileOverview serving static files, including js and css, and cacheing + * and minifying. + * + * Terminology Note: + * "path" is confusing because paths can be part of URLs and part + * of filesystem paths, and static files have both types of paths + * associated with them. Therefore, in this module: + * + * LOCALDIR or LOCALFILE refers to directories or files on the filesystem. + * + * HREF is used to describe things that go in a URL. + */ + +import("fileutils.{readFile,readFileBytes}"); +import("yuicompressor"); +import("stringutils"); +import("varz"); +import("ejs.EJS"); + +jimport("java.lang.System.out.println"); + +//---------------------------------------------------------------- +// Content Type Guessing +//---------------------------------------------------------------- + +var _contentTypes = { + 'gif': 'image/gif', + 'png': 'image/png', + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'css': 'text/css', + 'js': 'application/x-javascript', + 'txt': 'text/plain', + 'html': 'text/html; charset=utf-8', + 'ico': 'image/x-icon', + 'swf': 'application/x-shockwave-flash', + 'zip': 'application/zip', + 'xml': 'application/xml' +}; + +var _gzipableTypes = { + 'text/css': true, + 'application/x-javascript': true, + 'text/html; charset=utf-8': true +}; + +function _guessContentType(path) { + var ext = path.split('.').pop().toLowerCase(); + return _contentTypes[ext] || 'text/plain'; +} + +//---------------------------------------------------------------- + +function _getCache(name) { + var m = 'faststatic'; + if (!appjet.cache[m]) { + appjet.cache[m] = {}; + } + var c = appjet.cache[m]; + if (!c[name]) { + c[name] = {}; + } + return c[name]; +} + +var _mtimeCheckInterval = 5000; // 5 seconds + +function _getMTime(f) { + var mcache = _getCache('mtimes'); + var now = +(new Date); + if (appjet.config.devMode || + !(mcache[f] && (now - mcache[f].lastCheck < _mtimeCheckInterval))) { + var jfile = new net.appjet.oui.JarVirtualFile(f); + if (jfile.exists() && !jfile.isDirectory()) { + mcache[f] = { + lastCheck: now, + mtime: jfile.lastModified() + }; + } else { + mcache[f] = null; + } + } + if (mcache[f]) { + return +mcache[f].mtime; + } else { + return null; + } +} + +function manglePluginPath(localFile, fileType) { + var prefix = '/static/' + fileType + '/plugins/'; + if (localFile.substring(0, prefix.length) != prefix) + return localFile; + var suffix = localFile.substring(prefix.length); + var plugin = suffix.split('/', 1)[0]; + suffix = suffix.substring(plugin.length + 1); + return '/plugins/' + plugin + '/static/' + fileType + '/' + suffix; +} + +function manglePluginPaths(localFile) { + return manglePluginPath( + manglePluginPath( + manglePluginPath( + manglePluginPath( + manglePluginPath( + localFile, + 'js'), + 'css'), + 'swf'), + 'html'), + 'zip'); +} + +function _wrapFile(localFile) { + return { + getPath: function() { return localFile; }, + getMTime: function() { return _getMTime(localFile); }, + getContents: function() { return _readFileAndProcess(manglePluginPaths(localFile), 'string'); } + }; +} + +function _readFileAndProcess(fileName, type) { + if (fileName.slice(-8) == "_ejs.css") { + // run CSS through EJS + var template = readFile(fileName); + var ejs = new EJS({text:template, name:fileName}); + var resultString = ejs.render({}); + if (type == 'bytes') { + return new java.lang.String(resultString).getBytes("UTF-8"); + } + else { + return resultString; + } + } + else if (type == 'string') { + return readFile(fileName); + } + else if (type == 'bytes') { + return readFileBytes(fileName); + } +} + +function _cachedFileBytes(f) { + var mtime = _getMTime(f); + if (!mtime) { return null; } + var fcache = _getCache('file-bytes-cache'); + if (!(fcache[f] && (fcache[f].mtime == mtime))) { + varz.incrementInt("faststatic-file-bytes-cache-miss"); + var bytes = _readFileAndProcess(f, 'bytes'); + if (bytes) { + fcache[f] = {mtime: mtime, bytes: bytes}; + }; + } + if (fcache[f] && fcache[f].bytes) { + return fcache[f].bytes; + } else { + return null; + } +} + +function _shouldGzip(contentType) { + var userAgent = request.headers["User-Agent"]; + if (! userAgent) return false; + if (! (/Firefox/.test(userAgent) || /webkit/i.test(userAgent))) return false; + if (! _gzipableTypes[contentType]) return false; + + return request.acceptsGzip; +} + +function _getCachedGzip(original, key) { + var c = _getCache("gzipped"); + if (! c[key] || ! java.util.Arrays.equals(c[key].original, original)) { + c[key] = {original: original, + gzip: stringutils.gzip(original)}; + } + return c[key].gzip; +} + +function _setGzipHeader() { + response.setHeader("Content-Encoding", "gzip"); +} + +//---------------------------------------------------------------- + +/** + * Function for serving a single static file. + */ +function singleFileServer(localPath, opts) { + var contentType = _guessContentType(localPath); + + return function() { + (opts.cache ? response.alwaysCache() : response.neverCache()); + response.setContentType(contentType); + var bytes = _cachedFileBytes(localPath); + if (bytes) { + if (_shouldGzip(contentType)) { + bytes = _getCachedGzip(bytes, "file:"+localPath); + _setGzipHeader(); + } + response.writeBytes(bytes); + return true; + } else { + return false; + } + }; +} + +/** + * valid opts: + * alwaysCache: default false + */ +function directoryServer(localDir, opts) { + if (stringutils.endsWith(localDir, "/")) { + localDir = localDir.substr(0, localDir.length-1); + } + return function(relpath) { + if (stringutils.startsWith(relpath, "/")) { + relpath = relpath.substr(1); + } + if (relpath.indexOf('..') != -1) { + response.forbid(); + } + (opts.cache ? response.alwaysCache() : response.neverCache()); + var contentType = _guessContentType(relpath); + response.setContentType(contentType); + var fullPath = localDir + "/" + relpath; + var bytes = _cachedFileBytes(fullPath); + + if (bytes) { + if (_shouldGzip(contentType)) { + bytes = _getCachedGzip(bytes, "file:"+fullPath); + _setGzipHeader(); + } + response.writeBytes(bytes); + return true; + } else { + return false; + } + }; +} + +/** + * Serves cat files, which are concatenated versions of many files. + */ +function compressedFileServer(opts) { + var cfcache = _getCache('compressed-files'); + return function() { + var key = request.path.split('/').slice(-1)[0]; + var contentType = _guessContentType(request.path); + response.setContentType(contentType); + response.alwaysCache(); + var data = cfcache[key]; + if (data) { + if (_shouldGzip(contentType)) { + data = _getCachedGzip((new java.lang.String(data)).getBytes(response.getCharacterEncoding()), "comp:"+key); + _setGzipHeader(); + response.writeBytes(data); + } else { + response.write(data); + } + return true; + } else { + return false; + } + }; +} + +function getCompressedFilesKey(type, baseLocalDir, localFileList) { + if (stringutils.endsWith(baseLocalDir, '/')) { + baseLocalDir = baseLocalDir.substr(0, baseLocalDir.length-1); + } + + var fileList = []; + // convert passed-in file list into list of our file objects + localFileList.forEach(function(f) { + if (typeof(f) == 'string') { + fileList.push(_wrapFile(baseLocalDir+'/'+f)); + } else { + fileList.push(f); + } + }); + + // have we seen this exact fileset before? + var fsId = fileList.map(function(f) { return f.getPath(); }).join('|'); + var fsMTime = Math.max.apply(this, + fileList.map(function(f) { return f.getMTime(); })); + + var kdcache = _getCache('fileset-keydata-cache'); + if (!(kdcache[fsId] && (kdcache[fsId].mtime == fsMTime))) { + //println("cache miss for fileset: "+fsId); + //println("compressing fileset..."); + kdcache[fsId] = { + mtime: fsMTime, + keyString: _compressFilesAndMakeKey(type, fileList) + }; + } + return kdcache[fsId].keyString; +} + +function _compressFilesAndMakeKey(type, fileList) { + function _compress(s) { + if (type == 'css') { + varz.incrementInt("faststatic-yuicompressor-compressCSS"); + return yuicompressor.compressCSS(s); + } else if (type == 'js') { + varz.incrementInt("faststatic-yuicompressor-compressJS"); + return yuicompressor.compressJS(s); + } else { + throw Error('Dont know how to compress this filetype: '+type); + } + } + + var fullstr = ""; + fileList.forEach(function(f) { + fullstr += _compress(f.getContents()); + }); + + fullstr = _compress(fullstr); + + var key = stringutils.md5(fullstr) + '.' + type; + var cfcache = _getCache('compressed-files'); + cfcache[key] = fullstr; + return key; +} + diff --git a/trunk/infrastructure/framework-src/modules/fileutils.js b/infrastructure/framework-src/modules/fileutils.js index aaf12e2..aaf12e2 100644 --- a/trunk/infrastructure/framework-src/modules/fileutils.js +++ b/infrastructure/framework-src/modules/fileutils.js diff --git a/trunk/infrastructure/framework-src/modules/funhtml.js b/infrastructure/framework-src/modules/funhtml.js index c27b667..c27b667 100644 --- a/trunk/infrastructure/framework-src/modules/funhtml.js +++ b/infrastructure/framework-src/modules/funhtml.js diff --git a/trunk/infrastructure/framework-src/modules/global/appjet.js b/infrastructure/framework-src/modules/global/appjet.js index 135ac44..135ac44 100644 --- a/trunk/infrastructure/framework-src/modules/global/appjet.js +++ b/infrastructure/framework-src/modules/global/appjet.js diff --git a/trunk/infrastructure/framework-src/modules/global/request.js b/infrastructure/framework-src/modules/global/request.js index a4327f9..a4327f9 100644 --- a/trunk/infrastructure/framework-src/modules/global/request.js +++ b/infrastructure/framework-src/modules/global/request.js diff --git a/trunk/infrastructure/framework-src/modules/global/response.js b/infrastructure/framework-src/modules/global/response.js index 7236920..7236920 100644 --- a/trunk/infrastructure/framework-src/modules/global/response.js +++ b/infrastructure/framework-src/modules/global/response.js diff --git a/trunk/infrastructure/framework-src/modules/image.js b/infrastructure/framework-src/modules/image.js index 8aec74b..8aec74b 100644 --- a/trunk/infrastructure/framework-src/modules/image.js +++ b/infrastructure/framework-src/modules/image.js diff --git a/trunk/infrastructure/framework-src/modules/jsutils.js b/infrastructure/framework-src/modules/jsutils.js index 02f81a2..02f81a2 100644 --- a/trunk/infrastructure/framework-src/modules/jsutils.js +++ b/infrastructure/framework-src/modules/jsutils.js diff --git a/trunk/infrastructure/framework-src/modules/netutils.js b/infrastructure/framework-src/modules/netutils.js index 6616b76..6616b76 100644 --- a/trunk/infrastructure/framework-src/modules/netutils.js +++ b/infrastructure/framework-src/modules/netutils.js diff --git a/infrastructure/framework-src/modules/process.js b/infrastructure/framework-src/modules/process.js new file mode 100644 index 0000000..48ab62e --- /dev/null +++ b/infrastructure/framework-src/modules/process.js @@ -0,0 +1,91 @@ +/** + * Simple way to execute external commands through javascript + * + * @example + cmd = exec("cat"); + System.out.println("First: " +cmd.write("this is a loop.").read(Process.READ_AVAILABLE)); // prints "this is a loop." + System.out.println("Second: " +cmd.writeAndClose(" hi there").result()); // prints "this is a loop. hi there" + * + */ + +jimport("java.lang.Runtime"); +jimport("java.io.BufferedInputStream"); +jimport("java.io.BufferedOutputStream"); +jimport("java.lang.System"); + +/* returns a process */ +function exec(process) { + return new Process(process); +}; + +function Process(cmd) { + this.cmd = cmd; + this.proc = Runtime.getRuntime().exec(cmd); + this.resultText = ""; + this.inputStream = new BufferedInputStream(this.proc.getInputStream()); + this.errorStream = new BufferedInputStream(this.proc.getErrorStream()); + this.outputStream = new BufferedOutputStream(this.proc.getOutputStream()); +} + +Process.CHUNK_SIZE = 1024; +Process.READ_ALL = -1; +Process.READ_AVAILABLE = -2; + +Process.prototype.write = function(stdinText) { + this.outputStream.write(new java.lang.String(stdinText).getBytes()); + this.outputStream.flush(); + return this; +}; + +Process.prototype.writeAndClose = function(stdinText) { + this.write(stdinText); + this.outputStream.close(); + return this; +}; + +/* Python file-like behavior: read specified number of bytes, else until EOF*/ +Process.prototype.read = function(nbytesToRead, stream) { + var inputStream = stream || this.inputStream; + var availBytes = inputStream.available(); + if (!availBytes) return null; + + var result = ""; + var nbytes = nbytesToRead || Process.READ_ALL; + var readAll = (nbytes == Process.READ_ALL); + var readAvailable = (nbytes == Process.READ_AVAILABLE); + while (nbytes > 0 || readAll || readAvailable) { + var chunkSize = readAll ? Process.CHUNK_SIZE : + readAvailable ? Process.CHUNK_SIZE : nbytes; + + // allocate a java byte array + var bytes = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, chunkSize); + + var len = inputStream.read(bytes, 0, chunkSize); + + // at end of stream, or when we run out of data, stop reading in chunks. + if (len == -1) break; + if (nbytes > 0) nbytes -= len; + + result += new java.lang.String(bytes); + + if (readAvailable && inputStream.available() == 0) break; + } + + this.resultText += new String(result); + return new String(result); +}; + +Process.prototype.result = function() { + this.outputStream.close(); + this.proc.waitFor(); + this.read(Process.READ_ALL, this.inputStream); + return new String(this.resultText); +}; + +Process.prototype.resultOrError = function() { + this.proc.waitFor(); + this.read(Process.READ_ALL, this.inputStream); + var result = this.resultText; + if(!result || result == "") result = this.read(Process.READ_ALL, this.errorStream); + return result || ""; +}; diff --git a/trunk/infrastructure/framework-src/modules/profiler.js b/infrastructure/framework-src/modules/profiler.js index 223c197..223c197 100644 --- a/trunk/infrastructure/framework-src/modules/profiler.js +++ b/infrastructure/framework-src/modules/profiler.js diff --git a/trunk/infrastructure/framework-src/modules/sessions.js b/infrastructure/framework-src/modules/sessions.js index 3d0041b..3d0041b 100644 --- a/trunk/infrastructure/framework-src/modules/sessions.js +++ b/infrastructure/framework-src/modules/sessions.js diff --git a/trunk/infrastructure/framework-src/modules/sqlbase/persistent_vars.js b/infrastructure/framework-src/modules/sqlbase/persistent_vars.js index 1c4cc95..1c4cc95 100644 --- a/trunk/infrastructure/framework-src/modules/sqlbase/persistent_vars.js +++ b/infrastructure/framework-src/modules/sqlbase/persistent_vars.js diff --git a/trunk/infrastructure/framework-src/modules/sqlbase/sqlbase.js b/infrastructure/framework-src/modules/sqlbase/sqlbase.js index 3df1a0f..3df1a0f 100644 --- a/trunk/infrastructure/framework-src/modules/sqlbase/sqlbase.js +++ b/infrastructure/framework-src/modules/sqlbase/sqlbase.js diff --git a/trunk/infrastructure/framework-src/modules/sqlbase/sqlcommon.js b/infrastructure/framework-src/modules/sqlbase/sqlcommon.js index 360f5e2..360f5e2 100644 --- a/trunk/infrastructure/framework-src/modules/sqlbase/sqlcommon.js +++ b/infrastructure/framework-src/modules/sqlbase/sqlcommon.js diff --git a/infrastructure/framework-src/modules/sqlbase/sqlobj.js b/infrastructure/framework-src/modules/sqlbase/sqlobj.js new file mode 100644 index 0000000..e599c92 --- /dev/null +++ b/infrastructure/framework-src/modules/sqlbase/sqlobj.js @@ -0,0 +1,551 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import("cache_utils.syncedWithCache"); +import("sqlbase.sqlcommon.*"); +import("jsutils.*"); +import("etherpad.log"); + +jimport("java.lang.System.out.println"); +jimport("java.sql.Statement"); + +function _withCache(name, fn) { + return syncedWithCache('sqlobj.'+name, fn); +} + +function getIdColspec() { + return ('INT NOT NULL '+autoIncrementClause()+' PRIMARY KEY'); +} + +function getLongtextColspec(extra) { + var spec = getSqlBase().longTextType(); + if (extra) { + spec = (spec + " " + extra); + } + return spec; +} + +function getBoolColspec(extra) { + var spec; + if (isMysql()) { + spec = 'TINYINT(1)'; + } else { + spec = 'SMALLINT'; + } + if (extra) { + spec = (spec + " " + extra); + } + return spec; +} + +function getDateColspec(extra) { + var spec; + if (isMysql()) { + spec = 'DATETIME'; + } else { + spec = 'TIMESTAMP'; + } + if (extra) { + spec = (spec + " " + extra); + } + return spec; +} + +function _bq(x) { return btquote(x); } + +/* + * for debugging queries + */ +function _qdebug(q) { + if (appjet.config.debugSQL) { + println(q); + } +} + +/** executeFn is either "execute" or "executeUpdate" "executeQuery" */ +function _execute(stmnt, executeFn) { + if (!executeFn) { + executeFn = 'execute'; + } + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + return closing(pstmnt, function() { + _qdebug(stmnt); + return pstmnt[executeFn](); + }); + }); +} + +function _executeUpdate(stmnt) { + return _execute(stmnt, 'executeUpdate'); +} + +function _executeQuery(stmnt) { + return _execute(stmnt, 'executeQuery'); +} + +/* + * Not all SQL/JS types supported. + */ +function _getJsValFromResultSet(rs, type, colName) { + var r; + if (type == java.sql.Types.VARCHAR || + type == java.sql.Types.LONGVARCHAR || + type == java.sql.Types.CHAR) { + r = String(rs.getString(colName)); + } else if (type == java.sql.Types.TIMESTAMP) { + var t = rs.getTimestamp(colName); + if (t) { + r = new Date(t.getTime()); + } else { + r = null; + } + } else if (type == java.sql.Types.BIGINT || + type == java.sql.Types.INTEGER || + type == java.sql.Types.SMALLINT || + type == java.sql.Types.TINYINT) { + r = rs.getInt(colName); + } else if (type == java.sql.Types.DECIMAL) { + r = rs.getFloat(colName); + } else if (type == java.sql.Types.BIT) { + r = rs.getBoolean(colName); + } else { + throw Error("Cannot fetch sql type ID "+type+" (columnName = "+colName+")"); + } + + if (rs.wasNull()) { + r = null; + } + return r; +} + +function _lookupColumnType(tableName, columnName) { + return withConnection(function(conn) { + var metadata = conn.getMetaData(); + var rs = metadata.getColumns(null, null, tableName, columnName); + if (!rs) { + throw Error("Table '"+tableName+"' does not appear to have colum '"+columnName+"'."); + } + var rsmd = rs.getMetaData(); + var colCount = rsmd.getColumnCount(); +// rs.first(); + rs.next(); + var type = rs.getInt("DATA_TYPE"); + return type; + }); +} + +/* cached, on misses calls _lookuParameterType */ +function _getParameterType(tableName, columnName) { + var key = [tableName, columnName].join("."); + return _withCache('column-types', function(cache) { + if (!cache[key]) { + cache[key] = _lookupColumnType(tableName, columnName); + } + return cache[key]; + }); +} + +/* + * Not all SQL/JS types supported. + */ +function _setPreparedValues(tableName, pstmnt, keyList, obj, indexOffset) { + if (!indexOffset) { indexOffset = 0; } + + for (var i = 1; i <= keyList.length; i++) { + var k = keyList[i-1]; + var v = obj[k]; + var j = i + indexOffset; + + if (v === undefined) { + throw Error("value is undefined for key "+k); + } + + if (v === null) { + var type = _getParameterType(tableName, k); + pstmnt.setNull(j, type); + } else if (typeof(v) == 'string') { + pstmnt.setString(j, v); + } else if (typeof(v) == 'number') { + pstmnt.setInt(j, v); + } else if (typeof(v) == 'boolean') { + pstmnt.setBoolean(j, v); + } else if (v.valueOf && v.getDate && v.getHours) { + pstmnt.setTimestamp(j, new java.sql.Timestamp(+v)); + } else { + throw Error("Cannot insert this type of javascript object: "+typeof(v)+" (key="+k+", value = "+v+")"); + } + } +} + +function _resultRowToJsObj(resultSet) { + var resultObj = {}; + + var metaData = resultSet.getMetaData(); + var colCount = metaData.getColumnCount(); + + for (var i = 1; i <= colCount; i++) { + var colName = metaData.getColumnLabel(i); + var type = metaData.getColumnType(i); + resultObj[colName] = _getJsValFromResultSet(resultSet, type, colName); + } + + return resultObj; +} + +/* + * Inserts the object into the given table, and returns auto-incremented ID if any. + */ +function insert(tableName, obj) { + var keyList = keys(obj); + + var stmnt = "INSERT INTO "+_bq(tableName)+" ("; + stmnt += keyList.map(function(k) { return _bq(k); }).join(', '); + stmnt += ") VALUES ("; + stmnt += keyList.map(function(k) { return '?'; }).join(', '); + stmnt += ")"; + + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt, Statement.RETURN_GENERATED_KEYS); + return closing(pstmnt, function() { + _setPreparedValues(tableName, pstmnt, keyList, obj, 0); + _qdebug(stmnt); + pstmnt.executeUpdate(); + var rs = pstmnt.getGeneratedKeys(); + if (rs != null) { + return closing(rs, function() { + if (rs.next()) { + return rs.getInt(1); + } + }); + } + }); + }); +}; + +/* + * Selects a single object given the constraintMap. If there are more + * than 1 objects that match, it will return a single one of them + * (unspecified which one). If no objects match, returns null. + * + * constraints is a javascript object of column names to values. + * Currently only supports string equality of constraints. + */ +function selectSingle(tableName, constraints) { + var keyList = keys(constraints); + + var stmnt = "SELECT * FROM "+_bq(tableName)+" WHERE ("; + stmnt += keyList.map(function(k) { return '('+_bq(k)+' = '+'?)'; }).join(' AND '); + stmnt += ')'; + if (isMysql()) { + stmnt += ' LIMIT 1'; + } + + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + return closing(pstmnt, function() { + _setPreparedValues(tableName, pstmnt, keyList, constraints, 0); + _qdebug(stmnt); + var resultSet = pstmnt.executeQuery(); + return closing(resultSet, function() { + if (!resultSet.next()) { + return null; + } + return _resultRowToJsObj(resultSet); + }); + }); + }); +} + +function _makeConstraintString(key, value) { + if (typeof(value) != 'object' || ! (value instanceof Array)) { + return '('+_bq(key)+' = ?)'; + } else { + var comparator = value[0]; + return '('+_bq(key)+' '+comparator+' ?)'; + } +} + +function _preparedValuesConstraints(constraints) { + var c = {}; + eachProperty(constraints, function(k, v) { + c[k] = (typeof(v) != 'object' || ! (v instanceof Array) ? v : v[1]); + }); + return c; +} + +function selectMulti(tableName, constraints, options) { + if (!options) { + options = {}; + } + + var constraintKeys = keys(constraints); + + var stmnt = "SELECT * FROM "+_bq(tableName)+" "; + + if (constraintKeys.length > 0) { + stmnt += "WHERE ("; + stmnt += constraintKeys.map(function(key) { + return _makeConstraintString(key, constraints[key]); + }).join(' AND '); + stmnt += ')'; + } + + if (options.orderBy) { + var orderEntries = []; + options.orderBy.split(",").forEach(function(orderBy) { + var asc = "ASC"; + if (orderBy.charAt(0) == '-') { + orderBy = orderBy.substr(1); + asc = "DESC"; + } + orderEntries.push(_bq(orderBy)+" "+asc); + }); + stmnt += " ORDER BY "+orderEntries.join(", "); + } + + if (options.limit) { + stmnt += " LIMIT "+options.limit; + } + + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + return closing(pstmnt, function() { + _setPreparedValues( + tableName, pstmnt, constraintKeys, + _preparedValuesConstraints(constraints), 0); + + _qdebug(stmnt); + var resultSet = pstmnt.executeQuery(); + var resultArray = []; + + return closing(resultSet, function() { + while (resultSet.next()) { + resultArray.push(_resultRowToJsObj(resultSet)); + } + + return resultArray; + }); + }); + }); +} + +function executeRaw(stmnt, params) { + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + return closing(pstmnt, function() { + for (var i = 0; i < params.length; i++) { + var v = params[i]; + + if (v === undefined) { + throw Error("value is undefined for key "+i); + } + + if (typeof(v) == 'object' && v.isnull) { + pstmnt.setNull(i+1, v.type); + } else if (typeof(v) == 'string') { + pstmnt.setString(i+1, v); + } else if (typeof(v) == 'number') { + pstmnt.setInt(i+1, v); + } else if (typeof(v) == 'boolean') { + pstmnt.setBoolean(i+1, v); + } else if (v.valueOf && v.getDate && v.getHours) { + pstmnt.setTimestamp(i+1, new java.sql.Timestamp(+v)); + } else { + throw Error("Cannot insert this type of javascript object: "+typeof(v)+" (key="+i+", value = "+v+")"); + } + } + + _qdebug(stmnt); + var resultSet = pstmnt.executeQuery(); + var resultArray = []; + + return closing(resultSet, function() { + while (resultSet.next()) { + resultArray.push(_resultRowToJsObj(resultSet)); + } + + return resultArray; + }); + }); + }); +} + +/* returns number of rows updated */ +function update(tableName, constraints, obj) { + var objKeys = keys(obj); + var constraintKeys = keys(constraints); + + var stmnt = "UPDATE "+_bq(tableName)+" SET "; + stmnt += objKeys.map(function(k) { return ''+_bq(k)+' = ?'; }).join(', '); + stmnt += " WHERE ("; + stmnt += constraintKeys.map(function(k) { return '('+_bq(k)+' = ?)'; }).join(' AND '); + stmnt += ')'; + + return withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + return closing(pstmnt, function() { + _setPreparedValues(tableName, pstmnt, objKeys, obj, 0); + _setPreparedValues(tableName, pstmnt, constraintKeys, constraints, objKeys.length); + _qdebug(stmnt); + return pstmnt.executeUpdate(); + }); + }); +} + +function updateSingle(tableName, constraints, obj) { + var count = update(tableName, constraints, obj); + if (count != 1) { + throw Error("save count != 1. instead, count = "+count); + } +} + +function deleteRows(tableName, constraints) { + var constraintKeys = keys(constraints); + var stmnt = "DELETE FROM "+_bq(tableName)+" WHERE ("; + stmnt += constraintKeys.map(function(k) { return '('+_bq(k)+' = ?)'; }).join(' AND '); + stmnt += ')'; + withConnection(function(conn) { + var pstmnt = conn.prepareStatement(stmnt); + closing(pstmnt, function() { + _setPreparedValues(tableName, pstmnt, constraintKeys, constraints); + _qdebug(stmnt); + pstmnt.executeUpdate(); + }); + }) +} + +//---------------------------------------------------------------- +// table management +//---------------------------------------------------------------- + +/* + * Create a SQL table, specifying column names and types with a + * javascript object. + */ +function createTable(tableName, colspec, indices) { + if (doesTableExist(tableName)) { + return; + } + + var stmnt = "CREATE TABLE "+_bq(tableName)+ " ("; + stmnt += keys(colspec).map(function(k) { return (_bq(k) + ' ' + colspec[k]); }).join(', '); + if (indices) { + stmnt += ', ' + keys(indices).map(function(k) { return 'INDEX (' + _bq(k) + ')'; }).join(', '); + } + stmnt += ')'+createTableOptions(); + _execute(stmnt); +} + +function dropTable(tableName) { + _execute("DROP TABLE "+_bq(tableName)); +} + +function dropAndCreateTable(tableName, colspec, indices) { + if (doesTableExist(tableName)) { + dropTable(tableName); + } + + return createTable(tableName, colspec, indices); +} + +function renameTable(oldName, newName) { + _executeUpdate("RENAME TABLE "+_bq(oldName)+" TO "+_bq(newName)); +} + +function modifyColumn(tableName, columnName, newSpec) { + _executeUpdate("ALTER TABLE "+_bq(tableName)+" MODIFY "+_bq(columnName)+" "+newSpec); +} + +function alterColumn(tableName, columnName, alteration) { + var q = "ALTER TABLE "+_bq(tableName)+" ALTER COLUMN "+_bq(columnName)+" "+alteration; + _executeUpdate(q); +} + +function changeColumn(tableName, columnName, newSpec) { + var q = ("ALTER TABLE "+_bq(tableName)+" CHANGE COLUMN "+_bq(columnName) + +" "+newSpec); + _executeUpdate(q); +} + +function addColumns(tableName, colspec) { + inTransaction(function(conn) { + eachProperty(colspec, function(name, definition) { + var stmnt = "ALTER TABLE "+_bq(tableName)+" ADD COLUMN "+_bq(name)+" "+definition; + _executeUpdate(stmnt); + }); + }); +} + +function dropColumn(tableName, columnName) { + var stmnt = "ALTER TABLE "+_bq(tableName)+" DROP COLUMN "+_bq(columnName); + _executeUpdate(stmnt); +} + +function listTables() { + return withConnection(function(conn) { + var metadata = conn.getMetaData(); + var resultSet = metadata.getTables(null, null, null, null); + var resultArray = []; + + return closing(resultSet, function() { + while (resultSet.next()) { + resultArray.push(resultSet.getString("TABLE_NAME")); + } + return resultArray; + }); + }); +} + +function setTableEngine(tableName, engineName) { + var stmnt = "ALTER TABLE "+_bq(tableName)+" ENGINE="+_bq(engineName); + _executeUpdate(stmnt); +} + +function getTableEngine(tableName) { + if (!isMysql()) { + throw Error("getTableEngine() only supported by MySQL database type."); + } + + var tableEngines = {}; + + withConnection(function(conn) { + var stmnt = "show table status"; + var pstmnt = conn.prepareStatement(stmnt); + closing(pstmnt, function() { + _qdebug(stmnt); + var resultSet = pstmnt.executeQuery(); + closing(resultSet, function() { + while (resultSet.next()) { + var n = resultSet.getString("Name"); + var eng = resultSet.getString("Engine"); + tableEngines[n] = eng; + } + }); + }); + }); + + return tableEngines[tableName]; +} + +function createIndex(tableName, columns) { + var indexName = "idx_"+(columns.join("_")); + var stmnt = "CREATE INDEX "+_bq(indexName)+" on "+_bq(tableName)+" ("; + stmnt += columns.map(_bq).join(", "); + stmnt += ")"; + _executeUpdate(stmnt); +} + diff --git a/trunk/infrastructure/framework-src/modules/stringutils.js b/infrastructure/framework-src/modules/stringutils.js index 3fe5611..3fe5611 100644 --- a/trunk/infrastructure/framework-src/modules/stringutils.js +++ b/infrastructure/framework-src/modules/stringutils.js diff --git a/trunk/infrastructure/framework-src/modules/sync.js b/infrastructure/framework-src/modules/sync.js index a222ea0..a222ea0 100644 --- a/trunk/infrastructure/framework-src/modules/sync.js +++ b/infrastructure/framework-src/modules/sync.js diff --git a/trunk/infrastructure/framework-src/modules/timer.js b/infrastructure/framework-src/modules/timer.js index 01be175..01be175 100644 --- a/trunk/infrastructure/framework-src/modules/timer.js +++ b/infrastructure/framework-src/modules/timer.js diff --git a/trunk/infrastructure/framework-src/modules/varz.js b/infrastructure/framework-src/modules/varz.js index 0e55d20..0e55d20 100644 --- a/trunk/infrastructure/framework-src/modules/varz.js +++ b/infrastructure/framework-src/modules/varz.js diff --git a/trunk/infrastructure/framework-src/modules/yuicompressor.js b/infrastructure/framework-src/modules/yuicompressor.js index 572cc0d..572cc0d 100644 --- a/trunk/infrastructure/framework-src/modules/yuicompressor.js +++ b/infrastructure/framework-src/modules/yuicompressor.js diff --git a/trunk/infrastructure/framework-src/oncomet.js b/infrastructure/framework-src/oncomet.js index b6aeda5..b6aeda5 100644 --- a/trunk/infrastructure/framework-src/oncomet.js +++ b/infrastructure/framework-src/oncomet.js diff --git a/trunk/infrastructure/framework-src/onerror.js b/infrastructure/framework-src/onerror.js index f19a85f..f19a85f 100644 --- a/trunk/infrastructure/framework-src/onerror.js +++ b/infrastructure/framework-src/onerror.js diff --git a/trunk/infrastructure/framework-src/onprint.js b/infrastructure/framework-src/onprint.js index 8e334fe..8e334fe 100644 --- a/trunk/infrastructure/framework-src/onprint.js +++ b/infrastructure/framework-src/onprint.js diff --git a/trunk/infrastructure/framework-src/onrequest.js b/infrastructure/framework-src/onrequest.js index d76c8db..d76c8db 100644 --- a/trunk/infrastructure/framework-src/onrequest.js +++ b/infrastructure/framework-src/onrequest.js diff --git a/trunk/infrastructure/framework-src/onreset.js b/infrastructure/framework-src/onreset.js index 24b000a..24b000a 100644 --- a/trunk/infrastructure/framework-src/onreset.js +++ b/infrastructure/framework-src/onreset.js diff --git a/trunk/infrastructure/framework-src/onsars.js b/infrastructure/framework-src/onsars.js index 31dc8ca..31dc8ca 100644 --- a/trunk/infrastructure/framework-src/onsars.js +++ b/infrastructure/framework-src/onsars.js diff --git a/trunk/infrastructure/framework-src/onscheduledtask.js b/infrastructure/framework-src/onscheduledtask.js index 810c3b5..810c3b5 100644 --- a/trunk/infrastructure/framework-src/onscheduledtask.js +++ b/infrastructure/framework-src/onscheduledtask.js diff --git a/trunk/infrastructure/framework-src/onshutdown.js b/infrastructure/framework-src/onshutdown.js index 0243bf6..0243bf6 100644 --- a/trunk/infrastructure/framework-src/onshutdown.js +++ b/infrastructure/framework-src/onshutdown.js diff --git a/trunk/infrastructure/framework-src/onstartup.js b/infrastructure/framework-src/onstartup.js index 61feff7..61feff7 100644 --- a/trunk/infrastructure/framework-src/onstartup.js +++ b/infrastructure/framework-src/onstartup.js diff --git a/trunk/infrastructure/framework-src/onsyntaxerror.js b/infrastructure/framework-src/onsyntaxerror.js index 7129a16..7129a16 100644 --- a/trunk/infrastructure/framework-src/onsyntaxerror.js +++ b/infrastructure/framework-src/onsyntaxerror.js diff --git a/trunk/infrastructure/framework-src/postamble.js b/infrastructure/framework-src/postamble.js index 76fa766..76fa766 100644 --- a/trunk/infrastructure/framework-src/postamble.js +++ b/infrastructure/framework-src/postamble.js diff --git a/trunk/infrastructure/framework-src/preamble.js b/infrastructure/framework-src/preamble.js index 40f6845..40f6845 100644 --- a/trunk/infrastructure/framework-src/preamble.js +++ b/infrastructure/framework-src/preamble.js diff --git a/trunk/infrastructure/framework-src/syntaxerror.js b/infrastructure/framework-src/syntaxerror.js index 801066b..801066b 100644 --- a/trunk/infrastructure/framework-src/syntaxerror.js +++ b/infrastructure/framework-src/syntaxerror.js diff --git a/trunk/infrastructure/lib/activation.jar b/infrastructure/lib/activation.jar Binary files differindex 29a59a9..29a59a9 100644 --- a/trunk/infrastructure/lib/activation.jar +++ b/infrastructure/lib/activation.jar diff --git a/trunk/infrastructure/lib/c3p0-0.9.1.2.jar b/infrastructure/lib/c3p0-0.9.1.2.jar Binary files differindex 0f42d60..0f42d60 100644 --- a/trunk/infrastructure/lib/c3p0-0.9.1.2.jar +++ b/infrastructure/lib/c3p0-0.9.1.2.jar diff --git a/infrastructure/lib/commons-fileupload-1.2.1-javadoc.jar b/infrastructure/lib/commons-fileupload-1.2.1-javadoc.jar Binary files differnew file mode 100644 index 0000000..86a56ac --- /dev/null +++ b/infrastructure/lib/commons-fileupload-1.2.1-javadoc.jar diff --git a/infrastructure/lib/commons-fileupload-1.2.1-sources.jar b/infrastructure/lib/commons-fileupload-1.2.1-sources.jar Binary files differnew file mode 100644 index 0000000..8141625 --- /dev/null +++ b/infrastructure/lib/commons-fileupload-1.2.1-sources.jar diff --git a/infrastructure/lib/commons-fileupload-1.2.1.jar b/infrastructure/lib/commons-fileupload-1.2.1.jar Binary files differnew file mode 100644 index 0000000..aa209b3 --- /dev/null +++ b/infrastructure/lib/commons-fileupload-1.2.1.jar diff --git a/infrastructure/lib/commons-io-1.4-javadoc.jar b/infrastructure/lib/commons-io-1.4-javadoc.jar Binary files differnew file mode 100644 index 0000000..95731a7 --- /dev/null +++ b/infrastructure/lib/commons-io-1.4-javadoc.jar diff --git a/infrastructure/lib/commons-io-1.4-sources.jar b/infrastructure/lib/commons-io-1.4-sources.jar Binary files differnew file mode 100644 index 0000000..299708f --- /dev/null +++ b/infrastructure/lib/commons-io-1.4-sources.jar diff --git a/infrastructure/lib/commons-io-1.4.jar b/infrastructure/lib/commons-io-1.4.jar Binary files differnew file mode 100644 index 0000000..133dc6c --- /dev/null +++ b/infrastructure/lib/commons-io-1.4.jar diff --git a/trunk/infrastructure/lib/commons-lang-2.4.jar b/infrastructure/lib/commons-lang-2.4.jar Binary files differindex 532939e..532939e 100644 --- a/trunk/infrastructure/lib/commons-lang-2.4.jar +++ b/infrastructure/lib/commons-lang-2.4.jar diff --git a/trunk/infrastructure/lib/derby-10.5.1.1.jar b/infrastructure/lib/derby-10.5.1.1.jar Binary files differindex 2820dbd..2820dbd 100644 --- a/trunk/infrastructure/lib/derby-10.5.1.1.jar +++ b/infrastructure/lib/derby-10.5.1.1.jar diff --git a/trunk/infrastructure/lib/derbytools.jar b/infrastructure/lib/derbytools.jar Binary files differindex 4aa76e1..4aa76e1 100644 --- a/trunk/infrastructure/lib/derbytools.jar +++ b/infrastructure/lib/derbytools.jar diff --git a/trunk/infrastructure/lib/dnsjava-2.0.6.jar b/infrastructure/lib/dnsjava-2.0.6.jar Binary files differindex e41f9b0..e41f9b0 100644 --- a/trunk/infrastructure/lib/dnsjava-2.0.6.jar +++ b/infrastructure/lib/dnsjava-2.0.6.jar diff --git a/infrastructure/lib/java_uno-3.2.0.jar b/infrastructure/lib/java_uno-3.2.0.jar Binary files differnew file mode 100644 index 0000000..1f23dd0 --- /dev/null +++ b/infrastructure/lib/java_uno-3.2.0.jar diff --git a/trunk/infrastructure/lib/jetty-6.1.20.jar b/infrastructure/lib/jetty-6.1.20.jar Binary files differindex 8f45db9..8f45db9 100644 --- a/trunk/infrastructure/lib/jetty-6.1.20.jar +++ b/infrastructure/lib/jetty-6.1.20.jar diff --git a/trunk/infrastructure/lib/jetty-sslengine-6.1.20.jar b/infrastructure/lib/jetty-sslengine-6.1.20.jar Binary files differindex 6f7d232..6f7d232 100644 --- a/trunk/infrastructure/lib/jetty-sslengine-6.1.20.jar +++ b/infrastructure/lib/jetty-sslengine-6.1.20.jar diff --git a/trunk/infrastructure/lib/jetty-util-6.1.20.jar b/infrastructure/lib/jetty-util-6.1.20.jar Binary files differindex 96c0979..96c0979 100644 --- a/trunk/infrastructure/lib/jetty-util-6.1.20.jar +++ b/infrastructure/lib/jetty-util-6.1.20.jar diff --git a/trunk/infrastructure/lib/json.jar b/infrastructure/lib/json.jar Binary files differindex 5ab955c..5ab955c 100644 --- a/trunk/infrastructure/lib/json.jar +++ b/infrastructure/lib/json.jar diff --git a/infrastructure/lib/juh-3.2.0.jar b/infrastructure/lib/juh-3.2.0.jar Binary files differnew file mode 100644 index 0000000..5345fe2 --- /dev/null +++ b/infrastructure/lib/juh-3.2.0.jar diff --git a/infrastructure/lib/jurt-3.2.0.jar b/infrastructure/lib/jurt-3.2.0.jar Binary files differnew file mode 100644 index 0000000..50f2346 --- /dev/null +++ b/infrastructure/lib/jurt-3.2.0.jar diff --git a/trunk/infrastructure/lib/mail.jar b/infrastructure/lib/mail.jar Binary files differindex e6f7083..e6f7083 100644 --- a/trunk/infrastructure/lib/mail.jar +++ b/infrastructure/lib/mail.jar diff --git a/trunk/infrastructure/lib/manifest b/infrastructure/lib/manifest index b91a5a7..b91a5a7 100644 --- a/trunk/infrastructure/lib/manifest +++ b/infrastructure/lib/manifest diff --git a/trunk/infrastructure/lib/rhino-js-1.7r1.jar b/infrastructure/lib/rhino-js-1.7r1.jar Binary files differindex 79f8529..79f8529 100644 --- a/trunk/infrastructure/lib/rhino-js-1.7r1.jar +++ b/infrastructure/lib/rhino-js-1.7r1.jar diff --git a/infrastructure/lib/ridl-3.2.0.jar b/infrastructure/lib/ridl-3.2.0.jar Binary files differnew file mode 100644 index 0000000..de46acb --- /dev/null +++ b/infrastructure/lib/ridl-3.2.0.jar diff --git a/trunk/infrastructure/lib/sanselan-0.94aj.jar b/infrastructure/lib/sanselan-0.94aj.jar Binary files differindex 0fd8c96..0fd8c96 100644 --- a/trunk/infrastructure/lib/sanselan-0.94aj.jar +++ b/infrastructure/lib/sanselan-0.94aj.jar diff --git a/trunk/infrastructure/lib/servlet-api-2.5-20081211.jar b/infrastructure/lib/servlet-api-2.5-20081211.jar Binary files differindex f1bfa12..f1bfa12 100644 --- a/trunk/infrastructure/lib/servlet-api-2.5-20081211.jar +++ b/infrastructure/lib/servlet-api-2.5-20081211.jar diff --git a/trunk/infrastructure/lib/tagsoup-1.2.jar b/infrastructure/lib/tagsoup-1.2.jar Binary files differindex af27803..af27803 100644 --- a/trunk/infrastructure/lib/tagsoup-1.2.jar +++ b/infrastructure/lib/tagsoup-1.2.jar diff --git a/infrastructure/lib/unoil-3.2.0.jar b/infrastructure/lib/unoil-3.2.0.jar Binary files differnew file mode 100644 index 0000000..b1e77aa --- /dev/null +++ b/infrastructure/lib/unoil-3.2.0.jar diff --git a/trunk/infrastructure/lib/yuicompressor-2.4-appjet.jar b/infrastructure/lib/yuicompressor-2.4-appjet.jar Binary files differindex b5bdfc1..b5bdfc1 100644 --- a/trunk/infrastructure/lib/yuicompressor-2.4-appjet.jar +++ b/infrastructure/lib/yuicompressor-2.4-appjet.jar diff --git a/trunk/infrastructure/net.appjet.ajstdlib/ajstdlib.scala b/infrastructure/net.appjet.ajstdlib/ajstdlib.scala index 8d285af..8d285af 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/ajstdlib.scala +++ b/infrastructure/net.appjet.ajstdlib/ajstdlib.scala diff --git a/trunk/infrastructure/net.appjet.ajstdlib/sqlbase.scala b/infrastructure/net.appjet.ajstdlib/sqlbase.scala index 047c086..047c086 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/sqlbase.scala +++ b/infrastructure/net.appjet.ajstdlib/sqlbase.scala diff --git a/trunk/infrastructure/net.appjet.ajstdlib/streaming-client.js b/infrastructure/net.appjet.ajstdlib/streaming-client.js index 3bfa227..3bfa227 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/streaming-client.js +++ b/infrastructure/net.appjet.ajstdlib/streaming-client.js diff --git a/trunk/infrastructure/net.appjet.ajstdlib/streaming-iframe.html b/infrastructure/net.appjet.ajstdlib/streaming-iframe.html index 3bdb5c4..3bdb5c4 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/streaming-iframe.html +++ b/infrastructure/net.appjet.ajstdlib/streaming-iframe.html diff --git a/trunk/infrastructure/net.appjet.ajstdlib/streaming.scala b/infrastructure/net.appjet.ajstdlib/streaming.scala index fbff137..fbff137 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/streaming.scala +++ b/infrastructure/net.appjet.ajstdlib/streaming.scala diff --git a/trunk/infrastructure/net.appjet.ajstdlib/timer.scala b/infrastructure/net.appjet.ajstdlib/timer.scala index dac8fb6..dac8fb6 100644 --- a/trunk/infrastructure/net.appjet.ajstdlib/timer.scala +++ b/infrastructure/net.appjet.ajstdlib/timer.scala diff --git a/trunk/infrastructure/net.appjet.bodylock/bodylock.scala b/infrastructure/net.appjet.bodylock/bodylock.scala index e24d55c..e24d55c 100644 --- a/trunk/infrastructure/net.appjet.bodylock/bodylock.scala +++ b/infrastructure/net.appjet.bodylock/bodylock.scala diff --git a/trunk/infrastructure/net.appjet.bodylock/compressor.scala b/infrastructure/net.appjet.bodylock/compressor.scala index 5041787..5041787 100644 --- a/trunk/infrastructure/net.appjet.bodylock/compressor.scala +++ b/infrastructure/net.appjet.bodylock/compressor.scala diff --git a/trunk/infrastructure/net.appjet.common.cli/cli.scala b/infrastructure/net.appjet.common.cli/cli.scala index ef9223f..ef9223f 100644 --- a/trunk/infrastructure/net.appjet.common.cli/cli.scala +++ b/infrastructure/net.appjet.common.cli/cli.scala diff --git a/trunk/infrastructure/net.appjet.common.sars/sars.scala b/infrastructure/net.appjet.common.sars/sars.scala index f91b292..f91b292 100644 --- a/trunk/infrastructure/net.appjet.common.sars/sars.scala +++ b/infrastructure/net.appjet.common.sars/sars.scala diff --git a/trunk/infrastructure/net.appjet.common.sars/sha1.scala b/infrastructure/net.appjet.common.sars/sha1.scala index 8f9e69e..8f9e69e 100644 --- a/trunk/infrastructure/net.appjet.common.sars/sha1.scala +++ b/infrastructure/net.appjet.common.sars/sha1.scala diff --git a/trunk/infrastructure/net.appjet.common/rhino/rhinospect.scala b/infrastructure/net.appjet.common/rhino/rhinospect.scala index 65f278c..65f278c 100644 --- a/trunk/infrastructure/net.appjet.common/rhino/rhinospect.scala +++ b/infrastructure/net.appjet.common/rhino/rhinospect.scala diff --git a/trunk/infrastructure/net.appjet.common/util/BCrypt.java b/infrastructure/net.appjet.common/util/BCrypt.java index 818c261..818c261 100644 --- a/trunk/infrastructure/net.appjet.common/util/BCrypt.java +++ b/infrastructure/net.appjet.common/util/BCrypt.java diff --git a/trunk/infrastructure/net.appjet.common/util/BetterFile.java b/infrastructure/net.appjet.common/util/BetterFile.java index c674810..c674810 100644 --- a/trunk/infrastructure/net.appjet.common/util/BetterFile.java +++ b/infrastructure/net.appjet.common/util/BetterFile.java diff --git a/trunk/infrastructure/net.appjet.common/util/ClassReload.java b/infrastructure/net.appjet.common/util/ClassReload.java index 3fbc480..3fbc480 100644 --- a/trunk/infrastructure/net.appjet.common/util/ClassReload.java +++ b/infrastructure/net.appjet.common/util/ClassReload.java diff --git a/trunk/infrastructure/net.appjet.common/util/ExpiringMapping.java b/infrastructure/net.appjet.common/util/ExpiringMapping.java index d4b9d5a..d4b9d5a 100644 --- a/trunk/infrastructure/net.appjet.common/util/ExpiringMapping.java +++ b/infrastructure/net.appjet.common/util/ExpiringMapping.java diff --git a/trunk/infrastructure/net.appjet.common/util/HttpServletRequestFactory.java b/infrastructure/net.appjet.common/util/HttpServletRequestFactory.java index 4d7826a..4d7826a 100644 --- a/trunk/infrastructure/net.appjet.common/util/HttpServletRequestFactory.java +++ b/infrastructure/net.appjet.common/util/HttpServletRequestFactory.java diff --git a/trunk/infrastructure/net.appjet.common/util/LenientFormatter.java b/infrastructure/net.appjet.common/util/LenientFormatter.java index 293dcdf..293dcdf 100644 --- a/trunk/infrastructure/net.appjet.common/util/LenientFormatter.java +++ b/infrastructure/net.appjet.common/util/LenientFormatter.java diff --git a/trunk/infrastructure/net.appjet.common/util/LimitedSizeMapping.java b/infrastructure/net.appjet.common/util/LimitedSizeMapping.java index 331baca..331baca 100644 --- a/trunk/infrastructure/net.appjet.common/util/LimitedSizeMapping.java +++ b/infrastructure/net.appjet.common/util/LimitedSizeMapping.java diff --git a/trunk/infrastructure/net.appjet.oui/ConfigParam.java b/infrastructure/net.appjet.oui/ConfigParam.java index 5029f28..5029f28 100644 --- a/trunk/infrastructure/net.appjet.oui/ConfigParam.java +++ b/infrastructure/net.appjet.oui/ConfigParam.java diff --git a/trunk/infrastructure/net.appjet.oui/FastJSON.scala b/infrastructure/net.appjet.oui/FastJSON.scala index 60cfc48..60cfc48 100644 --- a/trunk/infrastructure/net.appjet.oui/FastJSON.scala +++ b/infrastructure/net.appjet.oui/FastJSON.scala diff --git a/trunk/infrastructure/net.appjet.oui/GeneratedConfigParam.java b/infrastructure/net.appjet.oui/GeneratedConfigParam.java index 0986015..0986015 100644 --- a/trunk/infrastructure/net.appjet.oui/GeneratedConfigParam.java +++ b/infrastructure/net.appjet.oui/GeneratedConfigParam.java diff --git a/infrastructure/net.appjet.oui/config.scala b/infrastructure/net.appjet.oui/config.scala new file mode 100644 index 0000000..2b0e47a --- /dev/null +++ b/infrastructure/net.appjet.oui/config.scala @@ -0,0 +1,245 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.appjet.oui; + +import scala.collection.mutable.HashMap; +import java.util.regex.Pattern; +import java.net.URL; +import org.mortbay.jetty.servlet.Context; +import org.mozilla.javascript.{Scriptable, ScriptableObject, Context => JSContext}; + +import net.appjet.common.util.BetterFile; + + +object config { + val values = new HashMap[String, String]; + def stringOrElse(name: String, default: String): String = { + val v = values.getOrElse(name, default); + if (v != null) { + val m = propertiesPattern.matcher(v); + val sb = new StringBuffer(); + while (m.find()) { + m.appendReplacement(sb, getClass.getDeclaredMethod(m.group(1), Array[Class[_]](): _*).invoke(this, Array[Class[_]](): _*).asInstanceOf[String]); + } + m.appendTail(sb); + sb.toString(); + } else { + null; + } + } + def boolOrElse(name: String, default: Boolean) = values.get(name).map(_.matches("(?i)\\s*true\\s*")).getOrElse(default); + def intOrElse(name: String, default: Int) = values.get(name).map(Integer.parseInt(_)).getOrElse(default); + def longOrElse(name: String, default: Long) = values.get(name).map(java.lang.Long.parseLong(_)).getOrElse(default); + + @ConfigParam("Read configuration options from this file before processing any command-line flags.") + { val argName = "file" } + def configFile = stringOrElse("configFile", null); + + // configuation parameters + var specialDebug = false; + + @ConfigParam("Enable additional logging output.") + def verbose = boolOrElse("verbose", false); + + @ConfigParam("Activate \"developer\" mode.") + def devMode = boolOrElse("devMode", false); + + @ConfigParam("Activate \"profiling\" mode.") + def profile = boolOrElse("profile", false); + + @ConfigParam("Directory to use for storing appjet support files, logs, etc. This directory will be created if it does not exist and must be writeable by the user who runs appjet.jar. Defaults to current working directory.") + { val argName = "directory" } + def appjetHome = stringOrElse("appjetHome", "appjet"); + + @ConfigParam("Directory to use for storing built-in database (Apache Derby) files. Will be created if it doesn't exist. Defaults to [appjetHome]/db") + def derbyHome = stringOrElse("derbyHome", "[appjetHome]/derbydb"); + + @ConfigParam("Directory to use for storing appserver logs. Defaults to [appjetHome]/log/appserver") + { val argName = "directory" } + def logDir = stringOrElse("logDir", "[appjetHome]/log/appserver"); + + @ConfigParam("Optional alternative directory to load built-in libraries from. Used by AppJet platform hackers to develop and debug built-in libraries. Default: use built-in libraries.") + { val argName = "directory" } + def ajstdlibHome = stringOrElse("ajstdlibHome", null); + + @ConfigParam("Optional directory to specify as the \"app home\".") + { val argName = "directory" } + def appHome = stringOrElse("appHome", ""); + + @ConfigParam("Whether to generate https URLs even if running locally behind HTTP (useful for Apache handling HTTPS)") + def useHttpsUrls = boolOrElse("useHttpsUrls", false); + + @ConfigParam("Search path for modules imported via \"import\". Defaults to current working directory.") + { val argName = "dir1:dir2:..." } + def modulePath = stringOrElse("modulePath", null); + def moduleRoots = + Array.concat(Array("."), if (modulePath != null) modulePath.split(":") else Array[String](), Array(ajstdlibHome)); + + @ConfigParam("Where to read the static files from on the local filesystem. Don't specify this to read static files from the classpath/JAR.") + { val argName = "directory" } + def useVirtualFileRoot = stringOrElse("useVirtualFileRoot", null); + + @ConfigParam("Directory to use for storing the temporary sessions file on shutdown. Will be created if it does not exist.") + { val argName = "directory" } + def sessionStoreDir = stringOrElse("sessionStoreDir", "[appjetHome]/sessions"); + + // performance tuning + @ConfigParam("Create this many runners before opening up the server.") + { val argName = "count" } + def preloadRunners = intOrElse("preloadRunners", 0); + + @ConfigParam("Have this many JDBC connections available in the pool.") + { val argName = "count" } + def jdbcPoolSize = intOrElse("jdbcPoolSize", 10); + @ConfigParam("Max count of worker threads.") + { val argName = "num" } + def maxThreads = intOrElse("maxThreads", 250); + + // specifying ports and such + def extractHostAndPort(s: String): (String, Int) = + if (s.indexOf(":") >= 0) + (s.split(":")(0), Integer.parseInt(s.split(":")(1))) + else + ("", Integer.parseInt(s)) + + @ConfigParam("Whether to show the port numbers to the outside world (false: assume ports visible from the outside are the default http/https ports)") + def hidePorts = boolOrElse("hidePorts", false); + + @ConfigParam("[host:]port on which to serve the app. Default: 8080.") + { val argName = "[host:]port" } + def listen = stringOrElse("listen", "8080"); + @GeneratedConfigParam + def listenHost = extractHostAndPort(listen)._1; + @GeneratedConfigParam + def listenPort = extractHostAndPort(listen)._2; + + @ConfigParam("[host:]port on which to serve the app using SSL. Default: none.") + { val argName = "[host:]port" } + def listenSecure = stringOrElse("listenSecure", "0"); + @GeneratedConfigParam + def listenSecureHost = extractHostAndPort(listenSecure)._1; + @GeneratedConfigParam + def listenSecurePort = extractHostAndPort(listenSecure)._2; + + @ConfigParam("[host:]port:port on which to listen for monitoring. Default: none.") + { val argName = "[host:]primaryPort:secondaryPort" } + def listenMonitoring = stringOrElse("listenMonitoring", "0:0"); + def extractHostAndPortPort(s: String): (String, Int, Int) = { + val spl = s.split(":", 3); + if (spl.length > 2) + (spl(0), Integer.parseInt(spl(1)), Integer.parseInt(spl(2))) + else + ("", Integer.parseInt(spl(0)), Integer.parseInt(spl(1))); + } + @GeneratedConfigParam + def listenMonitoringHost = extractHostAndPortPort(listenMonitoring)._1; + @GeneratedConfigParam + def listenMonitoringPrimaryPort = extractHostAndPortPort(listenMonitoring)._2; + @GeneratedConfigParam + def listenMonitoringSecondaryPort = extractHostAndPortPort(listenMonitoring)._3; + + @ConfigParam("[host:]port on which to listen for RPCs (via SARS). Default: none.") + { val argName = "[host:]port" } + def listenSars = stringOrElse("listenSars", "0"); + @GeneratedConfigParam + def listenSarsHost = extractHostAndPort(listenSars)._1; + @GeneratedConfigParam + def listenSarsPort = extractHostAndPort(listenSars)._2; + + // Licensing + @ConfigParam("Private key for generating license keys.") + { val argName = "pathToKey" } + def licenseGeneratorKey = stringOrElse("licenseGeneratorKey", null); + + // SARS + @ConfigParam("SARS auth key. Default: \"appjet\".") + { val argName = "authkey" } + def sarsAuthKey = stringOrElse("sarsAuthKey", "appjet"); + + // SSL + @ConfigParam("[SSL] Keystore location. Default: appjetHome/sslkeystore.") + { val argName = "keystore" } + def sslKeyStore = stringOrElse("sslKeyStore", appjetHome+"/sslkeystore"); + def sslKeyStore_isSet = values.contains("sslKeyStore"); + @ConfigParam("[SSL] Key password. Default: same as store password.") + { val argName = "password" } + def sslKeyPassword = stringOrElse("sslKeyPassword", "[sslStorePassword]"); + @ConfigParam("[SSL] Store password. Default: 'appjet'.") + { val argName = "password" } + def sslStorePassword = stringOrElse("sslStorePassword", "appjet"); + + // email + @ConfigParam("host:port of mail server to use for sending email. Default: localhost:25.") + { val argName = "host:port" } + def smtpServer = stringOrElse("smtpServer", "localhost:25"); + def smtpServerHost = extractHostAndPort(smtpServer)._1; + def smtpServerPort = extractHostAndPort(smtpServer)._2; + @ConfigParam("username for authentication to mail server. Default: no authentication.") + { val argName = "username" } + def smtpUser = stringOrElse("smtpUser", ""); + @ConfigParam("password for authentication to mail server. Default: no authentication.") + { val argName = "password" } + def smtpPass = stringOrElse("smtpPass", ""); + + // comet + @ConfigParam("prefix for all comet requests. Required to use Comet system.") + { val argName = "path" } + def transportPrefix = stringOrElse("transportPrefix", null); + @ConfigParam("Use a subdomain for all comet requests.") + def transportUseWildcardSubdomains = boolOrElse("transportUseWildcardSubdomains", false); + @ConfigParam("Don't use short polling, ever.") + def disableShortPolling = boolOrElse("disableShortPolling", false); + + // helpers + val allProperties = + for (m <- getClass.getDeclaredMethods() if (m.getAnnotation(classOf[ConfigParam]) != null || m.getAnnotation(classOf[GeneratedConfigParam]) != null)) + yield m; + val configParamNames = + for (m <- allProperties if m.getAnnotation(classOf[ConfigParam]) != null) yield m.getName + lazy val allPropertiesMap = + Map((for (m <- allProperties) yield ((m.getName, () => m.invoke(this)))): _*); + val propertiesPattern = Pattern.compile("\\[("+allProperties.map(x => "(?:"+x.getName()+")").mkString("|")+")\\]"); + + override def toString() = + (allProperties.map(m => m.getName()+" -> "+m.invoke(this)) ++ + values.keys.toList.filter(! allPropertiesMap.contains(_)).map(k => k+" -> "+values(k))).mkString("[Config ", ", ", "]"); + def print { + for (m <- allProperties) { + println(m.getName() + " -> " + m.invoke(this)); + } + for ((k, v) <- values if (! allPropertiesMap.contains(k))) { + println(k + " -> " + v); + } + } + def configObject(globalScope: Scriptable) = + new ScriptableAdapter { + val keys = (Set.empty[Object] ++ allProperties.map(m => m.getName) ++ values.keySet).toList.toArray; + override def get(n: String, start: Scriptable) = + allPropertiesMap.getOrElse(n, () => values.getOrElse(n, JSContext.getUndefinedValue()))(); + override def put(n: String, start: Scriptable, value: Object) = + values(n) = value.toString(); + override def getIds() = keys; + override def getPrototype() = ScriptableObject.getObjectPrototype(globalScope); + override def has(n: String, start: Scriptable) = + allPropertiesMap.contains(n) || values.contains(n); + override def getDefaultValue(hint: Class[_]) = config.toString(); + } +} + +object global { + var context: Context = null; +} diff --git a/trunk/infrastructure/net.appjet.oui/dynamicvar.scala b/infrastructure/net.appjet.oui/dynamicvar.scala index b1f8c2e..b1f8c2e 100644 --- a/trunk/infrastructure/net.appjet.oui/dynamicvar.scala +++ b/infrastructure/net.appjet.oui/dynamicvar.scala diff --git a/trunk/infrastructure/net.appjet.oui/encryption.scala b/infrastructure/net.appjet.oui/encryption.scala index 92d463b..92d463b 100644 --- a/trunk/infrastructure/net.appjet.oui/encryption.scala +++ b/infrastructure/net.appjet.oui/encryption.scala diff --git a/infrastructure/net.appjet.oui/execution.scala b/infrastructure/net.appjet.oui/execution.scala new file mode 100644 index 0000000..dc17c29 --- /dev/null +++ b/infrastructure/net.appjet.oui/execution.scala @@ -0,0 +1,660 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.appjet.oui; + +import java.net.URLDecoder; +import java.util.Enumeration; +import java.util.concurrent.atomic.AtomicLong; + +import javax.servlet.http.{HttpServletRequest, HttpServletResponse, HttpServlet}; + +import scala.collection.mutable.{ListBuffer, LinkedHashSet, HashMap, ArrayBuffer}; +import scala.collection.immutable.Map; +import scala.collection.jcl.Conversions; + +import org.mozilla.javascript.{Scriptable, Context, Function, ScriptableObject, JavaScriptException}; +import org.mortbay.jetty.RetryRequest; + +import net.appjet.bodylock.{BodyLock, Executable, JSRuntimeException, JSCompileException}; +import net.appjet.common.util.{HttpServletRequestFactory, BetterFile}; + +import Util.enumerationToRichEnumeration; + +// Removed due to licensing issues; REMOVED_COS_OF_COS +// import com.oreilly.servlet.MultipartFilter; + +class RequestWrapper(val req: HttpServletRequest) { + req.setCharacterEncoding("UTF-8"); +// REMOVED_COS_OF_COS ... ? +// private lazy val parameterNames = +// (for (i <- Conversions.convertSet(req.getParameterMap.keySet().asInstanceOf[java.util.Set[String]])) yield i).toList.toArray +// private def parameterValues(k: String) = req.getParameterValues(k); + def headerCapitalize(s: String) = + s.split("-").map( + s => + if (s == null || s.length < 1) s + else s.substring(0, 1).toUpperCase()+s.substring(1).toLowerCase() + ).mkString("-"); + def isFake = false; + lazy val path = req.getRequestURI(); + lazy val host = { + val hostFromHeader = req.getHeader("Host"); + if ((hostFromHeader ne null) && hostFromHeader.indexOf(':') >= 0) { + // fix the port, which may be wrong in Host header (e.g. IE 6) + hostFromHeader.substring(0, hostFromHeader.indexOf(':')) + ":" + + req.getLocalPort; + } + else { + hostFromHeader; + } + } + lazy val query = req.getQueryString(); + lazy val method = req.getMethod(); + lazy val scheme = req.getScheme(); + lazy val clientAddr = req.getRemoteAddr(); + + def decodeWwwFormUrlencoded(content: => String): Map[String, Array[String]] = { + val map = new HashMap[String, ArrayBuffer[String]]; + if (content != null) { + for (pair <- content.split("&").map(_.split("=", 2))) { + val key = URLDecoder.decode(pair(0), "UTF-8"); + val list = map.getOrElseUpdate(key, new ArrayBuffer[String]); + if (pair.length > 1) { + list += URLDecoder.decode(pair(1), "UTF-8"); + } + } + } + Map((for ((k, v) <- map) yield (k, v.toArray)).toSeq: _*); + } + + def postParams = decodeWwwFormUrlencoded(content.asInstanceOf[String]); + def getParams = decodeWwwFormUrlencoded(query); + + lazy val params_i = { + if (contentType != null && contentType.startsWith("application/x-www-form-urlencoded")) { + if (req.getAttribute("ajcache_parameters") == null) { + req.setAttribute("ajcache_parameters", + Map((for (k <- (postParams.keys ++ getParams.keys).toList) + yield (k, postParams.getOrElse(k, Array[String]()) ++ + getParams.getOrElse(k, Array[String]()))).toSeq: _*)); + } + req.getAttribute("ajcache_parameters").asInstanceOf[Map[String, Array[String]]]; + } else { + Conversions.convertMap(req.getParameterMap().asInstanceOf[java.util.Map[String, Array[String]]]); + } + } + + def params(globalScope: Scriptable) = new ScriptableFromMapOfStringArrays( + globalScope, + params_i.keys.toList, + params_i.get(_), + false); + def headers(globalScope: Scriptable) = new ScriptableFromMapOfStringArrays( + globalScope, + req.getHeaderNames().asInstanceOf[Enumeration[String]] + .map(headerCapitalize).toList, + h => h match { + case "Host" => Some(Array(host)); + case hh => Some(Util.enumerationToArray(req.getHeaders(headerCapitalize(hh)).asInstanceOf[Enumeration[String]])) }, + true); + lazy val protocol = req.getProtocol(); + lazy val contentType = req.getHeader("Content-Type"); + lazy val postParamsInBody = contentType != null && contentType.startsWith("application/x-www-form-urlencoded"); + lazy val content = + if ((contentType != null && contentType.startsWith("text/")) || postParamsInBody) { + val reader = req.getReader(); + if (reader != null) + BetterFile.getReaderString(req.getReader()); + else + null; + } else { + val stream = req.getInputStream(); + if (stream != null) + BetterFile.getStreamBytes(req.getInputStream()); + else + null; + } + + // Depends on cos.jar; REMOVED_COS_OF_COS + def files(globalScope: Scriptable): Object = { +// if (! req.isInstanceOf[com.oreilly.servlet.MultipartWrapper]) { + new ScriptableAdapter(); +// } else { +// val r = req.asInstanceOf[com.oreilly.servlet.MultipartWrapper]; +// val fileScriptables = new HashMap[String, Scriptable](); +// val fileBytes = new HashMap[String, Array[byte]](); +// new ScriptableFromMapOfScriptableArrays(globalScope, +// r.getFileNames().asInstanceOf[Enumeration[String]].toList, +// name => { +// if (r.getFile(name) == null) +// None +// else +// Some(Array(fileScriptables.getOrElseUpdate(name, +// new ScriptableFromMapOfArrays[Object](globalScope, +// Set("contentType", "filesystemName", "bytes").toSeq, +// _ match { +// case "contentType" => Some(Array(r.getContentType(name))); +// case "filesystemName" => +// Some(Array(r.getFilesystemName(name))); +// case "bytes" => +// Some(Array(Context.javaToJS(fileBytes.getOrElseUpdate(name, +// BetterFile.getFileBytes(r.getFile(name))), globalScope))); +// case _ => None; +// }, +// true)))) +// }, +// true); +// } + } +} + +class ResponseWrapper(val res: HttpServletResponse) { + private lazy val outputStrings = new ListBuffer[String]; + private lazy val outputBytes = new ListBuffer[Array[byte]]; + private var statusCode = 200; + private var contentType = "text/html"; + private var redirect: String = null; + private lazy val headers = new LinkedHashSet[(String, String, HttpServletResponse => Unit)] { + def removeAll(k: String) { + this.foreach(x => if (x._1 == k) remove(x)); + } + } + + private[oui] def overwriteOutputWithError(code: Int, errorStr: String) { + statusCode = code; + outputStrings.clear(); + outputStrings += errorStr; + outputBytes.clear(); + headers.clear(); + Util.noCacheHeaders.foreach(x => headers += (x._1, x._2, res => res.setHeader(x._1, x._2))); + redirect = null; + contentType = "text/html; charset=utf-8"; + } + + def reset() { + outputStrings.clear(); + outputBytes.clear(); + redirect = null; + headers.clear(); + Util.noCacheHeaders.foreach(x => headers += (x._1, x._2, res => res.setHeader(x._1, x._2))); + statusCode = 200; + contentType = "text/html; charset=utf-8"; + } + def error(code: Int, errorStr: String) { + overwriteOutputWithError(code, errorStr); + stop(); + } + def stop() { + throw AppGeneratedStopException; + } + + def write(s: String) { + outputStrings += s; + } + def getOutput() = outputStrings.mkString(""); + def writeBytes(bytes: String) { + val a = new Array[byte](bytes.length()); + bytes.getBytes(0, bytes.length(), a, 0); + outputBytes += a; + } + def writeBytes(bytes: Array[Byte]) { + outputBytes += bytes; + } + def getOutputBytes() = outputBytes.flatMap(x => x).toArray + def setContentType(s: String) { + contentType = s; + } + def getCharacterEncoding() = { + res.setContentType(contentType); + res.getCharacterEncoding(); + } + def setStatusCode(sc: Int) { + statusCode = sc; + } + def getStatusCode() = statusCode; + def redirect(loc: String) { + statusCode = 302; + redirect = loc; + stop(); + } + def setHeader(name: String, value: String) { + headers += ((name, value, res => res.setHeader(name, value))); + } + def addHeader(name: String, value: String) { + headers += ((name, value, res => res.addHeader(name, value))); + } + def getHeader(name: String) = { + headers.filter(_._1 == name).map(_._2).toSeq.toArray; + } + def removeHeader(name: String) { + headers.removeAll(name); + } + + var gzipOutput = false; + def setGzip(gzip: Boolean) { + gzipOutput = gzip; + } + + def print() { + if (redirect != null && statusCode == 302) { + headers.foreach(_._3(res)); + res.sendRedirect(redirect); + } else { + res.setStatus(statusCode); + res.setContentType(contentType); + headers.foreach(_._3(res)); + if (gzipOutput) res.setHeader("Content-Encoding", "gzip"); + if (outputStrings.length > 0) { + var bytes: Seq[Array[Byte]] = outputStrings.map(_.getBytes(res.getCharacterEncoding())); + if (gzipOutput) bytes = List(Util.gzip(Array.concat(bytes:_*))); + res.setContentLength((bytes :\ 0) {_.length + _}); + bytes.foreach(res.getOutputStream.write(_)); + } else if (outputBytes.length > 0) { + var bytes: Seq[Array[Byte]] = outputBytes; + if (gzipOutput) bytes = List(Util.gzip(Array.concat(bytes:_*))); + res.setContentLength((bytes :\ 0) {_.length + _}); + bytes.foreach(res.getOutputStream.write(_)); + } + } + } +} + +class ScriptableAdapter extends Scriptable { + private def unsupported() = throw UnsupportedOperationException; + def delete(index: Int) { unsupported(); } + def delete(name: String) { unsupported(); } + def get(index: Int, start: Scriptable): Object = Context.getUndefinedValue(); + def get(name: String, start: Scriptable): Object = Context.getUndefinedValue(); + def getClassName() = getClass.getName(); + def getDefaultValue(hint: Class[_]) = "[ScriptableAdapter]"; + def getIds(): Array[Object] = Array[Object](); + def getParentScope: Scriptable = null; + def getPrototype: Scriptable = null; + def has(index: Int, start: Scriptable): Boolean = false; + def has(name: String, start: Scriptable): Boolean = false; + def hasInstance(instance: Scriptable): Boolean = false; + def put(index: Int, start: Scriptable, value: Object) { unsupported(); } + def put(name: String, start: Scriptable, value: Object) { unsupported(); } + def setParentScope(parent: Scriptable) { unsupported(); } + def setPrototype(prototype: Scriptable) { unsupported(); } +} + +class ScriptableFromMapOfStringArrays(globalScope: Scriptable, + keys: Seq[String], values: String => Option[Array[String]], + zeroMeansNone: Boolean) extends ScriptableFromMapOfArrays[String]( + globalScope, keys, values, zeroMeansNone); + +class ScriptableFromMapOfScriptableArrays(globalScope: Scriptable, + keys: Seq[String], values: String => Option[Array[Scriptable]], + zeroMeansNone: Boolean) extends ScriptableFromMapOfArrays[Scriptable]( + globalScope, keys, values, zeroMeansNone); + + +class ScriptableFromMapOfArrays[V <: Object](globalScope: Scriptable, + keys: Seq[String], values: String => Option[Array[V]], + zeroMeansNone: Boolean) extends ScriptableAdapter { + override def get(n: String, start: Scriptable): Object = { + val v = values(n); + if (v.isEmpty || (zeroMeansNone && v.get.length == 0)) { + Context.getUndefinedValue(); + } else if (v.get.length == 1) { + v.get.apply(0); + } else { + Context.getCurrentContext().newArray(globalScope, v.get.map(x => x.asInstanceOf[Object])); + } + } + override def getIds(): Array[Object] = keys.toArray[Object]; + override def getPrototype = ScriptableObject.getObjectPrototype(globalScope); + override def has(n: String, start: Scriptable): Boolean = ! (values(n).isEmpty || (zeroMeansNone && values(n).get.length == 0)); +} + +object AppGeneratedStopException extends JSRuntimeException("User-generated stop.", null); +class NoHandlerException(msg: String) extends JSRuntimeException(msg, null); +object UnsupportedOperationException extends JSRuntimeException("Unsupported operation.", null); + +object ExecutionContextUtils { + val uniqueIds = new AtomicLong(0); + + val ecVar = new NoninheritedDynamicVariable[ExecutionContext](null); + def withContext[E](ec: ExecutionContext)(block: => E): E = { + ecVar.withValue(ec)(block); + } + + def currentContext = ecVar.value; +} + +case class ExecutionContext( + val request: RequestWrapper, + val response: ResponseWrapper, + var runner: ScopeReuseManager.Runner) { + val asyncs = new ListBuffer[Function]; + lazy val attributes = new HashMap[String, Any]; + var completed = false; + lazy val executionId = ""+ExecutionContextUtils.uniqueIds.incrementAndGet(); + var result: AnyRef = null; +} + +object CometSupport { + trait CometHandler { + def handleCometRequest(req: HttpServletRequest, res: HttpServletResponse); + } + var cometHandler: CometHandler = null; +} + +class OuiServlet extends HttpServlet { + override def doGet(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doPost(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doHead(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doPut(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doDelete(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doTrace(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + override def doOptions(req: HttpServletRequest, res: HttpServletResponse) { + execute(req, res); + } + + def execute(req: HttpServletRequest, res: HttpServletResponse) { + if (req.getProtocol() == "HTTP/1.1" && req.getHeader("Host") == null) { + res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid HTTP/1.1 request: No \"Host\" header found."); + } else if (config.transportPrefix != null && req.getRequestURI().startsWith(config.transportPrefix)) { + val runner = ScopeReuseManager.getRunner; + val ec = new ExecutionContext(new RequestWrapper(req), new ResponseWrapper(res), runner); + req.setAttribute("executionContext", ec); + req.setAttribute("isServerPushConnection", true); + try { + CometSupport.cometHandler.handleCometRequest(req, res); + } catch { + case e: RetryRequest => { + ec.runner = null; + ScopeReuseManager.freeRunner(runner); + throw e; + } + case _ => {}; + } + try { + ec.response.print(); + execution.onprint(ec, BodyLock.subScope(runner.mainScope)); + } finally { + ec.runner = null; + ScopeReuseManager.freeRunner(runner); + } + } else { + execution.execute(req, res); + } + } +} + +object execution { + // maybe find a better place for this? + { // initialize ajstdlib + val c = Class.forName("net.appjet.ajstdlib.ajstdlib$"); + val m = c.getDeclaredMethod("init"); + val o = c.getDeclaredField("MODULE$"); + m.invoke(o.get(null)); + } + + val requestLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onrequest.js")); + val errorLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onerror.js")); + val printLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onprint.js")); + val syntaxErrorLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "syntaxerror.js")); + val onSyntaxErrorLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onsyntaxerror.js")); + val sarsLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onsars.js")); + val scheduledTaskLib = new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onscheduledtask.js")); + def requestExecutable = requestLib.executable; + def errorExecutable = errorLib.executable; + def printExecutable = printLib.executable; + def syntaxErrorExecutable = syntaxErrorLib.executable; + def onSyntaxErrorExecutable = onSyntaxErrorLib.executable; + def sarsExecutable = sarsLib.executable; + def scheduledTaskExecutable = scheduledTaskLib.executable; + + def postSuccessfulRun(ec: ExecutionContext) { + try { + for (f <- ec.asyncs) { + BodyLock.runInContext({ cx => + f.call(cx, f.getParentScope(), ec.runner.mainScope, Array[Object]()); + }); + } + } catch { + case e => exceptionlog(e); + } + } + + def onprint(ec: ExecutionContext, scope: Scriptable) { + try { +// ec.runner.globalScope.put("_appjetcontext_", ec.runner.globalScope, ec); + printExecutable.execute(scope); + } catch { + case e => { exceptionlog(e); } // shrug. this was best-effort anyway. + } + } + + def execute(req: HttpServletRequest, res: HttpServletResponse) { + val runner = try { + ScopeReuseManager.getRunner; + } catch { + case e: JSCompileException => { + val r = ScopeReuseManager.getEmpty { r => + syntaxErrorExecutable.execute(r.globalScope) + } + val ec = ExecutionContext(new RequestWrapper(req), new ResponseWrapper(res), r); +// r.globalScope.put("_appjetcontext_", r.globalScope, ec); + ExecutionContextUtils.withContext(ec) { + ec.attributes("error") = e; + ec.result = onSyntaxErrorExecutable.execute(r.globalScope); + ec.response.print(); + } + return; + } + } + val ec = ExecutionContext(new RequestWrapper(req), new ResponseWrapper(res), runner); + val startTime = executionlatencies.time; + execute(ec, + (sc: Int, msg: String) => { + ec.response.overwriteOutputWithError(sc, msg); + }, + () => { executionlatencies.log(Map( + "time" -> (executionlatencies.time - startTime))); + ec.response.print() }, + () => { ScopeReuseManager.freeRunner(runner) }, + None); + } + + def errorToHTML(e: Throwable) = { + val trace = new java.io.StringWriter(); + e.printStackTrace(new java.io.PrintWriter(trace)); + trace.toString().split("\n").mkString("<br>\n"); + } + def execute(ec: ExecutionContext, + errorHandler: (Int, String) => Unit, + doneWritingHandler: () => Unit, + completedHandler: () => Unit, + customExecutable: Option[Executable]) = + ExecutionContextUtils.withContext(ec) { +// ec.runner.globalScope.put("_appjetcontext_", ec.runner.globalScope, ec); + val runScope = BodyLock.subScope(ec.runner.mainScope); + try { + ec.result = customExecutable.getOrElse(requestExecutable).execute(runScope); + ec.completed = true; + } catch { + case AppGeneratedStopException => { ec.completed = true; } + case e: NoHandlerException => errorHandler(500, "No request handler is defined."); + case e: RetryRequest => { completedHandler(); throw e; } + case e => { + ec.attributes("error") = e; + try { + ec.result = errorExecutable.execute(runScope); + } catch { + case AppGeneratedStopException => { } + case nhe: NoHandlerException => { + exceptionlog(e); + e.printStackTrace(); + errorHandler(500, "An error occurred and no error handler is defined."); + } + case e2 => { + exceptionlog(e); exceptionlog(e2); + val etext = e2 match { + case jse: JavaScriptException => { (jse.getValue() match { + case ne: org.mozilla.javascript.IdScriptableObject => ne.get("message", ne) + case e => e.getClass.getName + }) + "<br>\n" + errorToHTML(jse); } + case _ => errorToHTML(e2); + } + errorHandler( + 500, + "You like apples? An error occurred in the error handler while handling an error. How do you like <i>them</i> apples?<br>\n"+ + etext+"<br>\nCaused by:<br>\n"+errorToHTML(e)); + } + } + } + } + onprint(ec, runScope); + doneWritingHandler(); + if (ec.completed && ! ec.asyncs.isEmpty) { + main.server.getThreadPool().dispatch(new Runnable { + def run() { + postSuccessfulRun(ec); + completedHandler(); + } + }); + } else { + completedHandler(); + } + } + + def runOutOfBandSimply(executable: Executable, + props: Option[Map[String, Any]]) = { + // there must be a context already. + val currentContext = ExecutionContextUtils.currentContext; + val request = + if (currentContext != null) { + currentContext.request; + } else { + val fakeHeaders = scala.collection.jcl.Conversions.convertMap( + new java.util.HashMap[String, String]); + fakeHeaders("Host") = "unknown.local"; + new RequestWrapper(HttpServletRequestFactory.createRequest( + "/", fakeHeaders.underlying, "GET", null)) { + override val isFake = true; + } + } + val response = + if (currentContext != null && currentContext.response != null) { + currentContext.response; + } else { + new ResponseWrapper(null); + } + val runner = + if (currentContext != null) { + (false, currentContext.runner); + } else { + (true, ScopeReuseManager.getRunner); + } + val ec = new ExecutionContext(request, response, runner._2) + if (props.isDefined) { + for ((k, v) <- props.get) { + ec.attributes(k) = v; + } + } + try { + ExecutionContextUtils.withContext(ec) { + executable.execute(BodyLock.subScope(ec.runner.mainScope)); + } + } finally { + if (runner._1) { + ScopeReuseManager.freeRunner(runner._2); + } + } + } + + def runOutOfBand(executable: Executable, name: String, + props: Option[Map[String, Any]], + onFailure: Any => Unit) = { + var ec: ExecutionContext = null; + try { + val runner = ScopeReuseManager.getRunner; + val currentContext = ExecutionContextUtils.currentContext; + val request = + if (currentContext != null) { + currentContext.request; + } else { + val fakeHeaders = scala.collection.jcl.Conversions.convertMap( + new java.util.HashMap[String, String]); + fakeHeaders("Host") = "unknown.local"; + new RequestWrapper(HttpServletRequestFactory.createRequest( + "/", fakeHeaders.underlying, "GET", null)) { + override val isFake = true; + } + } + val response = + if (currentContext != null && currentContext.response != null) { + new ResponseWrapper(currentContext.response.res); + } else { + new ResponseWrapper(null); + } + ec = new ExecutionContext(request, response, runner); + if (props.isDefined) + for ((k, v) <- props.get) { + ec.attributes(k) = v; + } + execution.execute(ec, + (sc: Int, msg: String) => { println(name+" execution failed with error: "+sc+"\n"+msg); onFailure((sc, msg)); }, + () => { }, + () => { ScopeReuseManager.freeRunner(runner) }, + Some(executable)); + if (ec.response != null && ec.response.getStatusCode() != 200) { + println(name+" execution failed with non-200 response: "+ec.response.getStatusCode()); + onFailure((ec.response.getStatusCode, ec.response.getOutput())); + } + ec; + } catch { + case e: JSCompileException => { + val r = ScopeReuseManager.getEmpty { r => + execution.syntaxErrorExecutable.execute(r.globalScope); + } + val ec = ExecutionContext(null, null, r); +// r.globalScope.put("_appjetcontext_", r.globalScope, ec); + ExecutionContextUtils.withContext(ec) { + ec.attributes("error") = e; + ec.result = execution.onSyntaxErrorExecutable.execute(r.globalScope); + onFailure(e); + } + ec; + } + case e => { + println(name+" execution failed with error."); onFailure(e); ec; + } + } + } +} diff --git a/trunk/infrastructure/net.appjet.oui/files.scala b/infrastructure/net.appjet.oui/files.scala index 3df5c1c..3df5c1c 100644 --- a/trunk/infrastructure/net.appjet.oui/files.scala +++ b/infrastructure/net.appjet.oui/files.scala diff --git a/trunk/infrastructure/net.appjet.oui/logging.scala b/infrastructure/net.appjet.oui/logging.scala index 9c384d2..9c384d2 100644 --- a/trunk/infrastructure/net.appjet.oui/logging.scala +++ b/infrastructure/net.appjet.oui/logging.scala diff --git a/infrastructure/net.appjet.oui/main.scala b/infrastructure/net.appjet.oui/main.scala new file mode 100644 index 0000000..67c1f6f --- /dev/null +++ b/infrastructure/net.appjet.oui/main.scala @@ -0,0 +1,388 @@ +/** + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.appjet.oui; + +import net.appjet.bodylock.{BodyLock, Executable}; + +import java.io.File; +import java.util.{Properties, Date}; +import java.lang.annotation.Annotation; +import java.text.SimpleDateFormat; + +import scala.collection.mutable.{HashMap, SynchronizedMap, HashSet}; +import scala.collection.jcl.{IterableWrapper, Conversions}; + +import org.mortbay.thread.QueuedThreadPool; +import org.mortbay.jetty.servlet.{Context, HashSessionIdManager, FilterHolder, ServletHolder}; +import org.mortbay.jetty.handler.{HandlerCollection, RequestLogHandler, HandlerList}; +import org.mortbay.jetty.{Server, NCSARequestLog, Request, Response}; +import org.mortbay.servlet.GzipFilter; + +// removed due to license restrictions; REMOVED_COS_OF_COS +// import com.oreilly.servlet.MultipartFilter; + +import net.appjet.common.util.{BetterFile, HttpServletRequestFactory}; +import net.appjet.common.cli._; +import net.appjet.bodylock.JSCompileException; + +import Util.enumerationToRichEnumeration; + +object main { + val startTime = new java.util.Date(); + + def quit(status: Int) { + java.lang.Runtime.getRuntime().halt(status); + } + + def setupFilesystem() { + val logdir = new File(config.logDir+"/backend/access"); + if (! logdir.isDirectory()) + if (! logdir.mkdirs()) + quit(1); + } + + val options = + for (m <- config.allProperties if (m.getAnnotation(classOf[ConfigParam]) != null)) yield { + val cp = m.getAnnotation(classOf[ConfigParam]) + new CliOption(m.getName(), cp.value(), if (cp.argName().length > 0) Some(cp.argName()) else None); + } + + def printUsage() { + println("\n--------------------------------------------------------------------------------"); + println("usage:"); + println((new CliParser(options)).usage); + println("--------------------------------------------------------------------------------\n"); + } + + def extractOptions(args: Array[String]) { + val parser = new CliParser(options); + val opts = + try { + parser.parseOptions(args)._1; + } catch { + case e: ParseException => { + println("error: "+e.getMessage()); + printUsage(); + System.exit(1); + null; + } + } + if (opts.contains("configFile")) { + val p = new Properties(); + p.load(new java.io.FileInputStream(opts("configFile"))); + extractOptions(p); + } + for ((k, v) <- opts) { + config.values(k) = v; + } + } + + def extractOptions(props: Properties) { + for (k <- for (o <- props.propertyNames()) yield o.asInstanceOf[String]) { + config.values(k) = props.getProperty(k); + } + } + + val startupExecutable = (new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onstartup.js"))).executable; + def runOnStartup() { + execution.runOutOfBand(startupExecutable, "Startup", None, { error => + error match { + case e: JSCompileException => { } + case e: Throwable => { e.printStackTrace(); } + case (sc: Int, msg: String) => { println(msg); } + case x => println(x); + } + System.exit(1); + }); + } + + lazy val shutdownExecutable = (new FixedDiskLibrary(new SpecialJarOrNotFile(config.ajstdlibHome, "onshutdown.js"))).executable; + def runOnShutdown() { + execution.runOutOfBand(shutdownExecutable, "Shutdown", None, { error => + error match { + case e: JSCompileException => { } + case e: Throwable => { } + case (sc: Int, msg: String) => { println(msg); } + case x => println(x); + } + }); + } + + def runOnSars(q: String) = { + val ec = execution.runOutOfBand(execution.sarsExecutable, "SARS", Some(Map("sarsRequest" -> q)), { error => + error match { + case e: JSCompileException => { throw e; } + case e: Throwable => { exceptionlog(e); throw e; } + case (sc: Int, msg: String) => { println(msg); throw new RuntimeException(""+sc+": "+msg) } + case x => { println(x); throw new RuntimeException(x.toString()) } + } + }); + ec.attributes.get("sarsResponse").map(_.toString()); + } + + def stfu() { + System.setProperty("org.mortbay.log.class", "net.appjet.oui.STFULogger"); + System.setProperty("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog"); + System.setProperty("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "OFF"); + } + var server: Server = null; + var sarsServer: net.appjet.common.sars.SarsServer = null; + + var loggers = new HashSet[GenericLogger]; + def main(args: Array[String]) { + val etherpadProperties = getClass.getResource("/etherpad.properties"); + if (etherpadProperties != null) { + val p = new Properties(); + p.load(etherpadProperties.openStream); + extractOptions(p); + } + extractOptions(args); + + if (! config.verbose) + stfu(); + setupFilesystem(); + if (config.devMode) + config.print; + if (config.profile) + profiler.start(); + if (config.listenMonitoring != "0:0") + monitoring.startMonitoringServer(); + + // this needs a better place. + if (config.devMode) + BodyLock.map = Some(new HashMap[String, String] with SynchronizedMap[String, String]); + + server = new Server(); + if (config.maxThreads > 0) + server.setThreadPool(new QueuedThreadPool(config.maxThreads)); + else + server.setThreadPool(new QueuedThreadPool()); + // set up socket connectors + val nioconnector = new CometSelectChannelConnector; + var sslconnector: CometSslSelectChannelConnector = null; + nioconnector.setPort(config.listenPort); + if (config.listenHost.length > 0) + nioconnector.setHost(config.listenHost); + if (config.listenSecurePort == 0) { + server.setConnectors(Array(nioconnector)); + } else { + sslconnector = new CometSslSelectChannelConnector; + sslconnector.setPort(config.listenSecurePort); + if (config.listenSecureHost.length > 0) + sslconnector.setHost(config.listenSecureHost); + if (! config.sslKeyStore_isSet) { + val url = getClass.getResource("/mirror/snakeoil-ssl-cert"); + if (url != null) + sslconnector.setKeystore(url.toString()); + else + sslconnector.setKeystore(config.sslKeyStore); + } else { + sslconnector.setKeystore(config.sslKeyStore); + } + sslconnector.setPassword(config.sslStorePassword); + sslconnector.setKeyPassword(config.sslKeyPassword); + sslconnector.setTrustPassword(config.sslStorePassword); + sslconnector.setExcludeCipherSuites(Array[String]( + "SSL_RSA_WITH_3DES_EDE_CBC_SHA", + "SSL_DHE_RSA_WITH_DES_CBC_SHA", + "SSL_DHE_DSS_WITH_DES_CBC_SHA", + "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", + "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", + "SSL_RSA_WITH_DES_CBC_SHA", + "SSL_RSA_EXPORT_WITH_RC4_40_MD5", + "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", + "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", + "SSL_RSA_WITH_NULL_MD5", + "SSL_RSA_WITH_NULL_SHA", + "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", + "SSL_DH_anon_WITH_DES_CBC_SHA", + "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", + "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA")); + server.setConnectors(Array(nioconnector, sslconnector)); + } + + // set up Context and Servlet + val handler = new Context(server, "/", Context.NO_SESSIONS | Context.NO_SECURITY); + handler.addServlet(new ServletHolder(new OuiServlet), "/"); + +// removed due to license restrictions; REMOVED_COS_OF_COS + +// val filterHolder = new FilterHolder(new MultipartFilter()); +// filterHolder.setInitParameter("uploadDir", System.getProperty("java.io.tmpdir")); +// handler.addFilter(filterHolder, "/*", 1); + + global.context = handler; + + // set up apache-style logging + val requestLogHandler = new RequestLogHandler(); + val requestLog = new NCSARequestLog(config.logDir+"/backend/access/access-yyyy_mm_dd.request.log") { + override def log(req: Request, res: Response) { + try { + if (config.devMode || config.specialDebug) + super.log(req, res); + else if (res.getStatus() != 200 || config.transportPrefix == null || ! req.getRequestURI().startsWith(config.transportPrefix)) + super.log(req, res); + val d = new Date(); + appstats.stati.foreach(_(if (res.getStatus() < 0) 404 else res.getStatus()).hit(d)); + } catch { + case e => { exceptionlog("Error writing to log?"); exceptionlog(e); } + } + } + }; + requestLog.setRetainDays(365); + requestLog.setAppend(true); + requestLog.setExtended(true); + requestLog.setLogServer(true); + requestLog.setLogLatency(true); + requestLog.setLogTimeZone("PST"); + requestLogHandler.setRequestLog(requestLog); + + // set handlers with server + val businessHandlers = new HandlerList(); + businessHandlers.setHandlers(Array(handler)); + val allHandlers = new HandlerCollection(); + allHandlers.setHandlers(Array(businessHandlers, requestLogHandler)); + server.setHandler(allHandlers); + + // fix slow startup bug + server.setSessionIdManager(new HashSessionIdManager(new java.util.Random())); + + // run the onStartup script. + runOnStartup(); + + // preload some runners, if necessary. + if (config.preloadRunners > 0) { + val b = new java.util.concurrent.CountDownLatch(config.preloadRunners); + for (i <- 0 until config.preloadRunners) + (new Thread { + ScopeReuseManager.freeRunner(ScopeReuseManager.newRunner); + b.countDown(); + }).start(); + while (b.getCount() > 0) { + b.await(); + } + println("Preloaded "+config.preloadRunners+" runners."); + } + + // start SARS server. + if (config.listenSarsPort > 0) { + try { + import net.appjet.common.sars._; + sarsServer = new SarsServer(config.sarsAuthKey, + new SarsMessageHandler { override def handle(q: String) = runOnSars(q) }, + if (config.listenSarsHost.length > 0) Some(config.listenSarsHost) else None, + config.listenSarsPort); + sarsServer.daemon = true; + sarsServer.start(); + } catch { + case e: java.net.SocketException => { + println("SARS: A socket exception occurred: "+e.getMessage()+" on SARS server at "+config.listenSarsHost+":"+config.listenSarsPort); + java.lang.Runtime.getRuntime().halt(1); + } + } + } + + // start server + java.lang.Runtime.getRuntime().addShutdownHook(new Thread() { + override def run() { + val df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ"); + def printts(str: String) { + println("["+df.format(new Date())+"]: "+str); + } + printts("Shutting down..."); + handler.setShutdown(true); + Thread.sleep(if (config.devMode) 500 else 3000); + printts("...done, running onshutdown."); + runOnShutdown(); + printts("...done, stopping server."); + server.stop(); + server.join(); + printts("...done, flushing logs."); + for (l <- loggers) { l.flush(); l.close(); } + printts("...done."); + } + }); + + def socketError(c: org.mortbay.jetty.Connector, e: java.net.SocketException) { + var msg = e.getMessage(); + println("SOCKET ERROR: "+msg+" - "+(c match { + case null => "(unknown socket)"; + case x => { + (x.getHost() match { + case null => "localhost"; + case y => y; + })+":"+x.getPort(); + } + })); + if (msg.contains("Address already in use")) { + println("Did you make sure that ports "+config.listenPort+" and "+config.listenSecurePort+" are not in use?"); + } + if (msg.contains("Permission denied")) { + println("Perhaps you need to run as the root user or as an Administrator?"); + } + } + + var c: org.mortbay.jetty.Connector = null; + + try { + c = nioconnector; + c.open(); + if (sslconnector != null) { + c = sslconnector; + c.open(); + } + c = null; + allHandlers.start(); + server.start(); + } catch { + case e: java.net.SocketException => { + socketError(c, e); + java.lang.Runtime.getRuntime().halt(1); + } + case e: org.mortbay.util.MultiException => { + println("SERVER ERROR: Couldn't start server; multiple errors."); + for (i <- new IterableWrapper[Throwable] { override val underlying = e.getThrowables.asInstanceOf[java.util.List[Throwable]] }) { + i match { + case se: java.net.SocketException => { + socketError(c, se); + } + case e => + println("SERVER ERROR: Couldn't start server: "+i.getMessage()); + } + } + java.lang.Runtime.getRuntime().halt(1); + } + case e => { + println("SERVER ERROR: Couldn't start server: "+e.getMessage()); + java.lang.Runtime.getRuntime().halt(1); + } + } + + println("HTTP server listening on http://"+ + (if (config.listenHost.length > 0) config.listenHost else "localhost")+ + ":"+config.listenPort+"/"); + if (config.listenSecurePort > 0) + println("HTTPS server listening on https://"+ + (if (config.listenSecureHost.length > 0) config.listenSecureHost else "localhost")+ + ":"+config.listenSecurePort+"/"); + if (config.listenSarsPort > 0) + println("SARS server listening on "+ + (if (config.listenSarsHost.length > 0) config.listenSarsHost else "localhost")+ + ":"+config.listenSarsPort); + } +} diff --git a/trunk/infrastructure/net.appjet.oui/monitoring.scala b/infrastructure/net.appjet.oui/monitoring.scala index e380b84..e380b84 100644 --- a/trunk/infrastructure/net.appjet.oui/monitoring.scala +++ b/infrastructure/net.appjet.oui/monitoring.scala diff --git a/trunk/infrastructure/net.appjet.oui/network.scala b/infrastructure/net.appjet.oui/network.scala index 2965b19..2965b19 100644 --- a/trunk/infrastructure/net.appjet.oui/network.scala +++ b/infrastructure/net.appjet.oui/network.scala diff --git a/trunk/infrastructure/net.appjet.oui/servermodel.scala b/infrastructure/net.appjet.oui/servermodel.scala index 1e2363f..1e2363f 100644 --- a/trunk/infrastructure/net.appjet.oui/servermodel.scala +++ b/infrastructure/net.appjet.oui/servermodel.scala diff --git a/trunk/infrastructure/net.appjet.oui/stats.scala b/infrastructure/net.appjet.oui/stats.scala index 075182f..075182f 100644 --- a/trunk/infrastructure/net.appjet.oui/stats.scala +++ b/infrastructure/net.appjet.oui/stats.scala diff --git a/trunk/infrastructure/net.appjet.oui/synchronizer.scala b/infrastructure/net.appjet.oui/synchronizer.scala index 2a6d9c1..2a6d9c1 100644 --- a/trunk/infrastructure/net.appjet.oui/synchronizer.scala +++ b/infrastructure/net.appjet.oui/synchronizer.scala diff --git a/trunk/infrastructure/net.appjet.oui/util.scala b/infrastructure/net.appjet.oui/util.scala index ba8a736..ba8a736 100644 --- a/trunk/infrastructure/net.appjet.oui/util.scala +++ b/infrastructure/net.appjet.oui/util.scala diff --git a/trunk/infrastructure/rhino1_7R1/apiClasses.properties b/infrastructure/rhino1_7R1/apiClasses.properties index d116ee4..d116ee4 100644 --- a/trunk/infrastructure/rhino1_7R1/apiClasses.properties +++ b/infrastructure/rhino1_7R1/apiClasses.properties diff --git a/trunk/infrastructure/rhino1_7R1/build-date b/infrastructure/rhino1_7R1/build-date index e6132e5..e6132e5 100644 --- a/trunk/infrastructure/rhino1_7R1/build-date +++ b/infrastructure/rhino1_7R1/build-date diff --git a/trunk/infrastructure/rhino1_7R1/build.properties b/infrastructure/rhino1_7R1/build.properties index 4477ee0..4477ee0 100644 --- a/trunk/infrastructure/rhino1_7R1/build.properties +++ b/infrastructure/rhino1_7R1/build.properties diff --git a/trunk/infrastructure/rhino1_7R1/build.xml b/infrastructure/rhino1_7R1/build.xml index fabbffa..fabbffa 100644 --- a/trunk/infrastructure/rhino1_7R1/build.xml +++ b/infrastructure/rhino1_7R1/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/build.xml b/infrastructure/rhino1_7R1/deprecatedsrc/build.xml index 4250fcf..4250fcf 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/build.xml +++ b/infrastructure/rhino1_7R1/deprecatedsrc/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java index 2197063..2197063 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/ClassDefinitionException.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java index 3de53a8..3de53a8 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/NotAFunctionException.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java index 8d786c7..8d786c7 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/PropertyException.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java index b525aff..b525aff 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/LogicalEquality.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java index 3a16320..3a16320 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/Namespace.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java index fc99c7e..fc99c7e 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/NamespaceHelper.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java index 247da19..247da19 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/QName.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java index c8818a5..c8818a5 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java index 987c8ed..987c8ed 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLCtor.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java index 90da7d4..90da7d4 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLLibImpl.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java index b66ec96..b66ec96 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLList.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java index 8ff972e..8ff972e 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLName.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java index a6d47d5..a6d47d5 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLObjectImpl.java diff --git a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java index 67a778d..67a778d 100644 --- a/trunk/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java +++ b/infrastructure/rhino1_7R1/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XMLWithScope.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/Control.java b/infrastructure/rhino1_7R1/examples/Control.java index d671181..d671181 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/Control.java +++ b/infrastructure/rhino1_7R1/examples/Control.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/Counter.java b/infrastructure/rhino1_7R1/examples/Counter.java index 14c179a..14c179a 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/Counter.java +++ b/infrastructure/rhino1_7R1/examples/Counter.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/CounterTest.java b/infrastructure/rhino1_7R1/examples/CounterTest.java index 63dc74b..63dc74b 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/CounterTest.java +++ b/infrastructure/rhino1_7R1/examples/CounterTest.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/DynamicScopes.java b/infrastructure/rhino1_7R1/examples/DynamicScopes.java index 10d53ac..10d53ac 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/DynamicScopes.java +++ b/infrastructure/rhino1_7R1/examples/DynamicScopes.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/E4X/e4x_example.js b/infrastructure/rhino1_7R1/examples/E4X/e4x_example.js index 7417404..7417404 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/E4X/e4x_example.js +++ b/infrastructure/rhino1_7R1/examples/E4X/e4x_example.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/File.java b/infrastructure/rhino1_7R1/examples/File.java index 62bd980..62bd980 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/File.java +++ b/infrastructure/rhino1_7R1/examples/File.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/Foo.java b/infrastructure/rhino1_7R1/examples/Foo.java index bca1b79..bca1b79 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/Foo.java +++ b/infrastructure/rhino1_7R1/examples/Foo.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/Matrix.java b/infrastructure/rhino1_7R1/examples/Matrix.java index 87e4b8a..87e4b8a 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/Matrix.java +++ b/infrastructure/rhino1_7R1/examples/Matrix.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/NervousText.html b/infrastructure/rhino1_7R1/examples/NervousText.html index 0e3c7dd..0e3c7dd 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/NervousText.html +++ b/infrastructure/rhino1_7R1/examples/NervousText.html diff --git a/trunk/infrastructure/rhino1_7R1/examples/NervousText.js b/infrastructure/rhino1_7R1/examples/NervousText.js index a2f82fe..a2f82fe 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/NervousText.js +++ b/infrastructure/rhino1_7R1/examples/NervousText.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java b/infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java index 4157a11..4157a11 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java +++ b/infrastructure/rhino1_7R1/examples/PrimitiveWrapFactory.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/RunScript.java b/infrastructure/rhino1_7R1/examples/RunScript.java index 758ac64..758ac64 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/RunScript.java +++ b/infrastructure/rhino1_7R1/examples/RunScript.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/RunScript2.java b/infrastructure/rhino1_7R1/examples/RunScript2.java index cb02896..cb02896 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/RunScript2.java +++ b/infrastructure/rhino1_7R1/examples/RunScript2.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/RunScript3.java b/infrastructure/rhino1_7R1/examples/RunScript3.java index 7baeba8..7baeba8 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/RunScript3.java +++ b/infrastructure/rhino1_7R1/examples/RunScript3.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/RunScript4.java b/infrastructure/rhino1_7R1/examples/RunScript4.java index bd3d6f4..bd3d6f4 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/RunScript4.java +++ b/infrastructure/rhino1_7R1/examples/RunScript4.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/Shell.java b/infrastructure/rhino1_7R1/examples/Shell.java index 6316c6f..6316c6f 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/Shell.java +++ b/infrastructure/rhino1_7R1/examples/Shell.java diff --git a/trunk/infrastructure/rhino1_7R1/examples/SwingApplication.js b/infrastructure/rhino1_7R1/examples/SwingApplication.js index a527aad..a527aad 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/SwingApplication.js +++ b/infrastructure/rhino1_7R1/examples/SwingApplication.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/checkParam.js b/infrastructure/rhino1_7R1/examples/checkParam.js index 51910d5..51910d5 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/checkParam.js +++ b/infrastructure/rhino1_7R1/examples/checkParam.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/enum.js b/infrastructure/rhino1_7R1/examples/enum.js index 02034bc..02034bc 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/enum.js +++ b/infrastructure/rhino1_7R1/examples/enum.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/jsdoc.js b/infrastructure/rhino1_7R1/examples/jsdoc.js index 3d44e48..3d44e48 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/jsdoc.js +++ b/infrastructure/rhino1_7R1/examples/jsdoc.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/liveConnect.js b/infrastructure/rhino1_7R1/examples/liveConnect.js index 7befc08..7befc08 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/liveConnect.js +++ b/infrastructure/rhino1_7R1/examples/liveConnect.js diff --git a/trunk/infrastructure/rhino1_7R1/examples/unique.js b/infrastructure/rhino1_7R1/examples/unique.js index a4274bb..a4274bb 100644 --- a/trunk/infrastructure/rhino1_7R1/examples/unique.js +++ b/infrastructure/rhino1_7R1/examples/unique.js diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/allclasses-frame.html b/infrastructure/rhino1_7R1/javadoc/allclasses-frame.html index 073b251..073b251 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/allclasses-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/allclasses-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html b/infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html index 48536b4..48536b4 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html +++ b/infrastructure/rhino1_7R1/javadoc/allclasses-noframe.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/constant-values.html b/infrastructure/rhino1_7R1/javadoc/constant-values.html index b29b7ba..b29b7ba 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/constant-values.html +++ b/infrastructure/rhino1_7R1/javadoc/constant-values.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/deprecated-list.html b/infrastructure/rhino1_7R1/javadoc/deprecated-list.html index 923cc54..923cc54 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/deprecated-list.html +++ b/infrastructure/rhino1_7R1/javadoc/deprecated-list.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/help-doc.html b/infrastructure/rhino1_7R1/javadoc/help-doc.html index 7a2e353..7a2e353 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/help-doc.html +++ b/infrastructure/rhino1_7R1/javadoc/help-doc.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/index-all.html b/infrastructure/rhino1_7R1/javadoc/index-all.html index 15ba433..15ba433 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/index-all.html +++ b/infrastructure/rhino1_7R1/javadoc/index-all.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/index.html b/infrastructure/rhino1_7R1/javadoc/index.html index fa48043..fa48043 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/index.html +++ b/infrastructure/rhino1_7R1/javadoc/index.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html index 07c38c5..07c38c5 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html index 8d8b3ef..8d8b3ef 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html index 924cfb5..924cfb5 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html index 8b5e109..8b5e109 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html index 64fb637..64fb637 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html index 8e7116c..8e7116c 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html index 6290c8c..6290c8c 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html index ef61a6f..ef61a6f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html index 71c774f..71c774f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html index a559d25..a559d25 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html index 6f06bb5..6f06bb5 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html index 55712dc..55712dc 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html index 4e9d011..4e9d011 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html index 2d998ac..2d998ac 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html index 78dd7a7..78dd7a7 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html index 6dafa13..6dafa13 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html index 910d0fd..910d0fd 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html index 4ad3d0f..4ad3d0f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html index 65f250f..65f250f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html index 14ab7aa..14ab7aa 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html index fce83d6..fce83d6 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html index 92c5c44..92c5c44 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html index 05b8fb4..05b8fb4 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html index 675c456..675c456 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html index 1109997..1109997 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html index 0d05fdc..0d05fdc 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html index 1159738..1159738 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html index 28878a0..28878a0 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html index 1a50d7f..1a50d7f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html index d32bdf5..d32bdf5 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html index bdce431..bdce431 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html index 1dc284b..1dc284b 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html index 8b86a40..8b86a40 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html index 55e23d0..55e23d0 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html index f40351c..f40351c 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html index c15d3c1..c15d3c1 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html index 030f3e0..030f3e0 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html index f0d178f..f0d178f 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html index fb6d1ba..fb6d1ba 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html index 39d85e2..39d85e2 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html index 568f562..568f562 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html index e672261..e672261 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html +++ b/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/overview-frame.html b/infrastructure/rhino1_7R1/javadoc/overview-frame.html index 10e9be0..10e9be0 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/overview-frame.html +++ b/infrastructure/rhino1_7R1/javadoc/overview-frame.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/overview-summary.html b/infrastructure/rhino1_7R1/javadoc/overview-summary.html index 043bb30..043bb30 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/overview-summary.html +++ b/infrastructure/rhino1_7R1/javadoc/overview-summary.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/overview-tree.html b/infrastructure/rhino1_7R1/javadoc/overview-tree.html index 9c5398c..9c5398c 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/overview-tree.html +++ b/infrastructure/rhino1_7R1/javadoc/overview-tree.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/package-list b/infrastructure/rhino1_7R1/javadoc/package-list index 62fc06b..62fc06b 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/package-list +++ b/infrastructure/rhino1_7R1/javadoc/package-list diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/resources/inherit.gif b/infrastructure/rhino1_7R1/javadoc/resources/inherit.gif Binary files differindex c814867..c814867 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/resources/inherit.gif +++ b/infrastructure/rhino1_7R1/javadoc/resources/inherit.gif diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/serialized-form.html b/infrastructure/rhino1_7R1/javadoc/serialized-form.html index c022624..c022624 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/serialized-form.html +++ b/infrastructure/rhino1_7R1/javadoc/serialized-form.html diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/stylesheet.css b/infrastructure/rhino1_7R1/javadoc/stylesheet.css index 6ea9e51..6ea9e51 100644 --- a/trunk/infrastructure/rhino1_7R1/javadoc/stylesheet.css +++ b/infrastructure/rhino1_7R1/javadoc/stylesheet.css diff --git a/trunk/infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar b/infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar Binary files differindex fef9a9c..fef9a9c 100644 --- a/trunk/infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar +++ b/infrastructure/rhino1_7R1/lib/jsr173_1.0_api.jar diff --git a/trunk/infrastructure/rhino1_7R1/lib/xbean.jar b/infrastructure/rhino1_7R1/lib/xbean.jar Binary files differindex 8a4dff4..8a4dff4 100644 --- a/trunk/infrastructure/rhino1_7R1/lib/xbean.jar +++ b/infrastructure/rhino1_7R1/lib/xbean.jar diff --git a/trunk/infrastructure/rhino1_7R1/src/build.xml b/infrastructure/rhino1_7R1/src/build.xml index a0a1e13..a0a1e13 100644 --- a/trunk/infrastructure/rhino1_7R1/src/build.xml +++ b/infrastructure/rhino1_7R1/src/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/src/manifest b/infrastructure/rhino1_7R1/src/manifest index b7d0c06..b7d0c06 100644 --- a/trunk/infrastructure/rhino1_7R1/src/manifest +++ b/infrastructure/rhino1_7R1/src/manifest diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java b/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java index fa4713e..fa4713e 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ByteCode.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java b/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java index b9c6c96..b9c6c96 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/classfile/ClassFileWriter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java index 954b078..954b078 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Arguments.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java index d7d8992..d7d8992 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/BaseFunction.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java index 03e0fce..03e0fce 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Callable.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java index 9047278..9047278 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassCache.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java index d5f4cd6..d5f4cd6 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ClassShutter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java index 645d098..645d098 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/CompilerEnvirons.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java index 860db79..860db79 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ConstProperties.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java index 0833883..0833883 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Context.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java index 1c584a9..1c584a9 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextAction.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java index 4f9fde2..4f9fde2 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextFactory.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java index 5e17145..5e17145 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ContextListener.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java index ad2a68a..ad2a68a 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DToA.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java index 8547d37..8547d37 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Decompiler.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java index c7d93d4..c7d93d4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefaultErrorReporter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java index 5864b5d..5864b5d 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/DefiningClassLoader.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java index e044863..e044863 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Delegator.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java index 1fd8f03..1fd8f03 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EcmaError.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java index 4649370..4649370 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ErrorReporter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java index e222af3..e222af3 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Evaluator.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java index 7b4e7cc..7b4e7cc 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/EvaluatorException.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java index a4377e6..a4377e6 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Function.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java index 484167e..484167e 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionNode.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java index 8fa4e68..8fa4e68 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/FunctionObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java index 0f73615..0f73615 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/GeneratedClassLoader.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java index 1f51cb1..1f51cb1 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IRFactory.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java index 713fabf..713fabf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionCall.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java index c578dfa..c578dfa 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdFunctionObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java index 2b3ecf3..2b3ecf3 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/IdScriptableObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java index 294deab..294deab 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ImporterTopLevel.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java index c73db34..c73db34 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InformativeParser.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java index 877e6a2..877e6a2 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterfaceAdapter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java index db84299..db84299 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpretedFunction.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java index a68c025..a68c025 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Interpreter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java index 7435b10..7435b10 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/InterpreterData.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java index 6e0a827..6e0a827 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaAdapter.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java index 84ef2d4..84ef2d4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaMembers.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java index 11ebedf..11ebedf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/JavaScriptException.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java index f7b4cad..f7b4cad 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Kit.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java index 4153372..4153372 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/LazilyLoadedCtor.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java index 2d3553f..2d3553f 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/MemberBox.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java index b170ff4..b170ff4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeArray.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java index b6a106a..b6a106a 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeBoolean.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java index b196ac3..b196ac3 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeCall.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java index 75d41ab..75d41ab 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeDate.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java index 4aff10c..4aff10c 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeError.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java index ac70556..ac70556 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeFunction.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java index 0a8da9f..0a8da9f 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGenerator.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java index 58faad4..58faad4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeGlobal.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java index c61f417..c61f417 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeIterator.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java index 2f711a0..2f711a0 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaArray.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java index ab8af5c..ab8af5c 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaClass.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java index 530bf81..530bf81 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaConstructor.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java index eb66f40..eb66f40 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaMethod.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java index 3d27852..3d27852 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java index 71f09f7..71f09f7 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaPackage.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java index b5c9b49..b5c9b49 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeJavaTopPackage.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java index 36b66b4..36b66b4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeMath.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java index 8fc9fb0..8fc9fb0 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeNumber.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java index 19aff63..19aff63 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java index 7b5191e..7b5191e 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeScript.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java index 972415d..972415d 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeString.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java index 83683b2..83683b2 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NativeWith.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java index 4298388..4298388 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Node.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java index 201c6f2..201c6f2 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/NodeTransformer.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java index a9636a3..a9636a3 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjArray.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java index 4aa7d23..4aa7d23 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ObjToIntMap.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java index 80cb937..80cb937 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Parser.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java index c4d3d7e..c4d3d7e 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/PolicySecurityController.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java index 1e237bc..1e237bc 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Ref.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java index 6d4b61c..6d4b61c 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RefCallable.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java index ac29c6e..ac29c6e 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RegExpProxy.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java index b7f4a4d..b7f4a4d 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/RhinoException.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java index 4721ead..4721ead 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Script.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java index 9ea6d1f..9ea6d1f 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptOrFnNode.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java index f879581..f879581 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptRuntime.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java index 74e5ba7..74e5ba7 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Scriptable.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java index 53de1fc..53de1fc 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/ScriptableObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java index bc8ed86..bc8ed86 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecureCaller.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java index ed85dbf..ed85dbf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityController.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java index 275ad92..275ad92 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SecurityUtilities.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java index b037eaf..b037eaf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/SpecialRef.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java index f2fca52..f2fca52 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Synchronizer.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java index be96487..be96487 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Token.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java index c8c3045..c8c3045 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/TokenStream.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java index 0027819..0027819 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UintMap.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java index 472f26c..472f26c 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Undefined.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java index 33f96eb..33f96eb 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/UniqueTag.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java index 5fba4a5..5fba4a5 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/VMBridge.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java index 3edc203..3edc203 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrapFactory.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java index c749f74..c749f74 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/WrappedException.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java index cb2d2f5..cb2d2f5 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/Wrapper.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java index c6d3966..c6d3966 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/continuations/Continuation.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java index ef15710..ef15710 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebugFrame.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java index 23e7421..23e7421 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableObject.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java index 705e442..705e442 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/DebuggableScript.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java index bfac153..bfac153 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/debug/Debugger.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java index f5d1522..f5d1522 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk11/VMBridge_jdk11.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java index c33e9b4..c33e9b4 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java index 0ffaf9d..0ffaf9d 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java index bd56714..bd56714 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Block.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java index 4a69c6a..4a69c6a 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/ClassCompiler.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java index 64952bf..64952bf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Codegen.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java index 607e649..607e649 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/DataFlowBitSet.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java index e043165..e043165 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptFunctionNode.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java index ba8ca03..ba8ca03 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptRuntime.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java index 7cf679f..7cf679f 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/OptTransformer.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java index 575c7e7..575c7e7 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/optimizer/Optimizer.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java index a893841..a893841 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExp.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java index 808d62d..808d62d 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/NativeRegExpCtor.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java index 4b0a303..4b0a303 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/RegExpImpl.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java index 00905ca..00905ca 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/regexp/SubString.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties index fd869c1..fd869c1 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages.properties diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties index fc87c97..fc87c97 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/resources/Messages_fr.properties diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java index 476ff69..476ff69 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableInputStream.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java index 5ba0d74..5ba0d74 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java index da57ddf..da57ddf 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLLib.java diff --git a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java index 5033564..5033564 100644 --- a/trunk/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java +++ b/infrastructure/rhino1_7R1/src/org/mozilla/javascript/xml/XMLObject.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/base.skip b/infrastructure/rhino1_7R1/testsrc/base.skip index 35d6c54..35d6c54 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/base.skip +++ b/infrastructure/rhino1_7R1/testsrc/base.skip diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/build.xml b/infrastructure/rhino1_7R1/testsrc/build.xml index bc05516..bc05516 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/build.xml +++ b/infrastructure/rhino1_7R1/testsrc/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/opt1.skip b/infrastructure/rhino1_7R1/testsrc/opt1.skip index 7006882..7006882 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/opt1.skip +++ b/infrastructure/rhino1_7R1/testsrc/opt1.skip diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java index 8bae79f..8bae79f 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/JsDriver.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java index 9acf64e..9acf64e 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/ShellTest.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java index 9c05df6..9c05df6 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/StandardTests.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html index 36bd729..36bd729 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/drivers/results.html diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java index e9793cb..e9793cb 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/Bug409702Test.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java index b6cf3ca..b6cf3ca 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/JavaAcessibilityTest.java diff --git a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java index 08f95a3..08f95a3 100644 --- a/trunk/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java +++ b/infrastructure/rhino1_7R1/testsrc/org/mozilla/javascript/tests/PrivateAccessClass.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/build.xml b/infrastructure/rhino1_7R1/toolsrc/build.xml index be9a9b7..be9a9b7 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/build.xml +++ b/infrastructure/rhino1_7R1/toolsrc/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java index 938f5f2..938f5f2 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/ToolErrorReporter.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java index de8fcde..de8fcde 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java index f9762ec..f9762ec 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java index 3f90915..3f90915 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/Main.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java index d8f65b9..d8f65b9 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/ScopeProvider.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java index 61dc065..61dc065 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml index c35fd40..c35fd40 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/debugger/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java index dd4f689..dd4f689 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/CodePrinter.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java index 60bdfb4..60bdfb4 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/FileBody.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java index 69d5065..69d5065 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/IdValuePair.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java index ae1d038..ae1d038 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java index 3db99d6..3db99d6 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java index 2da4f2f..2da4f2f 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/jsc/Main.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties index 76615e9..76615e9 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/resources/Messages.properties diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java index 08cac62..08cac62 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ConsoleTextArea.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java index 19904b9..19904b9 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Environment.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java index fdb8f4e..fdb8f4e 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Global.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java index f6fe3a1..f6fe3a1 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JSConsole.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java index de39a5e..de39a5e 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java index 9120892..9120892 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/Main.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java index dcad90e..dcad90e 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/QuitAction.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java index 8f029ea..8f029ea 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/SecurityProxy.java diff --git a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java index ba7e62c..ba7e62c 100644 --- a/trunk/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java +++ b/infrastructure/rhino1_7R1/toolsrc/org/mozilla/javascript/tools/shell/ShellContextFactory.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/build.xml b/infrastructure/rhino1_7R1/xmlimplsrc/build.xml index 1aedece..1aedece 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/build.xml +++ b/infrastructure/rhino1_7R1/xmlimplsrc/build.xml diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java index a4cf585..a4cf585 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java index 90a18cb..90a18cb 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java index 090ae1a..090ae1a 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java index fac8773..fac8773 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java index 6d45240..6d45240 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java index 59dcca3..59dcca3 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java index edd7525..edd7525 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java index db918f8..db918f8 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java index fbeb45e..fbeb45e 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLWithScope.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java index 06955d0..06955d0 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java diff --git a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java index d8ad495..d8ad495 100644 --- a/trunk/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java +++ b/infrastructure/rhino1_7R1/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java diff --git a/trunk/infrastructure/yuicompressor/lib/jargs-1.0.jar b/infrastructure/yuicompressor/lib/jargs-1.0.jar Binary files differindex cdbc80b..cdbc80b 100644 --- a/trunk/infrastructure/yuicompressor/lib/jargs-1.0.jar +++ b/infrastructure/yuicompressor/lib/jargs-1.0.jar diff --git a/trunk/infrastructure/yuicompressor/lib/rhino-yuicompressor.jar b/infrastructure/yuicompressor/lib/rhino-yuicompressor.jar Binary files differindex b99560e..b99560e 100644 --- a/trunk/infrastructure/yuicompressor/lib/rhino-yuicompressor.jar +++ b/infrastructure/yuicompressor/lib/rhino-yuicompressor.jar diff --git a/trunk/infrastructure/yuicompressor/make.sh b/infrastructure/yuicompressor/make.sh index 947aafa..947aafa 100755 --- a/trunk/infrastructure/yuicompressor/make.sh +++ b/infrastructure/yuicompressor/make.sh diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java index 1b95aca..1b95aca 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/Bootstrap.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java index 68b4de9..68b4de9 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/CssCompressor.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java index a6d3e13..a6d3e13 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JarClassLoader.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java index e69ae1a..e69ae1a 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java index 8668f49..8668f49 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java index fee21d9..fee21d9 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java index c1a2e47..c1a2e47 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java diff --git a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java index dcbaff4..dcbaff4 100644 --- a/trunk/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java +++ b/infrastructure/yuicompressor/src/com/yahoo/platform/yui/compressor/YUICompressor.java diff --git a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java index 348c568..348c568 100644 --- a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java +++ b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Decompiler.java diff --git a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java index bf830a8..bf830a8 100644 --- a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java +++ b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Parser.java diff --git a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java index f082d68..f082d68 100644 --- a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java +++ b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/Token.java diff --git a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java index 5bee827..5bee827 100644 --- a/trunk/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java +++ b/infrastructure/yuicompressor/src/yuicompressor/org/mozilla/javascript/TokenStream.java |