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

3083 Commits

Author SHA1 Message Date
Jermolene
3a00d2eea3 Allow drag and drop in toolbar layout in control panel 2017-03-20 22:29:03 +00:00
Jermolene
5ed7ade44f Add some handy drag-and-drop macros
And refactor the tag template to use one of them
2017-03-20 22:11:06 +00:00
Jermolene
bea33efd63 Fix problem with dragging text snippets 2017-03-20 22:03:28 +00:00
Jermolene
f4656b0f25 Add support dragging to the bottom of a list 2017-03-20 22:02:55 +00:00
Jermolene
9bad99d14e Draggable: properly stringify tiddler titles
Thanks @twMat
2017-03-20 22:01:51 +00:00
Jermolene
3197f9a639 Add select all/none checkbox to $:/Import
Prompted by this discussion:
https://groups.google.com/d/topic/tiddlywiki/MYBWCxOc_gM/discussion
2017-03-20 22:00:14 +00:00
Jermolene
eba1c3c160 Improve support for drag and drop
Documentation TBD
2017-03-19 19:33:56 +00:00
Jermolene
c2391c5250 Action-deletefield should only update tiddler modified/created if it is changed 2017-03-19 19:30:52 +00:00
Jermolene
39cdaeb34d Fix problem with tracking dragenter/leave events in Firefox
Fixes #686 (hopefully!)
2017-03-17 14:54:30 +00:00
Jermolene
b9fbe12118 More defensive deepFreeze()
IE11 chokes on Object.freeze(undefined)
2017-03-17 14:20:04 +00:00
Jermolene
779e62a30f Add support for JSON files containing a single tiddler
At the moment, we support JSON files containing an array of tiddlers.
With this change the core will import files containing a single
tiddler. Also adding templates for saving individual tiddlers in JSON
format
2017-03-17 14:19:43 +00:00
Jermolene
73e1724fdf Extend $tw.utils.httpRequest() to cope with binary data
The problem was that `this.responseText` crashes for non-text data. We
fix it by letting the client specify which property should be returned.

