Code Monkey home page Code Monkey logo

tw5-extendedit's Introduction

TW5-extendedit

Plugin to extend the editor of TiddlyWiki5 with 'link completion'.

NEW ⚡ can use mouse click or touch to select a completion option

Try it at http://snowgoon88.github.io/TW5-extendedit

Upload it from http://snowgoon88.github.io/TW5-extendedit

ConfigNEW ⚡ nothing to do, autocompletion works as soon the plugin is enabled.

For older version of TW5 - prior to v5.1.22 -, you still must explicitely use the comptext editor. => In $:/ControlPanel -> Advanced -> Editor Type -> text/vnd.tiddlywiki you must chose comptext instead of text. Reload and « voilà »...

Dev

Making demo onfile html

  • The edition/edit-comptextdemo directory should be copied/linked into $TW5HOME/editions directory
  • Then in $TW5HOME, run nodejs ./tiddlywiki.js editions/edit-comptextdemo --build index to create a stand alone edit-comptextdemo.html demo in $TW5HOME/editions/edit-comptextdemo/output

Develop with nodejs

  • Set up 'TIDDLYWIKI_EDITION_PATH' to 'edition'
  • Link '$TW5HOME/plugins/snowgoon88/edit-comptext' to 'plugin'
  • Create a local dev_rep nodejs ./tiddlywiki.js dev_rep --init edit-comptextdev
  • Run local server nodejs ./tiddlywiki.js dev_rep --server

Contributors

Older Stuff

  • 16/04/2021 : v0.9.3 with click/touch selection

  • 29/06/2020 : v0.9 default editor in TW5 now automatically has autocompletion

    • can use '||' trigger in order to create Links with Alias.
  • 12/02/2018 : v0.8.1 fix small bug (minPatLength)

  • 10/06/2018 : v0.8.0 config triggerKeys and FIX partial completion

  • 28/05/2017 : v0.7.0 compatible with toolbar text editor

  • 04/05/2016 : v0.6.1 self-sufficient module, use of body of tiddlers

  • 26/04/2016 : v0.5.0 Completion Templates

  • 07/03/2017 : v0.4.1 Fix small bug in naming config tiddler

  • 07/03/2017 : v0.4 Configuration in 'config' tiddler.

  • 29/02/2016 : v0.3 Can use CTRL+SPACE, UP/DOWN, ESC.

  • 22/01/2016 : v0.2 Completion with Title that match pattern

  • 12/28/2015 : v0.1 First real TW5 plugin

  • 12/26/2015 : Second Version as a stand alone TW5 file : Sandbox/tw5_one_file.html

  • 2014 : First Version a first prototype in Sandbox/index.html

tw5-extendedit's People

Contributors

saqimtiaz avatar snowgoon88 avatar vaultvulp avatar zimiarh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tw5-extendedit's Issues

Template Example: Markdown style links

Loved this plugin, and used it to get autocomplete to work in markdown files. Wondering if you could add the markdown style link approach as an example in the templates?

{
  "pattern": "[[",
  "filter": "[all[tiddlers]!is[system]]",
  "start": "[](#",
  "end": ")",
  "startOffset" : 1
}

More details on my wiki.

License is missing

Hi, ... Nice plugin!

But your licensing file is missing. So the plugin can't be used, if the TiddlyWiki is accessible from the web.

edit-comptext disrupts tab and shift-tab navigation

When editing a tiddler at http://snowgoon88.github.io/TW5-extendedit/, or editing a tiddler on a new empty.html file with the edit-comptext 0.9.3 plugin installed, the tab and shift-tab navigation is disrupted.

When editing a tiddler, the cursor is focused on the title field by default. In a fresh TW, pressing tab cycles through the following fields in order:

  • Tags
  • Main text field
  • Content type
  • Field name
  • Field value

When the edit-comptext 0.9.3 plugin is installed, the cursor focuses on an extra step between Tags and Main text field.
edit-comptext

The main text box is highlighted with a dotted line around its perimeter, but typing does nothing. Pressing tab one more time will bring the cursor back to the Main text field as intended.

Using the TAB key

It is not possible to use a TAB key to insert tabulation in the editor window; the cursor is moved to the next control. Would it be possible to add the posibility of using the TAB key?

best,
Darek

Support for languages having complex input methods

Hi! Thanks a lot for developing this cool plugin. I tried it out a little and feel that it is a must have for anyone who is as lazy as me.

However, I also noticed that this plugin is not quite responsive with certain languages, such as Chinese and Japanese. To be more specific, autocompletion candidates almost never show up when I try to type names of tiddlers in these two languages. If I copy part of the desired tilddler name, typing the autocompletion triggering pattern, and paste the copied texts, the autocompletion window might show up (although the probability is quite small).

