1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-01 17:53:15 +00:00
Commit Graph

4444 Commits

Author SHA1 Message Date
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
jeremy@jermolene.com
f307f00e32 Fixes to enable the transclude widget itself to be overridden
There are two big changes here:

Replace the previous "ts-wrapper" mechanism, which we had been using to redefine custom widgets inside their definitions to prevent recursive calls. Now we've got the genesis widget we can instead control recursion through a new "$remappable" attribute that allows the custom widget mechanism to be skipped.

We also extend the slot widget to allow a depth to be specified; it then reaches up by the indicated number of transclusion widgets to find the one from which it should retrieve the slot value.
2022-05-05 08:20:14 +01:00
jeremy@jermolene.com
e99137f4cc Cache parse trees when transcluding variables 2022-05-03 17:59:45 +01:00
jeremy@jermolene.com
56c2242e4e Introduce genesis widget for dynamically creating widgets
See the "RedefineLet" test for a contrived example of usage
2022-05-03 12:55:10 +01:00
jeremy@jermolene.com
e1df50d981 Fix parameter handling 2022-05-03 12:54:29 +01:00
jeremy@jermolene.com
c4743ebbec Fix importing of function definitions 2022-05-03 09:39:05 +01:00
jeremy@jermolene.com
8f69c27632 Reuse attribute objects when executing custom widgets 2022-05-03 09:38:41 +01:00
jeremy@jermolene.com
0163c04b7d Fix addAttributeToParseTreeNode handling of ordered attributes 2022-05-03 09:37:49 +01:00
jeremy@jermolene.com
2ea0374b55 Allow the let widget to create variables starting with $ 2022-05-03 08:44:33 +01:00
jeremy@jermolene.com
3000d3339c Remove extraneous code 2022-05-03 08:11:00 +01:00
jeremy@jermolene.com
a888cd57cd Unquoted parameters should not eat a succeeding comma
Fixes #6672
2022-05-02 13:49:41 +01:00
jeremy@jermolene.com
a10106a4a6 Fix crash when transcluding an undefined variable
Thanks @pmario

