[TW plugin library] - a gesture library in the TW plugin library?

47 views
Skip to first unread message

Simon Huber

unread,
Feb 16, 2018, 3:36:31 AM2/16/18
to TiddlyWikiDev
Hello TW devs & maintainers,

I'm using the hammer.js library a lot for different widgets or plugins. It provides/handles gestures like swipe, pan, tap, press, rotate and pinch
If one wants to use them, it requires to get the hammer.js library from one of my widgets/plugins
But that's very inconsistent - say I'd like to pack two different plugins all using that library, I'd have to pack the library twice or refer to the library tiddler from one of my plugins, so that they get that, too
This forces to either use two plugins or just one with a part from another

The TW plugin library already includes the JSZip, XMLDOM and async.js wrappers that are used by some plugins, that's why I'd like to ask:

Could the hammer.js library be included like that?

It could be a different library with similar functionality - though I think hammer.js is pretty stable. But I'd be happy to investigate about the best solution


kind regards,
Simon

PMario

unread,
Feb 16, 2018, 5:25:12 AM2/16/18
to tiddly...@googlegroups.com
Hi Simon,

If you have a closer look, how jszip is implemented, you should be able to use the same mechanism.

TiddlyWiki uses the "commonjs" modul loader convention. The hammer.js checks for this mechanims and should do the right things.

So it should be possible to include hammer.js as a library, that can be used similar too: JSZip = require("$:/plugins/tiddlywiki/jszip/jszip.js") .. as in xlsutils. <- click!

There will be some testing needed. But imo this should be a starting point.

-m


Simon Huber

unread,
Feb 16, 2018, 6:10:13 AM2/16/18
to tiddly...@googlegroups.com
Hi Mario,
 

If you have a closer look, how jszip is implemented, you should be able to use the same mechanism.

yes, I use it the same 'require("...hammer.js");' way

TiddlyWiki uses the "commonjs" modul loader convention. The hammer.js checks for this mechanims and should do the right things.

So it should be possible to include hammer.js as a library, that can be used similar too: JSZip = require("$:/plugins/tiddlywiki/jszip/jszip.js") .. as in xlsutils. <- click!

I've seen that the JSZip plugin contains the license, a description and the minified library without further modifications. That would do it in the hammer.js case, too

There will be some testing needed. But imo this should be a starting point.

I'd test it, sure thing! Beyond the starting point, what else is expected from my point?

-m


Simon 

Jeremy Ruston

unread,
Feb 16, 2018, 8:14:06 AM2/16/18
to TiddlyWikiDev
Hi Simon

I would support putting hammer.js in the official plugin library; I’m interested in using it for a future development of the DynaView plugin, for example.

Best wishes

Jeremy.

On 16 Feb 2018, at 11:10, Simon Huber <hypnotize...@gmail.com> wrote:

Hi Mario,
 

If you have a closer look, how jszip is implemented, you should be able to use the same mechanism.

yes, I use it the same 'require("...hammer.js");' way

TiddlyWiki uses the "commonjs" modul loader convention. The hammer.js checks for this mechanims and should do the right things.

So it should be possible to include hammer.js as a library, that can be used similar too: JSZip = require("$:/plugins/tiddlywiki/jszip/jszip.js") .. as in xlsutils. <- click!

I've seen that the JSZip plugin contains the license, a description and the minified library without further modifications. That would do it the hammer.js case, too

There will be some testing needed. But imo this should be a starting point.

I'd test it, sure thing! Beyond the starting point, what else is expected from my point?

-m


Simon 

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/c34debdd-ed0d-42b5-bbb4-c99c3ae0a538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Huber

unread,
Feb 16, 2018, 10:04:22 AM2/16/18
to TiddlyWikiDev
Hi Jeremy,

I made a PR here: https://github.com/Jermolene/TiddlyWiki5/pull/3125, hoping that I did it right

Simon
Reply all
Reply to author
Forward
0 new messages