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

679 Commits

Author SHA1 Message Date
saqimtiaz
25f8b3f903
Check for DOM node existence before removing class. (#4696)
Can cause issues if dragstart and dragend actions trigger a refresh.
2020-06-11 12:11:56 +01:00
Simon Huber
5b9dbf7b95
Use srcWindow in scrollable widget (#4677) 2020-06-11 11:49:32 +01:00
Simon Huber
e59f606566
Cancel popups when clicking within an editor (#4658)
* Add cancelPopups attribute to edit widget

* Add cancelPopups attribute to factory.js

* Cancel popups in editor/simple.js

* Cancel popups on focus in engines/framed.js

* Cancel popups on focus in CodeMirror engine

* Add cancelPopups="yes" to tag-picker

* Add cancelPopups="yes" to sidebar search

* Add cancelPopups="yes" to editor

* Add cancelPopups="yes" to fields EditTemplate

* Update body.tid

* Add cancelPopups="yes" to title EditTemplate

* Add cancelPopups="yes" to type EditTemplate

* Update EditTextWidget.tid

* Update EditWidget.tid

* Add cancelPopups="yes" to menubar plugin search

* Update tag-picker.tid

* Update tags.tid
2020-06-11 11:41:35 +01:00
Bimba Laszlo
9c22537b4e
Fix the class attribute of Droppable widget (#4647)
Even though we passed the `class` attribute, it did not take it into
account. For example try to render this:

  <$droppable class="custom-css-class">
    ... content ...
  </$droppable>

Before applying this patch:

  <span class=" tc-droppable">
    ... content ...
  </span>

After applying:

  <span class="custom-css-class tc-droppable">
    ... content ...
  </span>
2020-05-14 13:55:33 +01:00
jeremy@jermolene.com
33d973fb91 Add originating widget to event objects 2020-05-09 15:53:38 +01:00
Cameron Fischer
2385bd978f
Fix importvariables crash (#4593)
* Fixed issue: multi nonMacro imports broke everything

* Fixed issue: dead variables in import might linger
2020-04-23 09:10:52 +01:00
jeremy@jermolene.com
77a929faa3 ActionPopup widget: Add ability to cancel all popups 2020-04-21 22:19:03 +01:00
jeremy@jermolene.com
c86a621d5d BrowseWidget: Add "accepts" attribute
And add docs for the 'message' and 'param' attributes
2020-04-21 22:18:34 +01:00
jeremy@jermolene.com
e71a27ac2d Fix link widget to work within SVG elements 2020-04-19 12:57:56 +01:00
Mario Pietsch
22802b4be8
Action create tiddler improvements (#4436)
* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* add $template and $overwrite parameter

* documentation for new parameters + 4 new examples

* remove unwanted files
2020-04-15 15:51:21 +01:00
Mario Pietsch
de5b0062b5
Add new parameters to fields-widget and fields-operator. (#4433)
* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* extend fields-widget with include/exclude/sort/reverse and fields-filter with include and exclude params plus DOCS

* remove new-line

* remove eslint settings

* restore old eslint settings

* remove typo
2020-04-15 12:36:48 +01:00
Jeremy Ruston
bdc5ac592f Fix count widget to return "0" for an empty filter string instead of undefined 2020-04-09 11:04:50 +01:00
saqimtiaz
21565f635e
Fix range widget for IE10/11 (#4534)
As detailed in #4519 the range widget currently does not save its value to the state tiddler on IE 10/11 as they do not support the input event, but rather the change event is fired instead of the input event. This has patch has been tested in IE11 and should work in IE10 as well.

Note that on Chrome and Firefox, the change event will fire only once after the user stops dragging the range slider (In addition the input event). However this does lead to an extra refresh as the handleInputEvent method already checks to see if the current value of the slider is different from the saved value before saving to the store.
2020-04-03 13:07:55 +01:00
Jeremy Ruston
cf46b6b0ff Add "class" attribute to dropzone widget 2020-04-03 10:33:39 +01:00
Jeremy Ruston
cb52d709c2 Improve ability to disable drag and drop
Now we disable the draggable list macros too.
2020-03-20 10:46:17 +00:00
Cameron Fischer
561662782e
Fixes issue with #4504 and importvariable copying (#4518)
* Fixes issue with #4504 and importvariable copying

ImportVariables widget was using $tw.utils.extend to copy the
variables from temporary set widgets into itself. However,
$tw.utils.extend does NOT behave like Object.assign. It not only
copies all self-owned variables over, but also all variables
in that object's prototype chain. This led to some redundant copying,
and a problem where some variables might show up more than once
(like transclusion).

Fixed now. importvariables widget does its own copying, since it
can't rely on $tw.utils.extend to do the right job, and it can't
count on Object.assign to be there.

* Added test to prevent reversion of #4504

* Slight corrections to new importvariables test
2020-03-19 20:32:51 +00:00
Jeremy Ruston
bc687e5783 Add a hidden setting for disabling the page dropzone 2020-03-15 14:46:33 +00:00
saqimtiaz
8cd1dc36c1
Fix suspected typo that impacts refresh handling (#4464) 2020-03-09 21:07:34 +00:00
Jeremy Ruston
665b63ec38 Fix lack of refresh when button widget actions attribute changes 2020-03-08 17:11:21 +00:00
Jeremy Ruston
24d2804799 Add action-popup widget
Fixes #4185
2020-03-03 12:03:32 +00:00
saqimtiaz
04c28ba5f2
Add tabindex support to button widgets (#4442)
This pull request adds support for specifying a tabindex for button widgets following the same pattern as the LinkWidget.
2020-02-05 12:14:38 +00:00
Lee Sheng Long
96eca32b11
Add download button/link to binary tiddler warning banners in view and edit mode (#4423) 2020-01-31 09:13:28 +00:00
Cameron Fischer
aa817f66d2
Changed importVariable to store its own variables (#4108)
* Changed importVariable to store its ownvariables

Before, importVariables was creating a setWidget for every single variable it would find in its tiddlers, and it would create a long-ass call tree. Now, instead, it just accumulates the variables in itself.

* Can't use Object.assign

Learned the hardway while working on tw5-relink that Object.assign
doesn't exist in IE11. Using $tw.utils.extend instead.

* Retaining setWidget transclusion flexibility

* One more test to verify mixing sets and macros
2020-01-30 12:53:26 +00:00
Jeremy Ruston
136dbf1a60 Fix bug with importvariables and empty set widgets
A self-closing set widget doesn't have a "children" property.
2020-01-03 10:39:37 +00:00
Jeremy Ruston
54fc932740 Fix wiki referenced by navigator widget's rename tiddler handler 2019-11-20 17:38:59 +00:00
Jeremy Ruston
bfbd886a8b Add "index" attribute to range widget 2019-11-04 18:56:22 +00:00
Jeremy Ruston
e84c422e50 Range widget: fix refreshing
The range widget wasn't refreshing correctly when the underlying tiddler value changed
2019-11-02 09:31:15 +00:00
Simon Huber
66b68f4a58 Allow configuration of default focus field of new tiddlers (#4238)
* add editFocus attribute to edit widget

* add focus condition to title editTemplate

* add focus condition to body-editor editTemplate

* add focus attribute to type editTemplate

* add focus attribute to fields editTemplate

* add focus attribute to tag-picker

* add $:/config/AutoFocus tiddler

... default focus is title

* Update Basics.tid

* Update ControlPanel.multids

* Create minifocusswitcher.tid

* Update minifocusswitcher.tid

* Update Basics.tid

* Update body-editor.tid
2019-10-12 12:04:10 +01:00
Jeremy Ruston
d30eacc652 Select widget: fix bug with deselecting entries programmatically
Previously, it was not possible to deselect entries by editing the tiddler $:/generated-list-demo-state used in the final example of the SelectWidget docs
2019-10-11 17:46:30 +01:00
Jeremy Ruston
a170210069 Fix crash with action-deletefield and missing tiddler attribute
Fixes #4188
2019-08-24 11:39:00 +01:00
Jeremy Ruston
8159c4a865 Fix navigator widget when story and/or history attributes are missing
To fix the crash described here: https://groups.google.com/d/msgid/tiddlywiki/c5461591-bf27-4c85-9f27-9eef14c38816%40googlegroups.com?utm_medium=email&utm_source=footer
2019-08-04 11:34:45 +01:00
Jeremy Ruston
394725f00c Fix edit-bitmap crash with missing tiddlers
Fixes #4141
2019-08-02 09:16:36 +01:00
Simon Huber
e669ec098f Fix beyboard widget empty parameters (#4094) 2019-07-30 13:47:56 +01:00
jed
e86d4d29d5 Fix th-renaming-tiddler (see #4023) (#4037)
* Remove the th-renaming-tiddler hook from navigatior.js

The hook is invoked in the renameTiddler function which would cause the same hook to be called twice, and the version in the navigator widget didn't have the correct inputs and return value according to the documentation.

* Make it so that the th-renaming-tiddler hook isn't called twice

by removing it from the navigator.js file
2019-07-24 18:12:09 +01:00
Cameron Fischer
b67e088e55 Reducing function calls across board (#4102) 2019-07-14 16:20:27 +01:00
Jeremy Ruston
8e7c0907f8 Add checkactions attribute to Checkbox widget
See discussion at https://groups.google.com/d/msgid/tiddlywiki/526754d5-8786-49cd-aaa1-c77311670116%40googlegroups.com:

The history here is that in v5.1.14 we added an "actions" attribute to the checkbox widget that specified an action string to be specified whenever the state of the checkbox changed. The same action string is executed regardless of whether the checkbox was checked or unchecked.

Then in v5.1.16 we merged https://github.com/Jermolene/TiddlyWiki5/pull/3182 which added the "uncheckactions" attribute. The difference between the two is that the uncheckactions are only executed if the checkbox is unchecked. The main "actions" attribute is executed before any actions in "uncheckactions", which makes it possible to arrange things so that the "actions" attribute sets things to the checked state while the "uncheckactions" attribute overwrites those changes to set things to the unchecked state.

In retrospect, it would have made more sense to have also added a "checkactions" attribute that was executed only if the checkbox was checked. I'll investigate adding it for v5.1.20.
2019-07-14 13:42:43 +01:00
Jeremy Ruston
3edaa652ee Reveal widget: add option to avoid clamping popup position
Fixes #4041
2019-07-04 15:58:27 +01:00
Jeremy Ruston
f02352f6a1 Use default link text when link widget has no content
Fixes #3974
2019-06-10 21:04:21 +01:00
Jeremy Ruston
28c732d2be Improve action-createtiddler to return a draft title too 2019-06-04 12:33:01 +01:00
Jeremy Ruston
7869546fef Speed up reveal widget
It turns out that the `localeCompare` function used by `compareStateText()` is very, very slow. Replacing it with a straightforward equality test makes one of my test rigs be 10x faster...

Note that this PR reverts the behaviour of match/nomatch to that before #3157. That change was not backwards compatible in that the switch to localeCompare meant that é === e, now it doesn't again.
2019-05-10 08:47:00 +01:00
Simon Huber
662ae91067 Bugfix: reveal widget regression! (#3897) 2019-04-06 10:27:37 +01:00
Jermolene
02ae8969b2 Reveal widget: faulty logic for default handling
@BurningTreeC I think this might have been a typo in your recent refactorings; if you look back at an old version such as c0c1b557eb/core/modules/widgets/reveal.js then there is no sign of this fallback.

Fixes #3874
2019-03-20 16:50:34 +00:00
Jermolene
e52a616891 Add support for widget subclassing
Fixes #3865
2019-03-17 12:25:15 +00:00
Simon Huber
c9b16d88f3 Fix: reveal widget prevent undefined state (#3848)
the state didn't fall back to the default when there was no data-item to extract for a stateIndex

see the google group for a bug report: https://groups.google.com/forum/#!topic/TiddlyWiki/3jiFpayAIRc
2019-03-11 09:04:17 +00:00
Jermolene
477c41f843 Add tooltip attribute to select widget 2019-03-04 12:24:16 +00:00
Simon Huber
b6e2985ac6 Fix typo in edit-shortcut widget refresh - missing focus attr (#3815)
* fix edit-shortcut widget refresh - missing focus attr

* + typo fix. NOW it works
2019-03-02 18:16:55 +01:00
Simon Huber
87eab62b7e Make the keyboard-shortcut input focus automatically (#3776)
* add focus capability to edit-shortcut widget

* focus the keyboard-shortcut inputs in the control panel

... there's no other reason why it could have been opened other than just pressing a shorcut ...

... saves the mouseclick
2019-03-02 17:25:49 +01:00
Simon Huber
16bb474fef Partial fix for the sticky dropzone on firefox (#3809)
in my tests listening for the dragend event and removing the tc-dragover class in that case removes the `tc-dragover` every time it should ...

without this, firefox often doesn't remove it and the green bar sticks at the top

investigating now if the droppable widget has a similar problem
2019-03-02 16:13:36 +01:00
Simon Huber
f97d18bb6e Adding optional tabindex attr to simple, framed and cm engines (#3756)
* add optional tabindex attribute to factory.js

* add changedAttributes.tabindex to refresh mechanic

* add optional tabindex attribute to edit widget

* remove some extra whitespace

* remove some trailing whitespace

* add optional tabindex attribute to simple engine

* add optional tabindex attribute to framed engine

* add optional tabindex attribute to cm engine
2019-02-08 16:11:39 +00:00
Jermolene
44c66b98a9 Add default prefix for tm-fold-all-tiddlers message 2019-02-05 16:01:24 +00:00