1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
Commit Graph

2913 Commits

Author SHA1 Message Date
Saq Imtiaz
5ce2601c10
Fixes issues in the PR "Button widget data attributes" (#7852)
* fix: fixed ordered attributes handling and improved tests to catch event attributes

* fix: clean up code from testing

* fix: more tests and refactoring

* fix: use lowercase when checking for event attribute prefix

* fix: use lowercase when checking for event attribute prefix

* fix: changed comment wording

* fix: minor refactoring

* refactor: for brevity
2023-11-22 19:57:08 +00:00
Saq Imtiaz
fb57eab2f4
Refactors Select widget to directly create DOM node (#7848)
* fix: refactored SelectWidget to directly create DOM nodes

* fix: refactored SelectWidget to directly create DOM nodes

* fix: improve refresh handling for select widget
2023-11-21 10:20:14 +00:00
Saq Imtiaz
142bc19a29
Feat: add support for data attributes to Draggable and Droppable widgets (#7845) 2023-11-20 16:01:31 +00:00
Saq Imtiaz
f7a94879da
Fixes refresh issues for checkbox and links widgets for data attributes (#7846)
* fix: refresh issues with checkbox and links widgets

* fix: indenting
2023-11-20 16:00:46 +00:00
Jeremy Ruston
e43a75ae59 Remove obsolete comment 2023-11-20 09:52:26 +00:00
Jeremy Ruston
65b3b18e1f Update select widget to support style.* attributes 2023-11-13 09:47:18 +00:00
Jeremy Ruston
a5d5926534 Clarify docs 2023-11-13 09:16:28 +00:00
Jeremy Ruston
a1bffa7e36 Fix typo 2023-11-13 09:16:19 +00:00
Jeremy Ruston
793692a4e4 Refactor to use existing widget.assignAttributes() method 2023-11-12 22:05:25 +00:00
Jeremy Ruston
08d6560391 Apply more generic implementation to multiplate widgets 2023-11-10 22:14:07 +00:00
Jeremy Ruston
70774eca83 Refactor ready for making mechanism more generic 2023-11-09 18:34:41 +00:00
Jeremy Ruston
4f0e148bf1 Fix typo 2023-10-04 22:18:50 +01:00
Jeremy Ruston
b4896d79d8 Add data attribute support to button widget 2023-10-04 22:12:51 +01:00
Robin Munn
8effb3f218
Fix list widget bug with counter-last when appending items (#7712)
* Add failing test for list widget with counter-last

The failing test appends a value to a list without changing the rest of
the list, and the counter-last value doesn't get updated correctly when
that happens. Also added another test, which passes, testing removing
the last item of the list, just in case of a regression.

* Improve unit tests for counter-last list widget bug

The unit tests were looking very similar to each other, so I factored
out the common code and made them into simple data-driven tests.

* Fix bug where counter-last fails in list widget

The only scenario that was failing was when counter-last was used, but
the list was strictly appended to with no other changes made. The one
unit test that was failing now passes with this fix.

* Improve bugfix to list widget counter-last

Now we only refresh the last item if it was truly necessary.
2023-09-24 20:19:50 +01:00
Robin Munn
780e5d33a4
Slightly speed up [all[shadows+tiddlers]] filters (#7702)
The `all` filter operator has shortcuts to optimise common patterns like
`[all[shadows+tiddlers]]` or `[all[tiddlers]]`. In those cases, the
filter operator function returns early and never uses the `result`
linked list that was created, so it's immediately garbage-collected.
Let's delay creating it until we know it's actually going to be used.
2023-09-24 20:19:04 +01:00
Jeremy Ruston
49c96901f3 Fix typo in 7d8766d2b9 2023-09-13 18:06:30 +01:00
Jeremy Ruston
7d8766d2b9 Test editors shouldn't set type attribute of textareas
fixes #7732
2023-09-13 18:04:12 +01:00
Robin Munn
779ac28bd0
Fix checkbox widget when listIndex field undefined (#7679) 2023-08-15 17:12:49 +01:00
Jeremy Ruston
4bdac09872
Fix transclude inefficiency (#7647)
* Refactor parse mode out of getTransclusionTarget

* Refactor missing transclusion target

* Add a test to avoid regressions on the handling of macros vs procedures

* Refactor condition logic

* Preparing to split getTransclusionTarget into two separate functions

* Split getTransclusionTarget into getTransclusionTargetIncludingParseTreeNodes

* Resolve another inefficiency

The transclusion target was sometimes being parsed twice when transcluding as text/plain

Associated test results are also made more consistent

* Simplify method naming

* Neatening up
2023-07-30 18:04:05 +01:00
Mario Pietsch
e60232e0cb
Fix drag and drop from chrome-like browsers to FireFox (#7622)
* fix drag and drop from chrome-like browsers to FireFox

* test feature matchMedia function

* implement new borwser sniffing functions as utilities

* use $tw.browser structure for isMobileChrome detection
2023-07-22 15:47:39 +01:00
Jeremy Ruston
ad6e09f1cb Minor refactor transclude widget
Preparing to fix #7592
2023-07-22 14:01:24 +01:00
Jeremy Ruston
160cc0e9a9 Revert "Add widget.destroy() function (#7468)"
See discussion at https://github.com/Jermolene/TiddlyWiki5/pull/7468#issuecomment-1645753857
2023-07-22 11:41:36 +01:00
Saq Imtiaz
61a08cbd7b
Feat: allow new pragmas to be indented (#7624) 2023-07-21 13:40:42 +01:00
Jeremy Ruston
0a4cfa1164 Revert f61d244410
No evidence that this change improved anything
2023-07-20 22:03:00 +01:00
Jeremy Ruston
9b2af13596 tm-http-request: Add support for binary responses
With a demo courtesy of https://random.dog/

@rmunn you recently worked on the base64 utilities. I tried to use $tw.utils.base64Encode instead of window.btoa, but found that it didn't work. It's concerning because we expose that utility method as a filter operation, and it would be frustrating if we were not base64encoding things properly.
2023-07-17 12:15:20 +01:00
Jeremy Ruston
f61d244410 Adjust max widget tree depth to 500
See discussion at https://talk.tiddlywiki.org/t/recursive-error-in-template-tiddler-not-getting-caught-in-5-3-0/7566/12
2023-07-17 09:33:16 +01:00
Saq Imtiaz
284669544b
Trim whitespace when importing variables in $importvariables (#7611)
* fix: trim whitespace when importing variables

* feat: added tests for importing variables
2023-07-17 09:18:42 +01:00
Jeremy Ruston
b54a88ce83 Clean up transclude widget
1. Update comments
2. Refactor use of parseTreeNodes so that they are not referenced unnecessarily
3. getTransclusionTarget doesn't need to return the parser object
2023-07-16 14:04:09 +01:00
btheado
8e9d8d4fef
Allow attribute substitution to handle variables containing non-word characters (#7606)
* Added failing test for #7604

* Fix attribute substitution regexp

Use the same regexp in wiki.getSubstitutedText as is used in
Widget.prototype.substituteVariableReferences. Fixes #7604.

* Added a test for a variable name containing spaces
2023-07-14 21:42:31 +01:00
Scott Sauyet
f517497fe7
Add tabindex to SelectWidget and docs (#7594) 2023-07-09 16:52:35 +01:00
btheado
eff158b1ae
Fixed http-request bind-status and bind-progress option names (#7595) 2023-07-09 16:50:48 +01:00
jeremy@jermolene.com
29b5b064d6 Robustify widget.removeLocalDomNodes
Otherwise we get crashes if the DOM nodes generated by a widget have been subsequently modified by something like MathJax – see https://talk.tiddlywiki.org/t/tw-5-3-0-js-exception/7488/2
2023-07-06 09:56:39 +01:00
jeremy@jermolene.com
c24d1ef4fb Codify implicit startup module dependency
Previously, the implicit sort ordering of modules ensured that the "plugins" startup module ran before the "startup" startup module. That no longer holds when experimenting with alternate stores that might use a subtly different collation order (eg $:/core/modules/startup.js vs. $:/core/modules/startup/commands.js), so it's more robust to explicitly specify the dependency
2023-06-30 10:50:28 +01:00
WhiteFall
28aef51855
Add explodePlugins=yes option to savewikifolder command (#7490)
* add option explodeplugins

refactor

Maintain Parameter Compatibility

change let to var

Refactoring the code

add conditional judgment

use === to avoid type-casting errors

refactor use <path> [<name>=<value>]

delete redundant code

backward compatibility support

easier to use

improve code

add documentation

* Update Notes

* Improve the code
2023-06-29 15:40:35 +01:00
jeremy@jermolene.com
a02d99a4c1 Widget.getVariableInfo() shouldn't return srcVariable if variable is missing
Fixes #7566
2023-06-28 11:31:12 +01:00
yaisog
f2d6c5a6eb
Add a :then filter run prefix (#7392)
* Initial commit

* Replace previous result only when non-empty

* Add doc tiddler

* Small change in rp-output description

* Update FRP title

lowercase with colon prefix

* Integrate with other doc tiddlers

* Add two doc-styles for reuse

* Add tests

* Add another test

* Correct indentation in stylesheet

* Change title and tags, add example to doc tiddler

* Replace leading spaces with tabs

* Improve docs text and structure
2023-06-24 18:07:34 +01:00
Saq Imtiaz
3825e2579f
Adds Text substitution support in widget attributes and new operator (#7526)
* feat: new text substitution support, first pass

* fix: use the widget method instead of evaluating a filter

* revert to earlier implementation that emulates macro syntax

* fix: capitalize comments

* feat: add support for triple backticks for substituted attributes

* docs: added docs for substitute operator

* chore: more docs tweaks

* docs: substituted attributes, refactored docs for widget attributes

* docs: fixed typo

* docs: more examples for substituted attributes

* docs: updated prior documentation on concatenating text and variables

* docs: documentation corrections

* Update editions/tw5.com/tiddlers/filters/examples/substitute Operator (Examples).tid

Co-authored-by: btheado <brian.theado@gmail.com>

---------

Co-authored-by: btheado <brian.theado@gmail.com>
2023-06-24 14:57:15 +01:00
jeremy@jermolene.com
a05302da10 Revert "Bidirectional text improvements (#4541)"
This reverts commit f90eb386ae.
2023-06-21 17:13:33 +01:00
jeremy@jermolene.com
b90c9ef9a0 Transclude widget should only create double underscore variables for macros and ordinary variables
Fixes #7544
2023-06-17 10:32:44 +01:00
Jeremy Ruston
f90eb386ae
Bidirectional text improvements (#4541)
* Add support for \dir pragma

* Add "dir" attribute to reveal, edit, edit-text and edit-codemirror widgets

* Add  $:/config/DefaultTextDirection hidden setting

* Revert accidentally commited test data

This reverts some of commit b83c1d160f.

* Remove Codemirror plugin from Prerelease

Makes it easier to test things

* Fix framed text editor directionality in Firefox

* Add direction attribute for edit body template

* Missed closing brace

* Add docs for \dir pragma

* Templates should set text direction from a variable, not a transclusion

* Updates to framed.js in the light of PRs that have been merged since this

* Restore whitespace trim

* Docs dates

* Fix typo

* Clarify docs
2023-06-13 16:36:07 +01:00
buggyj
50315310f5
Add widget.destroy() function (#7468) 2023-06-13 15:55:44 +01:00
Jeremy Ruston
d1f90f075f
Add tm-http-request message for making HTTP requests (#7422)
* Initial Commit

* HttpClient object shouldn't need to know about events

* Add support for cancelling HTTP requests

* Make the number of outstanding HTTP requests available in a state tiddler

* Add a network activity button

Click it to cancel outstanding requests

* Fix typo

Thanks @btheado

Co-authored-by: btheado <brian.theado@gmail.com>

* Fix crash when cancelling more than one HTTP request

Thanks @saqimtiaz

* Further fixes to cancelling outstanding HTTP requests

* Fix missing body

---------

Co-authored-by: btheado <brian.theado@gmail.com>
2023-06-13 10:35:55 +01:00
jeremy@jermolene.com
66212cd491 Refactor dependency on widget.getVariableInfo
Fixing https://talk.tiddlywiki.org/t/tw-v5-3-0-pre-problem-with-autocomplete-plugin/6958/9?u=jeremyruston
2023-06-11 09:46:05 +01:00
jeremy@jermolene.com
cc383e6d1e Refactor function evaluation code to avoid adding evaluateVariable method
Adding the new widget method was causing backwards compatibility issues. For example, see this discussion:

https://talk.tiddlywiki.org/t/tw-v5-3-0-pre-problem-with-autocomplete-plugin/6958
2023-06-10 08:58:04 +01:00
Jeremy Ruston
0095ea60d9
Switch off CamelCase linking by default (#7513)
* Disable camelcase by default

* New parse rule for ~CamelCase

For backwards compatibility with text that includes ~ to suppress camelcase links

* Enable CamelCase for main documentation wikis

Will take us a bit longer to convert all the links over

* Fix tests

* Release note update
2023-06-08 21:45:14 +01:00
Saq Imtiaz
2221b8e08a
Adds a deserialize filter operator (#7511)
* feat: added deserialize operator, tests and documentation

* fix: correct typo in lingo file

* fix: remove test that fails on node but succeeds in browser due to different availability of DOM deserializer
2023-06-03 14:33:10 +01:00
jeremy@jermolene.com
68a7655396 Custom widgets and filter operator names must now contain a period
Fixes #7428
2023-06-01 08:06:28 +01:00
lin onetwo
3f763775d6
Feat: decode url-encoded user name in authenticate request header to allow CJK username in header (#7471)
* fix: CJK in header has to be urlEncoded

* refactor: use $tw.utils.decodeURIComponentSafe

* docs: about chagne in this field

* docs: update

* docs: use less "field"
2023-05-22 12:25:51 +01:00
jeremy@jermolene.com
8e132948b6 Fix crash when transcluding a lazily loaded tiddler as an attribute value
See bug report at https://talk.tiddlywiki.org/t/text-and-skinny-tiddler-and-echarts-oh-my/7044
2023-05-18 18:18:56 +01:00
jeremy@jermolene.com
990909c310 Revert "Feat: destroy() method for widgets to do custom cleanup (#6699)"
This reverts commit 474b73bdbe.
2023-05-18 17:27:05 +01:00