Managing the ownership and transfer of Security Tokens with Finhaven
-
Towards technical standards and interoperability of securities on the Ethereum blockchain
-
Blockchain technology provides the potential to fulfill many of the functions of traditional securities management. It has a built in identification system (each account has a unique address), every transaction is publicly logged (an immutable audit trail), and a smart contract layer (transfer restrictions or other business logic can be automated).
-
On the other hand, the past 18 months have been characterized by a proliferation of entrepreneurs bringing utility tokens to market. On closer inspection, many of them should be classified as securities, and we are beginning to see the first warnings and de-listing from utility token exchanges.
-
Finhaven believes that security tokens are part of the next wave. We think we can take some of the regulatory nature of existing securities and upgrade them with the digital first, automation first nature that goes beyond the concept of paper agreements, and sets a framework for global governance.
-
Tokens on the Ethereum Blockchain
-
Tokens are themselves smart contracts, or thought of more simply, “apps” or “decentralized apps” (dapps) — code that executes on the public Ethereum blockchain.
-
Ethereum and other open source blockchain projects follow an open process for submitting standards and changes to the functioning of the software. In the Ethereum community, these are called “Ethereum Improvement Proposals” or EIPs. Before being accepted or approved, they start as “Ethereum Request for Comments” or ERCs, so that the community and other interested parties can review, extend, make comments, and generally improve the proposal.
-
The acceptance of EIPs follows a very fluid open source collaboration model. But since the work is done out in the open, a pre-standard model can be adopted and turned into working code even without being approved.
-
The most infamous pre-standard is the ERC 20 “token standard”. It is what has powered Ethereum to host roughly 40 of the top 100 crypto assets globally. This has led to technical standardization among websites, apps, wallets, and exchanges. It has also led to large amounts of unregulated activity, at least some of which is more correctly classified as a security.
-
From the commonly known ERC 20 phrase, one can see adoption even at the request for comments stage. This standard has now been approved and is officially EIP 20.
-
There are numerous other ERCs in progress relating to tokens. Notable ones include:
-
-
-ERC 223, an attempt to upgrade security and apply other fixes to EIP 20
-
-ERC 721, a standard for non-fungible tokens supporting everything from land titles to digital cats (authored by another local BC company, Axiom Zen)
-
-ERC 777, an even newer token standard that likely supersedes and improves on 20 & 223, that Finhaven is looking to base its security tokens on
-
-
It is Finhaven’s intent to propose an ERC (internally we call this 999 since the final number is unknown) that begins the process of technical standard setting around what features Security Tokens support.
-
ERC 999 Restriction of Ownership & Transfer of Tokens
-
We believe that having a record of token ownership on the public blockchain is valuable for many use cases.
-
While most people think of tokens or coins as “in” an owners account, they are actually recorded as a balance in a token smart contract. The token contract lists each owner’s addresses and the balance of tokens that that address controls.
-
-
-
-
-Standard ERC-20 Transfer
A transfer of tokens between two addresses actually calls the “transfer” function of the token contract. The source address (the address “from” which the funds are being transferred) calls the smart contract transfer function. In its base form, this function has a destination address, plus an amount to transfer. If the source contains enough to satisfy the transfer amount, the tokens are debited from one address and credited to the destination.
-
-
-
-
-Security Token Smart Contract with “allowed” Whitelist
Our core proposal is that Security Tokens have a check function. Another function is added that contains a list of whitelisted address.
-
When a transfer request is made, the transfer function additionally checks the destination address to see if it is on the whitelist. If it is not, the transfer fails.
-
This function could additionally be used to make tokens completely non-transferable.
-
Token creators could use a variety of on- or off-chain processes to update the whitelist.
-
Finhaven Token Holder KYC to Support Security Needs
-
The technical details described above form the starting point for thinking about security tokens.
-
Another feature of securities is knowing — and oftentimes vetting — the owner of a security either as an individual or corporate entity.
Finhaven’s Platform helps with the technical details of token creation, issuance, and management. Many of these activities happen in a standard web app, before a security token and its accompanying smart contracts are deployed to the public Ethereum blockchain. After deployment, the platform continues to help with on- and off-chain management features — like a friendly web interface to the blockchain — while transfers and other functions can still be publicly inspected and audited on-chain by anyone.
-
Finhaven’s model will collect KYC information from users on the platform who buy, sell, or transfer tokens. We provide users on the platform with a standard Ethereum address, and link it off chain, in our private database, with their KYC’d identity. Only addresses which have been KYC’d can be on a token whitelist, but anyone can sign up on the platform to be added to the whitelist in order to buy, transfer or otherwise receive these security tokens.
-
Initially we will need to provide this KYC process with our platform, but this is another area of standardization — a way of protecting privacy of off-chain identities while also sharing claims about nationality, accreditation, or other identity aspects in a decentralized way.
-
Some examples of organizations and solutions include:
We’ve been pleased to see other organizations beginning to come forward and launch open source efforts of standardization. Read the Introduction to Harbor, and check out their R-Token on Github.
-
We are prepping our own Github releases and will work with the wider community to collaborate on technical and regulatory interoperability. On the regulatory side, we are starting from Canada, which we think is a very good base for broad investor and company appeal. Specifically, the Province of British Columbia (BC) is kind of like the Delaware of Canada — it’s easy and inexpensive to create corporations online with non-resident directors. We are hoping to work with the government on making it a crypto-friendly domicile.
We will host a similar event in Vancouver in March.
-
We will be speaking at Monage in April, so we are looking at planning a community meetup in SF on April 16th.
-
EDCON is in Toronto in early May, and we are tentatively planning a large technical interoperability test and one day Security Token Working Group. Please sign up to save the date. Other events we are hosting, attending, or promoting are listed on our events calendar.
-
If you want to get involved in the technical and/or regulatory aspects of decentralized Security Token interoperability, please get in touch.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/CircleJack.svg.svg b/tiddlywiki/plugins/WMR/CircleJack.svg.svg
deleted file mode 100644
index 536ad89..0000000
--- a/tiddlywiki/plugins/WMR/CircleJack.svg.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/CircleJack.svg.svg.meta b/tiddlywiki/plugins/WMR/CircleJack.svg.svg.meta
deleted file mode 100644
index a4604b2..0000000
--- a/tiddlywiki/plugins/WMR/CircleJack.svg.svg.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-created: 20170918060138058
-creator: Thomas Elmiger
-modified: 20200219150938674
-modifier: Thomas Elmiger
-tags: picture
-title: CircleJack.svg
-type: image/svg+xml
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/about.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/about.tid
deleted file mode 100644
index 9ecdbd8..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/about.tid
+++ /dev/null
@@ -1,14 +0,0 @@
-created: 20181125122609022
-modified: 20200219150938451
-tags:
-title: $:/plugins/telmiger/WMR/about
-type: text/vnd.tiddlywiki
-
-!!! About the Wikitext Markup Reference
-
-Examples are copied from or inspired by
-
-* [[Tobi Beer's Markup Reference|http://tobibeer.github.io/tb5/#Markup%20Reference]]
-** try the [[searchable version|http://tobibeer.github.io/tb5/#Markup]] too!
-
-A great idea found via [[Greg Davis' Begin plugin|http://gdplugins.tiddlyspot.com/#%24%3A%2Fplugins%2Fgdavis%2Ftwbegin]].
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/bar.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/bar.tid
deleted file mode 100644
index 544226b..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/bar.tid
+++ /dev/null
@@ -1,10 +0,0 @@
-caption: Bar
-created: 20181129205651711
-creator: Thomas
-modified: 20200219150938497
-modifier: Thomas Elmiger
-tags: Bar
-title: $:/plugins/telmiger/WMR/bar
-type: text/vnd.tiddlywiki
-
-He ordered another beer.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/code.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/code.tid
deleted file mode 100644
index 662b2fa..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/code.tid
+++ /dev/null
@@ -1,25 +0,0 @@
-created: 20181124200421812
-creator: Thomas
-modified: 20200219150938484
-modifier: Thomas
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/code
-type: text/vnd.tiddlywiki
-
-<>
-
-Use double backticks ... <>
-
-For longer code use a [[code block|https://tiddlywiki.com/#Code%20Blocks%20in%20WikiText]]:
-
-
-
```
-monospaced
-codeblock
-```
-
-
-```
-monospaced
-codeblock
-```
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/filters.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/filters.tid
deleted file mode 100644
index a083eba..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/filters.tid
+++ /dev/null
@@ -1,87 +0,0 @@
-created: 20181128065322406
-creator: Thomas
-modified: 20200219150938468
-modifier: Thomas Elmiger
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/filters
-type: text/vnd.tiddlywiki
-wmr-source-link: https://tiddlywiki.com/#Filter%20Expression
-
-
-!!! Display the result of a filter expression
-
-Use [[filter operators|https://tiddlywiki.com/#Filter%20Operators]] like `tag` to select tiddlers.
-
-List tiddlers tagged `Foo`:
-
-<>
-
-List tiddlers tagged `Foo` OR `Bar`:
-
-<>
-
-List tiddlers tagged `Foo` AND `Bar`:
-
-<>
-
-List tiddlers tagged `Foo` NOT `Bar`:
-
-<>
-
----
-
-!!! Limit results
-
-<>
-
----
-
-!!! Sorting
-
-Sort titles:
-
-<>
-
-Sort reverse:
-
-<>
-
-Sort numbers:
-
-<>
-
-First created:
-
-<>
-
-Last modified:
-
-<>
-
----
-
-!!! Special effects
-
-!!!! If empty ... aka Else ~
-
-Since TW version 5.1.18
-
-<>
-
-!!!! Range
-
-<>
-
-See https://tiddlywiki.com/#range%20Operator
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/font-variants.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/font-variants.tid
deleted file mode 100644
index 0875f7c..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/font-variants.tid
+++ /dev/null
@@ -1,43 +0,0 @@
-created: 20181124191306552
-creator: Thomas
-modified: 20200219150938522
-modifier: Thomas
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/font-variants
-type: text/vnd.tiddlywiki
-
-<>
-
-<>
-
-
-<>
-
-
-<>
-
-
-<>
-
-
-<>
-
-
-<>
-
-
-<>
-
-
-<>
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo-bar.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo-bar.tid
deleted file mode 100644
index 5adaa02..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo-bar.tid
+++ /dev/null
@@ -1,10 +0,0 @@
-caption: Foo Bar
-created: 20181130170447615
-creator: Thomas Elmiger
-modified: 20200219150938505
-modifier: Thomas Elmiger
-tags: Bar Foo Dummy
-title: $:/plugins/telmiger/WMR/foo-bar
-type: text/vnd.tiddlywiki
-
-Dummy text
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo.tid
deleted file mode 100644
index 441b0d5..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/foo.tid
+++ /dev/null
@@ -1,13 +0,0 @@
-caption: Foo
-created: 20181127222534567
-creator: Thomas
-modified: 20200219150938514
-modifier: Thomas Elmiger
-tags: Foo Dummy
-title: $:/plugins/telmiger/WMR/foo
-type: text/vnd.tiddlywiki
-wmr-example: 54rem
-
-A man went into a ''bar''.
-
-He ordered a beer.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/html.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/html.tid
deleted file mode 100644
index 43366e6..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/html.tid
+++ /dev/null
@@ -1,70 +0,0 @@
-created: 20181124205849430
-creator: Thomas
-modified: 20200219150938529
-modifier: Thomas
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/html
-type: text/vnd.tiddlywiki
-
-
-
----
-
-A template can show different fields of a tiddler. While the list of tiddlers tagged `Foo` shows the content of the field `title` ...
-
-<>
-
-... the same for tag `Bar` displayed through the template $:/core/ui/ViewTemplate/subtitle shows the content of the fields `modifier` and `modified`:
-
-<>
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/tmpl-code.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/tmpl-code.tid
deleted file mode 100644
index 904f033..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/tmpl-code.tid
+++ /dev/null
@@ -1,9 +0,0 @@
-caption: Bar
-created: 20181130195051148
-creator: Thomas Elmiger
-modified: 20200219150938537
-modifier: Thomas Elmiger
-title: $:/plugins/telmiger/WMR/tmpl-code
-type: text/vnd.tiddlywiki
-
-
{{!!text}}
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/transclusion.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/transclusion.tid
deleted file mode 100644
index 07b673a..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/transclusion.tid
+++ /dev/null
@@ -1,53 +0,0 @@
-created: 20181124205928499
-creator: Thomas
-modified: 20200219150938697
-modifier: Thomas Elmiger
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/transclusion
-type: text/vnd.tiddlywiki
-wmr-source-link: http://tiddlywiki.com/#Transclusion%20in%20WikiText
-
-!!! Display content from other tiddlers
-
-Transclude [[text|$:/plugins/telmiger/WMR/foo]] and [[images|$:/core/images/home-button]] from the main content (text field):
-
-<>
-
-<>
-
-
-!!! Content of tiddler fields
-
-
-
-```
-{{Foo!!bar}}
-{{!!bar}}
-```
-
-
-* field `bar` of tiddler `Foo`
-* field `bar` of the Current Tiddler
-
-!!! Data tiddler entries
-
-
-
-```
-{{Foo##index}}
-{{##index}}
-```
-
-
-* `index` of [[datatiddler|https://tiddlywiki.com/#DataTiddlers]] titled `Foo`
-* `index` of `CurrentTiddler`
-
----
-
-!!! Transclude widget
-
-Try the [[transclude widget|https://tiddlywiki.com/#TranscludeWidget]] if you have to set the parsing mode manually.
-
-<'>>
-
-<'>>
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/typed-elements.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/typed-elements.tid
deleted file mode 100644
index 432822f..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/typed-elements.tid
+++ /dev/null
@@ -1,86 +0,0 @@
-created: 20181124210140010
-creator: Thomas
-modified: 20200219150938690
-modifier: Thomas Elmiger
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/typed-elements
-type: text/vnd.tiddlywiki
-
-
-
-```
-$$$text/unknown
-plain text, not //formatted//
-$$$
-```
-
-
-$$$text/unknown
-plain text, not //formatted//
-$$$
-
-
-These are [[Typed Blocks|https://tiddlywiki.com/#Typed%20Blocks%20in%20WikiText]]
-
-
-
-```
-$$$image/svg+xml
-
-$$$
-```
-
-
-
-$$$image/svg+xml
-
-$$$
-
-
-
-```
-$$$.svg
-
-$$$
-```
-
-
-
-$$$.svg
-
-$$$
-
-
-
-
-```
-$$$text/vnd.tiddlywiki>text/html
-This is ''some'' wikitext
-$$$
-```
-
-
-$$$text/vnd.tiddlywiki>text/html
-This is ''some'' wikitext
-$$$
-
-
-
-```
-$$$text/vnd.tiddlywiki>text/plain
-This is ''some'' wikitext
-$$$
-```
-
-
-$$$text/vnd.tiddlywiki>text/plain
-This is ''some'' wikitext
-$$$
diff --git a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/variables.tid b/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/variables.tid
deleted file mode 100644
index 5a327db..0000000
--- a/tiddlywiki/plugins/WMR/_system/plugins/telmiger/WMR/variables.tid
+++ /dev/null
@@ -1,71 +0,0 @@
-created: 20181128064053957
-creator: Thomas
-modified: 20200219150938682
-modifier: Thomas Elmiger
-tags: ShortReference
-title: $:/plugins/telmiger/WMR/variables
-type: text/vnd.tiddlywiki
-
-\define animal1() lion
-\define animals1()
-seal
-penguin
-\end
-
-
-!!! Set the value of a variable
-
-To use a local variable in a single tiddler, insert a definition at the very top of the tiddler:
-
-`\define animal1() lion`
-
-To use a variable in a limited part of a tiddler, use the [[set widget|https://tiddlywiki.com/#SetWidget]]:
-
-<$macrocall $name="wt" wikitext="""<$set name="animal2" value="zebra">
-<> eats <>
-$set>
-"""/>
-
-!!! Multi-line variables
-
-```
-\define animals1()
-seal
-penguin
-\end
-
-<>
-```
-
-<>
-
-<$macrocall $name="wt" wikitext="""<$set name="animals2" value="
-* zebra
-* gnu
-* antelope
-">
-
-<>
-$set>
-"""/>
-
-
-!!! Variables as parameters
-
-<$tiddler tiddler="$:/plugins/telmiger/WMR/foo">
-
-<$macrocall $name="wt" wikitext="""<$set name="mywidth" value={{!!wmr-example}}>
-[img width=<> [CircleJack.svg]]
-$set>
-"""/>
-
-$tiddler>
-
-!!!! Change the value
-
-<$macrocall $name="wt" wikitext="""<$edit-text tiddler="$:/plugins/telmiger/WMR/foo" field="wmr-example"/>
-"""/>
-
-Hint: We also use the [[tiddler widget|https://tiddlywiki.com/#TiddlerWidget]] above to set $:/plugins/telmiger/WMR/foo as the current tiddler in the context of the image. This makes sure that the [[text reference|https://tiddlywiki.com/#TextReference]] `!!wmr-example` points to the right field.
-
-The edit text widget should ''not'' be used to edit a field of the tiddler that contains it to ommit unwanted side effects.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/WMR/plugin.info b/tiddlywiki/plugins/WMR/plugin.info
deleted file mode 100644
index 1d18456..0000000
--- a/tiddlywiki/plugins/WMR/plugin.info
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "title": "$:/plugins/telmiger/WMR",
- "author": "Thomas Elmiger",
- "core-version": ">=5.1.18",
- "description": "Wikitext Markup Reference – WMR",
- "list": "reference about",
- "name": "Wikitext Markup Reference – WMR",
- "plugin-type": "plugin",
- "source": "https://tid.li/tw5/plugins.html",
- "version": "0.3.4"
-}
diff --git a/tiddlywiki/plugins/aliases/$__core_modules_widgets_link.js b/tiddlywiki/plugins/aliases/$__core_modules_widgets_link.js
deleted file mode 100644
index 95a5959..0000000
--- a/tiddlywiki/plugins/aliases/$__core_modules_widgets_link.js
+++ /dev/null
@@ -1,214 +0,0 @@
-/*\
-title: $:/core/modules/widgets/link.js
-type: application/javascript
-module-type: widget
-
-Link widget
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var Widget = require("$:/core/modules/widgets/widget.js").widget;
-
-var LinkWidget = function(parseTreeNode,options) {
- this.initialise(parseTreeNode,options);
-};
-
-/*
-Inherit from the base widget class
-*/
-LinkWidget.prototype = new Widget();
-
-/*
-Render this widget into the DOM
-*/
-LinkWidget.prototype.render = function(parent,nextSibling) {
- // Save the parent dom node
- this.parentDomNode = parent;
- // Compute our attributes
- this.computeAttributes();
- // Execute our logic
- this.execute();
- // Get the value of the tv-wikilinks configuration macro
- var wikiLinksMacro = this.getVariable("tv-wikilinks"),
- useWikiLinks = wikiLinksMacro ? (wikiLinksMacro.trim() !== "no") : true,
- missingLinksEnabled = !(this.hideMissingLinks && this.isMissing && !this.isShadow);
- // Render the link if required
- if(useWikiLinks && missingLinksEnabled) {
- this.renderLink(parent,nextSibling);
- } else {
- // Just insert the link text
- var domNode = this.document.createElement("span");
- parent.insertBefore(domNode,nextSibling);
- this.renderChildren(domNode,null);
- this.domNodes.push(domNode);
- }
-};
-
-/*
-Render this widget into the DOM
-*/
-LinkWidget.prototype.renderLink = function(parent,nextSibling) {
- var self = this;
- // Sanitise the specified tag
- var tag = this.linkTag;
- if($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {
- tag = "a";
- }
- // Create our element
- var namespace = this.getVariable("namespace",{defaultValue: "http://www.w3.org/1999/xhtml"}),
- domNode = this.document.createElementNS(namespace,tag);
- // Assign classes
- var classes = [];
- if(this.overrideClasses === undefined) {
- classes.push("tc-tiddlylink");
- if(this.isShadow) {
- classes.push("tc-tiddlylink-shadow");
- }
- if(this.isMissing && !this.isShadow) {
- classes.push("tc-tiddlylink-missing");
- } else {
- if(!this.isMissing) {
- classes.push("tc-tiddlylink-resolves");
- }
- }
- if(this.linkClasses) {
- classes.push(this.linkClasses);
- }
- } else if(this.overrideClasses !== "") {
- classes.push(this.overrideClasses)
- }
- if(classes.length > 0) {
- domNode.setAttribute("class",classes.join(" "));
- }
- // Set an href
- var wikilinkTransformFilter = this.getVariable("tv-filter-export-link"),
- wikiLinkText;
- if(wikilinkTransformFilter) {
- // Use the filter to construct the href
- wikiLinkText = this.wiki.filterTiddlers(wikilinkTransformFilter,this,function(iterator) {
- iterator(self.wiki.getTiddler(self.to),self.to)
- })[0];
- } else {
- // Expand the tv-wikilink-template variable to construct the href
- var wikiLinkTemplateMacro = this.getVariable("tv-wikilink-template"),
- wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$";
- wikiLinkText = $tw.utils.replaceString(wikiLinkTemplate,"$uri_encoded$",encodeURIComponent(this.to));
- wikiLinkText = $tw.utils.replaceString(wikiLinkText,"$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
- }
- // Override with the value of tv-get-export-link if defined
- wikiLinkText = this.getVariable("tv-get-export-link",{params: [{name: "to",value: this.to}],defaultValue: wikiLinkText});
- if(tag === "a") {
- var namespaceHref = (namespace === "http://www.w3.org/2000/svg") ? "http://www.w3.org/1999/xlink" : undefined;
- domNode.setAttributeNS(namespaceHref,"href",wikiLinkText);
- }
- // Set the tabindex
- if(this.tabIndex) {
- domNode.setAttribute("tabindex",this.tabIndex);
- }
- // Set the tooltip
- // HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to "<$transclude field='tooltip'><$transclude field='title'/>$transclude>"
- var tooltipWikiText = this.tooltip || this.getVariable("tv-wikilink-tooltip");
- if(tooltipWikiText) {
- var tooltipText = this.wiki.renderText("text/plain","text/vnd.tiddlywiki",tooltipWikiText,{
- parseAsInline: true,
- variables: {
- currentTiddler: this.to
- },
- parentWidget: this
- });
- domNode.setAttribute("title",tooltipText);
- }
- if(this["aria-label"]) {
- domNode.setAttribute("aria-label",this["aria-label"]);
- }
- // Add a click event handler
- $tw.utils.addEventListeners(domNode,[
- {name: "click", handlerObject: this, handlerMethod: "handleClickEvent"},
- ]);
- // Make the link draggable if required
- if(this.draggable === "yes") {
- $tw.utils.makeDraggable({
- domNode: domNode,
- dragTiddlerFn: function() {return self.to;},
- widget: this
- });
- }
- // Insert the link into the DOM and render any children
- parent.insertBefore(domNode,nextSibling);
- this.renderChildren(domNode,null);
- this.domNodes.push(domNode);
-};
-
-LinkWidget.prototype.handleClickEvent = function(event) {
- // Send the click on its way as a navigate event
- var bounds = this.domNodes[0].getBoundingClientRect();
- this.dispatchEvent({
- type: "tm-navigate",
- navigateTo: this.to,
- navigateFromTitle: this.getVariable("storyTiddler"),
- navigateFromNode: this,
- navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
- },
- navigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1),
- metaKey: event.metaKey,
- ctrlKey: event.ctrlKey,
- altKey: event.altKey,
- shiftKey: event.shiftKey,
- followAliases: this.followAliases
- });
- if(this.domNodes[0].hasAttribute("href")) {
- event.preventDefault();
- }
- event.stopPropagation();
- return false;
-};
-
-/*
-Compute the internal state of the widget
-*/
-LinkWidget.prototype.execute = function() {
- // Pick up our attributes
- this.to = this.getAttribute("to",this.getVariable("currentTiddler"));
- this.tooltip = this.getAttribute("tooltip");
- this["aria-label"] = this.getAttribute("aria-label");
- this.linkClasses = this.getAttribute("class");
- this.overrideClasses = this.getAttribute("overrideClass");
- this.tabIndex = this.getAttribute("tabindex");
- this.draggable = this.getAttribute("draggable","yes");
- this.linkTag = this.getAttribute("tag","a");
- this.followAliases = this.getAttribute("followAliases", "true");
- // Determine the link characteristics
- this.isMissing = !this.wiki.tiddlerExists(this.to) && !(this.wiki.filterTiddlers("[title["+this.to+"]listed[aliases]]").length === 1);
- this.isShadow = this.wiki.isShadowTiddler(this.to);
- this.hideMissingLinks = (this.getVariable("tv-show-missing-links") || "yes") === "no";
- // Make the child widgets
- var templateTree;
- if(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {
- templateTree = this.parseTreeNode.children;
- } else {
- // Default template is a link to the title
- templateTree = [{type: "text", text: this.to}];
- }
- this.makeChildWidgets(templateTree);
-};
-
-/*
-Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
-*/
-LinkWidget.prototype.refresh = function(changedTiddlers) {
- var changedAttributes = this.computeAttributes();
- if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip) {
- this.refreshSelf();
- return true;
- }
- return this.refreshChildren(changedTiddlers);
-};
-
-exports.link = LinkWidget;
-
-})();
diff --git a/tiddlywiki/plugins/aliases/$__core_modules_widgets_navigator.js b/tiddlywiki/plugins/aliases/$__core_modules_widgets_navigator.js
deleted file mode 100644
index a12c16f..0000000
--- a/tiddlywiki/plugins/aliases/$__core_modules_widgets_navigator.js
+++ /dev/null
@@ -1,626 +0,0 @@
-/*\
-title: $:/core/modules/widgets/navigator.js
-type: application/javascript
-module-type: widget
-
-Navigator widget
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var IMPORT_TITLE = "$:/Import";
-
-var Widget = require("$:/core/modules/widgets/widget.js").widget;
-
-var NavigatorWidget = function(parseTreeNode,options) {
- this.initialise(parseTreeNode,options);
- this.addEventListeners([
- {type: "tm-navigate", handler: "handleNavigateEvent"},
- {type: "tm-edit-tiddler", handler: "handleEditTiddlerEvent"},
- {type: "tm-delete-tiddler", handler: "handleDeleteTiddlerEvent"},
- {type: "tm-save-tiddler", handler: "handleSaveTiddlerEvent"},
- {type: "tm-cancel-tiddler", handler: "handleCancelTiddlerEvent"},
- {type: "tm-close-tiddler", handler: "handleCloseTiddlerEvent"},
- {type: "tm-close-all-tiddlers", handler: "handleCloseAllTiddlersEvent"},
- {type: "tm-close-other-tiddlers", handler: "handleCloseOtherTiddlersEvent"},
- {type: "tm-new-tiddler", handler: "handleNewTiddlerEvent"},
- {type: "tm-import-tiddlers", handler: "handleImportTiddlersEvent"},
- {type: "tm-perform-import", handler: "handlePerformImportEvent"},
- {type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
- {type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
- {type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
- {type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
- {type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
- ]);
-};
-
-/*
-Inherit from the base widget class
-*/
-NavigatorWidget.prototype = new Widget();
-
-/*
-Render this widget into the DOM
-*/
-NavigatorWidget.prototype.render = function(parent,nextSibling) {
- this.parentDomNode = parent;
- this.computeAttributes();
- this.execute();
- this.renderChildren(parent,nextSibling);
-};
-
-/*
-Compute the internal state of the widget
-*/
-NavigatorWidget.prototype.execute = function() {
- // Get our parameters
- this.storyTitle = this.getAttribute("story");
- this.historyTitle = this.getAttribute("history");
- this.setVariable("tv-story-list",this.storyTitle);
- this.setVariable("tv-history-list",this.historyTitle);
- // Construct the child widgets
- this.makeChildWidgets();
-};
-
-/*
-Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
-*/
-NavigatorWidget.prototype.refresh = function(changedTiddlers) {
- var changedAttributes = this.computeAttributes();
- if(changedAttributes.story || changedAttributes.history) {
- this.refreshSelf();
- return true;
- } else {
- return this.refreshChildren(changedTiddlers);
- }
-};
-
-NavigatorWidget.prototype.getStoryList = function() {
- return this.storyTitle ? this.wiki.getTiddlerList(this.storyTitle) : null;
-};
-
-NavigatorWidget.prototype.saveStoryList = function(storyList) {
- if(this.storyTitle) {
- var storyTiddler = this.wiki.getTiddler(this.storyTitle);
- this.wiki.addTiddler(new $tw.Tiddler(
- {title: this.storyTitle},
- storyTiddler,
- {list: storyList}
- ));
- }
-};
-
-NavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) {
- if(storyList) {
- var p = storyList.indexOf(title);
- while(p !== -1) {
- storyList.splice(p,1);
- p = storyList.indexOf(title);
- }
- }
-};
-
-NavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle,newTitle) {
- if(storyList) {
- var pos = storyList.indexOf(oldTitle);
- if(pos !== -1) {
- storyList[pos] = newTitle;
- do {
- pos = storyList.indexOf(oldTitle,pos + 1);
- if(pos !== -1) {
- storyList.splice(pos,1);
- }
- } while(pos !== -1);
- } else {
- storyList.splice(0,0,newTitle);
- }
- }
-};
-
-NavigatorWidget.prototype.addToStory = function(title,fromTitle) {
- if(this.storyTitle) {
- this.wiki.addToStory(title,fromTitle,this.storyTitle,{
- openLinkFromInsideRiver: this.getAttribute("openLinkFromInsideRiver","top"),
- openLinkFromOutsideRiver: this.getAttribute("openLinkFromOutsideRiver","top")
- });
- }
-};
-
-/*
-Add a new record to the top of the history stack
-title: a title string or an array of title strings
-fromPageRect: page coordinates of the origin of the navigation
-*/
-NavigatorWidget.prototype.addToHistory = function(title,fromPageRect) {
- this.wiki.addToHistory(title,fromPageRect,this.historyTitle);
-};
-
-/*
-Handle a tm-navigate event
-*/
-NavigatorWidget.prototype.handleNavigateEvent = function(event) {
- event = $tw.hooks.invokeHook("th-navigating",event);
- if(event.navigateTo) {
- if (!this.wiki.tiddlerExists(event.navigateTo) && event.followAliases == "true") {
- var aliases = this.wiki.filterTiddlers("[title["+event.navigateTo+"]listed[aliases]]")
- if (aliases.length === 1) {
- event.navigateTo = aliases[0];
- }
- }
- this.addToStory(event.navigateTo,event.navigateFromTitle);
- if(!event.navigateSuppressNavigation) {
- this.addToHistory(event.navigateTo,event.navigateFromClientRect);
- }
- }
- return false;
-};
-
-// Close a specified tiddler
-NavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {
- var title = event.param || event.tiddlerTitle,
- storyList = this.getStoryList();
- // Look for tiddlers with this title to close
- this.removeTitleFromStory(storyList,title);
- this.saveStoryList(storyList);
- return false;
-};
-
-// Close all tiddlers
-NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {
- this.saveStoryList([]);
- return false;
-};
-
-// Close other tiddlers
-NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {
- var title = event.param || event.tiddlerTitle;
- this.saveStoryList([title]);
- return false;
-};
-
-// Place a tiddler in edit mode
-NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
- var editTiddler = $tw.hooks.invokeHook("th-editing-tiddler",event);
- if(!editTiddler) {
- return false;
- }
- var self = this;
- function isUnmodifiedShadow(title) {
- return self.wiki.isShadowTiddler(title) && !self.wiki.tiddlerExists(title);
- }
- function confirmEditShadow(title) {
- return confirm($tw.language.getString(
- "ConfirmEditShadowTiddler",
- {variables:
- {title: title}
- }
- ));
- }
- var title = event.param || event.tiddlerTitle;
- if(isUnmodifiedShadow(title) && !confirmEditShadow(title)) {
- return false;
- }
- // Replace the specified tiddler with a draft in edit mode
- var draftTiddler = this.makeDraftTiddler(title);
- // Update the story and history if required
- if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
- var draftTitle = draftTiddler.fields.title,
- storyList = this.getStoryList();
- this.removeTitleFromStory(storyList,draftTitle);
- this.replaceFirstTitleInStory(storyList,title,draftTitle);
- this.addToHistory(draftTitle,event.navigateFromClientRect);
- this.saveStoryList(storyList);
- return false;
- }
-};
-
-// Delete a tiddler
-NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
- // Get the tiddler we're deleting
- var title = event.param || event.tiddlerTitle,
- tiddler = this.wiki.getTiddler(title),
- storyList = this.getStoryList(),
- originalTitle = tiddler ? tiddler.fields["draft.of"] : "",
- originalTiddler = originalTitle ? this.wiki.getTiddler(originalTitle) : undefined,
- confirmationTitle;
- if(!tiddler) {
- return false;
- }
- // Check if the tiddler we're deleting is in draft mode
- if(originalTitle) {
- // If so, we'll prompt for confirmation referencing the original tiddler
- confirmationTitle = originalTitle;
- } else {
- // If not a draft, then prompt for confirmation referencing the specified tiddler
- confirmationTitle = title;
- }
- // Seek confirmation
- if((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !confirm($tw.language.getString(
- "ConfirmDeleteTiddler",
- {variables:
- {title: confirmationTitle}
- }
- ))) {
- return false;
- }
- // Delete the original tiddler
- if(originalTitle) {
- if(originalTiddler) {
- $tw.hooks.invokeHook("th-deleting-tiddler",originalTiddler);
- }
- this.wiki.deleteTiddler(originalTitle);
- this.removeTitleFromStory(storyList,originalTitle);
- }
- // Invoke the hook function and delete this tiddler
- $tw.hooks.invokeHook("th-deleting-tiddler",tiddler);
- this.wiki.deleteTiddler(title);
- // Remove the closed tiddler from the story
- this.removeTitleFromStory(storyList,title);
- this.saveStoryList(storyList);
- // Trigger an autosave
- $tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
- return false;
-};
-
-/*
-Create/reuse the draft tiddler for a given title
-*/
-NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
- // See if there is already a draft tiddler for this tiddler
- var draftTitle = this.wiki.findDraft(targetTitle);
- if(draftTitle) {
- return this.wiki.getTiddler(draftTitle);
- }
- // Get the current value of the tiddler we're editing
- var tiddler = this.wiki.getTiddler(targetTitle);
- // Save the initial value of the draft tiddler
- draftTitle = this.generateDraftTitle(targetTitle);
- var draftTiddler = new $tw.Tiddler(
- tiddler,
- {
- title: draftTitle,
- "draft.title": targetTitle,
- "draft.of": targetTitle
- },
- this.wiki.getModificationFields()
- );
- this.wiki.addTiddler(draftTiddler);
- return draftTiddler;
-};
-
-/*
-Generate a title for the draft of a given tiddler
-*/
-NavigatorWidget.prototype.generateDraftTitle = function(title) {
- return this.wiki.generateDraftTitle(title);
-};
-
-// Take a tiddler out of edit mode, saving the changes
-NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
- var title = event.param || event.tiddlerTitle,
- tiddler = this.wiki.getTiddler(title),
- storyList = this.getStoryList();
- // Replace the original tiddler with the draft
- if(tiddler) {
- var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
- draftOf = (tiddler.fields["draft.of"] || "").trim();
- if(draftTitle) {
- var isRename = draftOf !== draftTitle,
- isConfirmed = true;
- if(isRename && this.wiki.tiddlerExists(draftTitle)) {
- isConfirmed = confirm($tw.language.getString(
- "ConfirmOverwriteTiddler",
- {variables:
- {title: draftTitle}
- }
- ));
- }
- if(isConfirmed) {
- // Create the new tiddler and pass it through the th-saving-tiddler hook
- var newTiddler = new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
- title: draftTitle,
- "draft.title": undefined,
- "draft.of": undefined
- },this.wiki.getModificationFields());
- newTiddler = $tw.hooks.invokeHook("th-saving-tiddler",newTiddler);
- this.wiki.addTiddler(newTiddler);
- // If enabled, relink references to renamed tiddler
- var shouldRelink = this.getAttribute("relinkOnRename","no").toLowerCase().trim() === "yes";
- if(isRename && shouldRelink && this.wiki.tiddlerExists(draftOf)) {
-console.log("Relinking '" + draftOf + "' to '" + draftTitle + "'");
- this.wiki.relinkTiddler(draftOf,draftTitle);
- }
- // Remove the draft tiddler
- this.wiki.deleteTiddler(title);
- // Remove the original tiddler if we're renaming it
- if(isRename) {
- this.wiki.deleteTiddler(draftOf);
- }
- // #2381 always remove new title & old
- this.removeTitleFromStory(storyList,draftTitle);
- this.removeTitleFromStory(storyList,draftOf);
- if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
- // Replace the draft in the story with the original
- this.replaceFirstTitleInStory(storyList,title,draftTitle);
- this.addToHistory(draftTitle,event.navigateFromClientRect);
- if(draftTitle !== this.storyTitle) {
- this.saveStoryList(storyList);
- }
- }
- // Trigger an autosave
- $tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
- }
- }
- }
- return false;
-};
-
-// Take a tiddler out of edit mode without saving the changes
-NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
- event = $tw.hooks.invokeHook("th-cancelling-tiddler", event);
- // Flip the specified tiddler from draft back to the original
- var draftTitle = event.param || event.tiddlerTitle,
- draftTiddler = this.wiki.getTiddler(draftTitle),
- originalTitle = draftTiddler && draftTiddler.fields["draft.of"];
- if(draftTiddler && originalTitle) {
- // Ask for confirmation if the tiddler text has changed
- var isConfirmed = true,
- originalTiddler = this.wiki.getTiddler(originalTitle),
- storyList = this.getStoryList();
- if(this.wiki.isDraftModified(draftTitle)) {
- isConfirmed = confirm($tw.language.getString(
- "ConfirmCancelTiddler",
- {variables:
- {title: draftTitle}
- }
- ));
- }
- // Remove the draft tiddler
- if(isConfirmed) {
- this.wiki.deleteTiddler(draftTitle);
- if(!event.paramObject || event.paramObject.suppressNavigation !== "yes") {
- if(originalTiddler) {
- this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
- this.addToHistory(originalTitle,event.navigateFromClientRect);
- } else {
- this.removeTitleFromStory(storyList,draftTitle);
- }
- this.saveStoryList(storyList);
- }
- }
- }
- return false;
-};
-
-// Create a new draft tiddler
-// event.param can either be the title of a template tiddler, or a hashmap of fields.
-//
-// The title of the newly created tiddler follows these rules:
-// * If a hashmap was used and a title field was specified, use that title
-// * If a hashmap was used without a title field, use a default title, if necessary making it unique with a numeric suffix
-// * If a template tiddler was used, use the title of the template, if necessary making it unique with a numeric suffix
-//
-// If a draft of the target tiddler already exists then it is reused
-NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
- event = $tw.hooks.invokeHook("th-new-tiddler", event);
- // Get the story details
- var storyList = this.getStoryList(),
- templateTiddler, additionalFields, title, draftTitle, existingTiddler;
- // Get the template tiddler (if any)
- if(typeof event.param === "string") {
- // Get the template tiddler
- templateTiddler = this.wiki.getTiddler(event.param);
- // Generate a new title
- title = this.wiki.generateNewTitle(event.param || $tw.language.getString("DefaultNewTiddlerTitle"));
- }
- // Get the specified additional fields
- if(typeof event.paramObject === "object") {
- additionalFields = event.paramObject;
- }
- if(typeof event.param === "object") { // Backwards compatibility with 5.1.3
- additionalFields = event.param;
- }
- if(additionalFields && additionalFields.title) {
- title = additionalFields.title;
- }
- // Make a copy of the additional fields excluding any blank ones
- var filteredAdditionalFields = $tw.utils.extend({},additionalFields);
- Object.keys(filteredAdditionalFields).forEach(function(fieldName) {
- if(filteredAdditionalFields[fieldName] === "") {
- delete filteredAdditionalFields[fieldName];
- }
- });
- // Generate a title if we don't have one
- title = title || this.wiki.generateNewTitle($tw.language.getString("DefaultNewTiddlerTitle"));
- // Find any existing draft for this tiddler
- draftTitle = this.wiki.findDraft(title);
- // Pull in any existing tiddler
- if(draftTitle) {
- existingTiddler = this.wiki.getTiddler(draftTitle);
- } else {
- draftTitle = this.generateDraftTitle(title);
- existingTiddler = this.wiki.getTiddler(title);
- }
- // Merge the tags
- var mergedTags = [];
- if(existingTiddler && existingTiddler.fields.tags) {
- $tw.utils.pushTop(mergedTags,existingTiddler.fields.tags);
- }
- if(additionalFields && additionalFields.tags) {
- // Merge tags
- mergedTags = $tw.utils.pushTop(mergedTags,$tw.utils.parseStringArray(additionalFields.tags));
- }
- if(templateTiddler && templateTiddler.fields.tags) {
- // Merge tags
- mergedTags = $tw.utils.pushTop(mergedTags,templateTiddler.fields.tags);
- }
- // Save the draft tiddler
- var draftTiddler = new $tw.Tiddler({
- text: "",
- "draft.title": title
- },
- templateTiddler,
- additionalFields,
- this.wiki.getCreationFields(),
- existingTiddler,
- filteredAdditionalFields,
- {
- title: draftTitle,
- "draft.of": title,
- tags: mergedTags
- },this.wiki.getModificationFields());
- this.wiki.addTiddler(draftTiddler);
- // Update the story to insert the new draft at the top and remove any existing tiddler
- if(storyList && storyList.indexOf(draftTitle) === -1) {
- var slot = storyList.indexOf(event.navigateFromTitle);
- if(slot === -1) {
- slot = this.getAttribute("openLinkFromOutsideRiver","top") === "bottom" ? storyList.length - 1 : slot;
- }
- storyList.splice(slot + 1,0,draftTitle);
- }
- if(storyList && storyList.indexOf(title) !== -1) {
- storyList.splice(storyList.indexOf(title),1);
- }
- this.saveStoryList(storyList);
- // Add a new record to the top of the history stack
- this.addToHistory(draftTitle);
- return false;
-};
-
-// Import JSON tiddlers into a pending import tiddler
-NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
- // Get the tiddlers
- var tiddlers = [];
- try {
- tiddlers = JSON.parse(event.param);
- } catch(e) {
- }
- // Get the current $:/Import tiddler
- var importTiddler = this.wiki.getTiddler(IMPORT_TITLE),
- importData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),
- newFields = new Object({
- title: IMPORT_TITLE,
- type: "application/json",
- "plugin-type": "import",
- "status": "pending"
- }),
- incomingTiddlers = [];
- // Process each tiddler
- importData.tiddlers = importData.tiddlers || {};
- $tw.utils.each(tiddlers,function(tiddlerFields) {
- tiddlerFields.title = $tw.utils.trim(tiddlerFields.title);
- var title = tiddlerFields.title;
- if(title) {
- incomingTiddlers.push(title);
- importData.tiddlers[title] = tiddlerFields;
- }
- });
- // Give the active upgrader modules a chance to process the incoming tiddlers
- var messages = this.wiki.invokeUpgraders(incomingTiddlers,importData.tiddlers);
- $tw.utils.each(messages,function(message,title) {
- newFields["message-" + title] = message;
- });
- // Deselect any suppressed tiddlers
- $tw.utils.each(importData.tiddlers,function(tiddler,title) {
- if($tw.utils.count(tiddler) === 0) {
- newFields["selection-" + title] = "unchecked";
- }
- });
- // Save the $:/Import tiddler
- newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
- this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
- // Update the story and history details
- if(this.getVariable("tv-auto-open-on-import") !== "no") {
- var storyList = this.getStoryList(),
- history = [];
- // Add it to the story
- if(storyList && storyList.indexOf(IMPORT_TITLE) === -1) {
- storyList.unshift(IMPORT_TITLE);
- }
- // And to history
- history.push(IMPORT_TITLE);
- // Save the updated story and history
- this.saveStoryList(storyList);
- this.addToHistory(history);
- }
- return false;
-};
-
-//
-NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
- var self = this,
- importTiddler = this.wiki.getTiddler(event.param),
- importData = this.wiki.getTiddlerDataCached(event.param,{tiddlers: {}}),
- importReport = [];
- // Add the tiddlers to the store
- importReport.push($tw.language.getString("Import/Imported/Hint") + "\n");
- $tw.utils.each(importData.tiddlers,function(tiddlerFields) {
- var title = tiddlerFields.title;
- if(title && importTiddler && importTiddler.fields["selection-" + title] !== "unchecked") {
- var tiddler = new $tw.Tiddler(tiddlerFields);
- tiddler = $tw.hooks.invokeHook("th-importing-tiddler",tiddler);
- self.wiki.addTiddler(tiddler);
- importReport.push("# [[" + tiddlerFields.title + "]]");
- }
- });
- // Replace the $:/Import tiddler with an import report
- this.wiki.addTiddler(new $tw.Tiddler({
- title: event.param,
- text: importReport.join("\n"),
- "status": "complete"
- }));
- // Navigate to the $:/Import tiddler
- this.addToHistory([event.param]);
- // Trigger an autosave
- $tw.rootWidget.dispatchEvent({type: "tm-auto-save-wiki"});
-};
-
-NavigatorWidget.prototype.handleFoldTiddlerEvent = function(event) {
- var paramObject = event.paramObject || {};
- if(paramObject.foldedState) {
- var foldedState = this.wiki.getTiddlerText(paramObject.foldedState,"show") === "show" ? "hide" : "show";
- this.wiki.setText(paramObject.foldedState,"text",null,foldedState);
- }
-};
-
-NavigatorWidget.prototype.handleFoldOtherTiddlersEvent = function(event) {
- var self = this,
- paramObject = event.paramObject || {},
- prefix = paramObject.foldedStatePrefix;
- $tw.utils.each(this.getStoryList(),function(title) {
- self.wiki.setText(prefix + title,"text",null,event.param === title ? "show" : "hide");
- });
-};
-
-NavigatorWidget.prototype.handleFoldAllTiddlersEvent = function(event) {
- var self = this,
- paramObject = event.paramObject || {},
- prefix = paramObject.foldedStatePrefix || "$:/state/folded/";
- $tw.utils.each(this.getStoryList(),function(title) {
- self.wiki.setText(prefix + title,"text",null,"hide");
- });
-};
-
-NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
- var self = this,
- paramObject = event.paramObject || {},
- prefix = paramObject.foldedStatePrefix;
- $tw.utils.each(this.getStoryList(),function(title) {
- self.wiki.setText(prefix + title,"text",null,"show");
- });
-};
-
-NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
- var paramObject = event.paramObject || {},
- from = paramObject.from || event.tiddlerTitle,
- to = paramObject.to;
- this.wiki.renameTiddler(from,to);
-};
-
-exports.navigator = NavigatorWidget;
-
-})();
diff --git a/tiddlywiki/plugins/aliases/$__core_ui_ViewTemplate_body.tid b/tiddlywiki/plugins/aliases/$__core_ui_ViewTemplate_body.tid
deleted file mode 100644
index afb08fc..0000000
--- a/tiddlywiki/plugins/aliases/$__core_ui_ViewTemplate_body.tid
+++ /dev/null
@@ -1,25 +0,0 @@
-created: 20160218185029873
-modified: 20160218192615033
-tags: $:/tags/ViewTemplate
-title: $:/core/ui/ViewTemplate/body
-
-<$reveal tag="div" class="tc-tiddler-body" type="nomatch" state=<> text="hide" retain="yes" animate="yes">
-
-<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">
-
-<$transclude>
-
-<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
-
-<$list filter="[title{!!title}listed[aliases]first[]]" variable="">
-You may have meant one of the following pages
-<$list filter="[title{!!title}listed[aliases]]">
-
<$link>{{!!title}}$link>
-$list>
-
-$list>
-$transclude>
-
-$list>
-
-$reveal>
diff --git a/tiddlywiki/plugins/aliases/plugin.info b/tiddlywiki/plugins/aliases/plugin.info
deleted file mode 100644
index ac1d147..0000000
--- a/tiddlywiki/plugins/aliases/plugin.info
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "title": "$:/plugins/mklauber/aliases",
- "description": "Aliases - Alias Manager",
- "author": "Matthew Lauber",
- "version": "5.1.22",
- "core-version": ">=5.1.18",
- "plugin-type": "plugin",
- "list": "",
- "source": "https://github.com/mklauber/tiddly-aliases"
-}
diff --git a/tiddlywiki/plugins/edit-comptext/config.tid b/tiddlywiki/plugins/edit-comptext/config.tid
deleted file mode 100644
index 134dd36..0000000
--- a/tiddlywiki/plugins/edit-comptext/config.tid
+++ /dev/null
@@ -1,25 +0,0 @@
-type: application/json
-title: $:/plugins/snowgoon88/edit-comptext/config
-
-{
- "configuration": {
- "caseSensitive" : false,
- "maxMatch" : 8,
- "minPatLength" : 2,
- "triggerKeyCombination" : "^ "
- },
- "template": [{
- "pattern": "[[",
- "filter": "[all[tiddlers]!is[system]]",
- "start": "[[",
- "end": "]]"
- },
- {
- "pattern": "||",
- "filter": "[all[tiddlers]!is[system]]",
- "start": "[[|",
- "end": "]]",
- "startOffset" : 2
- }
- ]
-}
diff --git a/tiddlywiki/plugins/edit-comptext/edit-comptext.js b/tiddlywiki/plugins/edit-comptext/edit-comptext.js
deleted file mode 100644
index 2bf641e..0000000
--- a/tiddlywiki/plugins/edit-comptext/edit-comptext.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*\
-title: $:/plugins/snowgoon88/edit-comptext/edit-comptext.js
-type: application/javascript
-module-type: widget
-
-Taken from original Edit-text widget
-Version 5.1.13 of TW5
-Add link-to-tiddler completion in framed.js and simple.js
-
-TODO : CHECK usefull, and particularly save_changes after every input ??
-TODO : where should popupNode be created in the DOM ?
-TODO : check that options are valid (numeric ?)
-var isNumeric = function(n) {
- return !isNaN(parseFloat(n)) && isFinite(n);
-};
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var editTextWidgetFactory = require("$:/core/modules/editor/factory.js").editTextWidgetFactory,
- FramedCompEngine = require("$:/plugins/snowgoon88/edit-comptext/framed.js").FramedCompEngine,
- SimpleCompEngine = require("$:/plugins/snowgoon88/edit-comptext/simple.js").SimpleCompEngine;
-
-exports["edit-comptext"] = editTextWidgetFactory(FramedCompEngine,SimpleCompEngine);
-
-})();
diff --git a/tiddlywiki/plugins/edit-comptext/examples.tid b/tiddlywiki/plugins/edit-comptext/examples.tid
deleted file mode 100644
index 05db890..0000000
--- a/tiddlywiki/plugins/edit-comptext/examples.tid
+++ /dev/null
@@ -1,60 +0,0 @@
-title: $:/plugins/snowgoon88/edit-comptext/examples
-
-The configuration file [[$:/plugins/snowgoon88/edit-comptext/config]] allow you to use the completion plugin for various usages. Here are some examples...
-
-!! Link Completion
-The basic and default usage. Completion is triggered by `[[`, the search is among all non-system tiddlers. When selected, the `title` of the tiddler is inserted in the text, surrounded by `[[` and `]]`. This gives the following Completion Template.
-
-
-```
-{
- "pattern": "[[",
- "title": "[all[tiddlers]!is[system]]",
- "start": "[[",
- "end": "]]"
-}
-```
-
-!! Link Completion and reposition to add Alias
-Another basic usage. Completion is triggered by `||`, the search is among all non-system tiddlers. When selected, the `title` of the tiddler is inserted in the text, surrounded by `[[|` and `]]`. The cursor is positionned just before the `|`, ready for typing an Alias.
-
-```
-{
- "pattern": "||",
- "filter": "[all[tiddlers]!is[system]]",
- "start": "[[|",
- "end": "]]",
- "startOffset" : 2
- }
-
-```
-
-!! Special macro completion
-I have a 'pnjin' macro that is invoked by `<>` where 'TiddlerPNJName is a tiddler that hold data about a PNJ. I use tiddlywiki to organise my Role Playing Games campaigns. So, I want `
>`. So...
-
-```
-{
- "pattern": "
>"
-}
-```
-
-!! Insert some templates or stamp or snippets into text.
-I frequently use some text pattern and I want to insert them easily. So, I could create several tiddlers, tagged '$:stamp' and in their body are the piece of texte I want to insert. The titles of these tiddlers always start with `$:/config/stamp/` (i.e. $:/config/stamp/macro, $:/config/stamp/list1, $:/config/stamp/list2). I want to trigger the completion by using `<<`, then I only want to chose among the last part of the titles of tiddlers tagged `$:stamp` so I use a mask (`$:/config/stamp/`) to only display the last part of the tiddlers title. When selectected, the `body` of the tiddler is inserted, with no surrounding strings. As a results, the Completion Template is (notice the `body` field):
-
-```
-{
- "pattern": "<<",
- "body": "[tag[$:stamp]]",
- "mask" : "$:/config/stamp/",
- "start": "",
- "end": ""
-}
-```
-
-!! And you ?
-If you have funny usages of completion, let me know. If you'd like to do something that is not yet possible, let me know...
-
-mail : snowgoon88(AT)gmail(DOT)com
\ No newline at end of file
diff --git a/tiddlywiki/plugins/edit-comptext/files/completion.js b/tiddlywiki/plugins/edit-comptext/files/completion.js
deleted file mode 100644
index 879a12d..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/completion.js
+++ /dev/null
@@ -1,759 +0,0 @@
-/*\
-title: $:/plugins/snowgoon88/edit-comptext/completion.js
-type: application/javascript
-module-type: library
-
-Try to make self-contained completion module.
-
-To use this 'module', you need a `widget` with a kind of `editarea` node.
-I do not know the exacte prerequisites of this editarea node for the module to
-work, but mostly one should be able to attach the following `eventHandler` to
-it:
- - input
- - keydown
- - keypress
- - keyup
-The `widget` is needed because I use:
- - widget.document
- - widget.wiki.filterTiddlers(...)
-
-From the Widget, once you have a proper editarea, you just have to call
- - var completion = new Completion( theWidget, theEditAreaNode, configObject);
-where `configObject` is expected to have the following fields. if a field is missing, a default value will be given.
-One can have many `elements' in the template array.
-
-{
- "configuration": {
- "caseSensitive" : false,
- "maxMatch" : 8,
- "minPatLength" : 2,
- "triggerKeyCombination" : "^ "
- },
- "template": [{
- "pattern": "[[",
- "filter": "[all[tiddlers]!is[system]]",
- "start": "[[",
- "end": "]]"
- }
- ]
-}
-
-TODO : CHECK if needed
-\*/
-
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-// To compute pixel coordinates of cursor
-var getCaretCoordinates = require("$:/plugins/snowgoon88/edit-comptext/cursor-position.js");
-
-/** Default Completion Attributes */
-var DEFATT = { maxMatch: 5, minPatLength: 2, caseSensitive: false, triggerKeyCombination: "^ " };
-
-/**
- * Struct for generic Completion Templates.
- *
- *
pat : pattern searched for.
- *
filter : filter operation used to find the list of completion options
- *
mask: replaced by "" when presenting completion options
- *
- */
- var Template = function( pat, filter, mask, field, start, end, startOffset ) {
- this.pat = pat;
- this.filter = filter;
- this.mask = "^"+regExpEscape(mask);
- this.field = field;
- this.start = start;
- this.end = end;
- this.pos = 0;
- this.startOffset = startOffset;
-};
-/**
- * Struct for storing completion options, as we need to memorise
- * the titles of the tiddlers when masked and when body must be displayed.
- */
-var OptCompletion = function( title, str ) {
- this.title = title;
- this.str = str;
-};
-
-var keyMatchGenerator = function(combination) {
- let singleMatchGenerator = function(character) {
- if (character === '^') {
- return event => event.ctrlKey;
- }
- else if (character === '+') {
- return event => event.shiftKey;
- }
- else if (character === '!') {
- return event => event.altKey;
- }
- else {
- return event => (event.keyCode || event.which) === character.charCodeAt(0);
- }
- };
-
- let matchers = [];
- for (let i = 0; i < combination.length; i++) {
- matchers.push(singleMatchGenerator(combination[i]));
- }
-
- return event => {
- for (let i = 0; i < matchers.length; i++) {
- if (!matchers[i](event)) {
- return false;
- }
- }
- return true;
- };
-};
-
-/**
- * Widget is needed in creating popupNode.
- * - widget.document
- * - widget.wiki.filterTiddlers(...)
- * - sibling : where to create the popup in the DOM.
- */
- var Completion = function( editWidget, areaNode, param, sibling, offTop, offLeft ) {
- console.log( "==Completion::creation" );
-
- //check if the widget uses the framed engine
- if(typeof sibling !== 'undefined') {
- //The framed engine propagates all keydown events to the parent document
- //Disable this and only propagate keydown events not handled by the autocompletion in our handleKeydown method
- editWidget._original_handleKeydownEvent = editWidget.handleKeydownEvent;
- editWidget.handleKeydownEvent = function(event) {
- return false;
- };
- }
-
- // About underlying Widget
- this._widget = editWidget;
- this._areaNode = areaNode;
- this._sibling = (typeof sibling !== 'undefined') ? sibling : this._areaNode;
- this._offTop = (typeof offTop !== 'undefined') ? offTop : 0;
- this._offLeft = (typeof offLeft !== 'undefined') ? offLeft : 0;
-
- // Completions attributes
- /** State */
- this._state = "VOID";
- this._template = undefined;
- /** Best matches */
- this._bestMatches = []; // An array of OptCompletion
- this._idxChoice = -1;
- /** Param */
- // maximum nb of match displayed
- //DEBUG console.log( "__PARAM" );
- //DEBUG console.log( param.configuration );
- this._maxMatch = param.configuration.maxMatch || DEFATT.maxMatch;
- // Beware that a (0 || 2) gives 2 !, so change way attributs are checked.
- this._minPatLength = DEFATT.minPatLength;
- if ('minPatLength' in param.configuration) {
- this._minPatLength = param.configuration.minPatLength;
- }
- this._caseSensitive= param.configuration.caseSensitive || DEFATT.caseSensitive;
- this._triggerKeyMatcher = keyMatchGenerator(param.configuration.triggerKeyCombination || DEFATT.triggerKeyCombination);
- /** Input information */
- this._lastChar = "";
- this._hasInput = false;
- /** List of Completion Templates */
- this._listTemp = [];
-
- // Read templates from Param
- if( param.template ) {
- var idT;
- for( idT=0; idT array of OptCompletion
- */
- this._findBestMatches = function( listChoice, pattern, nbMax) {
- // regexp search pattern, case sensitive
- var flagSearch = this._caseSensitive ? "" : "i" ;
- var regpat = RegExp( regExpEscape(pattern), flagSearch );
- var regpat_start = RegExp( "^"+regExpEscape(pattern), flagSearch );
- var regMask = RegExp( this._template.mask ? this._template.mask : "","");
- var nbMatch = 0;
- // nbMax set to _maxMatch if no value given
- nbMax = nbMax !== undefined ? nbMax : this._maxMatch;
-
- //DEBUG console.log( "__FIND masked="+regMask+" regPat="+regpat);
-
- this._bestMatches= [];
- var otherMatches = [];
- // We test every possible choice
- for( var i=0; i< listChoice.length; i++ ) {
- // apply mask over potential choice
- var maskedChoice = listChoice[i].replace( regMask, "");
- // Test first if pattern is found at START of the maskedChoice
- // THEN added to BestMatches
- if( regpat_start.test( maskedChoice )) {
- if (nbMatch >= nbMax) {
- this._bestMatches.push( new OptCompletion("","...") );
- return;
- } else {
- this._bestMatches.push( new OptCompletion(listChoice[i],maskedChoice) );
- nbMatch += 1;
- }
- }
- // then if pattern is found WITHIN the maskedChoice
- // added AFTER the choices that starts with pattern
- else if( regpat.test( maskedChoice ) ) {
- if (nbMatch >= nbMax) {
- // add all otherMatches to _bestMatches
- this._bestMatches.push( new OptCompletion("","") ) ; //separator
- this._bestMatches = this._bestMatches.concat( otherMatches );
- this._bestMatches.push( new OptCompletion("","...") );
- return;
- } else {
- otherMatches.push( new OptCompletion(listChoice[i],maskedChoice) );
- nbMatch += 1;
- }
- }
- }
- // Here, must add the otherMatches
- this._bestMatches.push( new OptCompletion("","") ) ; //separator
- this._bestMatches = this._bestMatches.concat( otherMatches );
- };
- /**
- * Change Selected Status of Items
- */
- this._next = function (node) {
- var count = node.children.length;
- //DEBUG console.log( "__NEXT: co="+count+" nbMatch="+this._bestMatches.length);
- if( this._bestMatches.length > 0 )
- this._goto( node, this._idxChoice < count - 1 ? this._idxChoice + 1 : -1);
- //DEBUG this._logStatus( "NexT" );
- };
- this._previous = function (node) {
- var count = node.children.length;
- var selected = this._idxChoice > -1;
- //DEBUG console.log( "__PREV: co="+count+" nbMatch="+this._bestMatches.length);
- if( this._bestMatches.length > 0 )
- this._goto( node, selected ? this._idxChoice - 1 : count - 1);
- //DEBUG this._logStatus( "PreV" );
- };
- // Should not be used, highlights specific item without any checks!
- this._goto = function (node, idx) {
- var lis = node.children;
- var selected = this._idxChoice > -1;
- if (selected) {
- lis[this._idxChoice].setAttribute("patt-selected", "false");
- }
-
- this._idxChoice = idx;
-
- if (idx > -1 && lis.length > 0) {
- lis[idx].setAttribute("patt-selected", "true");
- }
- };
- /**
- * Abort pattern and undisplay.
- */
- this._abortPattern = function (displayNode) {
- this._state = "VOID";
- this._bestChoices = [];
- this._idxChoice = -1;
- this._undisplay( displayNode );
- this._template = undefined;
- };
- /**
- * Display popupNode at the cursor position in areaNode.
- */
- this._display = function( areaNode, popupNode ) {
- if ( popupNode.style.display == 'none' ) {
- // Must get coordinate
- // Cursor coordinates within area + area coordinates + scroll
- var coord = getCaretCoordinates(areaNode, areaNode.selectionEnd);
- var styleSize = getComputedStyle(areaNode).getPropertyValue('font-size');
- var fontSize = parseFloat(styleSize);
-
- popupNode.style.left = (this._offLeft+areaNode.offsetLeft-areaNode.scrollLeft+coord.left) + 'px';
- popupNode.style.top = (this._offTop+areaNode.offsetTop-areaNode.scrollTop+coord.top+fontSize*2) + 'px';
- popupNode.style.display = 'block';
- }
- };
- /**
- * Undisplay someNode
- */
- this._undisplay = function( displayNode ) {
- if ( displayNode.style.display != 'none' ) {
- displayNode.style.display = 'none';
- }
- };
-
- /**
- * Used for debug
- */
- this._logStatus = function(msg) {
- console.log( "__STATUS: "+this._state+":-"+msg+"- idx="+this._idxChoice );
- };
-
-};
-// **************************************************************************
-// ******************************************************************eventCbk
-// **************************************************************************
-/**
- * Disable the *effects* of ENTER / UP / DOWN / ESC when needed.
- * Set _hasInput to false.
- */
-Completion.prototype.handleKeydown = function(event) {
- // key
- var key = event.keyCode;
- this._hasInput = false;
-
- //DEBUG console.log( "__KEYDOWN ("+key+") hasI="+this._hasInput);
-
- // ENTER while selecting
- if( (this._state === "PATTERN" || this._state === "SELECT") && key === 13 ) {
- event.preventDefault();
- event.stopPropagation();
- }
- // ESC while selecting
- else if( (this._state === "PATTERN" || this._state === "SELECT") && key === 27 ) {
- event.preventDefault();
- event.stopPropagation();
- }
- // UP/DOWN while a pattern is extracted
- else if( (key===38 || key===40) &&
- (this._state === "PATTERN" || this._state === "SELECT") ) {
- event.preventDefault();
- } else {
- //If we have not handled the keydown event, allow the widget to propagate it to the parent document
- if(this._widget._original_handleKeydownEvent) {
- this._widget._original_handleKeydownEvent(event);
- }
- }
-};
-/**
- * Means that something has been added/deleted => set _hasInput
- */
-Completion.prototype.handleInput = function(event) {
- this._hasInput = true;
- //DEBUG console.log( "__INPUT hasI="+this._hasInput );
-};
-
-/**
- * Set _lastChar, detects CTRL+SPACE.
- */
-Completion.prototype.handleKeypress = function(event) {
- var curPos = this._areaNode.selectionStart; // cursor position
- var val = this._areaNode.value; // text in the area
- // key
- var key = event.keyCode || event.which;
-
- this._lastChar = String.fromCharCode(key);
- //DEBUG console.log( "__KEYPRESS ("+key+") hasI="+this._hasInput+" char="+this._lastChar );
- //DEBUG this._logStatus( "KEYPRESS" );
-
- // Detect Ctrl+Space
- if( this._triggerKeyMatcher(event) && this._state === "VOID" ) {
- //Find a proper Template
- // first from which we can extract a pattern
- if( this._template === undefined ) {
- //DEBUG console.log("__SPACE : find a Template" );
- var idT, res;
- for( idT=0; idT < this._listTemp.length; idT++ ) {
- res = extractPattern( val, curPos, this._listTemp[idT] );
- //DEBUG console.log(" t="+this._listTemp[idT].pat+" res="+res);
- // res is not undefined => good template candidate
- if( res ) {
- this._template = this._listTemp[idT];
- this._state = "PATTERN";
- break;
- }
- }
- }
- else {
- //DEBUG console.log("__SPACE : already a template" );
- this._state = "PATTERN";
- }
- }
-};
-/**
- * ESC -> abort;
- * Detect [ -> VOID switch to _state=PATTERN
- * PATTERN || SELECT : ENTER -> insertText
- * UP/DOWN -> previous/next
- * pattern.length > _minPatternLength -> display
- */
-Completion.prototype.handleKeyup = function(event) {
- var curPos = this._areaNode.selectionStart; // cursor position
- var val = this._areaNode.value; // text in the area
- // key a
- var key = event.keyCode;
-
- //DEBUG console.log( "__KEYUP ("+key+") hasI="+this._hasInput );
-
- // ESC
- if( key === 27 ) {
- this._abortPattern( this._popNode );
- //DEBUG this._logStatus( "" );
- }
- // Check for every template
- if( this._hasInput && this._state === "VOID" ) {
- // check every template's pattern
- var idT, template;
- for( idT=0; idT < this._listTemp.length; idT++ ) {
- template = this._listTemp[idT];
- if( this._lastChar === template.pat[template.pos] ) {
- template.pos += 1;
- //DEBUG console.log( "__CHECK : pat="+template.pat+" pos="+template.pos );
- // Pattern totaly matched ?
- if( template.pos === template.pat.length ) {
- //DEBUG console.log( "__CHECK => found "+template.pat );
- this._state = "PATTERN";
- this._template = template;
-
- break; // get out of loop
- }
- }
- else {
- template.pos = 0;
- //DEBUG console.log( "__CHECK : pat="+template.pat+" pos="+template.pos );
- }
- }
- }
- // a pattern
- else if( this._state === "PATTERN" || this._state === "SELECT" ) {
- // Pattern below cursor : undefined if no pattern
- var pattern = extractPattern( val, curPos, this._template );
- if( key === 13 ) { // ENTER
- //DEBUG console.log( "KEY : Enter" );
- // Choice made in the displayNode ?
- var selected = this._idxChoice > -1 && this._idxChoice !== this._maxMatch;
- //DEBUG console.log( " > sel="+selected+" len="+this._bestChoices.length );
- if( selected ) {
- //DEBUG console.log( " > selected" );
- var temp = this._bestMatches[this._idxChoice];
- var str = temp.str;
- // if str is "" or "...", abort
- if (str === "" || str === "...") {
- this._abortPattern( this._popNode );
- this._areaNode.focus();
- return;
- }
- if( this._template.field === "body" ) {
- str = $tw.wiki.getTiddlerText( temp.title );
- }
- insertInto( this._areaNode,
- str,
- pattern.start, curPos, this._template );
- // save this new content
- this._widget.saveChanges( this._areaNode.value );
- }
- // otherwise take the first choice (if exists)
- else if( this._bestMatches.length > 0 ) {
- //DEBUG console.log( " > take first one" );
- var temp = this._bestMatches[0];
- var str = temp.str;
- // if str is "" or "...", abort
- if (str === "" || str === "...") {
- this._abortPattern( this._popNode );
- this._areaNode.focus();
- return;
- }
- if( this._template.field === "body" ) {
- str = $tw.wiki.getTiddlerText( temp.title );
- }
- insertInto( this._areaNode,
- str,
- pattern.start, curPos, this._template );
- // save this new content
- this._widget.saveChanges( this._areaNode.value );
- }
- this._abortPattern( this._popNode );
- //DEBUG this._logStatus( "" );
- }
- else if( key === 38 && this._hasInput === false) { // up
- this._state = "SELECT";
- event.preventDefault();
- this._previous( this._popNode );
- //DEBUG this._logStatus( pattern.text );
- //event.stopPropagation();
- }
- else if( key === 40 && this._hasInput === false) { // down
- this._state = "SELECT";
- event.preventDefault();
- this._next( this._popNode );
- //DEBUG this._logStatus( pattern.text );
- //event.stopPropagation();
- }
- else if( pattern ) { // pattern changed by keypressed
- this._idxChoice = -1;
- // log
- //DEBUG console.log( " PATTERN changed" );
- //DEBUG this._logStatus( pattern.text );
- //DEBUG console.log( " pat.length",pattern.text.length, " min",this._minPatLength);
- // Popup with choices if pattern at least minPatLength letters long
- if( pattern.text.length > (this._minPatLength-1) ) {
- //DEBUG console.log( " should compute" );
- // compute listOptions from templateFilter
- var allOptions;
- if( this._template )
- allOptions = this._widget.wiki.filterTiddlers( this._template.filter );
- else
- allOptions = this._widget.wiki.filterTiddlers("[all[tiddlers]]");
- this._findBestMatches( allOptions, pattern.text );
- this._popNode.innerHTML = "";
- //console.log( "BC "+ this._pattern + " => " + choice );
- if (this._bestMatches.length > 0) {
- for( var i=0; i" or "...", abort
- if (str === "" || str === "...") {
- this._abortPattern( this._popNode );
- this._areaNode.focus();
- return;
- }
-
- if( this._template.field === "body" ) {
- str = $tw.wiki.getTiddlerText( temp.title );
- }
- insertInto( this._areaNode,
- str,
- pattern.start, curPos, this._template );
- // save this new content
- this._widget.saveChanges( this._areaNode.value );
- this._abortPattern( this._popNode );
- this._areaNode.focus();
- //DEBUG this._logStatus( "" );
-}
-// **************************************************************************
-// ******************************************************** private functions
-// **************************************************************************
-/**
- * Create popup element.
- */
-var createPopup = function( widget, node ) {
- // Insert a special "div" element for poping up
- // Its 'display' property in 'style' control its visibility
- var popupNode = widget.document.createElement("div");
- popupNode.setAttribute( "style", "display:none; position: absolute;");
- popupNode.className = "tc-block-dropdown ect-block-dropdown";
- // Insert the element into the DOM
- node.parentNode.insertBefore(popupNode,node.nextSibling);
- //CHECK the domNodes is a attribute of Widget [widget.js]
- //CHECK this.domNodes.push(popupNode);
-
- return popupNode;
-};
-/**
- * Extract Pattern from text at a given position.
- *
- * Between previous template.pat (or '[[') and pos
- *
- * If no pattern -> undefined
- */
-var extractPattern = function( text, pos, template ) {
- // Detect previous and next ]]=>STOP or [[=>START
- var sPat = template.pat ? template.pat : '[[';
- var pos_prevOpen = text.lastIndexOf( sPat, pos );
- var ePat = template.end ? template.end : ']]';
- var pos_prevClosed = text.lastIndexOf( ePat, pos );
- var pos_nextClosed = text.indexOf( ePat, pos );
- //DEBUG console.log("__CALC st="+sPat+" -> en="+ePat );
- //DEBUG console.log("__CALC po="+pos_prevOpen+" pc="+pos_prevClosed+" nc="+pos_nextClosed+" pos="+pos);
- pos_nextClosed = (pos_nextClosed >= 0) ? pos_nextClosed : pos;
-
- if( (pos_prevOpen >= 0) && // must be opened
- ((pos_prevOpen > pos_prevClosed ) || // not closed yet
- (pos_prevClosed === pos))) { // closed at cursor
- //DEBUG console.log(" pat="+text.slice( pos_prevOpen+sPat.length, pos) );
- return { text: text.slice( pos_prevOpen+sPat.length, pos ),
- start: pos_prevOpen,
- end: pos_nextClosed
- };
- }
-};
-/**
- * Controls how list items are generated.
- * Function that takes two parameters :
- * - text : suggestion text
- * - input : the user’s input
- * Returns : list item.
- * Generates list items with the user’s input highlighted via .
- */
- var itemHTML = function (text, input) {
- // text si input === ''
- // otherwise, build RegExp that is global (g) and case insensitive (i)
- // to replace with $& where "$&" is the matched pattern
- var html = input === '' ? text : text.replace(RegExp(regExpEscape(input.trim()), "gi"), "$&");
- // the DOM element created
- var elem = create("li", {
- innerHTML: html,
- "patt-selected": "false",
- });
- return elem;
-};
-/**
- * Insert text into a textarea node,
- * enclosing in 'template.start..template.end'
- *
- * - posBefore : where the 'template.pat+pattern' starts
- * - posAfter : where the cursor currently is
- */
-var insertInto = function(node, text, posBefore, posAfter, template ) {
- //DEBUG console.log( "__INSERT : "+template.pattern+":"+template.filter+":"+template.mask+":"+template.field+":"+template.start+":"+template.end );
- var val = node.value;
- var sStart = template.start !== undefined ? template.start : '[[';
- var sEnd = template.end !== undefined ? template.end : ']]';
- var newVal = val.slice(0, posBefore) + sStart + text + sEnd + val.slice(posAfter);
- //console.log("__INSERT s="+sStart+" e="+sEnd);
- //console.log ("__INSERT pb="+posBefore+" pa="+posAfter+" txt="+text);
- //console.log( "NEW VAL = "+newVal );
- // WARN : Directly modifie domNode.value.
- // Not sure it does not short-circuit other update methods of the domNode....
- // i.e. could use widget.updateEditor(newVal) from edit-comptext widget.
- // but how to be sure that cursor is well positionned ?
- node.value = newVal;
-
- // if startOffset in Template, set cursor at beginning of inserted value,
- // with an Offset (usefull for aliasing links)
- if (template.startOffset) {
- let cursorPos = posBefore+template.startOffset;
- node.setSelectionRange( cursorPos, cursorPos );
- }
- else {
- node.setSelectionRange(posBefore+text.length+sStart.length+sEnd.length, posBefore+text.length+sStart.length+sEnd.length );
- }
-};
-/**
- * Add an '\' in front of -\^$*+?.()|[]{}
- */
-var regExpEscape = function (s) {
- return s.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&");
-};
-/**
- * Add an element in the DOM.
- */
-var create = function(tag, o) {
- var element = document.createElement(tag);
-
- for (var i in o) {
- var val = o[i];
-
- if (i === "inside") {
- $(val).appendChild(element);
- }
- else if (i === "around") {
- var ref = $(val);
- ref.parentNode.insertBefore(element, ref);
- element.appendChild(ref);
- }
- else if (i in element) {
- element[i] = val;
- }
- else {
- element.setAttribute(i, val);
- }
- }
-
- return element;
-};
-
-
-exports.Completion = Completion;
-
-})();
-
-
diff --git a/tiddlywiki/plugins/edit-comptext/files/cursor-position.js b/tiddlywiki/plugins/edit-comptext/files/cursor-position.js
deleted file mode 100644
index cf2541d..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/cursor-position.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*\
-Module that compute the pixel position of the cursor of a text
-ements.
-
-Taken from https://github.com/component/textarea-caret-position
-
-(as https://github.com/kir/js_cursor_position is not updated any more)
-\*/
-// Fonction anonyme executée immediatement
-( function(){
-
-// The properties that we copy into a mirrored div.
-// Note that some browsers, such as Firefox,
-// do not concatenate properties, i.e. padding-top, bottom etc. -> padding,
-// so we have to do every single property specifically.
-var properties = [
- 'direction', // RTL support
- 'boxSizing',
- 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does
- 'height',
- 'overflowX',
- 'overflowY', // copy the scrollbar for IE
-
- 'borderTopWidth',
- 'borderRightWidth',
- 'borderBottomWidth',
- 'borderLeftWidth',
- 'borderStyle',
-
- 'paddingTop',
- 'paddingRight',
- 'paddingBottom',
- 'paddingLeft',
-
- // https://developer.mozilla.org/en-US/docs/Web/CSS/font
- 'fontStyle',
- 'fontVariant',
- 'fontWeight',
- 'fontStretch',
- 'fontSize',
- 'fontSizeAdjust',
- 'lineHeight',
- 'fontFamily',
-
- 'textAlign',
- 'textTransform',
- 'textIndent',
- 'textDecoration', // might not make a difference, but better be safe
-
- 'letterSpacing',
- 'wordSpacing',
-
- 'tabSize',
- 'MozTabSize'
-
-];
-var isFirefox = false;
-if($tw.browser) {
- isFirefox = window.mozInnerScreenX != null;
-}
-
-function getCaretCoordinates(element, position, options) {
-
- var debug = options && options.debug || false;
- if (debug) {
- var el = document.querySelector('#input-textarea-caret-position-mirror-div');
- if ( el ) { el.parentNode.removeChild(el); }
- }
-
- // mirrored div
- var div = document.createElement('div');
- div.id = 'input-textarea-caret-position-mirror-div';
- document.body.appendChild(div);
-
- var style = div.style;
- var computed;
- if($tw.browser) {
- computed = window.getComputedStyle? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9
- }
- else {
- computed = element.currentStyle;
- }
-
-
- // default textarea styles
- style.whiteSpace = 'pre-wrap';
- if (element.nodeName !== 'INPUT')
- style.wordWrap = 'break-word'; // only for textarea-s
-
- // position off-screen
- style.position = 'absolute'; // required to return coordinates properly
- if (!debug)
- style.visibility = 'hidden'; // not 'display: none' because we want rendering
-
- // transfer the element's properties to the div
- properties.forEach(function (prop) {
- style[prop] = computed[prop];
- });
-
- if (isFirefox) {
- // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275
- if (element.scrollHeight > parseInt(computed.height))
- style.overflowY = 'scroll';
- } else {
- style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'
- }
-
- div.textContent = element.value.substring(0, position);
- // the second special handling for input type="text" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037
- if (element.nodeName === 'INPUT')
- div.textContent = div.textContent.replace(/\s/g, "\u00a0");
-
- var span = document.createElement('span');
- // Wrapping must be replicated *exactly*, including when a long word gets
- // onto the next line, with whitespace at the end of the line before (#7).
- // The *only* reliable way to do that is to copy the *entire* rest of the
- // textarea's content into the created at the caret position.
- // for inputs, just '.' would be enough, but why bother?
- span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all
- div.appendChild(span);
-
- var coordinates = {
- top: span.offsetTop + parseInt(computed['borderTopWidth']),
- left: span.offsetLeft + parseInt(computed['borderLeftWidth'])
- };
-
- if (debug) {
- span.style.backgroundColor = '#aaa';
- } else {
- document.body.removeChild(div);
- }
-
- return coordinates;
-}
-
-// Exporte as a module of node.js otherwise set as global
-if (typeof module != "undefined" && typeof module.exports != "undefined") {
- module.exports = getCaretCoordinates;
-} else {
- window.getCaretCoordinates = getCaretCoordinates;
-}
-
-})();
diff --git a/tiddlywiki/plugins/edit-comptext/files/edit-comptext.css b/tiddlywiki/plugins/edit-comptext/files/edit-comptext.css
deleted file mode 100644
index 06fb3ee..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/edit-comptext.css
+++ /dev/null
@@ -1,26 +0,0 @@
-
-\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock
-
-/* The \rules pragma at the top of the tiddler restricts the WikiText
- * to just allow macros and transclusion. This avoids mistakenly
- * triggering unwanted WikiText processing.
- *
- * MUST not save as text/css for macro to be processed
-*/
-
-.ect-block-dropdown li {
- display: block;
- padding: 4px 14px 4px 14px;
- text-decoration: none;
- color: <>; /*#5778d8;*/
- background: transparent;
-}
-.ect-block-dropdown li[patt-selected="true"] {
- color: <>; /*#ffffff; */
- background-color: <>; /*#5778d8; */
-}
-.ect-block-dropdown li[patt-selected="true"] mark {
- background: hsl(86, 100%, 21%);
- color: inherit;
-}
-
diff --git a/tiddlywiki/plugins/edit-comptext/files/framed.js b/tiddlywiki/plugins/edit-comptext/files/framed.js
deleted file mode 100644
index 7af1d97..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/framed.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*\
-title: $:/plugins/snowgoon88/edit-comptext/framed.js
-type: application/javascript
-module-type: library
-
-Taken from $:/core/modules/editor/engines/framed.js
-Text editor engine based on a simple input or textarea within an iframe. This is done so that the selection is preserved even when clicking away from the textarea
-
-\*/
-(function(){
-
-/*jslint node: true,browser: true */
-/*global $tw: false */
-"use strict";
-
-var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
-
-// Configuration tiddler
-var COMPLETION_OPTIONS = "$:/plugins/snowgoon88/edit-comptext/config";
-var Completion = require("$:/plugins/snowgoon88/edit-comptext/completion.js").Completion;
-var FramedEngine = require("$:/core/modules/editor/engines/framed.js").FramedEngine;
-
-function FramedCompEngine(options) {
- FramedEngine.call(this,options);
- this._configOptions = $tw.wiki.getTiddlerData( COMPLETION_OPTIONS, {} );
- this._completion = new Completion( this.widget, this.domNode, this._configOptions, this.dummyTextArea, this.iframeNode.offsetTop, this.iframeNode.offsetLeft );
-};
-
-FramedCompEngine.prototype = Object.create(FramedEngine.prototype);
-
-FramedCompEngine.prototype.constructor = FramedCompEngine;
-
-exports.FramedCompEngine = FramedCompEngine;
-$tw.modules.types.library["$:/core/modules/editor/engines/framed.js"].exports.FramedEngine = FramedCompEngine;
-})();
diff --git a/tiddlywiki/plugins/edit-comptext/files/simple.js b/tiddlywiki/plugins/edit-comptext/files/simple.js
deleted file mode 100644
index d17a1e6..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/simple.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*\
-title: $:/plugins/snowgoon88/edit-comptext/simple.js
-type: application/javascript
-module-type: library
-
-Taken from $:/core/modules/editor/engines/simple.js
-Text editor engine based on a simple input or textarea tag
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
-
-// Configuration tiddler
-var COMPLETION_OPTIONS = "$:/plugins/snowgoon88/edit-comptext/config";
-var Completion = require("$:/plugins/snowgoon88/edit-comptext/completion.js").Completion;
-var SimpleEngine = require("$:/core/modules/editor/engines/simple.js").SimpleEngine;
-
-function SimpleCompEngine(options) {
- SimpleEngine.call(this,options);
- this._configOptions = $tw.wiki.getTiddlerData( COMPLETION_OPTIONS, {} );
- this._completion = new Completion( this.widget, this.domNode, this._configOptions );
-};
-
-SimpleCompEngine.prototype = Object.create(SimpleEngine.prototype);
-
-SimpleCompEngine.prototype.constructor = SimpleCompEngine;
-
-
-exports.SimpleCompEngine = SimpleCompEngine;
-$tw.modules.types.library["$:/core/modules/editor/engines/simple.js"].exports.SimpleEngine = SimpleCompEngine;
-})();
diff --git a/tiddlywiki/plugins/edit-comptext/files/tiddlywiki.files b/tiddlywiki/plugins/edit-comptext/files/tiddlywiki.files
deleted file mode 100644
index 7bf52a6..0000000
--- a/tiddlywiki/plugins/edit-comptext/files/tiddlywiki.files
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "tiddlers": [
- {
- "file": "framed.js",
- "fields": {
- "type": "application/javascript",
- "title": "$:/plugins/snowgoon88/edit-comptext/framed.js",
- "module-type": "startup"
- }
- },{
- "file": "simple.js",
- "fields": {
- "type": "application/javascript",
- "title": "$:/plugins/snowgoon88/edit-comptext/simple.js",
- "module-type": "startup"
- }
- },{
- "file": "cursor-position.js",
- "fields": {
- "type": "application/javascript",
- "title": "$:/plugins/snowgoon88/edit-comptext/cursor-position.js",
- "module-type": "library"
- }
- },{
- "file": "completion.js",
- "fields": {
- "type": "application/javascript",
- "title": "$:/plugins/snowgoon88/edit-comptext/completion.js",
- "module-type": "library"
- }
- },{
- "file": "edit-comptext.css",
- "fields": {
- "type": "text/vnd.tiddlywiki",
- "title": "$:/plugins/snowgoon88/edit-comptext/edit-comptext.css",
- "tags": "[[$:/tags/Stylesheet]]"
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/tiddlywiki/plugins/edit-comptext/plugin.info b/tiddlywiki/plugins/edit-comptext/plugin.info
deleted file mode 100644
index 2d886dd..0000000
--- a/tiddlywiki/plugins/edit-comptext/plugin.info
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "title": "$:/plugins/snowgoon88/edit-comptext",
- "description": "Editor with some on-line completion capabilities",
- "author": "AlainD",
- "version": "0.9.3",
- "core-version": ">=5.1.13",
- "source": "https://github.com/snowgoon88/TW5-extendedit",
- "plugin-type": "plugin",
- "list": "readme usage examples"
-}
diff --git a/tiddlywiki/plugins/edit-comptext/readme.tid b/tiddlywiki/plugins/edit-comptext/readme.tid
deleted file mode 100644
index 703120c..0000000
--- a/tiddlywiki/plugins/edit-comptext/readme.tid
+++ /dev/null
@@ -1,39 +0,0 @@
-title: $:/plugins/snowgoon88/edit-comptext/readme
-
-!! What ?
-This plugin adds ''completion'' when editing the body of a tiddler.
-
-* Enter completion-mode by typing `[[` or `CTRL+SPACE`
-* A list of tiddlers with a title that matches the pattern between `[[` and cursor appears
-* `UP/DOWN` keys can select a tiddler, `ENTER` to validate
-* `NEW` : can click with mouse or touch surface to select your completion.
-* If there is only one match, `ENTER` selects it.
-* you can specify you own trigger pattern and the list of possible completions. See [[$:/plugins/snowgoon88/edit-comptext/usage]] for more details.
-* `NEW` : after completion, the cursor can be set inside the inserted text. This allows for easier creation of "aliased links" (try completion with `||` for example).
-* `NEW` : version 0.9.1 and higher, the default TW5 editor automatically has autocompletion as soon as the plugin is enabled (if TW5 version 5.1.22 or higher)
-
-!! To try it or get the latest news
-See [[http://snowgoon88.github.io/TW5-extendedit]]
-
-!! Install
-
-To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
-
-[[$:/plugins/snowgoon88/edit-comptext]]
-
-Sometime (prior to TW5.1.22), a small configuration step is then needed
-
-in `$:/ControlPanel -> Advanced -> Editor Type -> text/vnd.tiddlywiki` you must chose `comptext` instead of `text`.
-
-Reload and « voilà »...
-
-This plugin is quite mature now :o)
-
-!! Old version
-
-* A version compatible with 5.0.8 to 5.1.11 : [[http://snowgoon88.github.io/TW5-extendedit/index_5.1.11.html]]
-
-!! Source code
-On github [[https://github.com/snowgoon88/TW5-extendedit]]
-
-Get in touch : snowgoon88(AT)gmail(DOT)com
diff --git a/tiddlywiki/plugins/edit-comptext/usage.tid b/tiddlywiki/plugins/edit-comptext/usage.tid
deleted file mode 100644
index f725c6d..0000000
--- a/tiddlywiki/plugins/edit-comptext/usage.tid
+++ /dev/null
@@ -1,27 +0,0 @@
-title: $:/plugins/snowgoon88/edit-comptext/usage
-
-Now, this plugin should be automatically integrated in the common editors.
-
-In some older version of Tiddlywiki, you might have to change things in `$:/ControlPanel -> Advanced -> Editor Type -> text/vnd.tiddlywiki` to put `comptext` instead of `text`.
-
-Configuration of the edit-comptext plugin can be done through the tiddler [[$:/plugins/snowgoon88/edit-comptext/config]]. Use a JSON tiddler (do not forget to set the type to `application/json`. See some examples at [[$:/plugins/snowgoon88/edit-comptext/examples]]
-
-In the `configuration` object you can set :
-
-* `caseSensitive`: `true`/`false` (is search case sensitive ?)
-* `maxMatch` : an `integer` (max number of match displayed)
-* `minPatLength` : an `integer` (minimal length of a pattern to trigger completion search)
-* `triggerKeyCombination ` : a `string` representing the key combination that triggers the autocompletion popup. To use modifier keys in your combination, use following conversions : `ctrl` -> `^`, `alt` -> `!`, `shift` -> `+`. Note: ` ` (literally a whitespace) represents the `space` key.
-
-In the `template` array you can specify the various completion templates that will be used. Every template can have the following members.
-
-* `pattern` : `string` (pattern that triggers a completion, default "[[" )
-* `title` or `body`: `string` (the filter operators that gives the list of valid completions, default "[all[tiddlers]!is[system]]"). If you specify `body`, then the body of the tiddler will be inserted on selection.
-* `start` : `string` (when completion is chosen, start is put before the completion, default "[[")
-* `end` : `string` (when completion is chosen, end is put after the completion, default "]]")
-* `startOffset` : `interger` but OPTIONNAL. If provided, the cursor will be positionned `startOffset` characters after the beginning of the completed text. This is useful to create aliased links using "||" as a trigger.
-
-!! Current body of Config Tiddler
-
-{{$:/plugins/snowgoon88/edit-comptext/config}}
-
diff --git a/tiddlywiki/plugins/inc/buttons/open.tid b/tiddlywiki/plugins/inc/buttons/open.tid
deleted file mode 100644
index 4d17146..0000000
--- a/tiddlywiki/plugins/inc/buttons/open.tid
+++ /dev/null
@@ -1,11 +0,0 @@
-title: $:/plugins/tobibeer/inc/buttons/open
-
-<$button tooltip="Open this tiddler" class=<>>
-<$action-navigate/>
-<$list filter="[prefix[yes]]">
-{{$:/core/images/down-arrow}}
-$list>
-<$list filter="[prefix[yes]]">
-open
-$list>
-$button>
\ No newline at end of file
diff --git a/tiddlywiki/plugins/inc/macro.tid b/tiddlywiki/plugins/inc/macro.tid
deleted file mode 100644
index a7f9205..0000000
--- a/tiddlywiki/plugins/inc/macro.tid
+++ /dev/null
@@ -1,23 +0,0 @@
-title: $:/plugins/tobibeer/inc/macro
-tags: $:/tags/Macro
-
-\define tb-inc(tiddler)
-
-\end
-<>
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/about.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/about.tid
deleted file mode 100644
index 5190749..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/about.tid
+++ /dev/null
@@ -1,8 +0,0 @@
-created: 20200528213406686
-modified: 20200604181038520
-tags:
-title: $:/plugins/telmiger/simple-search/about
-type: text/vnd.tiddlywiki
-
-A nice and simple overlay interface for searching your wiki. Designed for mobile and desktop screens.
-''Reduce to the max.'' The standard search input field in the sidebar is removed, instead there is a {{$:/plugins/telmiger/simple-search/ui/Buttons/search}} [[button|$:/plugins/telmiger/simple-search/ui/Buttons/search]].
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/filter-other.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/filter-other.tid
deleted file mode 100644
index d1667b2..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/filter-other.tid
+++ /dev/null
@@ -1,9 +0,0 @@
-created: 20181230131454911
-creator: Thomas Elmiger
-modified: 20200604181038535
-modifier: Thomas Elmiger
-tags:
-title: $:/plugins/telmiger/simple-search/filter-other
-type: text/vnd.tiddlywiki
-
--caption,title
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-new-button.css.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-new-button.css.tid
deleted file mode 100644
index 79dbb48..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-new-button.css.tid
+++ /dev/null
@@ -1,9 +0,0 @@
-created: 20200528214941993
-modified: 20200604181038542
-tags:
-title: $:/plugins/telmiger/simple-search/hide-new-button.css
-type: text/vnd.tiddlywiki
-
-.tc-simple-search-results .tc-image-new-button {
- display: none;
-}
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-options-button.css.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-options-button.css.tid
deleted file mode 100644
index e2972a8..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/hide-options-button.css.tid
+++ /dev/null
@@ -1,9 +0,0 @@
-created: 20200528221013699
-modified: 20200604181038557
-tags:
-title: $:/plugins/telmiger/simple-search/hide-options-button.css
-type: text/vnd.tiddlywiki
-
-.tc-simple-search-results .tc-image-options-button {
- display: none;
-}
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/icon.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/icon.tid
deleted file mode 100644
index 3fa9ac6..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/icon.tid
+++ /dev/null
@@ -1,7 +0,0 @@
-created: 20181104090446387
-modified: 20200604181038568
-tags:
-title: $:/plugins/telmiger/simple-search/icon
-type: text/vnd.tiddlywiki
-
-{{$:/plugins/telmiger/simple-search/images/search-button}}
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/images/search-button.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/images/search-button.tid
deleted file mode 100644
index 37c00f7..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/images/search-button.tid
+++ /dev/null
@@ -1,11 +0,0 @@
-created: 20181031165637871
-creator: Thomas Elmiger
-modified: 20200604181038575
-modifier: Thomas Elmiger
-tags: $:/tags/Image
-title: $:/plugins/telmiger/simple-search/images/search-button
-type: text/vnd.tiddlywiki
-
-
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/license.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/license.tid
deleted file mode 100644
index 34b42f6..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/license.tid
+++ /dev/null
@@ -1,21 +0,0 @@
-created: 20180104062422859
-creator: Thomas Elmiger
-modified: 20200604181038647
-modifier: Thomas Elmiger
-tags:
-title: $:/plugins/telmiger/simple-search/license
-type: text/vnd.tiddlywiki
-
-`Simple Search is published under the MIT License.`
-
-!!! Simple Search
-The content of $:/plugins/telmiger/simple-search is
-Copyright (c), Thomas Elmiger, https://thomas-elmiger.ch
-
-!!! The MIT License (MIT)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/macros.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/macros.tid
deleted file mode 100644
index 306fb4d..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/macros.tid
+++ /dev/null
@@ -1,35 +0,0 @@
-created: 20190303170108747
-creator: Thomas Elmiger
-modified: 20200604181038686
-modifier: Thomas Elmiger
-tags: $:/tags/Macro
-title: $:/plugins/telmiger/simple-search/macros
-type: text/vnd.tiddlywiki
-
-\define tempStory() $:/temp/simple-search/story
-
-\define simple-search-openSearch()
-<$action-navigate $to="$:/Search" $scroll="no"/>
-<$list filter="[list[$:/StoryList]] +[field:title[$:/AdvancedSearch]]">
-<>
-$list>
-\end
-
-\define simple-search-closeSearch()
-<$action-sendmessage $message="tm-close-tiddler" $param="$:/Search"/>
-<>
-\end
-
-\define simple-search-closeAdvanced()
-<$set name="myStory" filter="[list[$:/StoryList]]" >
-<$action-setfield $tiddler=<> $field="text" $value=<>/>
-$set>
-<$action-sendmessage $message="tm-close-tiddler" $param="$:/AdvancedSearch"/>
-\end
-
-\define simple-search-restoreAdvanced()
-<$list filter="[!is[missing]]">
-<$action-setfield $tiddler="$:/StoryList" list={{{ [get[text]] }}}/>
-<$action-deletetiddler $tiddler=<>/>
-$list>
-\end
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/readme.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/readme.tid
deleted file mode 100644
index 5d2273a..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/readme.tid
+++ /dev/null
@@ -1,47 +0,0 @@
-created: 20170208062643245
-creator: Thomas Elmiger
-modified: 20200604181038731
-modifier: Thomas Elmiger
-tags: EditorCounter
-title: $:/plugins/telmiger/simple-search/readme
-type: text/vnd.tiddlywiki
-
-!! Simple Search
-
-{{$:/plugins/telmiger/simple-search/about}}
-
-
-!!! Keyboard accessible
-
-* Press Shift + Cmd + Space to ''launch'' or ''close'' Simple Search (or define your own shortcut [[in the control panel|$:/core/ui/ControlPanel/KeyboardShortcuts]]).
-* Navigate with Tab
-** {{$:/core/ui/Buttons/advanced-search}} takes you to $:/AdvancedSearch
-** the next Tab jumps to the search results.
-
-Depending on your browser and settings, you can select a list item using Tab or up and down arrow keys, finally confirm your choice with Enter.
-
-
-!!! Search in fields
-Primary results are listed for tiddlers containing the search term in the ''title'' OR the ''caption'' fields.
-
-The secondary list finds results based on all other fields (not title nor caption). This can be adapted via settings.
-
-
-!!! Create tiddlers
-
-Empty result list? No problem. Create missing tiddlers using the search term as title and caption.
-
-* Hit Tab until you reach the plus button (+).
-* Create a tiddler with Enter.
-
-See template options on the ''settings tab''. – Hat tip to //Diego Mesa// for inspiring this feature.
-
-
-!!! Settings
-
-Make sure to visit the ''settings tab'' to adjust your preferences.
-
-
-!! Core overruling
-
-This plugin overwrites $:/core/ui/SideBarSegments/search and nothing else.
\ No newline at end of file
diff --git a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/results.tid b/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/results.tid
deleted file mode 100644
index 79413db..0000000
--- a/tiddlywiki/plugins/simple-search/_system/plugins/telmiger/simple-search/results.tid
+++ /dev/null
@@ -1,23 +0,0 @@
-created: 20181101220620505
-creator: Thomas Elmiger
-modified: 20200604181038739
-modifier: Thomas Elmiger
-tags:
-title: $:/plugins/telmiger/simple-search/results
-type: text/vnd.tiddlywiki
-
-\define close-simple-search()
-<>
-<$action-navigate $to=<>/>
-\end
-