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

15 Commits

Author SHA1 Message Date
Joe Bordes
82ec63e711
style(App) eliminate whitespace at the end of code lines (#5735) 2021-05-30 19:20:17 +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
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
Joshua Fontany
69c8058b72
Add has:index (#4540)
* has:index

* has:index

* has:index docs

* has op examples

* has op examples

* operator macros typo missing </div>

* possible mistake
2020-04-14 16:52:56 +01:00
Jeremy Ruston
a8f70b08a8
Add indexes to the wiki store to improve performance (#3951)
* First pass at modular wiki indexes

An exploratory experiment

* Fix tests

* Faster checking for existence of index methods

We don't really need to check the type

* Use the index for the has operator

* Fix typo

* Move iterator index methods into indexer modules

Now boot.js doesn't know the core indexers

* Fix up the other iterator index functions

* Fix crash with missing index branch

* Limit the field indexer to values less than 128 characters

* Fallback to the old manual scan if the index method returns null
* Sadly, we can no longe re-use the field indexer to accelerate the `has` operator, because the index now omits tiddlers that have field values longer than the limit

Still need to make the index configuration exposed somehow

* Rearrange tests so that we can test with and without indexers

We also need to expose the list of enabled indexers as a config option

* Test the field indexer with different length fields

So that we test the indexed and non-indexed codepaths
2019-05-24 21:07:37 +01:00
Jermolene
ad1c2a6571 Fix problem with 'has' operator
Fixes problem introduced in 6085936475
2017-02-23 14:27:43 +00:00
Tobias Beer
6085936475 Introduce "field" suffix for "has" filter operator (#2066)
* has:field — tested & documented

allows to test whether a field exists

* fixed inverted condition

* added from version to docs
2017-02-22 12:13:59 +00:00
Matt Lauber
899c5cb835 Update has.js 2016-02-18 11:51:29 -05:00
Matt Lauber
5a14b37686 Update to check if empty sting OR (is array AND is empty) 2016-02-16 08:08:09 -05:00
Matt Lauber
22145e2e51 Fix for #2274
List fields (such as tags) when evaluated to produce tiddlers result in empty arrays.  Using the exact not equals, an empty array is not the same as an empty string.  By using equivelent not equals, we state that the field is either != "" or anything that can be coerced to "".  Which, based on https://dorey.github.io/JavaScript-Equality-Table/ is `false` `0` `[]` or `[[]]`` neither `false` nor `0` can be set as a tiddler field as both will end up being quoted (`"false"`, `"0"`) so this should work.
2016-02-15 08:31:23 -05:00
Jermolene
42dba113cc Adjust field and has filter handling of missing tiddlers
Now `[!field:name[value]]` and `[!has[name]` will treat missing
tiddlers as not having the specified field
2014-12-11 17:49:17 +00:00
Jermolene
b7f674c51a First pass at refactoring filter execution
This is the beginning of addressing #523.
2014-04-03 20:49:16 +01:00
Jermolene
1c283c5586 Tighten "has" filter operator
We now require the field not to be an empty string in order to be
counted.
2014-01-20 08:59:01 +00:00
Jeremy Ruston
b51fb9cfa9 Linting 2013-07-05 22:37:55 +01:00
Jeremy Ruston
0cf5dc699e Refactor the filter mechanism
Long overdue rewrite to make it simpler, and break the filter operators
out into individual modules.
2013-05-25 17:26:22 +01:00