Wykres commitów

234 Commity (master)

Autor SHA1 Wiadomość Data
Saq Imtiaz ef2aeac7de
Added modulesproperty filter operator and extended modules operator (#6055)
* Added modulesproperty filter operator and extended modules operator. Docs included

* Removed spurious new line
2021-09-20 08:25:53 +01:00
Cameron Fischer 157afda2fc
Change backlinks to use LinkedList (#6050) 2021-09-19 19:58:45 +01:00
Cameron Fischer 575c233597
Update untagged filter to avoid $tw.utils.pushTop (#6034) 2021-09-18 16:47:46 +01:00
Cameron Fischer e9d8547a81
Optimise LinkedList filter ops to return iterator instead of array (#6035)
* filter ops don't LinkedList to array anymore

* LL.tiddlerIterator -> LL.makeTiddlerIterator

LinkedList method name change.
2021-09-16 22:22:44 +01:00
jeremy@jermolene.com e6fd0caf6b Update range operator to use multiple operands
We still also support the old way of packing all three parameters into one operand with a delimiter
2021-09-07 17:16:09 +01:00
Simon Huber c13f04d838
Add `m` flag for multiline matches to search-replace filter operator (#5968)
* add m flag to search-replace operator and add tests

* update documentation

* Update test-filters.js

* Update test-filters.js

* Update search-replace Operator (Examples).tid

* Fix "Hello There" title (HelloThere)
2021-08-29 17:44:34 +01:00
Joshua Fontany 33eef0202d
Adds $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe (#5999)
* call self.displayError

* Revert "call self.displayError"

This reverts commit 5d599aa9795f9d816c55378ab6df0a1a691ceed0.

* fixes decodeURI & decodeURIComponent
2021-08-29 13:39:32 +01:00
Jeremy Ruston d455072f13
Add support for JSON-formatted tiddler store, and make it the default (#5708)
* Add support for JSON-formatted tiddler store, and make it the default

The change to `getTiddlersAsJson()` is to allow experimentation

* Move JSON tiddlers into their own store area, and fix support for encrypted tiddlers

Also add a dummy old-style store area for backwards compatibility

The current arrangement is that JSON tiddlers will always override old-style tiddlers.

* Use the deserialiser mechanism to decode the content

* Refactor $:/core/modules/deserializers.js before we start extending it

Cleaning up the helper function names and ordering

* Drop support for the "systemArea" div

It was only used in really old v5.0.x

* Update deserializer to support JSON store format and add some tests

* Life UI restrictions on characters in fieldnames

* Add another test case

* Correct mis-merge

* Remove toLowerCase() methods applied to fieldnames

* Insert line breaks in output of getTiddlersAsJson (#5786)

Rather than have the entire store on one line, insert a line break
after each tiddler.

* Refactor #5786 for backwards compatibility

* Only read .tiddlywiki-tiddler-store blocks from script tags

Prompted by @simonbaird's comment here: https://github.com/Jermolene/TiddlyWiki5/pull/5708#discussion_r648833367

* Clean up escaping of unsafe script characters

It seems that escaping `<` is sufficient

* Add docs from @saqimtiaz

Thanks @saqimtiaz

* Docs tweaks

* Remove excess whitespace

Thanks @simonbaird

* Fix templates for lazy loading

* Remove obsolete item from release note

* Clean up whitespace

* Docs for the jsontiddler widget

* Fix whitespace

Fixes #5840

* Comments

* Fix newlines in JSON store area

* Remove obsolete docs change

Co-authored-by: Simon Baird <simon.baird@gmail.com>
2021-07-14 09:15:30 +01:00
jeremy@jermolene.com 83ee363cb4 Add charcode operator to make it easier to generate strings containing control characters
Avoids some confusing hacks. @saqimtiaz I'm guessing you might have already done something like this?
2021-06-22 21:52:00 +01:00
Joe Bordes 82ec63e711
style(App) eliminate whitespace at the end of code lines (#5735) 2021-05-30 19:20:17 +01:00
jeremy@jermolene.com 082aeb92ac Revert "extend lookup op flexibility with 2 parameters (#5315)"
This reverts commit 81b5fe944a.

See https://github.com/Jermolene/TiddlyWiki5/pull/5315#issuecomment-848725198 for explanation
2021-05-26 13:25:19 +01:00
Saq Imtiaz 7a41283c6b
Format:titlelist operator (#5665) 2021-05-24 19:28:43 +01:00
Saq Imtiaz 3fc7895af2
CurrentTiddler variable consistency in subfilters and prefixes (#5691)
* Make currentTiddler variable consistent in subfilters and filter run prefixes

* Updated filterun prefix and subfilter operators to use ..currentTiddler instead of outerCurrentTiddler
2021-05-22 19:43:37 +01:00
Saq Imtiaz 10b20657cc
Deserializers[] filter operator (#5673) 2021-05-22 10:50:11 +01:00
Joshua Fontany 81b5fe944a
extend lookup op flexibility with 2 parameters (#5315) 2021-05-21 10:11:23 +01:00
Saq Imtiaz 44df6fe52f
Fixed issue with widget not being available to filter operator, added test (#5640) 2021-05-01 10:00:32 +01:00
Jeremy Ruston bf773eb39a
Add "average" filter operator for arithmetic mean (#5612) 2021-04-27 10:09:13 +01:00
cdruan 3b35411aba
Change css-escape-polyfill to a tw uitility method (#5552)
* Replace css-escape-polyfill.js with escapecss.js utility module

* Add $tw.utils.escapeCSS() method and invoke that function within the
  escapecss operator.

* Add test cases for the "escapecss" filter operator

* Fix $tw.boot.doesTaskMatchPlatform() so it works as expected if
  a module's export.platforms contains more than one values

* Add missed files to the last commit
2021-04-02 09:25:01 +01:00
Cameron Fischer b632cea6b7
Fixed issue where [lookup[]] could emit undefined (#5376) 2021-01-07 18:19:50 +00:00
Cameron Fischer e280f89ca5
Converting [links[]] to use better LinkedList (#5369) 2021-01-05 17:36:18 +00:00
Cameron Fischer be70e5851d
Taking advantage of linkedLists in all operator (#5362)
* Taking advantage of linkedLists in all operator

* Test to confirm [all[]] with LinkList is the same
2021-01-04 08:38:50 +00:00
Robin Munn f60d0ef109
reduce and :reduce handle empty input identically (#5255)
Fixes #5246. Now the reduce operator and :reduce filter run prefix will
both return empty output when their input is empty, so that both can be
chained together with the else operator or :else prefix.
2020-12-11 10:07:52 +00:00
Joshua Fontany a878d82c7a
Ignore edition filters if not running on node (#5222) 2020-12-07 15:59:32 +00:00
Saq Imtiaz 8799911162
Reduce operator: second optional parameter instead of suffix (#5193)
* Tweak reduce operator to use an optional second parameter instead of a suffix

* Updated docs
2020-12-04 18:31:23 +00:00
Robin Munn 8ffe138942
Add rawunicode suffix to (json)stringify operators (#5191)
Default with no suffix is pre-5.1.23 behavior, escaping all Unicode
characters for maximum compatibility (avoids encoding issues). New
"rawunicode" suffix allows passing through Unicode characters U+0080
and up unchanged, for cases where you know your tools are handling
encoding correctly and you want less verbose escaping.
2020-12-04 13:19:59 +00:00
Saq Imtiaz 4079f72310
Fix typo in x-listops.js (#5171) 2020-12-01 18:14:07 +00:00
Robin Munn fd3e77d38f
"dedupe" and "raw" suffixes for enlist-input operator (#5152)
Includes unit tests.
2020-11-30 17:52:46 +00:00
saqimtiaz 8fc6910c03
Added string operator pad[] along with tests and docs (#5146) 2020-11-30 17:43:50 +00:00
saqimtiaz 51ca14861e
Fixed bug with default value in lookup operator (#5088)
* Fixed bug with default value in lookup operator

* Fixed test for lookup operator with default
2020-11-22 20:43:36 +00:00
saqimtiaz 4f07539164
Cycle operator improvements plus docs (#5069)
* Tweak cycle operator to support step size parameter and add docs for toggle and cycle

* Mention that title list should have no duplicates
2020-11-20 18:37:23 +00:00
saqimtiaz 89541edcff
Added mathematics filter operators power and log (#5080) 2020-11-20 14:00:20 +00:00
saqimtiaz fc1721709a
Cycle operator and refactored toggle operator (#5021)
* Refactored toggle operator and added cycle operator

* Better handling for operand case

* Syntax/whitespace corrections
2020-11-16 17:02:04 +00:00
saqimtiaz 13499557bf
Fix whitespace in x-listops.js and tweak toggle operator (#5024)
* Replaced leading spaces with tabs

* Tweak toggle[] to insert new value in same list position
2020-11-15 16:04:03 +00:00
saqimtiaz 445c15e719
Extend toggle operator (#5015)
* Extend toggle operator to support optional second operand to toggle a value pair

* Added tests for extended toggle filter

* Updated docs for toggle operator
2020-11-09 18:27:45 +00:00
saqimtiaz 66636d1a86
Docs for new operators (#4994)
* Docs for is[draft]

* Better error handling for suffixes

* Docs for search-replace operator

* Added tests for search-replace operator

* Docs for toggle operator
2020-11-08 09:34:05 +00:00
saqimtiaz cf58dcf116
Add is[draft] operator (#4991) 2020-11-07 10:29:15 +00:00
saqimtiaz 53922d3558
search-replace string operator (#4973)
* Added search-replace operator

* Merge with master

* Add try catch around new RegExp

* Better error handling
2020-11-07 10:09:11 +00:00
saqimtiaz c41e34793d
Add x-listops filter toggle (#4990) 2020-11-07 10:00:47 +00:00
saqimtiaz e7245a709c
Add string operator enlist-input[] (#4948)
* Add string operator titlelist[]

* Update strings.js

* Update strings.js

* Add tests
2020-11-01 17:11:46 +00:00
jeremy@jermolene.com 34a51d2e23 Typo in comment
Thanks @saqimtiaz
2020-10-08 17:21:31 +01:00
jeremy@jermolene.com 14a28b7779 Add "reduce" and "filter" operators 2020-10-06 19:20:03 +01:00
Robin Munn d5cf4112fa
Joining an empty list should return an empty list (#4853) 2020-09-24 18:37:51 +01:00
saqimtiaz 72c07a3f81
Format filter to create formatted date strings (#4785)
* asdate filter to create formatted date strings

* Added format filter operator
2020-09-24 18:35:10 +01:00
Robin Munn 5202441769
Add suffix and parameter to trim operator (#4811)
* Add suffix and parameter to trim operator

Fixes #4809

* Unit tests for new trim operator parameters

* Mention trim operator in 5.1.23 release notes

* Address review comments

* Move regex escaping into utils.js trim functions

This way the trimPrefix and trimSuffix functions from utils.js are safe
to call without regex-escaping their parameters, which should make them
easier to use from other parts of the Javascript code.
2020-08-29 12:27:58 +01:00
Bimba Laszlo 6570561d4e
The `!has[tags]` filter didn't work because `tags` field is an array (#4643)
* The `!has[tags]` filter didn't work because "tags" is an array

The negated `has` filter only considered empty strings, but not empty
arrays (such as the `tags` field).

* Add tests for `has` filter operator with array-like fields (tags, list)
2020-05-14 13:57:12 +01:00
jeremy@jermolene.com 5c0d91c510 Fix title of slugify.js filter module 2020-05-14 07:53:30 +01:00
jeremy@jermolene.com 4966f6ab62 Add slugify and duplicateslugs operators
Fixes #3379
2020-05-09 15:54:44 +01:00
Arlen22 81f07cdf85
Use this.wiki where applicable (#4601)
* Use state.wiki

* use local wiki where available

* fix a couple this vs self cases
2020-05-06 11:27:50 +01:00
jeremy@jermolene.com ad575efdcc Update sortsub to evaluate the subfilter for each item in the list
See the discussion here https://groups.google.com/d/msg/tiddlywiki/BqUFQ3v-fZw/U0F04CFFBQAJ
2020-04-25 15:22:24 +01:00
jeremy@jermolene.com 619c0752bd Add new sortsub operator 2020-04-25 11:26:19 +01:00