@ericshulman does this work for you?
2017-03-17 13:41:17 +00:00
Jermolene
66d5e2650e Fix problem with dragger image in Chrome
Fixes #2800
2017-03-12 18:07:59 +00:00
Jermolene
52a414959c wiki.extractTiddlerDataItem() should use caching 2017-02-28 10:23:02 +00:00
Jermolene
b9a835b879 Fix bug with wiki.getTiddlerDataCached()
We need to process the default data outside of the cache function to
ensure that we don’t cache the defaults
2017-02-28 10:23:02 +00:00
Jermolene
d0594e4a45 Rejiggle the license to try to make GitHub recognise it 2017-02-24 13:52:39 +00:00
Jermolene
ad1c2a6571 Fix problem with 'has' operator
Fixes problem introduced in 6085936475
2017-02-23 14:27:43 +00:00
Tobias Beer
88a65f038e Add a "close plugin library" button (#2072)
* provides a "close plugin library" button

* starting from #1718 by @inmysocks
* possibly fixes all of #1718, #1597,  and #2067

* corrected code comment

* add back title

No idea why I overlooked this beforehand.

Next time I will not suggest such changes that have little to do with
the PR, but rather just comment the code.

* ah, sorry, "fixed" wrong spot

now

```
<$action-sendmessage $message="tm-load-plugin-from-library"
url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
```

...should be back at the right spot.

* mhhh... still fixing the mess

load, unload, puh... let's see if I got it now

* added unloadIFrame and minor syntax fixes
2017-02-22 12:15:26 +00:00
Tobias Beer
6085936475 Introduce "field" suffix for "has" filter operator (#2066)
* has:field — tested & documented

allows to test whether a field exists

* fixed inverted condition

* added from version to docs
2017-02-22 12:13:59 +00:00
Jermolene
cd2bc88658 Add "enlist" operator
Fixes #2767
2017-02-21 15:17:47 +00:00
Jermolene
b1ecf81b0c Tentative improvements to highlight plugin problems
We now use highlight.js in raw HTML mode on the server, rather than
trying to use it with the fakedom. This causes problems with fakedoms
inability to get textContent for a node that has been created by
assigning innerHTML. So we extend the fakedom to allow the original
text content to be saved.

See #2778 for discussion.
2017-02-21 13:09:32 +00:00
Jermolene
9fc2086b71 Optimise sameday filter
I used this test:

console.time();for(var t=0; t<200; t++)
{$tw.wiki.filterTiddlers("[all[tiddlers+shadows]sameday[20170210]]");};c
onsole.timeEnd()

Before this patch, I got speeds of approx 190ms, versus 140ms
afterwards.

Note that the ability to add a cache property like this is only
possible because tiddler objects are immutable.
2017-02-21 08:31:05 +00:00
Jermolene
daf703b67f Add support for th-navigating event 2017-02-19 15:47:37 +00:00
Jermolene
0d0ece6377 Add new "fetch" command
Like the load command except retrieves the file over HTTP/HTTPS.

Allows experimentation with server-side twederation

This is a cleaned up version of code that I wrote last year at TWEUM
2016 @inmysocks @pmario @twMat @xcazin
2017-02-18 13:33:41 +00:00
Jermolene
74b0da065e Add logging functions to commander 2017-02-18 13:30:04 +00:00
Jermolene
6f93ce6ea7 Enhance rendertiddler command with support for additional variable
Passing an arbitrary variable allows us to e.g. reuse the export
filters as shown in the example
2017-02-18 13:17:44 +00:00
Jermolene
91b341e8e0 Better error trapping for WebDAV saver
Without these checks we get a startup crash when using TiddlyWiki in
client-server configuration.
2017-02-18 12:12:29 +00:00
FND
6505e6f448 WebDAV file overwrite protection (#2614)
* putSaver: detect edit conflicts to prevent clobbering, if possible

if the server supplies an ETag, we send it back when saving, allowing
the server to detect edit conflicts and respond with 412 (cf.
https://www.w3.org/1999/04/Editing/)

caveats:
* this only kicks in after the first save, as we don't have access to
  the ETag when first loading the document
* there's no recovery mechanism (e.g. resetting `this.etag` in order to
  force clobbering), other than manually reloading the document

* putSaver: retrieve ETag upon initialization for clobbering protection

this addresses one of the caveats from the previous commit
(2d75cb83af) - while theoretically prone
to a race condition, it seems unlikely that saving will be triggered
before the server responds

* putSaver: simplify URI extraction

this simplifies the approach introduced in
f51f6bf774, with the purpose of removing
the fragment identifier

* putSaver: localize error message

* putSaver: switch to built-in HTTP helper

in the process, fixed ETag assignment in `#save` method (was
`this.etag`, now `self.etag`) as well as a syntax error due to a missing
closing brace

* putSaver: consolidate URI handling
2017-02-17 12:26:15 +00:00
Jermolene
3708f6c8e4 Major refactoring of filesystemadaptor
The code here had got a bit broken by some PRs that I should have
checked more carefully. I’ve done a major refactoring which will
hopefully make it easier to understand, and fixes a number of problems:

* Problem with eg .md tiddlers not being deleted correctly
* Problem with Windows path separators not being usable within
$:/config/FileSystemPaths on Windows
* Problem with filename clashes not being detected correctly when
saving to a different directory via $:/config/FileSystemPaths
* Enables slashes within tiddler titles to be mapped into folders
* Enables plain text files like .md and .css to be saved with .meta
files instead of as .tid files (see #2558)
* No longer replaces spaces with underscores

As this is such a major update, I’d be grateful if Node.js users could
give it a careful run through — in particular, you’ll need to try
creating new tiddlers of various types and ensure that the expected
files are created.
2017-02-11 12:56:42 +00:00
Jermolene
97e995e0c7 Add wiki.checkTiddlerText() convenience method 2017-02-09 15:43:28 +00:00
Jermolene
2397f0aa6f Add several new hooks for UI actions 2017-02-09 15:42:55 +00:00
Jermolene
73ded6a82a Add new "count" filter operator
See discussion here:
https://groups.google.com/d/msgid/tiddlywiki/fe51b7f5-5369-493b-82e5-94c
18e863fe0%40googlegroups.com?utm_medium=email&utm_source=footer
2017-02-08 20:11:44 +00:00
Jermolene
9bc523fdef Fix bug in renameTiddler
This operation isn’t used by the core, but is used by the TextSlicer
plugin
2017-02-08 20:04:36 +00:00
Jermolene
ef1c47c3aa Fix accidental wikilinking 2017-02-05 19:58:58 +00:00
Jermolene
db056a84a5 Remove obsolete code 2017-02-04 18:14:20 +00:00
Jermolene
6c65aa2a6d Make the syncer more configurable, including names for sync adaptors
@danielo515 you may want to add a name to your sync adaptor 😄
2017-02-04 17:25:30 +00:00
Jermolene
ced9f315a1 Rename variable for clarity
It’s called an iterator in filter.js
2017-02-04 17:24:25 +00:00
Jermolene
b5059c612a Adds support for autosave with the download saver
Also does some reorganisation of control panel to move “saving” related
settings together, and expose a UI for savers to plug into.

Fixes #2741
2017-01-30 18:19:28 +00:00
Jermolene
56b6781715 Fixes to license visibility
Credits to @cdent - is 2012 right, or did your work there carry on into
2013?

Addresses part of #2378
2017-01-29 21:11:30 +00:00
Tobias Beer
1b339e17bc Add "tag" attribute to keyboard widget (#2593)
* allows to define the tag for keyboard widget

* added from 5.1.14 to docs
2017-01-13 11:17:19 -07:00
Tobias Beer
d4db283d61 Refresh simple editor when empty text, e.g. hitting ENTER (#2702)
fixes #2592, missing bit of deleting the field for adding a new tag in
edit-mode

also fix for:
https://groups.google.com/forum/?fromgroups=#!topic/tiddlywiki/L6Z7gSvBWjw
2017-01-09 10:31:40 +00:00
Jermolene
56131e4563 It's 2017!
🥂🍾
c.f. 665d6657bb
2017-01-03 13:31:22 +00:00
Thomas Elmiger
79ae3f8cb7 Replacement icon for timestamp on/off (#2692)
* Replacement icon stopwatch on

As discussed in issue #2690

* Replacement icon stopwatch off

As discussed in issue #2690
2017-01-02 17:38:32 +00:00
Jermolene
0c2734f181 Tweak wording of exporting story list 2016-12-30 17:43:35 +00:00
Marxsal
b1a5afbf15 Add an entry to the filter drop down for exporting the current story (minus advanced search) (#2670) 2016-12-30 17:42:23 +00:00
Jermolene
ab1b1f2cde Fix problem with beaker saver and default index pages
As discussed on the mailing list, we need to check for a URL that is
missing the default `/index.html`

https://groups.google.com/d/msg/tiddlywikidev/n6yUdu2zHWo/m32R2BuIDgAJ
2016-12-29 16:45:47 +00:00
Jermolene
0383b98555 Add support for other movie content types 2016-12-23 08:34:07 +00:00
Jermolene
f143164cbe Correct the name of the video parser 2016-12-22 22:07:28 +00:00
Jermolene
ba9d6187af Rename the dat saver to Beaker
It’s actually specific to the API provided by the Beaker browser, and
not a generic Dat saver
2016-12-22 08:15:16 +00:00
Jermolene
a20da9f530 Add preliminary Dat file saver
See https://datproject.org/ and https://beakerbrowser.com/
2016-12-21 12:09:08 +00:00
Tobias Beer
15c7d24eaa Allows adding a new tag name by typing enter (#2592)
* allows to add a new tagname hitting enter

see: https://groups.google.com/forum/#!topic/tiddlywiki/wqQ8jPYG-X4

* revert changes to vanilla/base

* added "Special Keys" to KeyboardShortcuts

* added info to Creating and editing tiddlers

did not add current version of <<.from-version "5.1.14">>  because it
would interrupt the flow. When changed from a noisy "New in 5.1.14" to
"(new in 5.1.14)" we might add the version info here

* revert setText & added inline styles to vanilla base

* remove fieldmangler

* commit initial edittemplate tags to merge master

* ok, now really revert to initial edittemplate tags

* move add tag via enter into tag-picker macro(s)
2016-12-18 20:43:26 +00:00
Mario Pietsch
e1053bf014 Toc recursion protection (#2650)
* add recursion protection first take

* fix problem with selectable expand

* ust path for toc-state variable instead of tag

* reactivate disabled macro call.
2016-12-17 15:29:03 +00:00
Arlen22
66a13cb915 TiddlyFox saver canSave() should always return true (#2626)
Whether saving is allowed should be determined by the parent side of the TiddlyFox, as this plugin can be used in many places.
2016-12-17 15:27:25 +00:00
Arlen22
1530b3e2d8 Put request handler on SimpleServer.prototype (#2627)
The request handler may be used by ExpressJS apps directly and can do most of the heavy lifting without any modification. Note that the self variable must be assignee using `[Function].bind(null,SimpleServer instance)`.
2016-12-17 15:06:10 +00:00
Tobias Beer
e5b432a86b Allows checkbox widget to worth with indexes within data tiddlers (#2103) 2016-12-17 11:59:59 +00:00
Tobias Beer
d6d3aab36a Allow radio widget to work with indexes in a data tiddler (#2104)
* allow radio widget to set an index in a data tiddler

* updated RadioWidget docs, with same demo macro as for CheckboxWidget
in #2103
* removed docs in widget code (seems the wrong place)

* added from version to docs

* revert doc maros to master

* using wikitext-example-without-html and .tip macro now

* fix quotes
2016-12-17 11:51:24 +00:00
Matt Lauber
9c3a6976f0 #2312 Prevent move filter from wrapping (#2658)
given a list `A B C D` if I run `A B C D +[move:-1 [A]]` I get `B C A D`.  However, if I were to do `A B C D +[move:1[D]]` it doesn't wrap around, and I get `A B C D`.  This fixes that such that `A B C D +[move:-1 [A]]` gives 'A B C D`
2016-12-16 17:58:45 +00:00
Jermolene
28591965b1 Yet more refactoring of the tag macro vs template
This change re-instates the existing behaviour whereby omitting the
parameter to the “tag” macro will default to the current tiddler
2016-12-16 17:25:06 +00:00
Jermolene
e8bb897e26 Add support for relinking when renaming tiddlers
When renaming an existing tiddler, the edit template now shows a
checkbox that determines whether or not to relink references to the
tiddler in the list or tags fields of other tiddlers.
2016-12-15 17:13:32 +00:00
Jermolene
1bba9dc315 Reuse $tw.loadTiddlersFromPath() in --load command
Thus allowing things like tiddlywiki.files to be used with the —load
command
2016-12-15 17:13:32 +00:00
Jermolene
74def9e080 Separate the PDF parser from the image parser
It was a bit of a hack, and made it harder to customise PDF presentation
2016-12-15 17:13:32 +00:00
Mario Pietsch
b43b89f44a fix for 2634 problems with week calculation 2016-11-29 17:31:54 +01:00
Jermolene
12ecb1fd08 Fix multids formatting 2016-11-29 10:29:32 +00:00
Jermolene
16bb65d17f Introduce tiddler manager 2016-11-29 08:36:07 +00:00
Jermolene
f07e0f981a Refactor tag template into an underlying macro
By refactoring the innards of the tag template into global macros, we
make it easier to re-use elements of the tag template
2016-11-28 19:17:25 +00:00
Jermolene
9a38642141 Add new "order" filter operator 2016-11-28 19:16:08 +00:00
Jermolene
a3dc3b4b98 Add new [all[tags]] filter operator 2016-11-28 19:04:04 +00:00
Jermolene
c02c3a06e0 Sort the edit content type dropdown groups more sensibly
Now we put the developer stuff at the bottom instead of the top…
2016-11-28 14:01:09 +00:00
Jermolene
cf28eeb2a1 Fix problem with checkbox widget and empty strings
If the value of `tiddler.fields[this.checkboxField]` was an empty
string then it would incorrectly fall back to the value of
`this.checkboxDefault`.
2016-11-28 13:45:41 +00:00
Jermolene
b759d82f4c @pmario's fix for #2635
This got reverted due to my git inabilities
2016-11-28 13:43:43 +00:00
Jermolene
c65d08240b Add strict mode to tag operator 2016-11-28 13:42:30 +00:00
Jermolene
c460cc03a4 Change "is" filter with blank operand to pass through arguments 2016-11-28 13:42:06 +00:00
Jeremy Ruston
a9b54d6fce Revert "Add provisional version of new tagger manager" 2016-11-28 10:40:55 +00:00
Jeremy Ruston
a85d034015 Merge pull request #2637: Introduce tiddler manager
Introduce tiddler manager
2016-11-28 10:28:12 +00:00
Jermolene
96708ecf65 Manager styling tweaks
* Make expand/collapse state be global across all tiddlers
* Remove “Show raw text” option, now that we’ve got the two expandable
areas for raw and wikified text
* Hide raw text by default
* Accentuate currently open tiddler
2016-11-28 10:01:30 +00:00
Jermolene
f67777161d Make manager sections be expandable 2016-11-27 23:04:54 +00:00
Jermolene
251619189e Add indentation to the manager 2016-11-27 22:35:04 +00:00
Jermolene
117bf0a0de Refactor the sidebar items into separate tiddlers
With some better styling too
2016-11-27 22:34:46 +00:00
Jermolene
e5af022bd3 Add image-picker-dropdown macro
Still need to add a way to select system images (like in the image
dropdown in tag manager)
2016-11-27 22:34:19 +00:00
Mario Pietsch
766bc7acee Fix for #2634 problem with week calculations (#2635) 2016-11-27 17:33:19 +00:00
Jermolene
b00c1c7290 Add select box for displaying tags vs. tiddlers 2016-11-27 14:52:39 +00:00
Jermolene
8e033eb0d4 Add new "all[tags]" filter operator 2016-11-27 14:52:04 +00:00
Jermolene
0b4669621a Return all tiddlers when "is" filter operand is missing 2016-11-27 14:51:51 +00:00
Jermolene
1a2ec12831 Fix problem with checkbox widget and empty strings
If the value of `tiddler.fields[this.checkboxField]` was an empty
string then it would incorrectly fall back to the value of
`this.checkboxDefault`.
2016-11-27 14:51:23 +00:00
Jermolene
9418538104 Separate the tag manager and tagger into separate tiddlers
As discussed in Hangout-101: https://www.youtube.com/watch?v=nXwCm794O6M
2016-11-27 13:53:42 +00:00
Jermolene
e98d324e66 Add provisional version of new tagger manager
For discussion
2016-11-26 12:48:47 +00:00
Jermolene
3bceb98119 Add support for actions attribute to CheckboxWidget 2016-11-26 08:21:58 +00:00
Jermolene
d1121787c0 Add new button to temporarily suspend timestamps
Useful when you want to make an edit but preserve the modification
date/time.
2016-11-23 18:20:31 +00:00
Jermolene
b3273bcbda Add "sticky" mode for tiddler info panel
A new option in control panel to cause the info panel to stay open
until it is explicitly closed
2016-11-23 18:17:54 +00:00
Jermolene
c8f7573a23 Make fakedom more resilient to non-string data 2016-11-22 20:24:59 +00:00
Jermolene
8d35178bc4 Undo 664225f6fd and 56640b90bb
See the discussion at #2628
2016-10-26 21:41:41 +01:00
Jermolene
56640b90bb Fix issue with tabs macro introduced by fix for #2628
I’m fixing this now to show how the tabs macro can be changed to
accommodate the change, but we may yet decide to reverse out the change
in order to maintain backwards compatibility.

One problem with changes like this is that there’s no easy way to find
out where it impacts the core UI. The tabs macro is now fixed, but
perhaps there’s more obscure things that are still broken in the core.

If we do opt to reverse the change to preserve backwards compatibility,
we could add a way to explicitly trigger the new behaviour. For
example, a new attribute `updateState=“yes”`.

Yet another alternative is to make completely new alternative to the
list widget with revised semantics, that authors can opt-in to. For
example `<$loop>`. (There was another issue we discussed a year or two
ago about adding support for an index variable which may be a candidate
for fixing at the same time).
2016-10-25 22:30:02 +01:00
Jermolene
664225f6fd Ensure list widget item title is used in getStateQualifier
Resolves a longstanding problem where the same state qualifier is
generated for every member of a list.

Fixes #2628
2016-10-25 15:34:20 +01:00
Jermolene
7108e0d861 Add support for filtered attributes to HTML elements and widgets
Fixes #2624
2016-10-21 11:27:07 +01:00
Jermolene
c72a0b7a67 Add action-createtiddler widget
Basically the same as sending a tm-new-tiddler message except that the
newly created tiddler is not added to the story.
2016-10-21 11:26:26 +01:00
Jermolene
0b76c327c2 Add page print button
cc @silvyn
2016-10-20 09:44:52 +01:00
Jermolene
a292a2be44 Add copy to clipboard icon 2016-10-19 14:57:19 +01:00
Jermolene
8e02bde938 Refinements to 87fa7f972c 2016-10-18 16:39:18 +01:00
Jermolene
7a6d7e2a15 Refactor user interface for plugin tiddlers
* Refactored control panel “Plugins” tab to make the elements more
reusable
* Refactored the display of plugin tiddlers to use the same format as
the control panel (as suggested, I think by @danielo515), adding the
shadow tiddler listing as an overridable extension tab
* Added a new tab in the “More” sidebar providing quick access to all
installed plugins
2016-10-18 09:23:19 +01:00
Jermolene
87fa7f972c Ensure global macros are available in modals and notifications 2016-10-18 09:18:56 +01:00