1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 10:43:16 +00:00
Commit Graph

4349 Commits

Author SHA1 Message Date
jeremy@jermolene.com
3af2cc2691 Introduce function operator for calling functions
Can invoke any functions, not just those start with a period. And can pass zero parameters (in contrast when invoked as a custom filter operator there's no way to omit the first parameter).
2022-05-30 18:05:54 +01:00
jeremy@jermolene.com
bd9d7c3d6a Clean up unknown filter 2022-05-30 18:04:37 +01:00
jeremy@jermolene.com
0c3f82855b Minor cleanups 2022-05-29 10:55:15 +01:00
jeremy@jermolene.com
8106ad390d Merge branch 'master' into parameterised-transclusions 2022-05-29 10:52:45 +01:00
jeremy@jermolene.com
bb47cc97f5 Fix code_body typo 2022-05-29 10:51:49 +01:00
jeremy@jermolene.com
9424e9d1f2 Cleaning up after f636349007 2022-05-28 17:32:09 +01:00
jeremy@jermolene.com
58f01c9a20 Fix tabs global so it doesn't crash when viewed directly 2022-05-28 13:50:08 +01:00
jeremy@jermolene.com
5d413d3e2d Change to ? for conditional definitions 2022-05-28 13:49:02 +01:00
jeremy@jermolene.com
0d78b3fa38 Convert the tabs macro into a global
So far it appears to be totally backwards compatible... In practice, I think maybe this and the conversion of the other macros should go into a separate subsequent PR.
2022-05-28 12:24:48 +01:00
jeremy@jermolene.com
f636349007 Introduce true global variables
The basic idea is that if we don't find a variable `foo` then we fallback to retrieving the value from the tiddler `$:/global/foo`, if it exists.

This allows us to replace the usual importvariables-based mechanism for global definitions, avoiding cluttering up the variable namespace with every macro.

In order to permit subprocedures to be overridden, we also introduce a mechanism for conditional definitions: preceding the word definition|procedure|function|widget with a + causes the definition only to occur if the specified variable doesn't already exist. In the next commit we'll apply this mechanism to the tabs macro
2022-05-28 12:23:50 +01:00
jeremy@jermolene.com
a2fbebf509 Add utility function for parsing macro parameter definitions 2022-05-27 18:37:42 +01:00
jeremy@jermolene.com
6f9f92fa69 Add support for $:/tags/Global 2022-05-26 21:11:53 +01:00
jeremy@jermolene.com
dec45f0fc3 Fix importvariables to work with setvariables as well as set (they are aliases) 2022-05-26 21:11:32 +01:00
jeremy@jermolene.com
45b7b4bc6d Make is[variable] and variables[] operators resilient to fake widgets 2022-05-26 08:23:54 +01:00
jeremy@jermolene.com
e2d45e176a Merge branch 'master' into parameterised-transclusions 2022-05-25 18:08:17 +01:00
jeremy@jermolene.com
7e4722f07a Fix crash with missing palette tiddler 2022-05-25 18:08:08 +01:00
jeremy@jermolene.com
cbce4ebb7b Allow custom functions to be invoked as attributes 2022-05-23 20:18:54 +01:00
jeremy@jermolene.com
9e8d05f699 Require period prefix for custom filter operator functions
To ensure that custom filter operators cannot clash with future core operators.
2022-05-23 16:40:21 +01:00
jeremy@jermolene.com
22e7ec2381 Procedures and widgets inherit whitespace trim setting from their definition 2022-05-23 15:30:33 +01:00
jeremy@jermolene.com
170c4b1799 Merge branch 'master' into parameterised-transclusions 2022-05-23 11:28:12 +01:00
Cameron Fischer
696c5c9c7a
Compiled filters are cached (#6402)
* Compiled filters are cached

* Adjusting comments, and filtercache cap
2022-05-23 11:26:56 +01:00
jeremy@jermolene.com
ec1ec8ccd8 Fix invocation of JS macros 2022-05-21 16:31:34 +01:00
jeremy@jermolene.com
e50101322f Require $$ for custom widgets, and that overridden JS widgets must exist
See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1133637763
2022-05-21 15:47:19 +01:00
jeremy@jermolene.com
6eb4fbeead Fix double palette entries
Fixes #6700

Thanks to Eric Shulman
2022-05-20 17:13:12 +01:00
Max Schillinger
7cbe1e1d83
Fix toggling of the numbered list prefix in Markdown tiddlers (#6697)
* Fix toggling of the numbered list prefix in Markdown tiddlers

* Define startsWith in utils.js because it's not available in ECMAScript5.1
2022-05-17 22:31:50 +02:00
Max Schillinger
5ea315fb98
Allow toggling wrap-lines text operations (like mono block) (#6698) 2022-05-17 22:16:54 +02:00
FlashSystems
e9405ac810
Fix for Bug #6618 (#6628)
* Fix for Bug #6618

This Commit fixes Bug #6618. It is a little bit more complicated than
using one tiddler to store the new value for a field. Because the
following can happen:

* The user types "not-a-date" into the field value of a simple text field.
* The user now selects a field name that uses a HTML5 date editor. The
  Editor will show no date because the value cannot be parsed.
* The user saves the tiddler by clicking the checkmark.

Now the date-field contains the value "not-a-date" but the user was not
aware that this will be added. The edit control showed no date (because
the value was invalid) and the user assumed the field was empty and
won't be added to the tiddler.

To prevent this, every kind of field editor gets its own storage tiddler.
Its name is derived from the SHA256-hash of the name of the tiddler that
is returned by the Field Editor Cascade. That way every editor in the
cascade is only seeing its input. As long as the default setup (with one
default editor) is used, everything works like in 5.2.1.

This commit also fixes the bug that the after adding a field the
field-type input box was not focused again.

* Update Documentation for Field Editor Cascade

The fix for bug #6618 makes the handling of the tiddler backing the edit
operation much more complicated. See previous commit "Fix for Bug #6618"
for more details.
2022-05-14 13:30:04 +01:00
jeremy@jermolene.com
bbd9e2f243 Rename <$value> widget to <$fill> 2022-05-13 09:18:25 +01:00
jeremy@jermolene.com
36cf50aa96 Use \widget for custom widget definitions, and remove need for angle brackets
Need to do some refactoring of all those isFunctionDefinition/isProcedureDefinition/isWidgetDefinition flags into a single property
2022-05-13 08:49:53 +01:00
jeremy@jermolene.com
904e30a0e2 Detect recursion by tracking widget tree depth
The old recursion marker approach was very slow, and didn't catch test cases like editions/test/tiddlers/tests/data/transclude/Recursion.tid
2022-05-12 16:26:33 +01:00
jeremy@jermolene.com
413dc86d05 Rename internal "unknown" filter operator so that users cannot invoke it 2022-05-11 14:52:25 +01:00
jeremy@jermolene.com
774459fa73 Transclude: replace paramNames/paramValues with more robust JSON payload
More details at https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1123719153
2022-05-11 13:51:11 +01:00
jeremy@jermolene.com
0b11b499c2 Better backwards compatibility for legacy recursion marker
Fixes the problem with tag dropdowns @btheado
2022-05-10 10:21:56 +01:00
jeremy@jermolene.com
eef7d180a5 Remove obsolete code
Left over after refactoring
2022-05-10 10:21:19 +01:00
jeremy@jermolene.com
8e4c13382b Fix visible transclusion example 2022-05-10 08:10:32 +01:00
jeremy@jermolene.com
e092113f9f Switch to using \procedure to define new-style macros, and \function for custom filter operator functions
I now need to update the OP!
2022-05-09 18:00:09 +01:00
Mario Pietsch
bc8c011eb3
Fix title indentation problem (#6679)
* fix-6678-title-indent

* optimize code as suggested by Saq
2022-05-09 15:49:42 +01:00
Simon Huber
b4deb7cc45
Add tv-widgetnode-width and tv-widgetnode-height (#6681)
* Add tv-widgetnode-width and tv-widgetnode-height to collectDOMVariables

* Add docs

* update docs

* Update modified field
2022-05-09 10:42:23 +01:00
jeremy@jermolene.com
64448ae774 Make the macrocall widget delegate to the transclude widget 2022-05-08 20:48:33 +01:00
jeremy@jermolene.com
e9630328f1 Extend transclude widget to work with old-style macros and use it for the macrocall shortcut syntax 2022-05-08 15:59:20 +01:00
jeremy@jermolene.com
9be05f6f38 Use consistent parse tree node property for params 2022-05-07 13:22:53 +01:00
jeremy@jermolene.com
2fe2d20ddf Genesis widget should pass raw attributes onto child widget...
...so that it can more efficiently handle refreshing itself.
2022-05-07 11:41:28 +01:00
Simon Huber
4b8594c4a8
Fix: eventcatcher widget - variables can be undefined (#6668)
* Fix: eventcatcher widget - variables can be undefined

* Fix: selectedNode can be an svg where offsetLeft ... are undefined

* Make check for offsetLeft short

* remove second collectDOMNodeVariables
2022-05-06 17:11:13 +01:00
lin onetwo
9b9e443c73
Fix lazy all template with user defined macro cause error (#6644)
* Fix lazy all template with user defined macro cause error

Fixes https://github.com/Jermolene/TiddlyWiki5/issues/6637

* fix: exclude the SJCL library when saving

@Jermolene said:

The construction -[type[application/javascript]library[yes]] is used in the core as a rather clumsy way to exclude the SJCL library when saving. The same construction is in the usual $:/core/save/all filter too.

It's possible that we should review unintended side effects of that behaviour, but here we should leave it alone.
2022-05-06 17:09:33 +01:00
jeremy@jermolene.com
c5b10d5c1d Add visible transclusions component and demo
Very useful to see transclusions explicitly

Makes a good demo of a super-complicated widget override.
2022-05-06 15:39:45 +01:00
jeremy@jermolene.com
e01dfa1507 Experimental support for custom filter operators
Just as we can define custom widgets we can also define custom parameterised filter operators
2022-05-06 15:01:17 +01:00
jeremy@jermolene.com
a9938a6c67 Improve recursion detection
While retaining backwards compatibility
2022-05-06 15:00:10 +01:00
jeremy@jermolene.com
e5164113c4 Don't create variables with value undefined for missing parameters 2022-05-05 14:47:22 +01:00
jeremy@jermolene.com
ea51b8a3fe Merge branch 'master' into parameterised-transclusions 2022-05-05 08:30:48 +01:00
jeremy@jermolene.com
f3bf5b6e85 Add support for $:/tags/Macro/View/Body macros 2022-05-05 08:30:05 +01:00