mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-07 21:36:06 +00:00
Change "tw-*" variables to "tv-*"
This commit is contained in:
@@ -171,12 +171,12 @@ describe("Widget module", function() {
|
||||
it("should deal with SVG elements", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Construct the widget node
|
||||
var text = "<svg class='tw-image-new-button' viewBox='83 81 50 50' width='22pt' height='22pt'><path d='M 101.25 112.5 L 101.25 127.5 C 101.25 127.5 101.25 127.5 101.25 127.5 L 101.25 127.5 C 101.25 129.156855 102.593146 130.5 104.25 130.5 L 111.75 130.5 C 113.406854 130.5 114.75 129.156854 114.75 127.5 L 114.75 112.5 L 129.75 112.5 C 131.406854 112.5 132.75 111.156854 132.75 109.5 L 132.75 102 C 132.75 100.343146 131.406854 99 129.75 99 L 114.75 99 L 114.75 84 C 114.75 82.343146 113.406854 81 111.75 81 L 104.25 81 C 104.25 81 104.25 81 104.25 81 C 102.593146 81 101.25 82.343146 101.25 84 L 101.25 99 L 86.25 99 C 86.25 99 86.25 99 86.25 99 C 84.593146 99 83.25 100.343146 83.25 102 L 83.25 109.5 C 83.25 109.5 83.25 109.5 83.25 109.5 L 83.25 109.5 C 83.25 111.156855 84.593146 112.5 86.25 112.5 Z'/></svg>\n";
|
||||
var text = "<svg class='tv-image-new-button' viewBox='83 81 50 50' width='22pt' height='22pt'><path d='M 101.25 112.5 L 101.25 127.5 C 101.25 127.5 101.25 127.5 101.25 127.5 L 101.25 127.5 C 101.25 129.156855 102.593146 130.5 104.25 130.5 L 111.75 130.5 C 113.406854 130.5 114.75 129.156854 114.75 127.5 L 114.75 112.5 L 129.75 112.5 C 131.406854 112.5 132.75 111.156854 132.75 109.5 L 132.75 102 C 132.75 100.343146 131.406854 99 129.75 99 L 114.75 99 L 114.75 84 C 114.75 82.343146 113.406854 81 111.75 81 L 104.25 81 C 104.25 81 104.25 81 104.25 81 C 102.593146 81 101.25 82.343146 101.25 84 L 101.25 99 L 86.25 99 C 86.25 99 86.25 99 86.25 99 C 84.593146 99 83.25 100.343146 83.25 102 L 83.25 109.5 C 83.25 109.5 83.25 109.5 83.25 109.5 L 83.25 109.5 C 83.25 111.156855 84.593146 112.5 86.25 112.5 Z'/></svg>\n";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki,{parseAsInline:true}),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe("<svg class='tw-image-new-button' height='22pt' viewBox='83 81 50 50' width='22pt'><path d='M 101.25 112.5 L 101.25 127.5 C 101.25 127.5 101.25 127.5 101.25 127.5 L 101.25 127.5 C 101.25 129.156855 102.593146 130.5 104.25 130.5 L 111.75 130.5 C 113.406854 130.5 114.75 129.156854 114.75 127.5 L 114.75 112.5 L 129.75 112.5 C 131.406854 112.5 132.75 111.156854 132.75 109.5 L 132.75 102 C 132.75 100.343146 131.406854 99 129.75 99 L 114.75 99 L 114.75 84 C 114.75 82.343146 113.406854 81 111.75 81 L 104.25 81 C 104.25 81 104.25 81 104.25 81 C 102.593146 81 101.25 82.343146 101.25 84 L 101.25 99 L 86.25 99 C 86.25 99 86.25 99 86.25 99 C 84.593146 99 83.25 100.343146 83.25 102 L 83.25 109.5 C 83.25 109.5 83.25 109.5 83.25 109.5 L 83.25 109.5 C 83.25 111.156855 84.593146 112.5 86.25 112.5 Z'></path></svg>\n");
|
||||
expect(wrapper.innerHTML).toBe("<svg class='tv-image-new-button' height='22pt' viewBox='83 81 50 50' width='22pt'><path d='M 101.25 112.5 L 101.25 127.5 C 101.25 127.5 101.25 127.5 101.25 127.5 L 101.25 127.5 C 101.25 129.156855 102.593146 130.5 104.25 130.5 L 111.75 130.5 C 113.406854 130.5 114.75 129.156854 114.75 127.5 L 114.75 112.5 L 129.75 112.5 C 131.406854 112.5 132.75 111.156854 132.75 109.5 L 132.75 102 C 132.75 100.343146 131.406854 99 129.75 99 L 114.75 99 L 114.75 84 C 114.75 82.343146 113.406854 81 111.75 81 L 104.25 81 C 104.25 81 104.25 81 104.25 81 C 102.593146 81 101.25 82.343146 101.25 84 L 101.25 99 L 86.25 99 C 86.25 99 86.25 99 86.25 99 C 84.593146 99 83.25 100.343146 83.25 102 L 83.25 109.5 C 83.25 109.5 83.25 109.5 83.25 109.5 L 83.25 109.5 C 83.25 111.156855 84.593146 112.5 86.25 112.5 Z'></path></svg>\n");
|
||||
expect(wrapper.firstChild.namespaceURI).toBe("http://www.w3.org/2000/svg");
|
||||
});
|
||||
|
||||
|
@@ -17,10 +17,10 @@ This is done in `bld.sh` by this command:
|
||||
|
||||
It saves the tiddler ReadMe to the file `./readme.md` in the `text/html` format.
|
||||
|
||||
By default, tiddler links will be rendered as `<a>` links to a relative URI consisting of the title of the tiddler. This behaviour can be overridden by defining the macro `tw-wikilink-template`, as is done at the top of the tiddler ReadMe:
|
||||
By default, tiddler links will be rendered as `<a>` links to a relative URI consisting of the title of the tiddler. This behaviour can be overridden by defining the macro `tv-wikilink-template`, as is done at the top of the tiddler ReadMe:
|
||||
|
||||
```
|
||||
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
\define tv-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
```
|
||||
|
||||
See the LinkWidget for more details.
|
||||
|
@@ -13,7 +13,7 @@ The import tiddlers message is usually generated with the DropzoneWidget or the
|
||||
|
||||
! Configuration Variables
|
||||
|
||||
The variable `tw-auto-open-on-import` controls whether the `tm-import-tiddlers` message automatically triggers the display of the pending import tiddler [[$:/Import]]:
|
||||
The variable `tv-auto-open-on-import` controls whether the `tm-import-tiddlers` message automatically triggers the display of the pending import tiddler [[$:/Import]]:
|
||||
|
||||
* ''no'': The pending import tiddler is not opened in the story
|
||||
* ''yes'': The pending import tiddler is opened in th story. This is the default
|
||||
|
@@ -2,7 +2,7 @@ created: 201308251449
|
||||
modified: 201308251449
|
||||
title: ContributingTemplate
|
||||
|
||||
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
\define tv-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
! Contributing to TiddlyWiki5
|
||||
|
||||
{{Contributing}}
|
||||
|
@@ -3,7 +3,7 @@ modified: 20131222161808390
|
||||
title: ReadMe
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
\define tv-wikilink-template() http://tiddlywiki.com/static/$uri_doubleencoded$.html
|
||||
! Welcome to TiddlyWiki
|
||||
|
||||
{{HelloThere}}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
title: TiddlyWiki2ReadMe
|
||||
|
||||
\define tw-wikilinks() no
|
||||
\define tv-wikilinks() no
|
||||
! Building TiddlyWikiClassic
|
||||
{{Building TiddlyWikiClassic}}
|
||||
|
@@ -14,14 +14,14 @@ The `link` widget generates links to tiddlers. (Use the HTML `<a>` element to ge
|
||||
|
||||
The content of the link widget is rendered within the `<a>` tag.
|
||||
|
||||
The default value of the tooltip attribute is `<<tw-wikilink-tooltip>>`.
|
||||
The default value of the tooltip attribute is `<<tv-wikilink-tooltip>>`.
|
||||
|
||||
This means that you can control the text of a link tooltip in several ways:
|
||||
|
||||
```
|
||||
<$link to="HelloThere" tooltip="Custom tooltip">Link 1</$link>
|
||||
|
||||
<$set name="tw-wikilink-tooltip" value="I'm a link to {{!!title}}">
|
||||
<$set name="tv-wikilink-tooltip" value="I'm a link to {{!!title}}">
|
||||
<$link to="HelloThere">Link 2</$link>
|
||||
</$set>
|
||||
|
||||
@@ -31,7 +31,7 @@ Renders as:
|
||||
|
||||
<$link to="HelloThere" tooltip="Custom tooltip">Link 1</$link>
|
||||
|
||||
<$set name="tw-wikilink-tooltip" value="I'm a link to {{!!title}}">
|
||||
<$set name="tv-wikilink-tooltip" value="I'm a link to {{!!title}}">
|
||||
<$link to="HelloThere">Link 2</$link>
|
||||
</$set>
|
||||
|
||||
@@ -40,7 +40,7 @@ Note that the tooltip is rendered with the current tiddler set to the target of
|
||||
A useful convention is to set the tooltip like this:
|
||||
|
||||
```
|
||||
\define tw-wikilink-tooltip()
|
||||
\define tv-wikilink-tooltip()
|
||||
<$transclude field="tooltip"><$transclude field="title"/></$transclude>
|
||||
\end
|
||||
```
|
||||
@@ -60,32 +60,32 @@ This causes the tooltip to be the ''tooltip'' field of the target tiddler. If th
|
||||
|
||||
Configuration macros can be used to modify the behaviour of the link widget.
|
||||
|
||||
!! tw-wikilinks
|
||||
!! tv-wikilinks
|
||||
|
||||
Links are suppressed if the macro `tw-wikilinks` evaluates to the string `no`. For example:
|
||||
Links are suppressed if the macro `tv-wikilinks` evaluates to the string `no`. For example:
|
||||
|
||||
```
|
||||
\define tw-wikilinks() no
|
||||
\define tv-wikilinks() no
|
||||
```
|
||||
|
||||
!! tw-wikilink-template
|
||||
!! tv-wikilink-template
|
||||
|
||||
The target of the link widget defaults to the URL encoded title of the tiddler. The `href` can be templated by defining the configuration macro `tw-wikilink-template`, and including within it the token `$uri_encoded$`. For example:
|
||||
The target of the link widget defaults to the URL encoded title of the tiddler. The `href` can be templated by defining the configuration macro `tv-wikilink-template`, and including within it the token `$uri_encoded$`. For example:
|
||||
|
||||
```
|
||||
\define tw-wikilink-template() http://tiddlywiki.com/#$uri_encoded$
|
||||
\define tv-wikilink-template() http://tiddlywiki.com/#$uri_encoded$
|
||||
```
|
||||
|
||||
The token `$uri_doubleencoded$` is replaced by the double encoded title of the tiddler.
|
||||
|
||||
Note that in the browser the `<a>` element generated by the link widget has a JavaScript event handler that navigates directly to the target tiddler, ignoring the `href` attribute.
|
||||
|
||||
!! tw-wikilink-tooltip
|
||||
!! tv-wikilink-tooltip
|
||||
|
||||
Provides default text for the link tooltip:
|
||||
|
||||
```
|
||||
\define tw-wikilink-tooltip() This is a link to {{!!title}}
|
||||
\define tv-wikilink-tooltip() This is a link to {{!!title}}
|
||||
<$link to="HelloThere"/>
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user