1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 02:33:15 +00:00
Commit Graph

178 Commits

Author SHA1 Message Date
Simon Huber
66dc7df745
Update popup.js 2019-07-14 09:37:53 +02:00
Simon Huber
ba2f4822dd
Merge branch 'master' into patch-10 2019-07-11 18:19:49 +02:00
Simon Huber
ecbbe87a0d
popup cancelling - use state reference
in the google group there's a discussion: https://groups.google.com/forum/#!topic/tiddlywiki/_mDDZ1jpMgU

buttons allow setting a state-reference for popups but the popup mechanism doesn't respect that
2019-07-11 07:35:06 +02:00
Simon Huber
7811614d53
Update popup.js 2019-07-10 09:55:32 +02:00
Jeremy Ruston
8012a3508f Ensure tiddlyspot saver works with local storage disabled
Fixes #3955
2019-06-08 16:38:13 +01:00
Jermolene
232eba2f7d Http utilities: add xhr object to callback 2019-04-15 21:07:23 +01: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
BurningTreeC
0396af849a Undo #3490 - error in popup-cancelling logic (#3586) 2018-11-29 09:49:11 +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
BurningTreeC
2541b9b090 Pagescroller - get scroll pos in src window (#3561) 2018-11-21 11:32:22 +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
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
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
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
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
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
f98b4d5956 Add more logging for drop operations 2018-09-13 20:42:35 +01:00
Jermolene
7a6213dcbf Update code comment for $tw.utils.http 2018-08-23 13:13:49 +01:00
Jermolene
5a2e87eb09 Extend permalink/permaview to optionally copy URL to the clipboard
Fixes #3255
2018-08-16 19:39:18 +01:00
Jermolene
b55a3102be Fix typo from 8a38685 2018-08-16 16:08:33 +01:00
Jermolene
8a38685de9 Optionally adjust scroll targets to allow for a top menu bar
Fixes #3396
2018-08-16 12:07:50 +01:00
Jermolene
7b9dc7557c Popup manager enhancements 2018-08-09 19:39:58 +01:00
snlhnk
c05c0d3df6 Module-ize server routes, add static file support and other enhancements(#2679)
* Module-ize server routes and add static file support (#2510)

* Refactor server routes to modules

New module type: serverroute

Caveats: Loading order is not deterministic but this would only matter
if two route modules attempted to use the same path regexp (that would
be silly).

* Add static assets plugin

This plugin allows the node server to fetch static assets in the /assets
directory. I felt that this was a feature that goes above the core
functionality. That is why I added it as a plugin. with the modular
route extensions this was a breeze.

* Add serverroute description to ModuleTypes

* Coding standards tweaks

* Fix filename typo

* Move support for attachments from a plugin into the core

* Missing "else"

* Refactor server handling

* Introduce a new named parameter scheme for commands
* Move the SimpleServer class into it's own module
* Deprecate the --server command because of the unwieldy syntax
* Add a new --listen command using the new syntax

For example:

tiddlywiki mywiki --listen host:0.0.0.0 port:8090

* Add check for unknown parameters

* Add support for multiple basic authentication credentials in a CSV file

Beware: Passwords are stored in plain text. If that's a problem, use an authenticating proxy and the trusted header authentication approach.

* Refactor module locations

* Rename "serverroute" module type to "route"

* Remove support for verifying optional named command parameters

The idea was to be able to flag unknown parameter names, but requiring a command to pre-specify all the parameter names makes it harder for (say) the listen command to be extensible so that plugins can add new optional parameters that they handle. (This is particularly in the context of work in progress to encapsulate authenticators into their own modules).

* Refactor the two authenticators into separate modules and add support for authorization

* Correct mistaken path.join vs. path.resolve

See https://stackoverflow.com/a/39836259

* Docs for the named command parameters

I'd be grateful if anyone with sufficient Windows experience could confirm that the note about double quotes in "NamedCommandParameters" is correct.

* Be consistent about lower case parameter names

* Do the right thing when we have a username but no password

With a username parameter but no password parameter we'll attribute edits to that username, but not require authentication.

* Remove obsolete code

* Add support for requiring authentication without restricting the username

* Refactor authorization checks

* Return read_only status in /status response

* Fix two code typos

* Add basic support for detecting readonly status and avoiding write errors

We now have syncadaptors returning  readonly status and avoid attempting to write to the server if it's going to fail

* Add readonly-styles

We hide editing-related buttons in read only mode

I've made this part of the tiddlyweb plugin but I think a case could be made for putting it into the core.

* Add custom request header as CSRF mitigation

By default we require the header X-Requested-With to be set to TiddlyWiki. Can be overriden by setting csrfdisable to "yes"

See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Protecting_REST_Services:_Use_of_Custom_Request_Headers

* Add support for HTTPS

* First pass at a route for serving rendered tiddlers

cc @Drakor

* Tweaks to the single tiddler static view

Adding a simple sidebar

* Switch to "dash" separated parameter names

* Typo

* Docs: Update ServerCommand and ListenCommand

* First pass at docs for the new web server stuff

Writing the docs is turning out to be quite an undertaking, much harder than writing the code!

* Get rid of extraneous paragraphs in static renderings

* Rejig anonymous user handling

Now we can support wikis that are read-only for anonymous access, but allow a user to login for read/write access.

* More docs

Slowly getting there...

* Static tiddler rendering: Fix HTML content in page title

* Docs updates

* Fix server command parameter names

Missed off 30ce7ea

* Docs: Missing quotes

* Avoid inadvertent dependency on Node.js > v9.6.0

The listenOptions parameter of the plain HTTP version of CreateServer was only introduced in v9.6.0

cc @Drakor @pmario

* Typo
2018-07-18 16:54:43 +01:00
BurningTreeC
afe14b47b5 draggable widget: actions on drag-start and drag-end (#3203)
* pass drag-start end drag-end actions to draggable

* Update dragndrop.js

* Update dragndrop.js

* Update dragndrop.js

* Update dragndrop.js

* Update dragndrop.js

* renaming dragstart/dragend -> start/end

* renaming dragstart/dragend -> start/end

* adding docs
2018-04-08 10:29:17 +01:00
Jermolene
1c8170463c Simplify page scrolling behaviour
Fixes #2180
2018-01-30 11:29:07 +00:00
Jermolene
327fed30c8 Mitigate problem with microscropic editor in zoomin view
See #3098
2018-01-23 16:22:35 +00:00
BurningTreeC
42660b05a7 check if dataTransfer is undefined (#3093)
this prevents an error when dragging elements not by mouse where dataTransfer can be undefined
2018-01-20 17:28:10 +00:00
Jermolene
ca43a28d0e Fix copy to clipboard for iOS 10/11 2017-12-17 21:37:29 +00:00
Jermolene
d2ff164c07 Add support for tm-copy-to-clipboard message 2017-12-15 15:08:18 +00:00
Jermolene
1e106a8f3d Better handling of dropeffect 2017-03-28 15:09:36 +01:00
Jermolene
f3cab3753e Don't set draggable property for links 2017-03-28 13:05:00 +01:00
Jermolene
d3fe4f600a Partially fix drag and drop on IE11
These changes allow drag and drop to work with one issue: <a> links are
not draggable; draggable divs, spans, buttons etc. seem to work fine.
There’s some issue with IE11 that I don’t understand.

For testing, you can force links to become spans by changing line 64 of
$:/core/modules/widgets/link.js to:

	var domNode = this.document.createElement("span");
2017-03-27 09:59:40 +01:00
Jermolene
1f860bd04e Fix problem with dragging links 2017-03-23 17:52:15 +00:00
Jermolene
b1ed77d6b8 Switch drag image to use draggable DOM node
We’ll still support dragging pills, but dragging the DOM node image
seems to look better in most situations.
2017-03-23 17:02:26 +00:00
Jermolene
8f1114960a Refactor draggable stuff for easier reuse
And in the process, make the button widget draggable.

Unfortunately, Firefox has a bug that prevents buttons from being
dragged (see https://bugzilla.mozilla.org/show_bug.cgi?id=568313 and
https://bugzilla.mozilla.org/show_bug.cgi?id=646823). So we have to use
the “tag” attribute to make it use a different element.
2017-03-23 14:23:33 +00:00
Jermolene
bea33efd63 Fix problem with dragging text snippets 2017-03-20 22:03:28 +00:00
Jermolene
eba1c3c160 Improve support for drag and drop
Documentation TBD
2017-03-19 19:33:56 +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
8e02bde938 Refinements to 87fa7f972c 2016-10-18 16:39:18 +01:00
Jermolene
f846a004b6 Partial fix for copyStyles problem under Chrome
There’s still a problem: in Chrome, the styling of the textarea
placeholder isn’t correct.
2016-05-17 15:45:10 -06:00
Myeongjin
6388f859d1 Add localisable strings for error (#2447)
* Add localisable strings for error

* Update tiddler Transclusion Basic Usage in fr-FR
2016-05-17 21:58:47 +01:00
Myeongjin
8afc1e9354 Add localisable strings (#2438)
* Add localisable string for recursive transclusion error

* Add localisable string for count

* Add localisable strings for syncer
2016-05-12 08:44:28 -06:00
Jermolene
e54cc7b211 Fix copyStyles() not working in Firefox
Yet more browser incompatibilities to weep over…
2016-05-09 14:11:08 -06:00
Jermolene
3a3754aebb Add rel="noopener noreferrer" to external links
Background:
https://medium.com/@jitbit/target-blank-the-most-underestimated-vulnerab
ility-ever-96e328301f4c#.hduwdbjlb
2016-05-05 11:49:40 +01:00
Jeremy Ruston
2adf09129d Introduce text editor toolbar (#2315)
Tada!
2016-04-22 08:36:29 +01:00
Myeongjin
e6e346ea29 change string 'Close' to lowercase for dialog (#2366) 2016-04-14 23:03:14 +01:00
Myeongjin
c9b0e15201 add localisable strings for dialog 2016-03-28 16:24:55 +09:00
Jermolene
5cc1f2b313 Fix problem with search popup disappearing
This one took quite a lot of tracking down…

Fixes #2172
2016-01-03 18:05:08 +00:00
Jermolene
a204784c0c Limited implementation of external text tiddlers in the browser
Triggered by the discussion in #1917
2015-08-29 16:33:04 +01:00