Commit Graph
134 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
Jos van den Oever 1bfd1af795 Only load a class if it has not yet been defined. 2013-12-18 09:03:09 +01:00
Friedrich W. H. Kossebau efcf964df3 Workaround possible parallel calls to runtime's loadManifest(dir, manifests) 2013-12-16 23:46:29 +01:00
Jos van den Oever 5703d17248 Fix unit test for reading a utf-8 file as binary.
This test was broken because webkit browsers report the request as a string
instead of a byte array. The string has to be converted back to a byte array
in such cases.
2013-12-11 12:53:32 +01:00
Jos van den Oever 9984265c10 Make odf.OdfCanvas 100% typed. 2013-12-02 13:01:56 +01:00
Jos van den Oever dfec9ee62e Use manifest.json instead of manifest.js
The manifest.json files are generated automatically from the sources by the script updateJS.js, which also runs JSLint.
Dependencies are stored in manifest.json now. This allows the loading of modules to be more efficient, since all the required modules can be determined before loading.
2013-11-29 18:33:17 +01:00
Jos van den Oever dedf020d71 Avoid loading classes more than once. 2013-11-26 18:29:27 +01:00
Jos van den Oever 3d36212d9f Fix bug in runtime: manifest is now loaded only once per directory. 2013-11-26 16:56:01 +01:00
Jos van den Oever d39d255824 Make typed compilation standard for the js files that are 100% types. 2013-11-26 16:56:00 +01:00
Jos van den Oever 2ccfde5fa4 Simplify loading of classes.
runtime.js is now 100.0% typed. The contents of packages.js moves to runtime.js. manifest.js files now use JSON format.
2013-11-26 16:56:00 +01:00
Jos van den Oever 2ac6736d41 Make Runtime play a bit nicer with closure compiler. 2013-11-26 16:55:59 +01:00
Jos van den Oever 9d5b061734 Whitespace cleanup. 2013-11-26 16:55:00 +01:00
Jos van den Oever 0a215ff0f1 Fix more types in runtime.js.
There are still a number of tough type situations involving eval left over.
2013-11-26 16:55:00 +01:00
Jos van den Oever 81112e6532 Add more type checking for the IE workaround code. 2013-11-22 18:32:21 +01:00
Jos van den Oever aa50928233 Pass Uint8Array directly into Buffer constructor. 2013-11-22 18:32:21 +01:00
Jos van den Oever 1013d63a3e Add fallback for loading in IE. 2013-11-22 18:32:21 +01:00
Jos van den Oever 49a25d7c5c Fix loading of files via XHR. 2013-11-22 18:32:20 +01:00
Jos van den Oever 83982c5059 More type fixes.
This patch also contains quite some cleanups and reorganization in runtime.js.
2013-11-22 18:32:20 +01:00
Jos van den Oever 29b04dbbd3 Update Closure compiler and more typechecking.
The type Runtime.ByteArray is removed. Uint8Array is used instead.
The more rigorous type checking is enabled by the flag --jscomp_error reportUnknownTypes.
To compile with this flag, build the target typecheck-target.
2013-11-22 18:32:20 +01:00
Philip Peitsch cb9b666fb1 Use the cached data if possible when finding the file size of a path
Note, this function returns the size of the file in bytes. For a string,
the length is not indicitive of the file size, therefore a lookup is required
to the server.
2013-11-22 00:50:47 +11:00
Philip Peitsch 3c7eabb1cd Reduce GC load by batching calls to String.fromCharCode
Though string concatenation is theoretically faster, in practice
the myriad of calls to String.fromCharCode still seems to create
a lot of waste and cause more GC cycles. Batching these up using
an array and String.fromCharCode.apply produces roughly a 30%
speed-up in most browsers when loading the 1000page.odt document.

Results from benchmark, 1000page.odt:

Chrome 31.0.1650.48
Before: 1953ms
After:	1450ms

Safari 6.1 (7537.71)
Before: 1670ms
After:	1374ms

Firefox 25.0
Before: 2056ms
After:	1722ms
2013-11-18 23:37:27 +11:00
Aditya Bhatt 6a4f0e69ab Add translations support to runtime.js,
and programs/editor/Translator.js which is a reference
implementations of a translator.
The programs/editor/Translator code is used entirely in
localeditor.js/collabeditor.js and the editor itself, or webodf,
and need not know anything about the translation mechanism.

