1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-20 08:44:52 +00:00
Commit Graph

437 Commits

Author SHA1 Message Date
Jeremy Ruston
26b5fc4a6d Fixed default type for unknown typed text blocks 2012-03-03 18:07:47 +00:00
Jeremy Ruston
4999a3b729 Added an option to specify default mime type in parseText() 2012-03-03 18:07:33 +00:00
Jeremy Ruston
588bc550c0 Added plain text parser
Now we display plain text tiddlers properly
2012-03-03 18:07:09 +00:00
Jeremy Ruston
2ce77b3839 Comment update 2012-03-03 18:06:33 +00:00
Jeremy Ruston
9de3bb6f59 Fixed problem with SVG images identified by file extension 2012-03-03 13:52:10 +00:00
Jeremy Ruston
505c332123 Fix for identifying SVG images by file extension 2012-03-03 13:39:35 +00:00
Jeremy Ruston
128c94804a Fixed type block bug 2012-03-03 13:35:51 +00:00
Jeremy Ruston
3bfab9f9da Added support for typed blocks in wikitext
This allows embedded blocks of another mime type to appear in a
tiddler, useful for syntax highlighting fragments of javascript
2012-03-03 12:29:13 +00:00
Jeremy Ruston
12c6239bf5 Keeping JSHint happy 2012-03-02 18:00:40 +00:00
Jeremy Ruston
5eab89d1f0 Improved styles for JavaScript comments
Because we all want skeuomorphic post-it note comments on our code
2012-03-02 15:54:05 +00:00
Jeremy Ruston
d3ca939863 Improved rendering of JavaScript comments 2012-03-02 14:21:02 +00:00
Jeremy Ruston
865a0ad7cc Improved rendering of JavaScript that has parse errors 2012-03-02 12:09:06 +00:00
Jeremy Ruston
488562bd95 Restored the JSONParser as a separate entity
It doesn't really have much in common with the JavaScript parser
2012-03-02 11:31:39 +00:00
Jeremy Ruston
8adfcbdc69 Added syntax highlighting for JavaScript tiddlers 2012-03-02 00:48:05 +00:00
Jeremy Ruston
542561a0fa Trim javascript module tiddlers to exclude the standard header and footer 2012-03-02 00:10:39 +00:00
Jeremy Ruston
8552f2f894 Use the new esprima parser to display javascript modules as parse trees 2012-03-01 23:59:46 +00:00
Jeremy Ruston
a274bad1a2 Tying up the ability to load javascript modules as tiddlers 2012-03-01 23:24:25 +00:00
Jeremy Ruston
96d8c15f72 Added ability to load javascript modules into the tiddler store
When running in the browser
2012-03-01 23:23:37 +00:00
Jeremy Ruston
f6338d9109 Replace pegs parser with Esprima
It preserves comments and text positions, enabling us to do syntax
highlighting. Hopefully.
2012-03-01 22:47:31 +00:00
Jeremy Ruston
470b622bb1 Corrected dependency skinny/fat handling 2012-03-01 19:03:04 +00:00
Jeremy Ruston
46f019ea83 Refactored where we do macro parameter string parsing 2012-02-22 23:27:38 +00:00
Jeremy Ruston
6902ee19de Refactoring name of macro refresh method 2012-02-22 23:27:21 +00:00
Jeremy Ruston
106380b98a Fixed slider to refresh child nodes correctly 2012-02-22 22:47:42 +00:00
Jeremy Ruston
525fd3631e Handle cascadeDefaults in macro parameters 2012-02-22 22:24:51 +00:00
Jeremy Ruston
6d96632bf6 Fixed typo 2012-02-22 22:24:37 +00:00
Jeremy Ruston
c918bb6b35 Removed obsolete parameter from internal method 2012-02-22 21:58:48 +00:00
Jeremy Ruston
52c3e7a146 Extended slider macro to accept a "content" parameter
It specifies wikitext to directly include within the slider, overriding
any specified targetTiddler
2012-02-22 21:39:59 +00:00
Jeremy Ruston
6a0f2006bf Fixed problem with specifying positional parameters by name 2012-02-22 21:39:08 +00:00
Jeremy Ruston
bf6f5e0254 Refactored macro interface
Now 'this' points to the Renderer.MacroNode
2012-02-21 21:57:30 +00:00
Jeremy Ruston
1d007ce6d5 Removing the info macro 2012-02-21 21:56:38 +00:00
Jeremy Ruston
5a51604fdb Get rid of the info macro
We may bring it back, but it's a hassle to keep it up to date at the
moment
2012-02-21 21:56:27 +00:00
Jeremy Ruston
bc385abe23 Merged adjacent if() clauses 2012-02-20 21:19:12 +00:00
Jeremy Ruston
aaedf28904 Minor re-enhancements 2012-02-20 21:00:12 +00:00
Jeremy Ruston
5ca478d106 Get rid of the Renderer() wrapper and use the MacroNode directly 2012-02-20 20:52:54 +00:00
Jeremy Ruston
53f652bf2a Refactored evaluation of macro dependencies
Now the dependencies are evaluated in the constructor for the
Renderer.MacroNode
2012-02-20 19:27:37 +00:00
Jeremy Ruston
b37d3b6670 Refactored macros to use new Dependencies() constructor 2012-02-20 18:05:10 +00:00
Jeremy Ruston
b1a96d8bf5 Refactored renderTiddler() to create macro node directly
This is so that we can get rid of the Renderer() wrapper class entirely
2012-02-20 18:04:50 +00:00
Jeremy Ruston
36f61b4321 Further simplification of the Renderer() class 2012-02-20 18:04:12 +00:00
Jeremy Ruston
0c4f877093 Refactored Dependencies() constructor
Now it's much easier to call
2012-02-20 18:03:51 +00:00
Jeremy Ruston
707a08540c Ceding to JSHint's suggestions 2012-02-20 15:42:21 +00:00
Jeremy Ruston
4d6f8ab8eb Introduced new base class for Renderer nodes
Making the code a bit simpler
2012-02-20 11:06:17 +00:00
Jeremy Ruston
93de843016 Remove unused deepCopy() function 2012-02-19 20:12:25 +00:00
Jeremy Ruston
e4dd63d089 Updated slider macro to have a refresh method 2012-02-19 17:24:01 +00:00
Jeremy Ruston
a0524c2144 Added protection against wikitext recursion
Now attempts to view a tiddler recursively fail gracefully
2012-02-19 17:20:16 +00:00
Jeremy Ruston
3bb0490bee Added defaultText parameter to getTiddlerText() 2012-02-19 17:19:12 +00:00
Jeremy Ruston
1326b12948 Removed "optional" field from macro parameters
Macros need to tolerate missing parameters
2012-02-17 17:32:32 +00:00
Jeremy Ruston
94a84d8bc6 More JSHint hints 2012-02-17 17:31:57 +00:00
Jeremy Ruston
103a9a4d7f Introduced new Dependency() class to encapsulate dependency handling logic
Note that the format is now slightly different; see js/Dependencies.js
for details
2012-02-17 14:11:25 +00:00
Jeremy Ruston
8d4d168432 Beefed up <<slider>> macro to store state in a tiddler
Now the state of the slider is reflected in the text of a tiddler
2012-02-17 12:36:39 +00:00
Jeremy Ruston
81219b1205 Fix for refreshing untouched child nodes in story macro 2012-02-17 12:36:08 +00:00
Jeremy Ruston
6805b08cf4 The default wrapper tag for macros is now <span>
So we don't need this
2012-02-17 12:35:44 +00:00
Jeremy Ruston
167613552f Fixes to enable <<tiddler>> macro to cope with missing tiddlers 2012-02-17 12:35:21 +00:00
Jeremy Ruston
221cc80c65 Updated renderer to handle refreshing
Now we can refresh renderers that aren't in a DOM tree
2012-02-17 12:34:56 +00:00
Jeremy Ruston
56eb3dc1dc Added support for rendering and refreshing the window title 2012-02-17 12:34:28 +00:00
Jeremy Ruston
0439f259b4 Switched over to using new Renderer class 2012-02-16 20:38:10 +00:00
Jeremy Ruston
fef0b9e4da Introduce new Renderer class
Another massive refactoring, with a bit more polishing to come
2012-02-16 20:36:43 +00:00
Jeremy Ruston
155bf379cc Added stylability to HTML.label() 2012-02-13 13:46:49 +00:00
Jeremy Ruston
4ce479f693 Refactored the image and JSON parsers
Now they reuse the WikiTextParseTree
2012-02-11 20:12:25 +00:00
Jeremy Ruston
9ececdf406 JSHint was complaining without this unnecessary "break" statement 2012-02-11 20:11:59 +00:00
Jeremy Ruston
a98ff0350f Added HTML.label() 2012-02-11 20:11:38 +00:00
Jeremy Ruston
b05e7e82da Now passing store to the other parser constructors 2012-02-11 20:11:26 +00:00
Jeremy Ruston
c100b434f9 Revert "Passed "store" to the other parser constructors"
This reverts commit 017be8f4ff.
2012-02-11 20:02:35 +00:00
Jeremy Ruston
017be8f4ff Passed "store" to the other parser constructors 2012-02-11 20:01:58 +00:00
Jeremy Ruston
a20c9cc8ac Refactored view macro
Now we use renderTiddler when we can for wikified fields
2012-02-11 18:19:34 +00:00
Jeremy Ruston
8f4f8ae65f Add wrapper nodes around renderText() output 2012-02-11 18:18:50 +00:00
Jeremy Ruston
fb9ea4c202 Minor cleanup and comment improvements 2012-02-11 17:51:23 +00:00
Jeremy Ruston
0598d697ee Reordered dependencies within the WikiTextParseTree dump 2012-02-11 17:10:49 +00:00
Jeremy Ruston
d2c6248efd Renamed the moving clock tiddler 2012-02-11 17:10:28 +00:00
Jeremy Ruston
7fdd8985ef Stopped caching renderer output
It means we're inadvertently caching the missing/resolved state of links
2012-02-10 11:12:08 +00:00
Jeremy Ruston
91caf57ef1 Removed obsolete WikiStore.adjustClassesForLink() method 2012-02-09 13:37:05 +00:00
Jeremy Ruston
e8a93fa56b Refactored link macro
To handle external links correctly, and URI encode internal links
2012-02-09 13:36:46 +00:00
Jeremy Ruston
210f1bcd09 Added missing event processing to story macro 2012-02-09 13:36:21 +00:00
Jeremy Ruston
6166ca3d36 Refactored the naming of the JavaScript parser methods 2012-02-09 13:15:37 +00:00
Jeremy Ruston
66bcef51b3 Changed the ordering of dependencies in WikiTextRenderer.toString 2012-02-08 12:51:46 +00:00
Jeremy Ruston
95ab295fbb Refactored dependency handling
Now each class of dependency can be tracked individually
2012-02-07 19:03:59 +00:00
Jeremy Ruston
10774a724f Refactored macro parsing
So that we can more easily improve the way that dependencies are tracked
2012-02-06 17:16:45 +00:00
Jeremy Ruston
9dfa0f4edd Added support for macros to HTML.js 2012-02-06 12:55:38 +00:00
Jeremy Ruston
5814e29416 More HTML.js changes 2012-02-06 12:43:05 +00:00
Jeremy Ruston
4376e26d53 Switched over to HTML.js 2012-02-06 12:15:16 +00:00
Jeremy Ruston
5406d00612 Fixed problems with slider 2012-02-06 11:31:23 +00:00
Jeremy Ruston
2cb337706d Remove the obsolete element stitching functions 2012-02-06 10:58:07 +00:00
Jeremy Ruston
00774c1a48 Switched over to the new HTML class 2012-02-06 10:57:55 +00:00
Jeremy Ruston
7ac85ebbbb Switched the macros to use the new HTML class 2012-02-06 10:57:28 +00:00
Jeremy Ruston
26c7177752 Introduced new class for constructing and processing HTML trees
Intended to simplify various bits of HTML generation code
2012-02-06 10:56:55 +00:00
Jeremy Ruston
e579630249 Added explanatory comment to the view macro 2012-02-04 15:56:20 +00:00
Jeremy Ruston
2ff56c193c Fixed return value for macro events 2012-02-04 15:56:06 +00:00
Jeremy Ruston
15cfed83f4 Restored operation of sliders in info macro
Accidentally clobbered in the last refactoring
2012-02-02 18:15:59 +00:00
Jeremy Ruston
58ab36ef51 Refactored navigation to use new macro event mechanism
Phew. This gets rid of a lot of hacks
2012-02-02 18:00:42 +00:00
Jeremy Ruston
f576c86b41 Refactored macro event handling
Updated the slider macro to use the new mechanism to start with
2012-02-02 17:48:09 +00:00
Jeremy Ruston
449f322a86 Refactoring navigation handling
Not done yet, but the tests are passing so it's a good point to check
in. The idea is to let macros register for events to handle both the
click and the navigation request.
2012-02-02 15:13:50 +00:00
Jeremy Ruston
6707034ae5 Corrected typo 2012-02-02 12:49:26 +00:00
Jeremy Ruston
0458c538b0 Removed unneeded variable declaration 2012-02-01 16:13:49 +00:00
Jeremy Ruston
b0336c527c Changed the signature of WikiStore.renderTiddler
The parameters are more sensible and predictable now
2012-02-01 16:12:49 +00:00
Jeremy Ruston
5b301dc30b Added rerender support to the story macro
Allowing the selective refresh of the story tiddlers
2012-02-01 12:37:29 +00:00
Jeremy Ruston
121907fd36 Added a video embed macro
Playing videos makes it easier to verify that a particular tiddler
hasn't been inadvertently refreshed (which would cause the video to
reload)
2012-02-01 12:36:40 +00:00
Jeremy Ruston
6996f255ca Refactored renderer structure
This is to enable macros to be re-rendered as part of the refresh
process
2012-01-31 12:00:07 +00:00
Jeremy Ruston
6f027c3b49 Fixed problem with property names that need quoting 2012-01-31 11:58:53 +00:00
Jeremy Ruston
ddfa6732a6 Rename render function of macros 2012-01-30 20:04:47 +00:00
Jeremy Ruston
350ad5bf3b Removed extraneous debugging log 2012-01-30 20:04:20 +00:00
Jeremy Ruston
b0fc3d4668 Added ability to suppress the wrapper HTML nodes required by the refresh circuitry 2012-01-30 18:26:05 +00:00
Jeremy Ruston
6066b5cf89 Removed extraneous parameters to JSONParser constructor 2012-01-30 18:25:26 +00:00
Jeremy Ruston
56e701b326 Switched stitchElement parameter from className to classes
It's shorter, and looks better
2012-01-30 17:30:33 +00:00
Jeremy Ruston
f4d530a114 Removed erroneous blank line 2012-01-30 17:29:49 +00:00
Jeremy Ruston
205987d280 Improved the tiddler macro
Now you can transclude tiddlers as templates
2012-01-27 18:43:39 +00:00
Jeremy Ruston
6a81ed786e Documentation update for the tiddler macro
Including describing a new parameter that we'll add once the tests are
more up to date
2012-01-27 18:00:49 +00:00
Jeremy Ruston
a89acfc997 Fixed context for parameterised transclusions 2012-01-27 17:22:20 +00:00
Jeremy Ruston
1aa9b084e2 Fixed tiddler macro context for transclusions
Before this view macros in the transcluded tiddler displayed fields
from the tiddler doing the transcluding
2012-01-27 17:20:12 +00:00
Jeremy Ruston
d399a01f15 Added some judicious hasOwnProperty() checks 2012-01-27 16:49:29 +00:00
Jeremy Ruston
f29f06f3e9 Cleanups 2012-01-27 16:35:55 +00:00
Jeremy Ruston
3e62698efb Added parsing and rendering for JSON tiddlers 2012-01-25 22:35:52 +00:00
Jeremy Ruston
a04cec3723 Added a helpful comment 2012-01-25 19:15:07 +00:00
Jeremy Ruston
fdbb46afb8 Missing return value if slider click event not handled 2012-01-25 19:14:01 +00:00
Jeremy Ruston
a4600c6c16 Put the tiddler info stuff into sliders 2012-01-25 15:35:52 +00:00
Jeremy Ruston
aba830ff8c Refactored story navigator to work by modifying the story tiddlers
Currently hardwiring the name of the tiddler containing the story
2012-01-25 12:48:12 +00:00
Jeremy Ruston
0d45d76af6 Finally, selective refreshing now works
Although it's a bit hard to see which DOM nodes have been refreshed.
2012-01-25 12:05:18 +00:00
Jeremy Ruston
dad7756f65 Getting selective refresh working
A bunch of changes, and we're halfway there
2012-01-25 10:51:04 +00:00
Jeremy Ruston
81d642dd8b Fix type for transclusions 2012-01-24 18:11:59 +00:00
Jeremy Ruston
04e9376eca Refactored the story macro to invoke the tiddler macro to display tiddlers 2012-01-24 18:11:38 +00:00
Jeremy Ruston
3268c46458 Parsers now take the type parameter 2012-01-24 18:11:09 +00:00
Jeremy Ruston
889bdbc82a Added wrapper around macro invocations 2012-01-24 18:10:51 +00:00
Jeremy Ruston
527b750714 Wrap macro invocations in an information element 2012-01-24 18:10:27 +00:00
Jeremy Ruston
b92e011c66 Refactored stringily not to add the double quotes 2012-01-24 18:09:54 +00:00
Jeremy Ruston
b32826f110 Revise startup display handling
And adjust the image parser registration
2012-01-24 18:09:38 +00:00
Jeremy Ruston
bd5de61156 Replace the bitmap and SVG parsers with a single image parser 2012-01-24 18:08:59 +00:00
Jeremy Ruston
2cd0e681ea Temporarily suppressed rendering of the render step
So that the tests pass, which looks nicer
2012-01-24 16:28:26 +00:00
Jeremy Ruston
398831b0d9 Major reorganisation of wikitext rendering
Getting ready to support selective refresh of DOM elements
2012-01-24 16:26:37 +00:00
Jeremy Ruston
a96df59172 Added dump of the compile tree to info macro 2012-01-23 19:04:11 +00:00
Jeremy Ruston
32c8e69949 Use utils.stitchElement in WikiTextParseTree.compileElementHtml 2012-01-23 18:50:18 +00:00
Jeremy Ruston
33ad4461db Removed erroneous HTML encode in plain text generation 2012-01-23 18:45:50 +00:00
Jeremy Ruston
9123c32782 Corrected typos 2012-01-23 18:45:21 +00:00
Jeremy Ruston
ed87061897 Added the slider macro 2012-01-23 18:31:17 +00:00
Jeremy Ruston
c185989ca5 Fixed view macro to check whether the tiddler exists 2012-01-23 16:42:12 +00:00
Jeremy Ruston
82a37d3ab4 Fixed info macro when invoked in a missing tiddler 2012-01-23 16:41:49 +00:00
Jeremy Ruston
fd9d4973e3 Cleaned up last few diffs for building 2.6.5
Now the file is byte-for-byte identical with that produced by
TiddlyWiki itself.
2012-01-23 14:36:12 +00:00
Jeremy Ruston
3675958e30 Improvements to recipe error handling 2012-01-22 17:37:21 +00:00
Jeremy Ruston
17826a72fb More fixes for recipe directory handling
Done some variable name refactoring to make things clearer
2012-01-21 17:08:07 +00:00
Jeremy Ruston
106f287a94 Fixed problem with recipe directory handling 2012-01-21 16:54:31 +00:00
Jeremy Ruston
61adbbf83a Keeping JSHint on it's toes 2012-01-21 14:03:03 +00:00
Jeremy Ruston
b96f0c1bd6 Improvements to tree dumping 2012-01-21 14:00:09 +00:00
Jeremy Ruston
693cb67c6b Minor style tweaks 2012-01-20 12:19:13 +00:00
Jeremy Ruston
6fc3d45369 Update the info macro to display parse trees 2012-01-19 11:56:06 +00:00
Jeremy Ruston
e72fc6bc80 Added toString() method to WikiTextParseTree
For debugging and seeing what's going on behind the covers
2012-01-19 11:55:51 +00:00
Jeremy Ruston
d539286e09 New renderObject() function for displaying trees
So that we can display parse trees nicely
2012-01-19 11:55:18 +00:00
Jeremy Ruston
4bed00220e Cleaning up WikiTextRules 2012-01-17 16:44:59 +00:00
Jeremy Ruston
0f3cf24642 Added comments 2012-01-17 16:30:23 +00:00
Jeremy Ruston
ca3778f9fd Better error messages for eval'd code 2012-01-17 15:35:13 +00:00
Jeremy Ruston
a6de27b348 We shouldn't use the source of images as their text in text/plain renderings 2012-01-17 15:21:56 +00:00
Jeremy Ruston
8cfff2c2fa Refactored JavaScriptParseTree handling of output array 2012-01-17 15:20:46 +00:00
Jeremy Ruston
f10d58ed2b Refactored WikiTextParseTree to handle the output array better 2012-01-17 15:12:59 +00:00
Jeremy Ruston
73236d72f5 Note 2012-01-17 14:36:37 +00:00