For Japanese users, luckily enough, pressing the key combination ctrl + space can invoke the autocompletion window manually. For Chinese users however, doing so does not work because such key combination usually is intercepted by the input method to switch input modes (on Win 10, it locks/unlocks the key board to input English alphabets instead of Chinese).

I am not quite sure about the root cause of this issue because I have not read the source code yet. My guess is that it cannot handle the texts output of an input method that generating a character by collecting and combining multiple key strokes. This is the common point of the two languages that the plugin fails on.

[IDEA] Use Caption instead of Title

The drop down window shows the title of tiddlers. One can use mask to mask a prefix. But why not to allow the caption.

In the Example given in doc a mask like "mask" : "$:/config/stamp/", but how if snippets are stored in mixed namespace?

A better solution is to allow use of caption instead of title for drop down list.
This can be customizable: title or caption? or use caption if exist if not use title

Complete onClick / onTouch

Hi and first of all thanks for the nice plugin. :) Works great for my case!

One question: Is it possible to finish the completion onClick or onTouch? At the moment I have to select a completion entry via arrow keys if I understand this correctly and this makes it unsuitable for mobile devices (which is a pity because otherwise it seems to work great).

Thanks again.

Cursor Position not calculating as expected when using comptext widget

Hello,

I I have found a bug with the cursor position that I am unable to fix. When housing an <$edit-comptext> widget inside of any HTML table, the popup element to select the desired option is rendering in the corner of the tiddler. This can be replicated with the below code:

<$list filter="[{!!title}addprefix[test]]">
<table><$edit-comptext field="leader" placeholder="Leader of this org" />
</table>
</$list>

Unclear as to what the solution here would be. Thanks for the good work, this plugin is still one of my favorites :)

Add ul to popupNode

I noticed that the li results displayed within the popupNode lack a ul container which throws the bullets outside the container (at least on Firefox).

Related: For a cleaner look, should bullets be droppped the from li styling?

Uncaught TypeError: Cannot read property 'start' of undefined

Got this error when normally using TW (with comptext). The TextArea was not empty.

Uncaught TypeError: Cannot read property 'start' of undefined
    at Completion.handleKeyup ($:/plugins/snowgoon88/edit-comptext/completion.js:484)
    at HTMLTextAreaElement.handler ($:/core/modules/utils/dom.js:207)

Pb with Demo

Internal Java Error on demo version. tidConfig undefined

Editor Independent Implementation

Maybe this is completely unreasonable, I have not actually looked at the code for this plugin. But would it be possible to have an editor-independent implementation? I use the codemirror editor, but would love to have this functionality.

Thanks.

Plugin does not prevent propagation of event from framed editor

keydown events - such as enter to select an autocomplete entry - are still propagated to the main document from the framed editor (which is inside an iframe). This is due to some special handling of events inside the iframe in TW, by which events from the iframe are propagated to the parent document. This causes clashes with other plugins that also react to keyboard events.

I will submit a pull request in a few days that works around this, so that events are only propagated further if not handled by the autocomplete.

Integrate edit-comptext in rich text editor

Dear Snowgoon88,

During the Christmas break I worked on a rich text editor for TW4 see: https://github.com/JoostvandenDool/TW-Plugins One thing I am missing is the great functionality of edit-comptext to have link completion. Is it somehow possible to integrate your plugin in the riich text editor?

I tried to understand the code but do not understand it enough to see how integration could work.

Kind regards,

Joost

Various Enhancements

Hello!

There is now an excellent keeboard plugin that aspects of which have made it into the 5..1.18 prerelease.

  • Do you think parts of this could work with that?
  • Can we use the mouse to click on the dropdown (to match tag selection?)
  • Can this be added to the core?

Make bestMatches case insensitive

Thank you for your great work on this plugin. One suggestion: Make it so that the completion object returns results regardless of the case (upper or lower) of the user's input.

Changing regpat.test( listChoice[i] ) to regpat.test( listChoice[i].toLowerCase() ) within completion.js changed the behavior for me.

Thanks!

[Feature Request] alternative regexp pattern parameter

Hi!

For a more customizable pattern configuration there should be a parameter which accepts regexp patterns. So for example it is possible to capture pretty link inputs with the following regexp pattern: (?:^|\s)\[\[[^\[\[]*\|([^\[\[\]\]]*)$ (as you can see, I'm not a regexp expert ;)

Best regards,
Albert (an avid user of your autocompletion plugin :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.