Translate all strings within the editor and all
user-facing strings in webodf core itself using
runtime.tr();
2013-11-05 18:38:41 +01:00
Friedrich W. H. Kossebau c2a795e668 Update link to repo: now https://github.com/kogmbh/WebODF/ 2013-10-23 18:20:30 +02:00
Friedrich W. H. Kossebau 508570dab8 Add copy of the AGPL3 to sources (+ add to created zip files) 2013-10-21 17:55:16 +02:00
Friedrich W. H. Kossebau f2b56083e6 add a ops.Server interface + a ServerFactory interface, move Nowjs-based server stuff into programs/editor/server/nowjs
MemberModel, SessionList, and OperationRouter are proxy classes which use
the server object to communicate with the server, while the server does
not always need to know about them
e.g. some server could not provide a SessionList, while another could have
that and more, while sharing the same basic server protocol.
Thus the serverfactory instance is separated from the server instance.
2013-08-28 16:33:49 +02:00
Friedrich W. H. Kossebau 9e1f0ce990 Do not reuse var name "document" in RhinoRuntime.loadXML() 2013-08-12 21:39:28 +02:00
Friedrich W. H. Kossebau 27d2663f4b Add more types to API documentation of odf.* 2013-08-12 18:50:14 +02:00
Philip Peitsch a653bb3539 Workaround a CORS bug in Cocoa's WebView on OSX10.8
Even though the server says it's ok to access the Content-Length
field in a CORS request, (and Chrome & Safari work with it), Cocoa's
WebView still refuses to return the proper length.
2013-07-25 13:29:20 +02:00
Jos van den Oever 64d57c96cf Fix issues exposed by latest JSLint. 2013-07-24 21:41:56 +02:00
Philip Peitsch e95673c1fe Reset the cursor blink after each movement
This prevents a rather strange effect if the arrow keys are held down
for cursor navigation. If the blink is not reset, the cursor fades in
and out while moving to the next/previous position.
2013-07-24 01:26:58 +02:00
Saket Patel 9b9280cb32 fixed typo 2013-07-03 09:37:43 +02:00
Saket Patel f3912d13f5 Fix loading of documents in IE10
IE10 was throwing InvalidStateError when accessing xhr.responseBody property,
and xhr.responseBody is not standard compliant and only used in IE < 9
so make code more standard compliant as per w3c
2013-07-03 09:37:43 +02:00
Philip Peitsch e11ebab6ac Clarified error message when unavailable module is loaded
Previously, attempting to load a module with no manifest.js defined
for the directory the script is executed in would result in node throwing
an "Error: ENOENT, no such file or directory".

With these changes, node will report "Cannot load manifest for …" instead,
allowing it to then fail with the specific module being searched for. This makes
hunting down ordering problems in the compilation a little easier.
2013-06-17 12:22:54 +02:00
Philip Peitsch 624b9107ed Use more widely support sourceURL prefix (tested in Chrome + Safari) 2013-06-11 11:48:55 +02:00
Jos van den Oever aaa9fa4ab2 Add labels to dynamic scripts for easier debugging
http://www.softwareishard.com/blog/firebug/firebug-tip-label-dynamic-scripts-with-sourceurl-directive/
2013-06-02 16:45:48 +02:00
Jos van den Oever c4f04e5c46 Fix reading of binary files in Chrome 26. 2013-05-23 14:00:24 +02:00
Lu Li 556e21f2be handles supplementary code points in utf8ByteArrayToString method
see the following link for more detail: http://terenceyim.wordpress.com/2011/03/04/javascript-utf-8-codec-that-supports-supplementary-code-points/
2013-05-23 12:02:50 +02:00
Friedrich W. H. Kossebau 16c0a92192 Don't fail on class names with more than one namespace section 2013-05-07 13:01:58 +02:00
Jos van den Oever afc4dbda5e Add ability to run single tests in the browser environment.
Each suite and test now has a link. Pressing the link will add a query to the tests page that will filter out only a particular suite or even a particular test.
2013-05-06 11:39:31 +02:00
Jos van den Oever 95407f9336 Upgrade to JSLint 2013-03-28
This version needs a new option 'closure' to tolerate Closure Compiler idiom.
Some outdated options have been removed.
2013-04-05 15:14:15 +02:00
Jos van den Oever d1dc5840c4 Upgrade to newer closure compiler. 2013-04-05 15:14:15 +02:00
Tobias Hintze 555fad5ecd runtime: make path resolving more windows compatible 2013-02-07 19:17:04 +01:00
Jos van den Oever b455820c59 Fix handling of passed args argument.
args can be false, in which case it is replace by an empty array.
2013-02-04 11:20:45 +01:00
Jos van den Oever 0e84d6acae Fix runtime.js to properly run all tests.
The way arguments are passed was wrongly changed and is now back to the state of a few months back when the code was changed to please Closure Compiler.
Now an explicit cast has been added to fix compilation errors.
2013-02-04 11:20:45 +01:00
Friedrich W. H. Kossebau 3fea5d3158 Make handling of global var "arguments" in runtime.js also work in browsers 2013-01-04 15:23:09 +01:00
Jos van den Oever bc3e2f9f08 Update to newer Closure Compiler. 2012-12-28 11:59:47 +01:00
Jos van den Oever 95ef3267bb Throw and exception in the assert. 2012-11-15 10:19:50 +01:00
Tobias Hintze 258d829dbe implement runtime.log according to declaration also for node+rhino 2012-11-14 14:01:24 +01:00
Tobias Hintze 99d1eaf555 runtime.log implement alert-category; use it in watchdog 2012-11-14 13:36:47 +01:00
Tobias Hintze e1d35828bd add try/catch to runtime.getVariable 2012-11-09 12:30:26 +01:00