See https://github.com/Jermolene/TiddlyWiki5/pull/6666#issuecomment-1114692359
2022-05-02 11:15:18 +01:00
jeremy@jermolene.com
fbd0357cae Mustn't allow commas in parameter names 2022-05-02 11:04:32 +01:00
jeremy@jermolene.com
ea7199600d Be as permissive as possible with parameter names
Previously restricted to upper and lower case, digits and dash and underscore
2022-05-02 10:56:09 +01:00
jeremy@jermolene.com
5f02cc49fd Add support for accessing function parameters as name/value pairs 2022-05-02 10:00:50 +01:00
jeremy@jermolene.com
bbc6661192 Remove erroneous "tag" property 2022-05-02 09:26:18 +01:00
jeremy@jermolene.com
8b867be8ef Add pragma rule for parameters declarations 2022-05-02 09:15:45 +01:00
jeremy@jermolene.com
99750d78b5 Allow brackets to be omitted for function definitions with no parameters 2022-04-30 13:06:28 +01:00
jeremy@jermolene.com
c9bd1b5274 Add wikitext shortcut for new-style function definitions 2022-04-30 12:44:26 +01:00
jeremy@jermolene.com
886c8620f5 Replace ubertransclude widget with transclude widget 2022-04-30 10:00:38 +01:00
jeremy@jermolene.com
aac2d6ccb0 Refactor ubertransclude functionality into transclude widget 2022-04-30 09:54:55 +01:00
jeremy@jermolene.com
c4991fff9e Refactor transclude widget before uberfying it 2022-04-30 09:30:25 +01:00
jeremy@jermolene.com
f78e1f6f7d Importvariables should skip parameters widgets 2022-04-29 22:36:07 +01:00
jeremy@jermolene.com
5bcf7b9edd Add support for shortcut syntax for positional transclusion parameters 2022-04-29 22:35:47 +01:00
jeremy@jermolene.com
89b7a3bd28 Ubertransclusion positional parameters should be based on name, not position 2022-04-29 16:28:03 +01:00
Simon Huber
5d55850c73
Update some palettes in the light of colorscheme: dark (#6661)
* Update CupertinoDark.tid

* Update GruvBoxDark.tid

* Update Nord.tid
2022-04-27 22:22:54 +01:00
jeremy@jermolene.com
9713da5071 Add support for positional parameters 2022-04-26 21:55:43 +01:00
jeremy@jermolene.com
31c3abb7ab Add a definition for the value widget just so that it doesn't cause errors
Of course, it doesn't actually need to be a JS widget, it could be a wikitext widget...
2022-04-26 14:36:05 +01:00
jeremy@jermolene.com
a401732995 Use ts- prefix for system slot names 2022-04-26 14:27:28 +01:00
jeremy@jermolene.com
fae038dcbc Remove need to explicitly clear widget mapping variable when invoking overridden widget 2022-04-26 14:24:31 +01:00
jeremy@jermolene.com
35616a0b39 Don't worry about ordered attributes
The changes in 0bffae2108 mean that we don't need to explicitly maintain the ordered attributes
2022-04-26 14:05:56 +01:00
jeremy@jermolene.com
7299d4fd1d Merge branch 'master' into parameterised-transclusions 2022-04-26 14:03:03 +01:00
jeremy@jermolene.com
0bffae2108 Add utility method for getting ordered attributes 2022-04-26 14:02:31 +01:00
jeremy@jermolene.com
0e4e037bb7 Changed transclude widget in binary parser to ubertransclude 2022-04-26 13:05:31 +01:00
jeremy@jermolene.com
cd0617f033 Use the ubertransclude widget for the wikitext transclusion syntax 2022-04-26 12:45:05 +01:00
jeremy@jermolene.com
05b582a202 Fix and test missing target handling 2022-04-26 12:32:46 +01:00
Simon Huber
1410488a23
Fix my error in framed.js (#6658)
* Fix my error in framed.js

* ouch
2022-04-25 08:45:42 +01:00
Simon Huber
e2ef5c933b
Update CupertinoDark.tid (#6655) 2022-04-24 21:46:33 +01:00
Simon Huber
3cf078faeb
Write the right "color-scheme" meta tag to the iframe of the framed text-editor (#6656)
* Write the right "color-scheme" meta tag to the iframe of the framed text-editor

* Update framed.js
2022-04-24 21:45:56 +01:00
jeremy@jermolene.com
21b10a225f Initial commit
Everything is draft.
2022-04-24 21:24:38 +01:00
Joshua Fontany
42bf203758
Fix 6649 (#6650)
* use filesystem utils

* use filesystem utils

* don't touch syncer

* fix messaging
2022-04-19 08:18:44 +01:00
Robin Munn
8dec674121
Allow checkboxes to be indeterminate (#6593)
* Documentation for indeterminate checkboxes

* Unit tests for indeterminate checkboxes

* Implement indeterminate checkboxes

* Simplify indeterminate checkbox example

* Slightly simplify refresh logic for indeterminate

That five-line if statement can be turned into a simple assignment.

* Use "yes" and "no" for checkbox indeterminate attr

This makes the "indeterminate" attribute of the checkbox widget work the
same way as other boolean attributes of other widgets.

* Fix bug with invertTag attribute

One place in the checkbox widget code was checking invertTag for
Javascript truthiness rather than the value "yes", which could have
produced incorrect results if anyone wrote invertTag="no". Fixed.
2022-04-18 20:50:03 +01:00
Jeremy Ruston
fd0b985ac5
action-setfield shouldn't write to the current tiddler if the $tiddler attribute is present but has evaluated to a missing attribute
Fixes #5916
2022-04-16 18:02:27 +01:00
Cameron Fischer
eb0b2a8d8e
Trim Saga: Advanced Search and actions (#6604)
* Trim Saga: Advanced Search and actions

* Split up AdvancedSearch macros to be readable
2022-04-16 17:40:27 +01:00
jeremy@jermolene.com
7d6923f3d6 Revert "Give plugin authors the chance to extend a palette (#6624)"
This reverts commit b3b3020d99.
2022-04-16 17:37:08 +01:00
Cameron Fischer
05375e093c
Trim Saga: I think this is the last batch (#6611) 2022-04-16 17:19:05 +01:00
lin onetwo
cc25e1f5b4
fix: formatDateString with [UTC]xxx didn't use passed date (#6615)
* fix: formatDateString with [UTC]xxx didn't use passed date

* test: for formatDateString UTC

* fix: not possible to test internal date without hijack

Expected '20220410073037515' to be '20220410073037516'.

* fix: hour
2022-04-16 17:10:57 +01:00
Simon Huber
b3b3020d99
Give plugin authors the chance to extend a palette (#6624)
* Give plugin authors the chance to extend a palette

* Update CSS.tid

* Update ColourMacro.tid

* Update CSS.tid

* Update ColourMacro.tid

* Add whitespace trim to colour macro
2022-04-16 16:50:21 +01:00
Simon Huber
2fd17e864c
Fix: dragndrop missing variables (#6632) 2022-04-15 17:05:27 +01:00
Simon Huber
030155ec27
Add "enabled" attribute to draggable widget (#6581)
* Add "enabled" attribute to draggable widget

* Update draggable.js

* Update draggable.js

* Update draggable.js
2022-04-15 14:17:06 +01:00
Simon Huber
58dd47d128
Add "tv-selectednode-width" and "tv-selectednode-height" ... (#6582)
* Add "tv-selectednode-width" and "tv-selectednode-height" ...

... variables to dragstartactions

* Update dragndrop.js

* Update dragndrop.js

* Add docs

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* Update modifier Variable.tid

* Update modifier Variable.tid

* Update eventcatcher.js

* Update dom.js

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* add a space after //

* Update modifier Variable.tid
2022-04-15 13:46:09 +01:00
jeremy@jermolene.com
73138b79aa Save command exit with error when encountering missing tiddlers
Fixes #6603
2022-04-06 17:18:13 +01:00
Cameron Fischer
6624ce3716
Fix for broken style block wikitext (#6599)
* Fix for broken style block wikitext

* Fixed it so styles are correct too
2022-04-06 08:33:38 +01:00
Cameron Fischer
c5ea6628f5
Trim Saga: Control panel and Editor Toolbar (#6600)
Shout out to the TiddlySpot tiddler macro for being completely broken, but also being completely unused, so no one noticed.
2022-04-06 08:27:05 +01:00
jeremy@jermolene.com
ad512be04e Don't code body for system tiddlers containing images
Fixes #6594
2022-04-05 17:29:47 +01:00
Simon Baird
39e4e69ae7
Show server response as error message in put saver (#6589)
* Show server response as error message in put saver

I'd like to use this on Tiddlyhost so users can get more informative
error messages if the put save fails for whatever reason.

This would make the put saver a viable replacement for the legacy
upload saver, which is what Tiddlyhost uses currently.

I'm not sure what standard WebDAV servers do, but I would guess they
don't provide any response body for put requests, and hence this
patch would have no impact for a standard WebDAV server. (That said,
it would be a good idea to test it to make sure there aren't any
unexpected regressions for WebDAV or other put saver compatible
services.)

* Access http response status directly in put saver

There's no need to extract it from the error string created inside
tw.utils.httpRequest if we can get it directly from the xhr object.

* Add 'Save starting' notification for put saver

There are two related changes here:

1. Add a 'Save starting' notification for the put saver, similar to
   the upload saver. Not sure if it was intentionally omitted for
   the put saver, but it seems reasonable to have the two be
   consistent.

2. Send the 'Save starting' notifications in both upload and put
   save right before the actual request is sent. While testing I
   noticed that the save might have failed before the "Save
   starting" notification appeared which doesn't seem useful.
2022-04-05 17:06:56 +01:00
Cameron Fischer
8990423374
Another batch of whitespace trims (#6587) 2022-04-05 16:48:07 +01:00
Robin Munn
e28af8d594
Checkbox widget: list and filter modes (#6561)
* Docs for CheckboxWidget list and filter modes

This documents the `listField` and `filter` attributes.

* Tests for checkbox widget list mode

* Implement checkbox list mode

* WIP on implementing filter attr for checkboxes

* Improve CheckboxWidget documentation

* Refactor checkbox tests: move function to top

The big findNodeOfType function belongs at the top of the describe
block, so that the checkbox tests are more compact and easy to read.

* Move checkbox widget tests to end of file

The checkbox widget tests are long and involved, so we'll move them to
the end of the file so they aren't a huge block of code you need to read
past to find the next test.

* Improve formatting of CheckboxWidget docs

The \define() calls that are short enough to fit on one line should be
put on one line, for readability. The ones that are quite long have been
kept on multiple lines, for readability.

* Added more passing tests for checkbox widget

* Add some failing tests for checkbox widget

The filter mode where neither checked nor unchecked is specified (in
which case an empty filter result means false and a non-empty result
means true) is not working yet.

* Make failing tests pass

* Uncomment (and improve) test for field mode

We're now ready to start working on making this test pass. (There was
also one small mistake in the test, which this commit corrects).

* All tests now passing

* No indeterminate checkboxes in simple modes

The simple checkbox modes (field and index) should not produce
indeterminate checkboxes. That should be reserved for the advanced modes
(list and filter).

* Minor improvement to unit tests

* Allow indeterminate checkboxes in list and filter modes

This change may require some tweaks to the unit tests to be able to test
it properly.

* Slightly easier to read tests

* Two more tests for list mode

* Greatly simplify unit test code

Turns out there's no need to jump through Object.getPrototypeOf hoops.

* Minor simplification of unit test

* Add tests for indeterminate in list & filter modes

With this, the set of tests is complete.

* More tests to specify list mode behavior

* Unfocus tests so all tests run

* Update docs to say "new in 5.2.3" insetad of 5.2.2

* Move checkbox widget tests into their own file

The test-widget.js file was getting too long with all the checkbox
tests added, so we'll move the checkbox tests into their own file.

* Add checkbox widget tests for index mode

This commit also adds tests for index list mode (with a listIndex
attribute that will parallel the listField attribute) but leaves them
commented out because they don't pass yet: the code that implements the
listIndex attribute hasn't been written yet).

* Add listIndex attribute to checkbox widget

* Remove code that lets checkboxes be indeterminate

This reverts commit 6afcb151be. We will
add this code back in a later PR.

* Remove indeterminate tests for checkbox widget

We're currently not allowing indeterminate checkboxes, so there's no
need for the tests that check for them.

* Document listIndex attribute of CheckboxWidget

* adds class tc-checkbox-checked when checked

* equivalent to #2182 (RadioWidget)
* also applies `tc-checkbox` to checkboxes by default, always

* Move macro definitions inside example text

Since the wikitext-example-without-html macro creates a new parsing
context, it's safe to have macro definitions inside it. That makes these
examples a lot easier to write, and to read.

* Remove all mention of indeterminate checkboxes

Also improve the documentation a little bit: mention what happens in
list mode if neither checked nor unchecked is specified.

* Move filter mode to bottom of checkbox docs

The `filter` attribute should be under both `listField` and `listIndex`
rather than being between them. The documentation for filter mode should
similarly be after the `listIndex` documentation.

* Improve docs for `class` attr of checkbox widget

This brings the wording of the `class` attribute more in line with how
it's worded in the RadioWidget docs.

* Fix bug with list tiddlers

If neither checked nor unchecked was specified, then the behavior should
be "empty = false, non-empty = true". But if *both* are specified yet
neither is found, then the checkbox should be unchecked (false). It had
been falling through to the "non-empty = true" behavior, which was wrong.

* Improve listIndex example of checkbox widgets

* Remove unused function from test-widget.js

Co-authored-by: Tobias Beer <beertobias@gmail.com>
2022-04-02 15:16:08 +01:00
Cameron Fischer
def8e6d354
Trim Saga: All snippets, language tiddlers, and typed (#6275)
* adding trim: link-dropdown, Fields, unfold

* adding trim: all remaining snippets

* Fix for reversion I accidentally applied
2022-04-01 12:10:29 +01:00
Cameron Fischer
6701683ddf
Trim saga: The big macros (#6269)
* adding trim: large macros and languageswitcher

* adding trim: KeyboardShortcuts.tid

* Hidden space to force some macros to be inline

This'll be our little secret. This single byte will actually allow
the uglifier to trim over thirty bytes while condensing.

I know I'm not supposed to optimize TW for some 3rd party plugin,
but I'm the one doing the whitespace trim work, so I'll give myself
this.

* More consistent nested quoting
2022-04-01 12:09:59 +01:00
Cameron Fischer
4a9cf67a25
Trim Saga: whitespace trimming three big tiddlers (#6265)
* whitespace trimming three big tiddlers

* Forgot one macro

* This emptyMessage needed trimming too

* Switching to more consistent emptyMessage quotes
2022-04-01 12:09:30 +01:00
Cameron Fischer
5e38f1b0b8
Trim Saga: First batch of \whitespace trim (#6257)
* First batch of \whitespace trim

Along with some quotation improvements to compensate for the new bytes.

* Undid experimental, new-age, gen-Z formatting

* daring to whitespace trim a placeholder macro

* switching to more consistent nesting of quotes
2022-04-01 12:08:53 +01:00
FlashSystems
73a9625b81
Fix regressions cause by PR #6511 (#6567)
* Fix field edit bug

This fixes the field edit bug mentioned in
https://talk.tiddlywiki.org/t/possible-field-editing-bug-in-5-2-2/2884 .

* Revert "Fix visual regression in #6511"

This reverts commit c920960942.

* Add new class `tc-edit-fieldeditor`

This class must be added to input and select elements that are used as
field editors. This class reduces the line height of the input element
if it is displayed within the `tc-edit-fields` part of the edit
template.

This allows the same input and select elements to be used for editing
and adding fields.

* Add the new class `tc-edit-field` to the docs

The example in `Customizing EditTemplate Field Rendering` now uses the
new CSS classes.
2022-04-01 11:42:16 +01:00
Mario Pietsch
ff42a9e4d4
Update core tabs-macro to make it easier to extend for plugin authors. (#6578)
* tabs activate v5.2.2 tests add whitespace trim

* tabs-macro -- add indentation and code preview

* tabs-macro -- replace substitutions with variables

* split tabs-macro macro into different elements

 - tabs-button
 - tabs-tab
 - tabs-tab-list
 - tabs-tab-body
 - tabs ... main macro

* tabs: add cascade to button and reaveal widgets

This will allow users to create "default tab" configurations similar to the tiddler info tab handling.

* tabs-macro -- add code_body: yes
2022-03-31 15:41:19 +01:00
jeremy@jermolene.com
6dbb3ee36e Revert scrollable changes e49dda3b48
See https://talk.tiddlywiki.org/t/stroll-issue-with-5-2-2/2885/2
2022-03-29 09:49:31 +01:00
jeremy@jermolene.com
c920960942 Fix visual regression in #6511
See https://talk.tiddlywiki.org/t/extra-space-between-fields-row-in-5-2-2-versus-5-2-1/2879/3
2022-03-28 11:01:34 +01:00
Simon Huber
e84acf97de
ControlPanel Button: use tv-story-list variable (#6562)
This PR makes the ControlPanel Button show as selected when the `tv-story-list` contains `$:/ControlPanel` in its list field
2022-03-27 08:54:33 +01:00
Cameron Fischer
98a509dbf3
Trim Saga: Another batch of medium-sized files (#6270)
* adding trim: Last of the macros I think

* adding trim: EditTemplate and ItemSidebarIcon

* adding trim: control panel basics

* Another hidden space to guide the uglifier

* More consistent nested quoting

* Reconciling tests for \whitespace trim
2022-03-26 15:19:04 +00:00
Cameron Fischer
5d69fe7bef
Trim Saga: Making existing trim tiddlers consistent (#6272)
* adding trim: AdvancedSearch Standard

* adding trim: tiddlers that had SOME trim already

* making all existing trim tiddlers consistent

* Forgot to properly indent this widget

* I don't THINK that space was important...

but I'm putting it back in

* Forgot one whitespace trim
2022-03-26 15:18:42 +00:00
Cameron Fischer
b9ae6607c0
Trim Saga: Edit and View templates (#6276)
* the text/vnd-tiddlywiki tiddler and language

* adding trim: edit and view templates
2022-03-26 14:16:01 +00:00
jeremy@jermolene.com
758d590837 Disable link rendering when rendering list-links-draggable captions 2022-03-26 12:49:17 +00:00
jeremy@jermolene.com
1c16f12d6f Disable link rendering when rendering list-links captions
Fixes #6558
2022-03-26 12:44:28 +00:00
jeremy@jermolene.com
9922701304 Prepare for v5.2.3-prerelease 2022-03-25 15:05:03 +00:00
jeremy@jermolene.com
74d63c7003 Fix another inadvertent div-nested-in-span 2022-03-25 13:35:25 +00:00
Saq Imtiaz
fe581a83b3
Fix nesting of block elements inside inline elements in the edit template (#6553)
* Fix nesting of block elements inside inline elements in the edit template

* Fix typo in previous commit
2022-03-23 13:30:49 +00:00
jeremy@jermolene.com
681f22b66d Remove erroneously included code
See https://github.com/Jermolene/TiddlyWiki5/pull/6540#pullrequestreview-914281218
2022-03-18 12:40:12 +00:00
Jeremy Ruston
b0c4886d23
Fix action-listops unsafe use of $tw.utils.stringifyList() (#6540)
Fixes #6535
2022-03-18 10:10:43 +00:00
Saq Imtiaz
977ea24e96
Fix: only refresh styles if the CSS has changed (#6537) 2022-03-17 21:19:49 +00:00
FlashSystems
b529e69289
Add a cascade for rendering fields within the Edit Template (#6511)
* Allow the rendering of fields to be extended

This commit extends the `$:/core/ui/EditTemplate/fields` tiddler to
use a new cascade (Field Editor Cascade) to allow customizing the
rendering of the field editor.
It provides a default element for the cascade that displays the standard
EditTextWidget as a fallback. That way, the implementation is completely
backwards compatible. The `currentTiddler` and `currentField` variables
are available in the transcluded tiddler. This has the additional
benefit, that not only the `EditTextWidget` can be used. The user can
use a dropdown-list or even something completely crazy. As long as it
can be put into a tiddler that updates the field, it will be fine.

* Make `select` Tags in Fields look like the rest

This patch updates the CSS to make `tc-edit-texteditor` usable on
`select`-tags as well.

I'm not sure what `-webkit-appearance: none;` is for, but it hides the
DropDown-arrow in Chrome and makes the select-tag hard to discover. I've
changed the css to only apply it to the input tag. Maybe it can be
removed altogether.

* Add documentation for the Field Editor Cascade
2022-03-17 17:06:24 +00:00
Mario Pietsch
c741978e95
Fix the button default fix (#6531) 2022-03-16 11:57:56 +00:00
Mario Pietsch
28a91aafa7
Button Widget: ensure changes to "default" attribute trigger a refresh 2022-03-15 12:35:58 +00:00
Jeremy Ruston
1d8c538e45
Eventcatcher widget: add "matchSelector" attribute (#6523)
* Initial Commit

* Allow matchSelector to be used even if selector attribute isn't used
2022-03-14 09:56:23 +00:00
Saq Imtiaz
aaf1aa3821
Improve affordances for new browser windows (#6498)
* feat: extend tm-open-window to allow opening the same tiddler in multiple templates, and introduce tm-close-window to close browser windows

* fix: use a windowID parameter to uniquely identify a window and introduce tm-close-all-tiddlers

* fix: whitespace

* fix: update variable
2022-03-02 17:34:02 +00:00
Saq Imtiaz
b196cf77e8
Sort sidebar language, plugin and theme list by name rather than description (#6501) 2022-03-01 09:23:19 +00:00
Ben Webber
2c38c8351b
Make butlast[0] consistent with rest (#6483)
butlast[0] now returns the input list unchanged.

Fixes: #5833
2022-02-26 09:42:24 +00:00
Ben Webber
a51191d334
Support specifying insertbefore position title as parameter (#6477)
* Support specifying insertbefore position title as parameter

Closes: #6133

* Update insertbefore calls with new variable parameter syntax

See-also: 96b52606a (Support specifying insertbefore position title as parameter, 2022-02-21)
2022-02-24 11:08:06 +00:00
Saq Imtiaz
4054566493
Extend $draggable to support an optional drag handle (#6480)
* feat: extend  to support a selector attribute identifying the DOM element to be used as the drag handle

* fix: remove redundant variable declaration

* fix: remove extranneous variable declaration
2022-02-24 11:06:18 +00:00
Ben Webber
7a7472833f
Consider non-existent tiddlers untagged (#6478)
Fixes regression introduced in 575c23359.

Fixes: #6119
See-also: 575c23359 (Update untagged filter to avoid $tw.utils.pushTop (#6034), 2021-09-18)
2022-02-23 12:46:34 +00:00
Cameron Fischer
d0b5b2124a
Is draft (#6442)
* corrected [!is[draft]] to be a proper complement

* Ensuring [is[draft]] and [!is[draft]] are complements

* Made [is[draft]] more analogous to .isDraft()
2022-02-22 16:41:29 +00:00
Ben Webber
95bd694a65
Support case insensitive matching in prefix/suffix operators (#6468)
* Support case insensitive matching in prefix/suffix operators

Support `caseinsensitive`/`caseinsensitive` suffixes in the following
filter operators:

  * prefix
  * suffix
  * removeprefix
  * removesuffix

The suffixes have the same behaviour as in the match operator.

Closes: #6407

* Do not filter titles if suffix/removesuffix operand is empty

Issue: #6407
2022-02-22 16:38:40 +00:00
Jeremy Ruston
82c8fe7fa8
Introduce JSON parse utility function with error handling (#6401)
* Introduce JSON parse utility function with error handling

Fixes #6400

* Fix typo
2022-02-21 15:29:25 +00:00
Jeremy Ruston
5378b45c40
Allow newlines within filtered transclusions (#6421)
* Allow newlines within filtered transclusions

* Docs
2022-02-21 15:28:21 +00:00
Jeremy Ruston
ab3109d84b
Add support for directly setting style.* attributes on HTML elements (#6388)
* Support direct style attributes on the element widget

* Fix tests

Not all parse tree nodes have an "orderedAttributes" member (eg. the error message generated at 5613bcc884/core/modules/widgets/transclude.js (L73-L75))

* Ensure ordering isn't insertion dependent if orderedAttributes is missing

* Add docs
2022-02-21 15:24:06 +00:00
Cameron Fischer
a4ab42da8a
findListingsOfTiddler should cache results (#6327)
* findListingsOfTiddler uses FieldIndexer now

* Turns out FieldIndexer can't help listed[]
2022-02-21 15:07:30 +00:00
Mario Pietsch
6b4e5c74ad
Add "some" flag to search operator (#6293) 2022-02-21 15:05:34 +00:00
Joshua Fontany
d6d2bc455c
Fix server options (#5899)
* removed illegal cahracter in filename

* fixes required plugin options & updates docs

* Update dev docs

* call self.displayError

* Revert "call self.displayError"

This reverts commit 5d599aa979.

* adds path based auth (backwards compatible)

* refactor per-route auth

* get status bug

* server options

* server options

* server options, new 'server-settings' param

* reflow

* fix boot.origin

* refactor new parameters

* restore sitetitle as servername option

* Soft reset to master

* docs update

* tweak wording

* docs

* cleanup

* remove literal string

* cleanup docs

* formatting

* Remove per-path auth

* revert get-status

* fold in PR 5538

* remove server-options

* remove doc

* required-plugins a server-parameter, not option
2022-02-21 09:53:06 +00:00
Joshua Fontany
1d0af90ba2
Extend lookup operator to work with fields and indexes (#5742)
* extend lookup op flexibility with 2 parameters

* bumped .from macro to .24

* aligned syntax

* lookup fixes

* bugfix

* docs

* messed up the tests somehow

* docs fix

* lookup bugfix

* docs

* docs

* call self.displayError

* Revert "call self.displayError"

This reverts commit 5d599aa979.

* storylist

* tests

* tests pass
2022-02-21 09:48:29 +00:00
Saq Imtiaz
59572cd75d
Extend tm-open-window to support optional top and left position for new browser window (#6470)
* feat: extend tm-open-window to support optional top and left position for new browser window

* fix: whitespace correction

* Update WidgetMessage_ tm-open-window.tid
2022-02-20 11:23:27 +00:00
jeremy@jermolene.com
1d16206188 Add support for tm-relink-tiddler message 2022-02-19 09:38:48 +00:00
jeremy@jermolene.com
37a6ff8521 Move tm-rename-tiddler handling from navigator widget into startup module
This reverses an August 2015 change in 68e15c10641e2eda1e64cf29954786a07326a920; the original rationale was wrong: there is nothing related to the navigator widget in the implementation of the tm-rename-tiddler message
2022-02-19 09:20:32 +00:00
Marxsal
8e50ad1243
Change 'Drop here' to 'Drop now' in import msg (#6435) 2022-02-07 17:32:06 +00:00
Cameron Fischer
1b3c2557b8
Fixed issue: deprecated regexp could cause crash (#6438)
* Fixed issue: deprecated regexp could cause crash

* Different fix which will bother plugins less
2022-02-07 16:39:29 +00:00
jeremy@jermolene.com
e49dda3b48 Fix search results cutoff on narrow screens
Fixes #6440
2022-02-01 09:36:30 +00:00
jeremy@jermolene.com
1a0c831216 Add sha256 operator 2022-01-29 11:02:47 +00:00
Saq Imtiaz
75d10a2dc3
Fix: bug with importvariables widget when importing block mode widgets. fixes #6424 (#6426) 2022-01-27 17:35:18 +00:00
Saq Imtiaz
6452eb56a9
fix: bug introduced with 88812092fd fixes #6419 (#6420) 2022-01-24 19:17:09 +00:00