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

2290 Commits

Author SHA1 Message Date
Jermolene
37ea659bf0 Refactor the dumpvariables macro as wikitext
Making it easier to customise
2019-03-30 10:52:49 +00:00
Jermolene
754c1251a9 Add new "variables" and "getvariables" operators 2019-03-30 10:52:28 +00:00
jed
b1edcdb757 Add unusedtitle macro (#3880)
* Add uniquetitle macro

This macro is a wrapper on the $tw.wiki.generateNewTitle function to return a unique name, it has been requested multiple times in the forums.

* Add documentation tiddler for uniquetitle macro

* Add uniquetitle macro examples

* Change name from uniquetitle to unusedtitle for clarity

The title isn't unique, just not currently used in the wiki.

* Update uniquetitle to unusedtitle

* Change uniquetitle to unusedtitle

* Fix a typo
2019-03-26 21:57:58 +00: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
784db30614 Fix removesuffix filter when title is undefined (#3827) 2019-03-11 09:37:49 +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
Simon Huber
441011885c Fix: tm-full-screen when event.event undefined (#3835) 2019-03-09 17:09:34 +00:00
Jermolene
12630d4a91 Provide an option for the load command to not error if no tiddlers are found 2019-03-08 16:43:04 +00:00
Jermolene
e61c71961b Fix default language
It is supposed to be the built-in core language, en-GB
2019-03-07 18:46:24 +00:00
Jermolene
2c2d03f7a7 Refactor startup action execution so that they can switch language/theme 2019-03-07 18:43:23 +00:00
Jermolene
c036c22826 Add $:/info/browser/language to the info mechanism 2019-03-07 18:42:49 +00:00
Jermolene
0c2689dd78 SaverHandler: Don't generate file if autosave disabled 2019-03-05 15:43:14 +00:00
Jermolene
348a0bc8bc Core: Allow startup navigation to be suppressed
Plugins can suppress it so that they can provide their own startup scroll handling
2019-03-04 16:59:15 +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
Jermolene
655fc31cee Server: Avoid displaying "undefined" for missing path prefix 2019-03-01 18:28:51 +00:00
Jermolene
18c00c2ef0 Don't allow $:/Import tiddler to be imported 2019-03-01 17:39:42 +00:00
Jermolene
b862348b06 Fix !is[variable] operator
Fixes #3804
2019-02-28 11:54:04 +00:00
Jermolene
36e76429b1 Add is[variable] filter
See discussion here https://groups.google.com/d/topic/tiddlywiki/4rEuAWc4EpM/discussion
2019-02-25 13:08:22 +00:00
Jermolene
810033bd71 Server: include path-prefix in display URL 2019-02-12 18:32:00 +00:00
Jermolene
72f2a94251 Ensure things work when $:/config/AnimationDuration is blank or not a valid number
Thanks @jdjdjdjdjdjd
2019-02-12 12:14:55 +00: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
9d7d3fefa0 Split operator: Remove empty strings when splitting
See the discussion on 9b2d527; thanks @kookma
2019-02-08 15:59:07 +00:00
Jermolene
6ff7a7d261 BrowserStorage: Make sure tiddlers loaded from local storage mark wiki as dirty
Thanks @xcazin
2019-02-08 15:38:23 +00:00
Jermolene
7df58a6813 Fixed bug with length operator
Thanks @BurningTreeC
2019-02-07 12:56:12 +00:00
Jermolene
dc29acd656 Fixed bug with split operator 2019-02-07 12:45:07 +00:00
Jermolene
9b2d52716a Add new string operators: length, join, split, concat etc. 2019-02-07 11:18:53 +00:00
Jermolene
64b665e706 More maths operators 2019-02-07 11:18:32 +00:00
Jermolene
0ea00b59b0 Add numeric maths filter operators
There are other ways we could add maths to TW5 (including @EvanBalster's awesome https://github.com/EvanBalster/TiddlyWikiFormula) but the approach here has the merit of simplicity because it reuses the existing filter evaluation mechanism. That means that it's not ordinary "2+2" maths, it's a unique list processing language...

Docs to come

Fixes #254
2019-02-06 14:19:55 +00:00
Simon Huber
5e9fc661a9 Tentative: Remove conditional from wrap-selection text-operation (#3749)
As per the discussion in #3749, the original purpose of the removed condition is unknown, and so we cannot be certain that removing it is safe, but doing so seems the best way of discovering more...
2019-02-05 17:18:20 +00:00
Jermolene
e5f3301c1c Merge branch 'pr/3634' 2019-02-05 16:21:06 +00:00
Jermolene
44c66b98a9 Add default prefix for tm-fold-all-tiddlers message 2019-02-05 16:01:24 +00:00
Jermolene
689e172e79 Move some utility functions into boot.js
So that they are available to code running earlier in the boot process
2019-02-03 12:01:38 +00:00
Simon Huber
4228c3f9cc Fix bug in reveal widget when stateTitle tiddler is missing (#3745)
in the group this bug was reported

when the stateTitle is missing it tries to get a field string of an undefined tiddler ...
2019-02-01 16:53:29 +00:00
Jermolene
b6d901f888 Innerwiki: Add support for SVG overlays 2019-01-28 18:21:24 +00:00
Moritz Ulrich
049244e8a8 WebServer: Enable deflate and gzip compression (#3677)
* get-index: Enable deflate and gzip compression

* Spaces -> Tabs

* listen: Add optional `gzip=yes` parameter (defaults to "no")

* get-index: Add comment explaining the usage of `zlib.*Sync` instead of async.
2019-01-27 16:23:24 +00:00
Simon Huber
95dbdff08a Fix bug with event.event.target being undefined (#3683) 2019-01-14 09:41:19 +00:00
Jermolene
e14e69bedc DynaView plugin: add optional scroll position preservation 2019-01-11 17:50:52 +00:00
Rob Hoelz
d8b291bc04 Fix search method for search tokens spread across fields (#3641)
* Fix search method for search tokens spread across fields

Addresses GH #3636, which reports that if you're searching for "test
body", and "test" only appears in the title field, and "body" only appears
in the text field, 5.1.18's search method won't yield that tiddler as a
result, which appears to be a regression from the 5.1.17 behavior

* Add test for searching for multiple tokens across fields

Verifies GH #3636:

> If I create a tiddler in the empty edition with the title "Test tiddler" and content "Body content", searching the wiki for "test body" yields no results under either "title matches" or "all matches". Searching for either word individually turns up "Test tiddler", and repeating this in an empty wiki I created from the 5.1.17 tag causes "Test tiddler" to show up under "all matches".
2018-12-17 11:19:48 +00:00
BurningTreeC
d5ac2ee49e Bugfix button widget: popupTitle refresh (#3650) 2018-12-17 10:52:20 +00:00
Jermolene
42cf077639 Fix basic authentication forced login
Fixes #3647
2018-12-16 18:20:33 +00:00
bimlas
18ed2faf82 Implement in $:/core/upgraders instead of navigator.js
The core module tiddlers are not blocked, they are only marked.
2018-12-10 23:05:41 +01:00
bimlas
38b088eabf Warn when importing core tiddlers
See https://groups.google.com/d/msg/tiddlywiki/YZlPGP0qX1o/3tUpyoHXDgAJ
2018-12-10 09:20:58 +01:00
BurningTreeC
ad799dbb61 Revert setting styles in framed.js (#3614)
this sets the framed-editor styles to 5.1.17 state
2018-12-03 08:55:16 +00:00
BurningTreeC
31e88dd2c6 Revert "remove unnecessary border-radius already set on the iframe" (#3613)
* Revert "v5.1.18 banner artwork"

This reverts commit 70500140b9.

* Revert "Revert #3607 and #3608"

This reverts commit 87b3e470c2.

* Revert "Fix default global keyboard shortcuts for Mac"

This reverts commit e466f62e7e.

* Revert "Comment plugin: Improve styles"

This reverts commit e17456e3bc.

* Revert "Style tweaks for framed editor + preview (#3608)"

This reverts commit c058378da0.

* Revert "Change to natural counting in range[N] operator (#3609)"

This reverts commit b9df224f99.

* Revert "Update release note contributors list"

This reverts commit 0f3912ba95.

* Revert "Make editor-preview not hide text-editor shadow (#3607)"

This reverts commit 11f02dc362.

* Revert "Editor needs to stand out a bit more (#3606)"

This reverts commit d711ef25ed.

* Revert "Tweak for keyboard-shortcuts how-to (#3605)"

This reverts commit 419ea9a243.

* Revert "Remove unnecessary border-radius already set on the iframe (#3604)"

This reverts commit 288d25e733.
2018-12-03 08:51:50 +00:00
Jermolene
87b3e470c2 Revert #3607 and #3608
Hi @BurningTreeC apologies I merged these without properly looking at them, but I think we should move them to 5.1.19 because:

* On Chrome, the new version hides the resize handle on textarea, which can be quite useful
* It's visually quite different, and I think might benefit from more discussion
* It's inconsistent with the CodeMirror editor

Would you mind perhaps starting another PR for edit template enhancements?
2018-12-02 20:57:13 +00:00
BurningTreeC
c058378da0 Style tweaks for framed editor + preview (#3608)
* remove border: none for iframe from framed.js

... inherits the iframe border 1px solid editor-border in vanilla base

* last style tweaks for editor-preview

same border-radius as framed editor

same additional space at the right as at the left

* Update base.tid

* Update base.tid

* looks actually better with this border
2018-12-02 08:40:11 +00:00
Evan Balster
b9df224f99 Change to natural counting in range[N] operator (#3609)
* Add range operator and documentation

* Use 1-based counting in range[N], update docs
2018-12-02 08:39:28 +00:00
BurningTreeC
288d25e733 Remove unnecessary border-radius already set on the iframe (#3604) 2018-12-01 15:31:34 +00:00
BurningTreeC
6e59d2597a Style the framed editor (#3596)
* style the framed editor

this makes the framed editor look a bit less ugly 😎

* Update framed.js

* Update base.tid

* Update base.tid
2018-12-01 14:21:43 +00:00
Andreas Hahn
2bf6203cf5 Improvements to the static single tiddler view as well as documentation. (#3386)
* Improvements to the static single tiddler view as well as documentation.

* Fixed tabs

* Fixed tabs

* Revert static view path

* Documentation updates
2018-12-01 13:30:00 +00:00
Arlen22
603c564872 Add the "tiddlywiki" argument to the server start hook (#3592)
* Update Hook__th-server-command-post-start.tid

* Update server.js

* Update listen.js
2018-11-29 09:51:11 +00:00
BurningTreeC
0396af849a Undo #3490 - error in popup-cancelling logic (#3586) 2018-11-29 09:49:11 +00:00
Mario Pietsch
42f7c03824 tm-open-external-window plus documentation. (#2721)
* first try - tm-open-external-window plus documentation.

* render examples and make help link a global variable
2018-11-27 18:43:25 +00:00
BurningTreeC
8542ebaecb Fix $tw.platform.isLinux on latest firefox (#3495) 2018-11-25 10:51:42 +00:00
Rob Hoelz
09ea59240a Cancel non-ancestor popups when showing a new popup (#3490)
Addresses GH #3484

As far as I can tell, the popup level checks in this module are
meant to handle nested popups.  It seems to me that the goal is
for at most a single hierarchy of popups to exist at any given time
- bearing that in mind, this change checks any popups currently tracked
by the module, canceling any that don't share an element hierarchy with
the new popup.
2018-11-25 10:42:21 +00:00
Jermolene
a83cd3f984 Change logic of tv-hide-missing-links to tv-show-missing-links
See https://github.com/Jermolene/TiddlyWiki5/pull/3530#issuecomment-441368922
2018-11-24 15:53:39 +00:00
BurningTreeC
3f91d5b3a1 Add tv-override-missing-links to fix links to missing tiddlers (#3530)
* add tv-override-missing-links variable

this lets us set `tv-override-missing-links` true so that we can fix edge cases like the `Filter` dropdown in the `Advanced Search` when `enable missing links` is unchecked in the `Settings` tab of the Control Panel

* add tv-override-missing-links to filter dropdown

* add tv-override-missing-links to type dropdown

* add tv-override-missing-links to fieldname dropd

* add tv-override-missing-links to TagManager(icons)

* undo tv-override-missing-links TagManager

not needed here

* Update link.js

* Update dropdown.tid

* Update fields.tid

* Update type.tid

* Update dropdown.tid

* Update link.js

* simplify all together

* add tv-hide-missing-links to pagetemplate

* do we need to refresh here...

... if the variable gets set on top of the pagetemplate?
2018-11-24 13:36:48 +00:00
BurningTreeC
2541b9b090 Pagescroller - get scroll pos in src window (#3561) 2018-11-21 11:32:22 +00:00
Jeremy Ruston
09330968cc
New "else" prefix for filters (#3558)
* Experimental "else" prefix for filters

See #3557

* Docs updates for "else" filter runs
2018-11-20 13:29:44 +00:00
BurningTreeC
7729649f0e Fix bad function declaration in wiki.js (#3559)
fix for #3555 - inner function declaration should be on top of its "host" function

error originally appeared on firefox v38.0.5
2018-11-20 11:50:12 +00:00
BurningTreeC
33ba69e852 Modals: Display in source-window (#3539)
* Make modals display in source Window

this makes modals display within the window where they got opened, with the parameter `rootwindow` that, if `yes` or `true`, shows the modal always in the root TW window (`<$action-sendmessage $message="tm-modal" $param="mymodal" rootwindow="yes|true"/>`)

* pass the full event to $tw.modal.display

we need the event there to find `srcDocument` and `srcWindow`

* pass event in options object

* update modal.js to use options.event

* add docs for rootwindow tm-modal attribute
2018-11-18 20:57:04 +00:00
Jermolene
3aae643e14 Reveal widget with lazily loaded state tiddlers
Fixes #3476
2018-11-18 19:31:53 +00:00
BurningTreeC
849844be12 Add stateTitle stateField stateIndex attributes (#3529)
* make triggerPopup optionally set state directly

* update button widget for new state attributes

* update reveal widget for new state attributes

* fix errors in button widget
2018-11-18 19:16:46 +00:00
Jeremy Ruston
33dd367a65
Introduce new subfilter operator (#3508) 2018-11-16 11:27:19 +00:00
BurningTreeC
9752531b61 FIX for keyboard widget keyInfoArray (#3544)
apologies
2018-11-15 21:40:27 +00:00
BurningTreeC
43c8a0f485 Keyboard Widget: refresh keyInfoArray (#3541)
this makes a keyboard widget update its keyInfoArray if its key has the `((descriptor))` format and one of the platform-specific configuration tiddlers with that descriptor-suffix changes
2018-11-15 16:50:23 +00:00
BurningTreeC
4f7297645d Fix action-navigate widget for undefined event (#3542)
we need to prevent the event from being undefined which happens when using `action-navigate` within a global keyboard shortcut
2018-11-15 16:49:41 +00:00
BurningTreeC
0ff96f9caf [pagescroller] add callback function option (#3473)
this allows using the pagescroller for scrolling elements into view where the rect gets calculated somewhere else

Example: CodeMirror has the `cm.cursorCoords()` function that returns the rect of the textselection (or cursor coordinates)

this scrolls the cursor or text selection into view using tiddlywikis pagescroller:

`$tw.pageScroller.scrollIntoView(undefined, function() { return self.cm.cursorCoords(true,"window"); });`
2018-11-15 14:58:32 +00:00
BurningTreeC
c82edbe6bc New window: add missing click listener for popups (#3538)
this adds a click listener to new windows which enables us to cancel popups by clicking
2018-11-13 18:08:54 +00:00
BurningTreeC
55b5b6dd56 PageScroller: scroll in new windows (#3537)
* make pageScroller work in new windows

* update getScrollPosition to work for new windows

* Update dom.js
2018-11-13 18:07:55 +00:00
Jermolene
4f8e32a647 Change qualify widget parameter name to match qualify macro 2018-11-06 16:41:18 +00:00
BurningTreeC
4d1127ed5b Fix tc-adjust-top-of-scroll (#3475)
* correct scrolling with tc-adjust-top-of-scroll

not multiplying `offset` with t causes jumps at the first animation steps, where the offset value is bigger than `endY - scrollPosition.y`

* correct scroll offset
2018-11-06 16:23:46 +00:00
Jermolene
d7914e3f3e Merge branch 'master' of https://github.com/Jermolene/TiddlyWiki5 2018-11-06 15:29:16 +00:00
Jermolene
698224556e Avoid wikify widget in TOC macro
Fixing the most egregious problem from #3517

@pmario can you kindly retest?
2018-11-06 15:29:13 +00:00
BurningTreeC
aeaf5ee5b6 FIX "Observe openLinkFromOutsideRiver ..." (#3516)
I assumed the attribute to be available but it's not
2018-11-06 14:33:41 +00:00
BurningTreeC
97b098b059 Observe openLinkFromOutsideRiver when creating new tiddlers (#3514) 2018-11-06 13:55:18 +00:00
BurningTreeC
457f03798c Fix error opening new windows with popup-blocker (#3515)
this prevents errors when a popup blocker blocks opening a new window from within a running TW
2018-11-06 13:54:00 +00:00
BurningTreeC
3592333cb8 Add support for global keyboard shortcuts (#3493)
* changes for global keyboardshortcuts

* add keyboard.js startup module

* remove not existing "th-opening-window" hook

* correct title

* use utils.addEventListeners

* define platform lookup-names on startup

* use the startup-lookup-names array

* use the platform-specific lookupNames only

* Update keyboard.js

* move initializations to the constructor

* move initializations to the constructor

* rename hasAnyTiddlerChanged

* don't explicitely create new RegExp

* use $tw.utils.hopArray

* match strings, no regex

* remove hopArray, move to boot.js

* add $tw.utils.hopArray to boot.js

* style update

* style updates

* move more to keyboardManager module

this could probably be moved to rootwidget.js

* move more to keyboardManager module

* add event listener for shortcuts in new windows

* prevent error when opening window is blocked

* add keydown listener on document in startup.js

* delete startup/keyboard.js

* add missing this.shortcutTiddlers

* Update keyboard.js

* Update boot.js

* add exports.hopArray to utils.js

* minor codingstyle tweak

* change how lookupnames get pushed to array

* Update windows.js

* re-add shortcuts-listener for new windows

I removed this before which I think was because I misunderstood what exactly should go to a separate PR
2018-11-06 13:34:51 +00:00
Jermolene
b584295831 Fix crash with search operator with blank field list 2018-11-01 12:56:56 +00:00
Jeremy Ruston
6dcdc2049a
Enhance search operator (#3502)
* Enhance search operator

* Add support for searching all fields

and also searching all fields except nominated fields.

* Docs tweaks

Thanks @pmario

* Error message improvements

* Improve error message formatting
2018-10-30 17:39:18 +00:00
Yurii Rashkovskii
c0c1b557eb Problem: revealed dropdown menu on mobiles (#3491)
On mobile phones, tiddler's dropdown menu stays partially off-screen.

Solution: ensure that the revealed coordinates are never negative

Closes #3486
2018-10-21 16:53:45 +01:00
Jermolene
6b03ba9876 Syncer: support configurable polling interval 2018-10-19 16:32:23 +01:00
Jermolene
d50e2df57b Syncer: fix problem with incoming tiddlers
The bug here is that incoming tiddlers (ie tiddlers that were updated on the server and synced back to the browser) will retain any fields that are currently present but deleted in the incoming tiddler
2018-10-14 15:35:26 +01:00
Jermolene
9c849eb10a WebServer - change /login-basic route to /login/basic
To avoid clashing with tiddlers called "login-basic" :)

We also need to revise the rout for /status for the same reason, but there are backward compatibility issues there
2018-10-13 17:22:21 +01:00
Cameron Fischer
d8007386cf Fix issues with ordering of tagged items (#3301)
* Added better handling for sortByList manual placements

If manual placement specifications show up in an inconvenient order,
sortByList, will go to the trouble of processing them in that order.

* Added tests to confirm solution to (#3296)

...That custom tag ordering will not choke when tiddlers get sorted after their dependencies have been placed around them

* Corrected list-after bug when referencing external titles

* Using more error-proof $tw.utils.hop in sortByList

* minor indentation correction in test-tags.js
2018-10-07 12:15:33 +01:00
BurningTreeC
5dcdff4b37 Fix scrolling with tc-adjust-top-of-scroll (#3467)
not multiplying `offset` with t causes jumps at the first animation steps, where the offset value is bigger than `endY - scrollPosition.y`
2018-10-07 10:23:41 +01:00
Jermolene
83a245ed21 Refactor utility for converting tiddlers to JSON 2018-10-01 11:27:45 +01:00
Jermolene
fe85845c3c Add new "\import" pragma 2018-09-28 16:01:32 +01:00
Jermolene
cfb2d7c9c8 Add support for splash screens during loading
Fixes #3417

Addresses some of the requirements discussed in #2254
2018-09-27 09:47:55 +01:00
Jermolene
7368cc74e1 Remove inadvertant usage of Object.assign
In order to retain compatibiltiy with IE11

See this discussion: https://groups.google.com/d/topic/tiddlywiki/RjA7_mee5oc/discussion
2018-09-21 10:56:01 +01:00
Jermolene
f98b4d5956 Add more logging for drop operations 2018-09-13 20:42:35 +01:00
Jermolene
874318091e Fix crash with illegal arguments to decodeuri(component)
Fixes #3428
2018-09-09 20:48:53 +01:00
Jermolene
e237d8fa97 Transliterate servername to safe ASCII
Fixes #3410
2018-08-24 14:33:31 +01:00
Jermolene
0f7ce7b67f Refactor navigator widget to use story utility to manipulate the storylist as well as the historylist 2018-08-23 18:31:48 +01:00
Jermolene
7dbe117bc5 Add username (if set) to the title of draft tiddlers
Makes things a bit easier to follow when working in multiuser environments.

@inmysocks, @danielo515, @arlen22, @pmario, @drakor does this make sense for your use cases?
2018-08-23 17:43:06 +01:00
Jermolene
7a6213dcbf Update code comment for $tw.utils.http 2018-08-23 13:13:49 +01:00