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

2751 Commits

Author SHA1 Message Date
Cameron Fischer
c0dc2669c0
Preallocating in LinkedList's toArray method (#5488) 2021-02-11 13:39:50 +00:00
Joshua Fontany
bfa062f23d
Fix filesystem (#5465) 2021-02-04 16:11:07 +00:00
jeremy@jermolene.com
9f9ce6595b Make it easier to subclass the wikitext parser with a custom rule set
We can now pass arrays of rule classes to the parser constructor, overriding the rules that would normally be used by the parser.

This allows us to create custom variants of the wikitext parser with their own content type.

It could also provide a basis for a new Markdown parser based on our existing wikitext parser but with new rules.
2021-02-03 15:13:56 +00:00
Simon Baird
12f1847475
Support upload saver without username/password (#5455)
The default behaviour is unchanged, but if you write "yes" to
$:/UploadWithUrlOnly then it will assume it's possible to upload
with a blank username and password, as long as the host is set.

The motivation is to support a upload plugin compatible upload
service that uses some method to authenticate other than the legacy
upload plugin user/password params.

Without this patch, the user would need to enter something random in
the user and password fields for TW to decide the upload plugin can
be used.
2021-01-31 15:32:18 +00:00
Dyllon Gagnier
3eefb3cce6
Fix backtracking issue with regex (#5401)
There was an unnecessary
2021-01-29 15:26:25 +00:00
Cameron Fischer
4c7dcb83d1
Fix for #3306, inline/block widget glitch (#5452)
* Fix for #3306, inline/block widget glitch

* Just realized we don't need to set lastIndex anymore

* Forgot that parseBlocks doesn't use options
2021-01-29 14:57:30 +00:00
Cameron Fischer
45355a7fcf
Wikirules now use better macrocall parser (#5451)
* wikirules now use better macrocall parser

Before, wikirules would use a deficient macrocall parser which couldn't
handle certain types of arguments. Now it uses the same one that the
widget parser uses. Less code!

* style changes and removing weird switch statement

That switch statement made more sense in an earlier iteration.

* comment improvements

* oops, wikirule macrocalls could do ONE thing better

* '=' wasn't allowed for widget macros, but why?

Now they're allowed for both widget macros and macrocall macros.
2021-01-29 13:26:31 +00:00
Nicolas Petton
b205da2007
Minor cleanup of startup.js (#5409)
* Remove unused var declaration
* Remove trailing whitespaces
2021-01-15 16:55:52 +00:00
Nicolas Petton
17b4f53ba2
Add server sent events (#5279)
* Create server-sent-events.js

* Create sse-change-listener.js

* Implement server sent events

* Convert to ES5 and wrap in function

* Use the host string from tiddlyweb

* Improve comments in sse-server.js

* Can't use object reference as key

* Add retry timeout

* Fix a bug

* bug fix

* Fix formatting

* Fix ES5 compat

* capitalize comments

* more fixes

* Refactor tiddlywek/sse-server.js

* Extract helper functions for handling wikis and connections.
* Replace JSDoc comments.
* Fix formatting according to TW core.
* Simplify the logic for adding and removing connections.

* Fix formatting of tiddlyweb/sse-client.js

Fix formatting according to TW core.

* Fix formatting of server-sent-events.js

Fix formatting and comments following TW core guidelines.

* Extract a debounce function in sse-client.js

* Avoid using startsWith in server-sent-events.js

startsWith is part of ES2015, while TiddlyWiki uses the 5.1 dialect.

* New sse-enabled WebServer parameter

* If not set to "yes", disabled SSE request handling.
* Add documentation for the parameter in core/language/en-GB/Help/listen.tid
* Add new tiddler editions/tw5.com/tiddlers/webserver/WebServer Parameter_ sse-enabled.tid

* Disable polling for changes if SSE is enabled

* Add sse_enabled to /status JSON response
* Store syncer polling status in $:/config/SyncDisablePolling
* Handled disabling polling in core/modules/syncer.js

* Simply boolean logic in syncer.js

* Delete trailing whitespaces in syncer.js

Co-authored-by: Arlen22 <arlenbee@gmail.com>
2021-01-15 10:37:55 +00:00
jeremy@jermolene.com
ca95f1069f Fixed comment parsers to match end marker correctly
Fixes #5396
2021-01-13 11:48:42 +00:00
Cameron Fischer
65932a9b21
Memory efficient linked list (#5380)
* Outlines of the mem efficient linked list

Need to stop for now. Found problem with $tw.utils.pushTop that I need
consultation for.

* Link list throws when given non-string vals

* Think I got rid of the last LinkList infinite loops

* LinkedList push better; fixed coding conventions

* Cleaning up LinkedList code and tests

* Ready to ship new mem efficient Linked List

* Switching to double quotes in LinkedList
2021-01-09 20:52:34 +00:00
Simon Huber
4858b24cfe
Fix #5308 - WidgetSubclassingMechanism not working with widgets that add EventListeners (or logic ?) in constructor (#5382)
* add EventListeners in the render() method instead of the constructor

* scrollable widget: add EventListeners in render() method instead of constructor +

... move logic from constructor to render()

* linkcatcher: add EventListeners in render() instead of constructor

* fieldmangler: add EventListeners in render() instead of constructor

* edit-bitmap: initialise editorOperations in render() instead of constructor

* list-widget: initialise storyviews in render() instead of constructor

* vars widget: execute Widget.call(this) in render() instead of constructor

... not shure what this should do

* Update fieldmangler.js

* Update edit-bitmap.js

* Update linkcatcher.js

* Update navigator.js

* Update scrollable.js

* Update list.js

* Update vars.js
2021-01-09 13:25:48 +00: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
Joshua Fontany
03626bc142
always test ext in tiddler title and remove it (#5329)
* always test ext in tiddler title and remove it

* patch custom ext length vulernability
2021-01-03 11:50:14 +00:00
jeremy@jermolene.com
d25e540dd2 Add support for image/vnd.microsoft.icon content type
Fixes #5357
2021-01-03 10:04:52 +00:00
jeremy@jermolene.com
a9a36b641a Filename for action-confirm widget should be 'action-confirm.js' for consistency 2020-12-22 11:50:26 +00:00
Saq Imtiaz
1e9cc2b747
Fix refresh for all attributes of droppable widget. Add disabled class (#5280) 2020-12-15 11:09:32 +00:00
Joshua Fontany
d50f6b406e
filesystem cleaup around hook (#5276) 2020-12-14 09:50:53 +00:00
jed
c1a1e272cc
Add a hook to allow modifying the the behaviour creating tiddler paths (#5267)
* Add a hook to allow modifying the the behaviour creating tiddler paths

This is needed for Bob to use the core to generate tiddler fileInfo 

I don't know if this is the best way to make the hook, but it works for what I need

* update th-make-tiddler-path arguments

the value is the current path, the parameter passed in is the original unmodified path so it is available to subsequent hooks
2020-12-13 23:24:23 +00:00
Saq Imtiaz
0911d99813
URGENT: Reveal widget - fixed problem with previous patch of refresh handling (#5260)
* Fixed problem with previous patch of refresh handling

* Update reveal.js
2020-12-11 23:24:27 +00:00
Saq Imtiaz
c0dd13d446
Reveal widget should update on changed class and style attributes (#5258) 2020-12-11 15:36:00 +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
Cameron Fischer
6ca89304a1
Fix for LinkedLists when using bad filter prefix (#5251) 2020-12-10 18:25:53 +00:00
Cameron Fischer
cd5d9bd5b9
Code cleanup of Linked Lists (#5241)
* made private methods limited to module scope
* moved private methods to file bottom
* changed tests to run comperable array functions in parallel
* added comments
2020-12-09 09:46:35 +00:00
jeremy@jermolene.com
bb6d41f3dd Macrocall widget: ensure we separately cache inline vs block parse trees
Fixes a bug in #5205
2020-12-07 16:05:34 +00:00
Joshua Fontany
a878d82c7a
Ignore edition filters if not running on node (#5222) 2020-12-07 15:59:32 +00:00
Saq Imtiaz
ce5d20b8fc
Logging widgets :Fixed issue on Firefox where logging does not work (#5223)
* Fixed issue on Firefox where logging does not work properly due to column names

* Remove second argument to utils.logTable
2020-12-07 15:53:49 +00:00
Joshua Fontany
c3e34b469c
typo (#5221) 2020-12-06 22:59:48 +00:00
jeremy@jermolene.com
005f7c55b6 Restore accidental commenting in 0b1a05d10 2020-12-06 10:50:59 +00:00
Jeremy Ruston
0b1a05d10d
Cache result of parsing macro calls which don't use text subsitution (#5205) 2020-12-06 09:43:06 +00:00
Joshua Fontany
b0f6d50b60
fix filesystem bugs (#5213) 2020-12-06 09:41:03 +00:00
Cameron Fischer
a857b4ab9a
use a linked list for filter runs. (#5206)
* Changed the filterrunprefixes to use LinkedList

* Testing for Linked List

* Finishing touches to LinkedList

* Minor corrections to link-list coding style

* Corrected for sneaky bug in linkedList
2020-12-06 08:54:57 +00:00
Saq Imtiaz
7fd24de372
Tests for filter prefixes (#5209) 2020-12-05 23:10:51 +00:00
Cameron Fischer
fbe5bb229a
Fix for filterrunprefixes using $tw.wiki (#5202)
* Fixed runprefix 'and' to use widget wiki

* Made widget arg of filterTiddlers optional again

* Switched to passing {wiki: wiki} to prefixes
2020-12-05 16:12:40 +00:00
Saq Imtiaz
9825b5b4a0
Ensure new variables are strings (#5197) 2020-12-04 19:02:05 +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
Saq Imtiaz
046746ba20
Add :reduce filter run prefix (#5196) 2020-12-04 18:23:50 +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
1f5e1205ec
Extend Eventcatcher to handle multiple events (#5185)
* support multiple events

* Add variables for event type and detail. Rename types attribute to events

* Correct typo in refresh handling
2020-12-02 21:15:35 +00:00
Simon Huber
fc797f3722
Fix #5162 - tiddler opening position is incorrect, bug in navigator.js 2020-12-02 12:21:02 +00:00
Joshua Fontany
c6bb783308
Fix filesystem regression (#5176)
* $:/config/OriginalTiddlerPaths if no filters match

* fixed & docs updated

* tested with tiddlywiki.files & tw.com edition

* typos

* originalpath to options, propigate isEditableFile

* syntax cleanup
2020-12-02 09:47:51 +00:00
Saq Imtiaz
4079f72310
Fix typo in x-listops.js (#5171) 2020-12-01 18:14:07 +00:00
Mario Pietsch
880930da8b
Add actions parameter to range-widget + docs! (#5158)
* add actionsStart, -Stop and actions to range-widgets

* fix indent
2020-12-01 18:11:09 +00:00
jeremy@jermolene.com
6a91dbfe2f Add support for working with negative dates
See discussion https://groups.google.com/g/tiddlywiki/c/aHlyaHr93Io/m/vGcDa6lxAgAJ
2020-12-01 10:39:27 +00:00
Joshua Fontany
dde4182830
Fix filesystem adaptor (#5113)
* ignore .env

testing new implementation

almost there

closer

bug, desyncing

fixed

final testing

final testing

cleanup

cleanup

* isEditableFile flow fixed

* removed `basepath` logic

* callback to delete title from $tw.boot.files

* comment fix

* have syncer delete from boot.files

* syntax

* bugfix: error on missing directory

* bugifx

* remove !draft check

* fix relative filepaths

* cleanup

* cleanup !draft

* catch undefined filepaths in deleteTiddlerFile()

* typo

* whitelist wiki dir, encodeURIComponent otherwise

* test for wikiPath, not wikiPath/tiddlers

* don't need to .normailze()

* whitelist wiki directory, move cleanup to util

* use cleanup util & fail EPERM & EACCESS gracefully

* comments

* final bugs fixed

* improved sync error
2020-11-30 22:31:48 +00:00
jeremy@jermolene.com
3406b98af6 Add "autocomplete" attribute to <$edit> and <$edit-text> widgets 2020-11-30 18:48:04 +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
Mario Pietsch
5cbe4c5317
Add radio actions, th-radio-variables hook and fix label refresh problem (#5154)
* Add actions to radio-widget, pass trhough all attributes and user parameters, fix label refresh

* invoke th-radio-hook instead of hardcoded variables

* simplify code and test it with a plugin hook

* remove hook
2020-11-30 17:28:49 +00:00
Simon Huber
eb7f59a855
Make "tc-dirty" update also on external windows (#5129)
* Update windows.js

* Update saver-handler.js

* Update saver-handler.js
2020-11-28 21:24:01 +00:00
Simon Huber
c655ec5469
Remove background-colors from framed engine (#5131) 2020-11-28 14:08:16 +00:00
Simon Huber
8005c91e79
Correctly add EventListener 'click' for popup-handling in new windows (#5127) 2020-11-28 07:26:47 +00:00
saqimtiaz
2175be27b0
Ensure that we always fetch the latest sha bypassing cache. (#5126)
Ensure that we always fetch the latest sha bypassing cache.
2020-11-27 21:37:11 +00:00
jeremy@jermolene.com
9637a29e55 Rename widget.executeStartupTiddlers() to invokeActionsByTag()
This method was introduced earlier in v5.1.23 in  5cc1600072

It is not in fact restricted to startup tiddlers.
2020-11-26 12:41:24 +00:00
jeremy@jermolene.com
2267e31546 Fix eventcatcher to ensure variable values are strings
I was getting some inconsistencies with filter operators that expect strings.
2020-11-25 15:54:28 +00:00
jeremy@jermolene.com
64ac29adca Fix typo preventing filter run prefix modules from being cached
This had a significant impact on performance.
2020-11-25 13:58:54 +00:00
jeremy@jermolene.com
94ffb50e04 Fix dark mode event handling
Previous code worked but this matches the spec, and works on iOS
2020-11-25 12:33:39 +00:00
saqimtiaz
ce27492b96
Refactor updating of classes for button widgets to avoid potential edge case failures (#5115) 2020-11-24 21:19:20 +00:00
jeremy@jermolene.com
c854e518fa Add support for $:/info/darkmode (and for dynamic info tiddlers) 2020-11-24 19:01:33 +00:00
jeremy@jermolene.com
7327a3fb92 Fixed: Shadow tiddlers don't refresh when their plugin is deleted/modified 2020-11-24 18:57:39 +00:00
saqimtiaz
aa6f152d35
Add Switcher modal (#5089)
* Alternative switcher using a parameter via tm-show-switcher

* Add CSS class for centered modals

* Changed keyboardshortcut and removed transition CSS

* Resolved wording issues
2020-11-23 17:06:24 +00:00
saqimtiaz
3c195b05cb
Button and Droppable widgets: improve refresh handling for classes (#5091)
* Button and Droppable widgets: improve refesh handling for classes

* Added comment regarding handling of class attribute
2020-11-22 21:13:24 +00:00
saqimtiaz
fa63ac5d1e
Add: Eventcatcher widget (#5086)
* Jeremy's original version of the event widget

* Renamed to eventcatcher, added modifier key support and mouse button support as variables

* Allow updating classname without re-rendering entire widget

* Handle tag attribute in refresh handler

* Improve handling for mouse button variable

* Fix typo in refresh handler

* Added variables for position of selected node and position of event relative to selected node and catcher node
2020-11-22 20:47:12 +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
d2f87d6200
Reveal widget allow re-positioning (#5087)
* Jeremy's original version of the event widget

* Renamed to eventcatcher, added modifier key support and mouse button support as variables

* Reveal widget: update popup position when state tiddler updates
2020-11-21 17:19:52 +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
483fd941f5
Extend action-log and subclass it as log widget (#5078)
* Extended action-log and subclassed it as log widget

* Do not rename LogWidget class

* Removed unneeded variable declaration
2020-11-20 14:08:18 +00:00
saqimtiaz
89541edcff
Added mathematics filter operators power and log (#5080) 2020-11-20 14:00:20 +00:00
saqimtiaz
e2bea854b6
System tiddler syncing (#4987)
* First pass at a fix for system tiddler sync issues

* Add new filter syncFromServer

* Undo previous attempt at a fix

* Added a flag to control sync of system tiddlers from server
2020-11-19 15:59:02 +00:00
jeremy@jermolene.com
d181b96518 Wikitext parser: Refactor a poorly written utility function 2020-11-18 12:05:06 +00:00
saqimtiaz
527638d5e6
Improved status messages in ImportListing to remove redundant and irrelevant messages (#5059) 2020-11-17 19:12:41 +00:00
jeremy@jermolene.com
8cd13e2f89 Change default branch for GitHub saver to "main"
To match GitHub's new default

See also #5055 for the accompanying docs change
2020-11-17 14:47:15 +00:00
saqimtiaz
d6e055368d
Added docs for action-confirm widget, added default message for widget and improved logic for disabling it. (#5047) 2020-11-16 17:02:22 +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
a637f7fb60
Modals: add navigator to handle tm-navigate (#5027)
* Wrap modal in a navigator widget to allow tm-navigate to work

* Move all story list handling to Modal

* Make sure any values for story list or history list sent as variables have precedence

* Code clean up
2020-11-16 16:27:46 +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
04bf6e0fd8
Action widget: confirm (#5037)
* added action widget: confirm

* Check for all attributes in refresh handler

* Always return a value from invokeActions
2020-11-15 11:40:08 +00:00
jeremy@jermolene.com
1b31c25ea7 Introduce <$action-log> widget to help debugging action strings 2020-11-14 13:00:00 +00:00
jeremy@jermolene.com
cc3462999b When importing don't use file type as content type
Fixes #5028

I've checked that importing other file types still works but would appreciate a sanity check!
2020-11-14 12:05:35 +00:00
saqimtiaz
09f7ad84b2
Added disabled attribute to input widgets (#5014)
* checkbox widget: added disabled attribute

* Range widget: added disabled attribute

* Radio widget: added disabled attribute

* EditText widget: added disabled attribute
2020-11-09 18:28:12 +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
71194d8767
Added disabled attribute support to ButtonWidget (#5010)
* Added disabled attribute to ButtonWidget

* Update ButtonWidget.tid
2020-11-08 22:32:27 +00:00
Simon Huber
9fe4c4889a
Add "meta" to getEventModifierKeyDescriptor (#5000)
* Add "meta" to getEventModifierKeyDescriptor

* Update modifier Variable.tid
2020-11-08 10:15:29 +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
5aa4e4cb68
Initial support for switching page templates (#4979)
* Add support for switching page templates

* Revert "Add support for switching page templates"

This reverts commit dbf7682d47.

* Adopt Jeremy's approach to page template switching instead

* Fix default value of recursion marker

* Fixed issue with conditional check
2020-11-07 09:51:01 +00:00
saqimtiaz
2b31c7a509
Multiple operands for filter operators (#4964)
* Firt pass at adding multiple operands to filter operators

* Optimized parsing of multiple operands and added more tests. Need more flexibility for interpreting multiple operands as variables/text references

* Add support for parsing text references and variables in multiple operands

* Added string-replace filter for testing multiple filter operands

* Added more tests for variables and text references in operands

* Removed string-replace operator and some whitespace corrections

* Removed string-replace operator and some whitespace corrections

* Added test with comma in operand
2020-11-07 09:47:08 +00:00
Miha Lunar
1b226c7556 Fixed coding standard nits 2020-11-06 19:56:20 +01:00
Simon Huber
d51975b183
KeyboardWidget: don't trap keyboard shortcut if actions and message are empty and invokeActions isn't handled (#4971)
* KeyboardWidget: don't trap keyboard shortcut if actions are empty

* Update keyboard.js

* Update keyboard.js
2020-11-06 17:32:26 +00:00
Miha Lunar
2bd9cc45fa Added more start/end parser ranges 2020-11-04 21:02:17 +01:00
Simon Huber
d5c4aa250a
Remove dependency on wiki.js for story-startup and navigator (#4200)
* Update story.js

* Update wiki.js

* Update navigator.js

* Add deprecation console logs to addToHistory and addToStory
2020-11-02 22:52:02 +00:00
Mario Pietsch
42b965c9f0
Init less parsers (#4954)
* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* Don't override browser selection colours by default

Reverts some of #4590

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* it shouldn't be there

* fremove this file from my PRs

* list-widget, init new Parser() only if needed.

* fix braces

Co-authored-by: jeremy@jermolene.com <jeremy@jermolene.com>
2020-11-01 17:14:42 +00:00
saqimtiaz
e9a635dc81
Added intersection filter run prefix (#4959) 2020-11-01 17:13:52 +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
Robin Munn
77fe6244a2
Fix bug with sortan operator called on date fields (#4839)
* Add failing unit test that shows the bug

* Fix the bug
2020-11-01 10:45:18 +00:00
saqimtiaz
9605d94b6c
Import rename (#4928)
* Add UI for renaming tiddlers before import in the import listing

* Removed spurious whitespace
2020-10-28 16:03:04 +00:00
Ryan Kramer
651619076a
add override saver (#4908)
* add override saver

* rename 'override' to 'custom' and use the  global instead of introducing a new one
2020-10-28 11:58:48 +00:00
saqimtiaz
972456ca07
Add new 'filter' prefix for filter runs (#4918) 2020-10-27 16:48:40 +00:00
saqimtiaz
c9efa23f02
Named filter run prefixes (#4915)
* First pass at refactoring filter code to support named filter run prefixes

* Remove filter prefix for now

* renamed module type and filter run prefixes

* Moved inline handling for no filter run prefix to 'or' filter run prefix.

* Added error handling for undefined filter run prefixes
2020-10-27 12:24:18 +00:00
jeremy@jermolene.com
3153c588ec Disable autosave in the upgrade wizard
To address @pmario's suggestion here: https://github.com/Jermolene/TiddlyWiki5/issues/4879#issuecomment-704320381
2020-10-26 17:28:57 +00:00
jeremy@jermolene.com
f7f55e8eff Add support for username/password parameters for tm-login message 2020-10-25 16:33:44 +00:00
jeremy@jermolene.com
5cc1600072 Introduce post-render startup actions 2020-10-25 16:22:21 +00:00
jeremy@jermolene.com
1446a1e44c Extend tm-scroll to accept CSS selector to identify the target 2020-10-14 15:59:27 +01:00
jeremy@jermolene.com
69c12618d9 Syncer: Allow syncadaptor to customise the login prompt 2020-10-14 12:41:51 +01: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
jeremy@jermolene.com
ae13a0fee1 Extend Macro Call Widget to support outputting raw text 2020-09-28 11:30:28 +01:00
Florian Kohrt
4cd6a24431
Mention <tiddler-filter> parameter of savelibrarytiddlers command (#4857) 2020-09-24 19:09:06 +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
31c9c23a18
Gitea API wants tokens, not HTTP basic auth (#4854) 2020-09-14 13:14: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
jeremy@jermolene.com
8497e5b95d GitHub/Gitlab/Gitea savers: Handle empty paths correctly
Fixes #4656
2020-08-28 15:28:34 +01:00
saqimtiaz
48c6146ab6
Link widget: Include original event in tm-navigate (#4724) 2020-08-27 15:52:25 +01:00
ento
259b45065a
Fix server error when saving a new tiddler created by following a tiddler link (#4770)
* Initialize draft tiddler with empty text

Otherwise, when the tiddler has a meta file,
$tw.utils.saveTiddlerToFile will call fs.writeFile with the content
to write as `undefined`. Depending on the version of Node, this
results in the string "undefined" getting saved or a TypeError.

* Remove what seems to be a leftover debug log
2020-08-27 15:45:34 +01:00
jeremy@jermolene.com
a2796d89ab Fix httpRequest() header handling
Header names are not case sensitive, so the old code failed if it was called with a "Content-Type" header
2020-08-17 18:44:36 +01:00
Robin Munn
c23eedd069
Fix incorrect base64 encoding of astral-plane text (#4813)
Most astral-plane text is emojis like U+1F4DA BOOKS (📚), but some
languages like Osage have their alphabet entirely in the supplementary
multilingual plane as well. For proper support of languages like Osage,
and newer emojis, the UTF-8 decode and encode functions need to properly
handle codepoints above U+FFFF, which are represented by a surrogate
pair in Javascript strings.
2020-08-17 17:33:46 +01:00
John Duhamel
89c0c6157b
Add saver for Hyperdrive protocol used in Beaker 1.x (#4777) 2020-08-10 20:32:28 +01:00
saqimtiaz
dd79c096be
Fix #4786 (#4787)
* Fix #4786

Fix #4786

* Update header.js
2020-08-03 10:41:23 +01:00
ento
222821804e
Fix Entity widget not rendering its content without a refresh (#4776)
* Expose TEXT_NODE and ELEMENT_NODE constants

* Add failing test for initial rendering of entity widget

* Compute attributes when rendering
2020-07-31 08:25:15 +01:00
Diep Pham
a9d79a1a84
Fix authenticated-user-header is case sensitive in header authenticator (#4780)
From RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers":

Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.
2020-07-30 18:24:28 +01:00
Simon Huber
95e30138f0
Add modifier variable to linkcatcher actionstring (#4758)
* Add modifier variable to linkcatcher actionstring

* Update LinkCatcherWidget.tid
2020-07-15 12:27:14 +01:00
Simon Huber
00ff0d6fa0
Add modifier variable to button actionstring (#4671)
* Add modifier variable to button actionstring

* Update ButtonWidget.tid

* Update droppable.js

* Create getEventModifierKeyDescriptor method in keyboard.js

* Update droppable.js

* Update button.js
2020-07-14 17:04:06 +01:00
Simon Huber
0d2df34c58
Keyboard-driven dropdown inputs (#4725)
* Add shortcut descriptions to Misc.multids

* Update framed.js

* Update simple.js

* Add inputActions and refreshTitle to factory.js

* Add inputActions and refreshTitle to edit.js

* Update DefaultSearchResultList.tid

* Update search.tid

* Update ShortcutInfo.multids

* Update shortcuts.multids

* Create keyboard-driven-input.tid

* Update tag-picker.tid

* Create keyboard-driven-input_Macro.tid

* Update EditTextWidget.tid

* Update EditWidget.tid

* Update engine.js

* Update base.tid

* Use primaryListFilter, secondaryListFilter, primaryList and secondaryList

* Update tag-picker.tid

* Update search.tid

* Update DefaultSearchResultList.tid

* Update keyboard-driven-input_Macro.tid

* Fix typo udpate -> update

* Update framed.js
2020-07-13 17:42:55 +01:00
jeremy@jermolene.com
bd2cf5c464 Extend the element widget with a hook to intercept DOM node creation
The element widget is used to render HTML elements in wikitext.
2020-07-02 13:13:55 +01:00
saqimtiaz
35a842ade6
EditWidget: Pass attributes from parseTreeNode to child widgets (#4740) 2020-06-27 12:33:14 +01:00
saqimtiaz
d46872c061
Extend tm-import-tiddlers message (#4741)
* Allow tm-import-tiddlers event to override tv-auto-open-on-import

* Add autoOpenOnImport attribute to dropzone

* Updated DropZone docs

* Updated dropzone to support importTitle attribute

* Updated navigator to support importTitle attribute on tm-import-tiddlers

* Update dropzone docs for importTitle attribute

* Updated docs for tm-import-tiddlers

* Fixed formatting
2020-06-27 12:32:11 +01:00
saqimtiaz
7911007973
Revised: toggling relink in tm-rename-tiddler (#4723)
* switch boolean logic in new parameters

Use renameinTags and renameInLists instead of dontRenameInTags and dontRenameInLists respectively. This avoids users having to think through double negatives, as well as corresponds better to the setting in $:/config/RelinkOnRename

* Updated docs for revised parameters for tm-new-tiddler
2020-06-19 18:20:25 +01:00
saqimtiaz
24ef51df01
Revert "Allow toggling relink in tm-rename-tiddler (#4719)" (#4722)
This reverts commit a689f31978.
2020-06-19 18:05:08 +01:00
saqimtiaz
a689f31978
Allow toggling relink in tm-rename-tiddler (#4719)
* Allow toggling relink in tm-rename-tiddler

* Updated docs for tm-rename-tiddler
2020-06-19 11:07:03 +01:00
jeremy@jermolene.com
f760a2fa79 Add old tiddler to th-saving-tiddler hook
Addresses https://github.com/Jermolene/TiddlyWiki5/pull/4434#issuecomment-645939182
2020-06-18 11:49:59 +01:00
Simon Huber
d832cb93ce
Fix (again) error in scrollable.js (#4705) 2020-06-11 13:54:59 +01:00
Simon Huber
bbf20f8955
Scrollable widget: Fix error in variable declaration (#4704) 2020-06-11 12:33:18 +01:00
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
Arlen22
d32fb6f900
Allow setting boot, wiki, and pathPrefix for each request (#4649)
* Add pathPrefix to state, and options to request handler

* use ternary operator instead of default empty object

* Fix styling issues

* Update server.js

* Add boot to server and filesystem adapter
2020-06-11 11:36:41 +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
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
5c0d91c510 Fix title of slugify.js filter module 2020-05-14 07:53:30 +01:00
jeremy@jermolene.com
bf6735420d Fix SVG favicons 2020-05-10 11:58:40 +01:00
jeremy@jermolene.com
4966f6ab62 Add slugify and duplicateslugs operators
Fixes #3379
2020-05-09 15:54:44 +01:00
jeremy@jermolene.com
33d973fb91 Add originating widget to event objects 2020-05-09 15:53:38 +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
48dfadd85b InfoMechanism: Add $:/info/startup-timestamp 2020-05-06 11:05:54 +01:00
jeremy@jermolene.com
13b8281f6b $tw.utils.copyDirectory: Ensure directories don't overlap 2020-04-27 15:00:06 +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
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
2a8f7a9c50 Add support for _canonical_uri field of $:/favicon.ico 2020-04-22 16:40:02 +01:00
jeremy@jermolene.com
5f98e7d7b3 Ensure $tw.utils.hasClass/addClass/removeClass work with SVG elements
These docs make clear that .className isn't recommended for SVG elements:

https://developer.mozilla.org/en-US/docs/Web/API/Element/className#Notes
2020-04-22 15:32:20 +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
d6ee700bca Fix $tw.utils.getSubdirectories() 2020-04-21 21:21:38 +01:00
Simon Huber
39d532a4a0
Revert "Make input fields dismiss their popups when the ... (#4579)" (#4586)
This reverts commit 4efcad46f3.
2020-04-20 19:26:54 +01:00
Simon Huber
4efcad46f3
Make input fields dismiss their popups when the ... (#4579)
* Make input fields dismiss their popups when the ...

... fields loose focus (`blur`)

* Update simple.js
2020-04-20 15:49:30 +01:00
jeremy@jermolene.com
2649d2f7dc Syncer: Fix typos
Fixes a bug introduced in #4584
2020-04-20 13:19:27 +01:00
idotobi
154e886873
Fix Comment in Webserver API route tidlers.json (#4557)
This commit fixes the the comment in the route
`recipes/default/tiddlers.json` which was inconsistent with the actually
used regex. Furthermore, the 403 response was adjusted to also agree
with the the new comment and the regex.

Co-authored-by: tobidot <post@tobidot.net>
2020-04-20 13:07:06 +01:00
jeremy@jermolene.com
5688670da6 makelibrary command: Guard against invalid directories 2020-04-20 12:58:27 +01:00
jeremy@jermolene.com
678e25f510 makelibrary command should skip non-directories
Fixes #4583
2020-04-20 11:47:54 +01:00
jeremy@jermolene.com
15d7255728 Syncer: Should not call syncadaptor for missing tiddlers
Fixes #4580
2020-04-20 11:35:11 +01:00
Daniel Rodríguez Rivero
4ea79cb0c3
fix(syncer): restore tiddlerInfo param to saveTiddler (#4584)
This was added on a159b5baf3 and lost in #4373.
Will be a good idea to introduce tests against this kind of changes
2020-04-20 11:17:27 +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
Jeremy Ruston
7cbe766bde Utils: ParseInt should specify a radix
Thanks @pmario
2020-04-15 15:28:03 +01:00
Jeremy Ruston
f21d013241 jsontiddlers macro: parse "spaces" parameter as integer 2020-04-15 15:27:53 +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
Cameron Fischer
65347ae858
Fixed join filter operator to never returns null (#4396)
If the operator were passed an empty list, it would return null
which could cause some proceeding operators to crash.
2020-04-14 17:49:38 +01:00
Cameron Fischer
43fdb553b7
Reduced indexOf calls in wiki.sortByList (#4275) (#4397)
Examined the tests in test-tag. They already cover all the use cases
I could think of.
2020-04-14 17:49:10 +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
0836fb7184 Makelibrary.js: Minor refactoring 2020-04-14 12:08:15 +01:00
jed
4146a04a9e
Fix makelibrary.js to use enviroment variable paths (#4559)
This makes makelibrary.js use environment variables to find paths for plugins, themes and languages instead of just using the paths hardcoded in boot.js
2020-04-14 12:03:12 +01:00
Jeremy Ruston
7b53f5724c Add new compare filter operator
Fixes #4554
2020-04-13 10:03:01 +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
Nils-Hero Lindemann
322c37d693
Let chained > blockquotes generate valid HTML (#4332)
* Replace "p" with "div" in itemTag

'>> text' will now be valid html.

* Make the new div's behave like p's
2020-04-07 20:39:13 +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
1154372a7b Update syncer to distinguish connection errors from other errors
We can automatically remove connection errors when things resume working
2020-03-31 10:47:17 +01:00
Jeremy Ruston
b95723a022
Fix syncer to handler errors properly (#4373)
* First commit

* Add throttling of saves

Now we refuse to save a tiddler more often than once per second.

* Wait for a timeout before trying again after an error

* Modest optimisations of isDirty() method

* Synchronise system tiddlers and deletions from the server

Fixes two long-standing issues:

* Changes to system tiddlers are not synchronised from the server to the browser
* Deletions of tiddlers on the server are not propagated to browser clients

* Make sure we update the dirty status even if there isn't a task to perform

* Replace save-wiki button with popup sync menu

* Remove the "Server" control panel tab

We don't need it with the enhanced sync dropdown

* Add indentation to the save-wiki button

* Fix spacing in dropdown menu items

* Switch between cloud icons according to dirty status

* Add a menu item to copy syncer logs to the clipboard

* Improve animated icon

* Remove indentation from save-wiki button

@pmario the annoying thing is that using `\trim whitespace` trims significant whitespace too, so it means we have to use <$text text=" "/> when we need a space that won't be trimmed. For the moment, I've removed the indentation but will keep thinking about it.

* Further icon, UI and copy text tweaks

Move the icons and styles from the core into the TiddlyWeb plugin

* Clean up PR diff

* Tweak animation durations

* Break the actions from the syncer dropdown into separate tiddlers

@pmario I think this makes things a bit easier to follow

* Refactor syncadaptor creation and logging

The goal is for the syncadaptor to be able to log to the same logger as the syncer, so that the "copy syncer logs to clipboard" data is more useful.

* Don't transition the dirty indicator container colour, just the SVG's colour

* Only trigger a sync for changes to tiddlers we're interested in

Otherwise it is triggered by the creation of the alert tiddlers used to display errors.

* Restore deleting local tiddlers removed from the server

(I had commented it out for some testing and accidentally commited it).

* Guard against missing adaptor info

* We still need to trigger a timeout when there was no task to process

* Avoid repeatedly polling for changes

Instead we only trigger a timeout call at if there is a pending task (ie a tiddler that has changed but isn't yet old enough to save).

* Lazy loading: include skinny versions of lazily loaded tiddlers in the index.html

* Introduce _is_skinny field for indicating that a tiddler is subject to lazy loading

* Remove savetrail plugin from prerelease

It doesn't yet work with the new syncer

* Make the savetrail plugin work again

* Clear outstanding alerts when synchronisation is restored

* Logger: only remove alerts from the same component

Missed off 9f5c0de07

* Make the saving throttle interval configurable (#4385)

After switching Bob to use the core syncer the throttle interval makes saving feel very sluggish compared to the message queue setup that I had before.
The editing lock that I use to prevent conflicts with multiple users doesn't go away until the save is completed, and with the 1 second delay it means that if you edit a tiddler and save it than you have to wait one second before you can edit it again.

* Tweaks to appearance of alerts

* Exclude temp tiddlers from offline snapshots

Otherwise alerts will persist

* Tweak appearance of status line in dropdown

* Update release note

* Web server: Don't include full path in error messages

Fixes #3724

* In change event handler check for deletions

* Disable the official plugin library when the tiddlyweb plugin is loaded

* Hide error details from browser for /files/ route

See https://github.com/Jermolene/TiddlyWiki5/issues/3724#issuecomment-565702492 -- thanks @pmario

* Revert all the changes to the relationship between the syncer and the syncadaptor

Previously we had some major rearrangements to make it possible for the syncadaptor to route it's logging to the logger used by the syncer. The motivation is so that the "copy logs to clipboard" button is more useful.

On reflection, changing the interface this drastically is undesirable from a backwards compatibility perspective, so I'm going to investigate other ways to achieve the logger sharing

* Make the tiddlyweb adaptor use the syncer's logger

So that both are availavble when copying the syncer logs to the clipboard

* Update release note

* Support setting port=0 to get an OS assigned port

Quite useful

* Update code comment

* UI: Use "Get latest changes from server" instead of "Refresh"

* Add getUpdatedTiddlers() method to syncadaptor API

See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573579495

* Refactor revision handling within the syncer

Thanks @pmario

* Fix typo in tiddlywebadaptor

* Improve presentation of errors

See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573695267

* Add docs for getTiddlerRevision()

* Remove unused error animation

* Update comment for GET /recipes/default/tiddlers/tiddlers.json

* Optimise SVG cloud image

* Add optional list of allowed filters for get all tiddlers route

An attempt to address @Arlen22's concern here:

https://github.com/Jermolene/TiddlyWiki5/pull/4373#pullrequestreview-342146190

* Fix network error alert text translatability

* Fix error code and logging for GET /recipes/default/tiddlers/tiddlers.json

Thanks @Arlen22

* Flip GET /recipes/default/tiddlers/tiddlers.json allowed filter handling to be secure by default

* Validate updates received from getUpdatedTiddlers()

* Add syncer method to force loading of a tiddler from the server

* Remove the release note update to remove the merge conflict

* Fix crash when there's no config section in the tiddlywiki.info file

* Use config tiddler title to check filter query (merge into fix-syncer) (#4478)

* Use config tiddler title to check filter query

* Create config-tiddlers-filter.tid

* Add config switch to enable all filters on GET /recipes/default/tiddlers/tiddlers.json

And update docs

* Fix bug when deleting a tiddler with a shadow

Reported by @kookma at https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-604027528

Co-authored-by: jed <inmysocks@fastmail.com>
Co-authored-by: Arlen22 <arlenbee@gmail.com>
2020-03-30 15:24:05 +01:00
Jeremy Ruston
091bcfce7d Fix the datauri macro to work with _canonical_uri tiddlers 2020-03-30 10:55:37 +01:00
Rob Hoelz
ae04a425c0
Add backlinks indexer (#4421)
* Add tests for backlinks

* Add backlinks indexer

* Use backlinks indexer in getTiddlerBacklinks if available

* Extract link extraction into its own method

This way we can provide an arbitrary parse tree, rather than just a
title, which will allow us to compare lists of outgoing links between
versions of a single tiddler

* Use new extractLinks method in backlinks indexer

...rather than copy-pasting the implementation

* Remove ES6-isms

TiddlyWiki needs to work with browsers that only support ES5
2020-03-26 13:15:02 +00: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
Jeremy Ruston
a6f6db40d9 Revert "Fix test for needing to update text editor DOM"
This reverts commit a65ec87c53.
2020-03-15 14:23:10 +00:00
Matthias Bilger
62f8c9353e
Use CamelCase for Gitea (#4496) 2020-03-13 17:36:05 +00:00
saqimtiaz
ca6dd93214
Add support for a custom class to modal wrapper (#4490)
* Add support for a custom class to modal wrapper

As per https://github.com/Jermolene/TiddlyWiki5/issues/4485 add support for a custom class to modal wrapper, by means of a field in the modal tiddler. The class is added to the modal wrapper in addition to the default class, allowing for custom styling via css of any part of the modal.

* Remove redundant check for tiddler.
2020-03-12 16:58:14 +00:00
Matthias Bilger
52a9f928ae
Added gitea saver (#4491)
* added gitea saver

* create nonexistent file
2020-03-12 15:53:55 +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
a65ec87c53 Fix test for needing to update text editor DOM
Checking the active element is clumsy, and interferes with debugging. Checking the content is clearer, and avoids the Firefox bug.

Fixes #4472
2020-03-07 14:00:46 +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
Jeremy Ruston
3df1f9c9d0 Extend jsontiddlers macro to generate unformatted output 2020-02-04 13:57:24 +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
Jeremy Ruston
3eacdc19fd Ensure GitHub and GitLab savers use a default path of / if empty
The empty string gets a slash appended further down this method.
2020-01-30 17:02:14 +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
29461403ed Fix bug with navigating via location hash
Introduced in 8159c4a865, the problem was that it is actually valid for storyTitle and/or historyTitle to be falsey in the Story constructor.
2020-01-27 17:59:13 +00:00
Stefan Krüger
1ed884cef4 Add support for file type webm & ogg theora (#4404) 2020-01-04 11:27:13 +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
a65cfe98d5 Slight optimisation of $tw.utils.addClass() 2019-11-20 17:38:28 +00:00
donmor
7b66df688a Refactor andtidwiki.js (The saver for Android apps including AndTidWiki, Tiddloid and Tiddloid Lite) (#4276)
* Create tiddloid.js

* Update andtidwiki.js

* Delete tiddloid.js

* Update andtidwiki.js

* Update andtidwiki.js

* Update andtidwiki.js

* Update andtidwiki.js

* Update andtidwiki.js

* Update andtidwiki.js
2019-11-20 09:45:42 +00:00
Jeremy Ruston
8f3da69f81 Correct fix for bug with millisecond 0XXX date format
Milliseconds need 3 digits, not 4...
2019-11-18 13:24:47 +00:00
Jeremy Ruston
cd8ab13b55 Fix bug with millisecond 0XXX date format 2019-11-18 13:22:10 +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
Jeremy Ruston
43d18e74d5 Syncer: add hidden setting for disabling lazy loading 2019-10-25 10:02:57 +01:00
donmor
588af44d4c Scale embedded videos and audios to fit their container (#3943)
* Update videoparser.js

* Update audioparser.js

* Update videoparser.js

* Update audioparser.js
2019-10-19 11:44:18 +01:00
Jeremy Ruston
6089c4de29 Extend refresh throttling to tiddlers having a "throttle.refresh" field
See discussion here: https://groups.google.com/d/msgid/tiddlywiki/7738644f-b53f-4fb0-b0df-16243fe51795%40googlegroups.com
2019-10-14 10:42:14 +01:00
Simon Huber
d01b781283 Restore previous popup mechanism (no cancelling when focusing inputs) (#4305)
* remove cancelpopups from factory.js

* remove handleFocusEvent from framed engine

* remove cancelPopups from simple engine

* Update popup.js
2019-10-12 14:08:52 +01: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
cb2640669b HTTP Server: should include bag in returned tiddlers
The bag field is included in the tiddlers baked into the HTML file, but is also needed on tiddlers read from the server dynamically.

Fixes #4291
2019-10-06 17:34:50 +01:00
Jeremy Ruston
a054d100e7 Fix usage of tm-edit-text-operation count parameter
Fixes #3912
2019-10-04 11:23:17 +01:00
Jeremy Ruston
93e01435d1 Dynamic plugins: Change "contains JavaScript" to "requires reload"
We might in the future offer support for certain types of JS module to be hot loaded.
2019-09-27 16:47:55 +01:00
Jeremy Ruston
cb3bec65a1 Don't crash for edit enginges that don't support cancelPopups 2019-09-26 08:51:35 +01:00
Jeremy Ruston
336f1ceae3 Indicate in import listing whether a plugin contains JS modules 2019-09-17 08:49:39 +01:00
Jeremy Ruston
8c89461291 Adding [is[binary]] filter -- Missed off 1150c87ed 2019-09-16 16:16:03 +01:00
Jeremy Ruston
1150c87edb Add [is[binary]] operator 2019-09-16 16:15:26 +01:00
Jeremy Ruston
7f9823c5b2 Dynamic plugins: Fix registration of themes and languages 2019-09-16 13:17:09 +01:00
Jeremy Ruston
1c23059204
Dynamic loading/unloading of plugins (#4259)
* First pass at dynamic loading/unloading

* Show warning for changes to plugins containing JS modules

* Use $:/config/RegisterPluginType/* for configuring whether a plugin type is automatically registered

Where "registered" means "the constituent shadows are loaded".

* Fix the info plugin

The previous mechanism re-read all plugin info during startup

* Don't prettify JSON in the plugin library

* Indicate in plugin library whether a plugin requires reloading

* Display the highlighted plugin name in the plugin chooser

And if there's no name field fall back to the part of the title after the final slash.
2019-09-16 12:15:39 +01:00
Jan-Oliver Kaiser
11506e9acf Fix gitlab saver (#4243)
This fixes the HTTP request sent to gitlab that is meant to see if the
target file already exists. It did not follow the official gitlab v4 api
documentation. That documentation dictates both `path` and `branch` to
be passed via corresponding GET parameters.
2019-09-11 10:21:31 +01:00
Bimba Laszlo
3732c83ad4 Fix GitLab saver Base64 encoding (#4255) 2019-09-10 14:16:06 +01:00
Jeremy Ruston
953038f0b2 Don't use field indexer when looking for blank/missing fields
Fixes #4247
2019-09-09 14:47:27 +01:00
Nils-Hero Lindemann
1c5b3e3d8d Remove duplicate code from transcludeblock parser (#4221) 2019-08-30 17:20:16 +01:00
Jeremy Ruston
471b73158a Fix overeager alerts from core module overwrite upgrade warning
This fixes a bug in #3634, and refines the logic so that the warning is only given if the incoming tiddler exists as a shadow tiddler. (In my case I have several draft core modules inactive in my notes wiki and they were erroneously suppressed from the upgrade).
2019-08-28 14:44:46 +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
bab1bca485 Coding style tweaks 2019-08-14 23:00:01 +01:00
Simon Huber
31e7dbf020 Add "preventScroll" option to tm-focus-selector message (#4157)
* add "delayed" option to tm-focus-selector message

this delays the focussing for the time of the animation duration if delayed="yes" or delayed="true"

this is useful when navigating the story river up and down with keyboard shortcuts and the shortcuts focus the title input if a navigated tiddler is in edit mode -> navigation doesn't jump but stays smooth

* Update rootwidget.js

* Update WidgetMessage_ tm-focus-selector.tid

* add preventScroll="true" tip
2019-08-06 13:12:21 +01:00
Simon Huber
e1bb532d98 Fix popups not being cancelled correctly (#4158) 2019-08-04 13:01:24 +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
17711657b6 Add then and else operators
Fixes #4147
2019-08-02 14:27:58 +01:00
Jeremy Ruston
394725f00c Fix edit-bitmap crash with missing tiddlers
Fixes #4141
2019-08-02 09:16:36 +01:00
Simon Huber
fab67a463b Pop storyview: fix bug where targetElement is null (#4143) 2019-08-02 08:51:16 +01:00
Simon Huber
64fe260f4d Fix: correct handling of tc-popup-keep when cancelling ... (#4144)
... popups through focussing inputs
2019-08-02 08:49:06 +01:00
Jeremy Ruston
0a6870656f Fix typo in b5653babd 2019-07-31 21:39:52 +01:00
Bimba Laszlo
b5653babdf Add GitLab saver, apply common lingo to Git savers (#3931)
* Transform GitHub saver to work with GitLab as well

You can choose which provider you want to use, the data is given in the
same place.

I tried to avoid code duplication, so service providers' unique
properties are in separate files, the settings of the selected provider
are loaded.

In two fields I am not sure that it fits into the current structure:

* module-type: gitservice
  Which module is a `gitservice` type, it will be listed in the
  drop-down menu.
* default-api-url: https://gitlab.com/api/v4
  The default URL to access the provider's API.

This is just a sketch, not a final version, suggestions for modification
are welcome!

* Rename saver from GitHub to GitService, update docs

* Split GitHub and GitLab to separate savers, apply common lingo

Sadly, it doesn't seem to make much sense to search for common parts in
the code, because there might be a Git service that is very different
from the GitHub API (such as BitBucket). Therefore, I feel that Git
savers are not able to share other than the translations.

I deleted the defaults values from the translations and set it to the
text entry because they should not depend on the translations.

* Add more information about the password field

It is not clear how to create a personal access token, thus added a link
to the help pages. In addition, GitLab only accepts personal access
token, GitHub also accepts the password, so I made this clear.

* Extract commit message to lingo

* Fix indentation

* Use improved base64 encoder

Fix conflict with a06acc4eb8
2019-07-31 21:38:52 +01:00
Jeremy Ruston
3afaa9de9a Add support for anchored searches 2019-07-31 21:36:12 +01:00
Jeremy Ruston
5faae2547d Add "match" operator for string comparison
Fixes #4130
2019-07-31 09:11:12 +01:00
Jeremy Ruston
7f78065992 Fix unnecessary "list" field creation when renaming tiddlers
Fixes #4120
2019-07-30 17:10:53 +01:00
Simon Huber
0a2d532a7b Fix bug where edit widget input-tag is empty (#4088) 2019-07-30 13:49:05 +01:00
Simon Huber
e669ec098f Fix beyboard widget empty parameters (#4094) 2019-07-30 13:47:56 +01:00
Jeremy Ruston
269fa5313f Fix for index ordering issue
Fixes #4082

This version removes selective updating of the tag index, instead completely clearing the index on each update. I'm investigating restoring that optimisation.
2019-07-28 16:39:34 +01:00
Simon Huber
b30746813b Fix: store noStateReference in popup.js (#4115) 2019-07-26 17:13:53 +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