1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-25 04:14:40 +00:00

Compare commits

...

74 Commits

Author SHA1 Message Date
Jermolene
f1e909278c Version update 2013-11-19 12:21:12 +00:00
Jermolene
8d3613e8b4 Docs updates 2013-11-19 12:21:08 +00:00
Jermolene
3fd3e408fc Adopt a brighter link colour 2013-11-19 12:17:31 +00:00
Jermolene
a2fcc59648 Docs update 2013-11-19 12:17:22 +00:00
Jermolene
223e9c4747 FIx margins and spacing 2013-11-19 12:17:16 +00:00
Jermolene
b63f7a7416 Fix missing seconds in serialised date fields 2013-11-19 12:14:37 +00:00
Jermolene
905d3e6e1e Docs update 2013-11-18 09:01:06 +00:00
Jermolene
90a0eca2f5 Add dropdown interface for setting the type of a tiddler 2013-11-18 09:00:25 +00:00
Jermolene
7658789971 Style tweaks for the edit template 2013-11-18 09:00:00 +00:00
Jermolene
9257c8205f More information about Jermolene 2013-11-18 08:58:23 +00:00
Jermolene
b117f74666 Make the toolbars be tag driven 2013-11-17 21:53:39 +00:00
Jermolene
3b35d7dfe4 Fixed problem with greedy regexp for macrocalls
It was preventing this from working:

```
<<macro>><<bacrp>><<sdf>><<qweqwe>>
```
2013-11-17 21:53:12 +00:00
Jermolene
29c0f7156b Fix overlooked typo
Ouch.
2013-11-16 22:50:10 +00:00
Jermolene
0d2ed8f112 More release docs 2013-11-16 17:51:20 +00:00
Jermolene
99a6b1bcc0 More TiddlyWeb docs 2013-11-15 23:02:30 +00:00
Jermolene
da4cdf2d3b Refactor edit template to be driven by $:/tags/EditTemplate tag 2013-11-15 22:55:32 +00:00
Jermolene
26cc62cff7 Fix problem with tiddler info panel in Firefox
Fixes #104
2013-11-15 22:46:17 +00:00
Jermolene
b1992714ed Docs update 2013-11-15 22:09:42 +00:00
Jermolene
ecca7a3ea9 TiddlyWeb control panel update 2013-11-15 22:09:06 +00:00
Jermolene
4b84d9bfe5 Update to pre-release version number
I should have done this immediately after the alpha.14 release.
2013-11-15 22:08:57 +00:00
Jermolene
92b1932fcf Update docs for TiddlyWeb 2013-11-15 22:08:23 +00:00
Jermolene
9a6e404215 Fix modules list in the Internal tab of Control Panel 2013-11-15 22:08:16 +00:00
Jermolene
939ad11eae Rename the 'setvariable' widget to 'set'
Sleeker.
2013-11-15 18:31:39 +00:00
Jermolene
6785c49734 Better styling for embedded PDFs 2013-11-15 18:30:57 +00:00
Jermolene
45c51481de Improve performance of tag handling with some caching 2013-11-13 23:33:32 +00:00
Jermolene
874bd7b2b8 Tweaks tests
This was the only place we were using the `variables` option to the
widget constructor.
2013-11-13 21:26:13 +00:00
Jermolene
fc6dd83f2f Use prototypal inheritance to speed up the inheritance of widget variables
Now we reuse the prototype mechanism to let javascript do the work of
searching up the parent chain.
2013-11-13 21:25:45 +00:00
Jermolene
a8129874fb Docs update 2013-11-13 20:21:28 +00:00
Jermolene
c7d5905242 Fix view format=date so that it doesn't crash on empty fields 2013-11-13 19:41:54 +00:00
Jermolene
02d3620d93 Update the tiddler info panel to use the new tw-popup class
This fixes the problem with the inability to click on items within the
tiddler info panel (including the static URL)
2013-11-12 22:03:20 +00:00
Jermolene
b304e3fe40 Update the reveal widget to set the tw-popup class 2013-11-12 22:02:43 +00:00
Jermolene
06a66cf24e Improve popup dismissal
Now we ignore clicks if they come from an element that has an ancestor
with the class `tw-popup`
2013-11-12 22:02:26 +00:00
Jermolene
145e3ece78 Fix $tw.utils.hasClass() to work even if the element doesn't have a className property 2013-11-12 22:01:31 +00:00
Jermolene
24e361da77 Removed inadvertent alert() 2013-11-12 20:58:54 +00:00
Jermolene
1b9614eb9d Docs update 2013-11-12 20:54:28 +00:00
Jermolene
791033d751 First pass at a saver for IE10 and above
It's not great, sadly. Clicking save in the browser pulls up an
unobtrusive bar at the bottom of the browser window where you can click
"save". You then get a new copy of your wiki in the downloads folder.
2013-11-12 20:49:00 +00:00
Jermolene
9748709759 Fix up prematutely committed static link tab for tw5.com 2013-11-12 20:29:53 +00:00
Jermolene
b885743efe Fix typo 2013-11-12 20:29:22 +00:00
Jermolene
8ec92405fd Add urlencoded and doubleurlencoded formats to the view widget 2013-11-12 20:29:14 +00:00
Jermolene
e68ab95ecb For tw5.com add a link in the info panel to the static tiddler representation 2013-11-12 19:52:57 +00:00
Jermolene
d2dbc73448 Correct typo 2013-11-12 19:52:25 +00:00
Jermolene
4a5a8dd773 Fix the execution context for widget attributes specified as macros
We need to ensure that variables in the tree up to this point are
accessible when we render the macro text.
2013-11-12 19:52:17 +00:00
Jermolene
439dfcb172 Added a link to Bob Robison's TW5 theme 2013-11-12 15:34:14 +00:00
Jermolene
f6a4ea6b0f Fixed typo from d64590a12b 2013-11-11 23:44:55 +00:00
Jeremy Ruston
8681e0228d Merge pull request #212 from grayeul/closeAllOthers
Add support for close-others
2013-11-11 14:46:05 -08:00
Jeremy Ruston
c1123cb3e9 Merge pull request #214 from grayeul/sign-cla2
CLA signature from @grayeul
2013-11-11 14:45:12 -08:00
Jermolene
d64590a12b Fixed problem with target fields/index being erroneously applied to template
See here for discussion:

https://groups.google.com/d/msg/TiddlyWiki/D3MBNhjaT3E/ph0ZuAhuPFMJ
2013-11-11 22:29:38 +00:00
Jermolene
e274a0c7d1 Make sure we use state tiddler titles in the $:/state namespace 2013-11-11 15:27:12 +00:00
Jermolene
51fe1e20e8 Make sure that searching for the empty string returns all available tiddlers
Makes sense because every tiddler contains the empty string. This
restores the functionality of the tag editor dropdown.
2013-11-11 15:26:41 +00:00
Grayeul
9c4ffae1b3 Remove close-others-button from core/images 2013-11-11 07:52:04 -06:00
Grayeul
3d0c6cf41e Fixed missing reference to old CloseAllOthers 2013-11-11 07:48:54 -06:00
Grayeul
3800d3b2b1 Merge branch 'closeAllOthers' of https://github.com/grayeul/TiddlyWiki5 into closeAllOthers
Conflicts:
	core/modules/widgets/navigator.js

merging namechange.
2013-11-11 07:41:22 -06:00
Grayeul
da54236f5a Change names to tw=close-other-tiddlers and handleCloseOtherTiddlersEvent 2013-11-11 07:34:19 -06:00
Grayeul
c930d84d01 Add support for close-all-others 2013-11-11 07:28:29 -06:00
Grayeul
2317f779e9 sign cla 2013-11-11 07:18:58 -06:00
Jermolene
c501e70512 Add new blog post link to docs 2013-11-11 12:42:49 +00:00
Jermolene
8357d90e59 Fix bug caused when creating a tiddler title starting or ending with a space 2013-11-11 08:48:06 +00:00
Grayeul
efef6261b8 Add support for close-all-others 2013-11-10 22:09:52 -06:00
Jermolene
95b7a5d4fe Add host configuration to TiddlyWeb control panel tab 2013-11-10 23:28:03 +00:00
Jermolene
2c55c7ca82 Fix typo 2013-11-10 23:27:44 +00:00
Jermolene
02dda51269 Docs updates 2013-11-10 23:17:10 +00:00
Jermolene
083cb848f2 Version update 2013-11-10 23:15:19 +00:00
Jermolene
254da0b170 Clean up the tools tab 2013-11-10 23:14:23 +00:00
Jermolene
8b0b9eafb8 Simplify the page controls by dropping the drop shadow
Makes the icons less blurry in Retina™ displays
2013-11-10 23:04:41 +00:00
Jermolene
04e2f18ff1 Remove tooltip, classes and styles from transclusion syntax
Now that transclusion doesn't generate any intrinsic elements we don't
have an element to attach the tooltip, classes and styles to.
2013-11-10 22:46:37 +00:00
Jermolene
a4783a2c19 Add a demo control panel page for the Starlight theme
If you open the control panel and then use the tools sidebar to switch
themes to and from Starlight, you'll see this tab dynamically appear
and disappear
2013-11-10 22:45:53 +00:00
Jermolene
8fb6f26729 Make sure we don't try to wikify the names of modules in the module listing 2013-11-10 22:45:11 +00:00
Jermolene
0e7ffa677a Narrow the gap between tabs 2013-11-10 21:53:56 +00:00
Jermolene
a668f09522 More refinements to the control panel
Including adding a TiddlyWeb-specific control panel tab
2013-11-10 21:53:39 +00:00
Jermolene
2598e22422 Spruce up the control panel
Structure things with extensible tabs.
2013-11-10 21:40:03 +00:00
Jermolene
dc6a9c6348 Release note for alpha.14 2013-11-10 19:24:34 +00:00
Jermolene
b1667259f0 Fix default password
The password widget was defaulting to the password "null".
2013-11-10 19:22:10 +00:00
Jermolene
c77b451863 Fixed bug when using checkbox widget to apply a tag to a tiddler that is untagged 2013-11-10 19:21:37 +00:00
Jermolene
9e48460940 Docs update 2013-11-09 19:29:57 +00:00
87 changed files with 671 additions and 379 deletions

View File

@@ -225,17 +225,18 @@ $tw.utils.pad = function(value,length) {
return s;
};
// Convert a date into UTC YYYYMMDDHHMM format
// Convert a date into UTC YYYYMMDDHHMMSSmmm format
$tw.utils.stringifyDate = function(value) {
return value.getUTCFullYear() +
$tw.utils.pad(value.getUTCMonth() + 1) +
$tw.utils.pad(value.getUTCDate()) +
$tw.utils.pad(value.getUTCHours()) +
$tw.utils.pad(value.getUTCMinutes()) +
$tw.utils.pad(value.getUTCSeconds()) +
$tw.utils.pad(value.getUTCMilliseconds(),3);
};
// Parse a date from a UTC YYYYMMDDHHMMSSMMM format string
// Parse a date from a UTC YYYYMMDDHHMMSSmmm format string
$tw.utils.parseDate = function(value) {
if(typeof value === "string") {
return new Date(Date.UTC(parseInt(value.substr(0,4),10),

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/image/gif
description: GIF image
name: image/gif

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/image/jpeg
description: JPEG image
name: image/jpeg

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/image/png
description: PNG image
name: image/png

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/text/plain
description: Plain text
name: text/plain

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/text/vnd.tiddlywiki
description: TW5 wikitext
name: text/vnd.tiddlywiki

View File

@@ -22,7 +22,7 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /<<([^\s>]+)\s*([\s\S]*?)>>(?:\r?\n|$)/mg;
this.matchRegExp = /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*?)>>(?:\r?\n|$)/mg;
};
/*

View File

@@ -7,10 +7,7 @@ Wiki text rule for block-level transclusion. For example:
```
{{MyTiddler}}
{{MyTiddler|tooltip}}
{{MyTiddler||TemplateTitle}}
{{MyTiddler|tooltip||TemplateTitle}}
{{MyTiddler}width:40;height:50;}.class.class
```
\*/
@@ -26,7 +23,7 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\{\{([^\{\}\|]+)(?:\|([^\|\{\}]+))?(?:\|\|([^\|\{\}]+))?\}([^\}]*)\}(?:\.(\S+))?(?:\r?\n|$)/mg;
this.matchRegExp = /\{\{([^\{\}\|]+)(?:\|\|([^\|\{\}]+))?\}\}(?:\r?\n|$)/mg;
};
exports.parse = function() {
@@ -38,17 +35,12 @@ exports.parse = function() {
targetTitle = tr.title,
targetField = tr.field,
targetIndex = tr.index,
tooltip = this.match[2],
template = $tw.utils.trim(this.match[3]),
style = this.match[4],
classes = this.match[5];
template = $tw.utils.trim(this.match[2]);
// Prepare the transclude widget
var transcludeNode = {
type: "element",
tag: "$transclude",
attributes: {
tiddler: {type: "string", value: template || targetTitle}
},
attributes: {},
isBlock: true
};
var tiddlerNode = {
@@ -60,20 +52,16 @@ exports.parse = function() {
isBlock: true,
children: [transcludeNode]
};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
if(tooltip) {
transcludeNode.attributes.tooltip = {type: "string", value: tooltip};
}
if(style) {
transcludeNode.attributes.style = {type: "string", value: style};
}
if(classes) {
transcludeNode.attributes["class"] = {type: "string", value: classes.split(".").join(" ")};
if(template) {
transcludeNode.attributes.tiddler = {type: "string", value: template};
} else {
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
}
return [tiddlerNode];
};

View File

@@ -7,10 +7,7 @@ Wiki text rule for inline-level transclusion. For example:
```
{{MyTiddler}}
{{MyTiddler|tooltip}}
{{MyTiddler||TemplateTitle}}
{{MyTiddler|tooltip||TemplateTitle}}
{{MyTiddler}width:40;height:50;}.class.class
```
\*/
@@ -26,7 +23,7 @@ exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\{\{([^\{\}\|]+)(?:\|([^\|\{\}]+))?(?:\|\|([^\|\{\}]+))?\}([^\}]*)\}(?:\.(\S+))?/mg;
this.matchRegExp = /\{\{([^\{\}\|]+)(?:\|\|([^\|\{\}]+))?\}\}/mg;
};
exports.parse = function() {
@@ -38,17 +35,12 @@ exports.parse = function() {
targetTitle = tr.title,
targetField = tr.field,
targetIndex = tr.index,
tooltip = this.match[2],
template = $tw.utils.trim(this.match[3]),
style = this.match[4],
classes = this.match[5];
template = $tw.utils.trim(this.match[2]);
// Prepare the transclude widget
var transcludeNode = {
type: "element",
tag: "$transclude",
attributes: {
tiddler: {type: "string", value: template || targetTitle}
}
attributes: {}
};
var tiddlerNode = {
type: "element",
@@ -58,20 +50,16 @@ exports.parse = function() {
},
children: [transcludeNode]
};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
if(tooltip) {
transcludeNode.attributes.tooltip = {type: "string", value: tooltip};
}
if(style) {
transcludeNode.attributes.style = {type: "string", value: style};
}
if(classes) {
transcludeNode.attributes["class"] = {type: "string", value: classes.split(".").join(" ")};
if(template) {
transcludeNode.attributes.tiddler = {type: "string", value: template};
} else {
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
}
return [tiddlerNode];
};

View File

@@ -0,0 +1,56 @@
/*\
title: $:/core/modules/savers/msdownload.js
type: application/javascript
module-type: saver
Handles saving changes via window.navigator.msSaveBlob()
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Select the appropriate saver module and set it up
*/
var MsDownloadSaver = function(wiki) {
};
MsDownloadSaver.prototype.save = function(text) {
// Get the current filename
var filename = "tiddlywiki.html",
p = document.location.pathname.lastIndexOf("/");
if(p !== -1) {
filename = document.location.pathname.substr(p+1);
}
// Set up the link
var blob = new Blob([text], {type: "text/html"});
window.navigator.msSaveBlob(blob,filename);
return true;
};
/*
Information about this saver
*/
MsDownloadSaver.prototype.info = {
name: "msdownload",
priority: 110
};
/*
Static method that returns true if this saver is capable of working
*/
exports.canSave = function(wiki) {
return !!window.navigator.msSaveBlob;
};
/*
Create an instance of this saver
*/
exports.create = function(wiki) {
return new MsDownloadSaver(wiki);
};
})();

View File

@@ -29,7 +29,7 @@ exports.removeChildren = function(node) {
};
exports.hasClass = function(el,className) {
return el.className.split(" ").indexOf(className) !== -1;
return el && el.className && el.className.split(" ").indexOf(className) !== -1;
};
exports.addClass = function(el,className) {

View File

@@ -26,16 +26,28 @@ Popup.prototype.show = function(options) {
this.title = options.title;
this.wiki = options.wiki;
this.anchorDomNode = options.domNode;
$tw.utils.addClass(this.anchorDomNode,"tw-popup");
this.rootElement.addEventListener("click",this,false);
};
Popup.prototype.handleEvent = function(event) {
if(event.type === "click" && this.anchorDomNode !== event.target && !$tw.utils.domContains(this.anchorDomNode,event.target)) {
this.cancel();
// Dismiss the popup if we get a click on an element that doesn't have .tw-popup class
if(event.type === "click") {
var node = event.target;
while(node && !$tw.utils.hasClass(node,"tw-popup")) {
node = node.parentNode;
}
if(!node) {
this.cancel();
}
}
};
Popup.prototype.cancel = function() {
if(this.anchorDomNode) {
$tw.utils.removeClass(this.anchorDomNode,"tw-popup");
this.anchorDomNode = null;
}
this.rootElement.removeEventListener("click",this,false);
if(this.title) {
this.wiki.deleteTiddler(this.title);

View File

@@ -62,7 +62,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
var checked = this.inputDomNode.checked,
tiddler = this.wiki.getTiddler(this.checkboxTitle);
if(tiddler && tiddler.hasTag(this.checkboxTag) !== checked) {
var newTags = tiddler.fields.tags.slice(0),
var newTags = (tiddler.fields.tags || []).slice(0),
pos = newTags.indexOf(this.checkboxTag);
if(pos !== -1) {
newTags.splice(pos,1);

View File

@@ -24,6 +24,7 @@ var NavigatorWidget = function(parseTreeNode,options) {
{type: "tw-cancel-tiddler", handler: "handleCancelTiddlerEvent"},
{type: "tw-close-tiddler", handler: "handleCloseTiddlerEvent"},
{type: "tw-close-all-tiddlers", handler: "handleCloseAllTiddlersEvent"},
{type: "tw-close-other-tiddlers", handler: "handleCloseOtherTiddlersEvent"},
{type: "tw-new-tiddler", handler: "handleNewTiddlerEvent"},
{type: "tw-import-tiddlers", handler: "handleImportTiddlersEvent"},
]);
@@ -134,6 +135,12 @@ NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {
this.saveStoryList();
return false;
};
// Close other tiddlers
NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {
this.storyList = [event.tiddlerTitle];
this.saveStoryList();
return false;
};
// Place a tiddler in edit mode
NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
@@ -233,8 +240,8 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
if(this.storyList[t] === event.tiddlerTitle) {
var tiddler = this.wiki.getTiddler(event.tiddlerTitle);
if(tiddler) {
var draftTitle = tiddler.fields["draft.title"],
draftOf = tiddler.fields["draft.of"];
var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
draftOf = (tiddler.fields["draft.of"] || "").trim();
if(draftTitle) {
var isRename = draftOf !== draftTitle,
isConfirmed = true;

View File

@@ -34,7 +34,7 @@ PasswordWidget.prototype.render = function(parent,nextSibling) {
// Execute our logic
this.execute();
// Get the current password
var password = $tw.browser ? $tw.utils.getPassword(this.passwordName) : "";
var password = $tw.browser ? $tw.utils.getPassword(this.passwordName) || "" : "";
// Create our element
var domNode = this.document.createElement("input");
domNode.setAttribute("type","password");

View File

@@ -38,6 +38,7 @@ RevealWidget.prototype.render = function(parent,nextSibling) {
this.renderChildren(domNode,null);
if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) {
this.positionPopup(domNode);
$tw.utils.addClass(domNode,"tw-popup"); // Make sure that clicks don't dismiss popups within the revealed content
}
if(!this.isOpen) {
domNode.setAttribute("hidden","true")
@@ -179,6 +180,8 @@ RevealWidget.prototype.updateState = function() {
// Animate our DOM node
if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) {
this.positionPopup(domNode);
$tw.utils.addClass(domNode,"tw-popup"); // Make sure that clicks don't dismiss popups within the revealed content
}
if(this.isOpen) {
domNode.removeAttribute("hidden");

View File

@@ -1,9 +1,9 @@
/*\
title: $:/core/modules/widgets/setvariable.js
title: $:/core/modules/widgets/set.js
type: application/javascript
module-type: widget
Setvariable widget
Set variable widget
\*/
(function(){
@@ -14,19 +14,19 @@ Setvariable widget
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var SetVariableWidget = function(parseTreeNode,options) {
var SetWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
SetVariableWidget.prototype = new Widget();
SetWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
SetVariableWidget.prototype.render = function(parent,nextSibling) {
SetWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
@@ -36,7 +36,7 @@ SetVariableWidget.prototype.render = function(parent,nextSibling) {
/*
Compute the internal state of the widget
*/
SetVariableWidget.prototype.execute = function() {
SetWidget.prototype.execute = function() {
// Get our parameters
this.setName = this.getAttribute("name","currentTiddler");
this.setValue = this.getAttribute("value");
@@ -49,7 +49,7 @@ SetVariableWidget.prototype.execute = function() {
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
SetVariableWidget.prototype.refresh = function(changedTiddlers) {
SetWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.name || changedAttributes.value) {
this.refreshSelf();
@@ -59,6 +59,7 @@ SetVariableWidget.prototype.refresh = function(changedTiddlers) {
}
};
exports.setvariable = SetVariableWidget;
exports.setvariable = SetWidget;
exports.set = SetWidget;
})();

View File

@@ -57,6 +57,12 @@ ViewWidget.prototype.execute = function() {
case "htmlencoded":
this.text = this.getValueAsHtmlEncoded();
break;
case "urlencoded":
this.text = this.getValueAsUrlEncoded();
break;
case "doubleurlencoded":
this.text = this.getValueAsDoubleUrlEncoded();
break;
case "date":
this.text = this.getValueAsDate(this.viewTemplate);
break;
@@ -126,15 +132,28 @@ ViewWidget.prototype.getValueAsText = function() {
};
ViewWidget.prototype.getValueAsHtmlWikified = function() {
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),this);
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
};
ViewWidget.prototype.getValueAsHtmlEncoded = function() {
return $tw.utils.htmlEncode(this.getValueAsText());
};
ViewWidget.prototype.getValueAsUrlEncoded = function() {
return encodeURIComponent(this.getValueAsText());
};
ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {
return encodeURIComponent(encodeURIComponent(this.getValueAsText()));
};
ViewWidget.prototype.getValueAsDate = function(format) {
return $tw.utils.formatDateString(this.getValue(),format);
var value = this.getValue();
if(value) {
return $tw.utils.formatDateString(value,format);
} else {
return "";
}
};
ViewWidget.prototype.getValueAsRelativeDate = function(format) {

View File

@@ -38,8 +38,10 @@ Widget.prototype.initialise = function(parseTreeNode,options) {
// Save widget info
this.parseTreeNode = parseTreeNode;
this.wiki = options.wiki;
this.variables = options.variables || {};
this.parentWidget = options.parentWidget;
this.variablesConstructor = function() {};
this.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};
this.variables = new this.variablesConstructor();
this.document = options.document;
this.attributes = {};
this.children = [];
@@ -67,6 +69,16 @@ Widget.prototype.execute = function() {
this.makeChildWidgets();
};
/*
Set the value of a context variable
name: name of the variable
value: value of the variable
params: array of {name:, default:} for each parameter
*/
Widget.prototype.setVariable = function(name,value,params) {
this.variables[name] = {value: value, params: params};
};
/*
Get the prevailing value of a context variable
name: name of variable
@@ -78,19 +90,14 @@ defaultValue: default value if the variable is not defined
Widget.prototype.getVariable = function(name,options) {
options = options || {};
var actualParams = options.params || [];
// Search up the widget tree for the variable name
var node = this;
while(node && !$tw.utils.hop(node.variables,name)) {
node = node.parentWidget;
}
// If we get to the root then look for a macro module
if(!node) {
// If the variable doesn't exist then look for a macro module
if(!(name in this.variables)) {
return this.evaluateMacroModule(name,actualParams,options.defaultValue);
}
// Get the value
var value = node.variables[name].value || "";
var variable = this.variables[name],
value = variable.value || "";
// Substitute any parameters specified in the definition
value = this.substituteVariableParameters(value,node.variables[name].params,actualParams);
value = this.substituteVariableParameters(value,variable.params,actualParams);
value = this.substituteVariableReferences(value);
return value;
};
@@ -166,16 +173,6 @@ Widget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue)
}
};
/*
Set the value of a context variable
name: name of the variable
value: value of the variable
params: array of {name:, default:} for each parameter
*/
Widget.prototype.setVariable = function(name,value,params) {
this.variables[name] = {value: value, params: params};
};
/*
Check whether a given context variable value exists in the parent chain
*/
@@ -218,7 +215,7 @@ Widget.prototype.computeAttributes = function() {
value = self.wiki.getTextReference(attribute.textReference,"",self.getVariable("currentTiddler"));
} else if(attribute.type === "macro") {
var text = self.getVariable(attribute.value.name,{params: attribute.value.params});
value = self.wiki.renderText("text/plain","text/vnd.tiddlywiki",text);
value = self.wiki.renderText("text/plain","text/vnd.tiddlywiki",text,{parentWidget: self});
} else { // String attribute
value = attribute.value;
}

View File

@@ -8,14 +8,12 @@ Extension methods for the $tw.Wiki object
Adds the following properties to the wiki object:
* `eventListeners` is a hashmap by type of arrays of listener functions
* `changedTiddlers` is a hashmap describing changes to named tiddlers since wiki change events were
last dispatched. Each entry is a hashmap containing two fields:
* `changedTiddlers` is a hashmap describing changes to named tiddlers since wiki change events were last dispatched. Each entry is a hashmap containing two fields:
modified: true/false
deleted: true/false
* `changeCount` is a hashmap by tiddler title containing a numerical index that starts at zero and is
incremented each time a tiddler is created changed or deleted
* `caches` is a hashmap by tiddler title containing a further hashmap of named cache objects. Caches
are automatically cleared when a tiddler is modified or deleted
* `changeCount` is a hashmap by tiddler title containing a numerical index that starts at zero and is incremented each time a tiddler is created changed or deleted
* `caches` is a hashmap by tiddler title containing a further hashmap of named cache objects. Caches are automatically cleared when a tiddler is modified or deleted
* `globalCache` is a hashmap by cache name of cache objects that are cleared whenever any tiddler change occurs
\*/
(function(){
@@ -163,6 +161,7 @@ exports.getChangeCount = function(title) {
exports.deleteTiddler = function(title) {
delete this.tiddlers[title];
this.clearCache(title);
this.clearGlobalCache();
this.enqueueTiddlerEvent(title,true);
};
@@ -207,6 +206,7 @@ exports.addTiddler = function(tiddler) {
// Save the tiddler
this.tiddlers[title] = tiddler;
this.clearCache(title);
this.clearGlobalCache();
this.enqueueTiddlerEvent(title);
};
@@ -425,15 +425,36 @@ exports.getShadowTitles = function() {
Retrieves a list of the tiddler titles that are tagged with a given tag
*/
exports.getTiddlersWithTag = function(tag) {
// Get the list associated with the tag
var titles = [];
for(var title in this.tiddlers) {
var tiddler = this.tiddlers[title];
if($tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.indexOf(tag) !== -1) {
titles.push(title);
var self = this;
return this.getGlobalCache("taglist-" + tag,function() {
var tagmap = self.getTagMap();
return self.sortByList(tagmap[tag],tag);
});
};
/*
Get a hashmap by tag of arrays of tiddler titles
*/
exports.getTagMap = function() {
var self = this;
return this.getGlobalCache("tagmap",function() {
var tags = {};
// Collect up all the tags
for(var title in self.tiddlers) {
var tiddler = self.tiddlers[title];
if(tiddler.fields.tags) {
for(var index=0; index<tiddler.fields.tags.length; index++) {
var tag = tiddler.fields.tags[index];
if(tags[tag]) {
tags[tag].push(title)
} else {
tags[tag] = [title];
}
}
}
}
}
return this.sortByList(titles,tag);
return tags;
});
};
/*
@@ -456,7 +477,9 @@ Sorts an array of tiddler titles according to an ordered list
*/
exports.sortByList = function(array,listTitle) {
var list = this.getTiddlerList(listTitle);
if(list) {
if(!array || array.length === 0) {
return [];
} else if(list) {
var titles = [], t, title;
// First place any entries that are present in the list
for(t=0; t<list.length; t++) {
@@ -557,6 +580,21 @@ exports.getTiddlerList = function(title) {
return [];
};
// Return a named global cache object. Global cache objects are cleared whenever a tiddler change occurs
exports.getGlobalCache = function(cacheName,initializer) {
this.globalCache = this.globalCache || {};
if($tw.utils.hop(this.globalCache,cacheName)) {
return this.globalCache[cacheName];
} else {
this.globalCache[cacheName] = initializer();
return this.globalCache[cacheName];
}
};
exports.clearGlobalCache = function() {
this.globalCache = {};
}
// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it
exports.getCacheForTiddler = function(title,cacheName,initializer) {
@@ -654,7 +692,7 @@ var tweakParseTreeNodes = function(nodeList) {
var tweakMacroDefinition = function(nodeList) {
if(nodeList && nodeList[0] && nodeList[0].type === "macrodef") {
nodeList[0].type = "setvariable";
nodeList[0].type = "set";
nodeList[0].attributes = {
name: {type: "string", value: nodeList[0].name},
value: {type: "string", value: nodeList[0].text}
@@ -726,10 +764,10 @@ exports.makeWidget = function(parser,options) {
children: []
},
currWidgetNode = widgetNode;
// Create setvariable widgets for each variable
// Create set variable widgets for each variable
$tw.utils.each(options.variables,function(value,name) {
var setVariableWidget = {
type: "setvariable",
type: "set",
attributes: {
name: {type: "string", value: name},
value: {type: "string", value: value}
@@ -761,7 +799,7 @@ parentWidget: optional parent widget for the root node
*/
exports.renderText = function(outputType,textType,text,options) {
options = options || {};
var parser = $tw.wiki.parseText(textType,text),
var parser = this.parseText(textType,text,options),
widgetNode = this.makeWidget(parser,options);
var container = $tw.document.createElement("div");
widgetNode.render(container,null);
@@ -878,7 +916,7 @@ exports.search = function(text,options) {
// Function to check a given tiddler for the search term
var searchTiddler = function(title) {
if(!searchTermsRegExps) {
return false;
return true;
}
var tiddler = self.getTiddler(title);
if(!tiddler) {

3
core/ui/ControlPanel.tid Normal file
View File

@@ -0,0 +1,3 @@
title: $:/ControlPanel
<div class="tw-control-panel"><<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]]" "$:/core/ui/ControlPanel/Basics">></div>

View File

@@ -0,0 +1,11 @@
title: $:/core/ui/ControlPanel/Appearance
tags: $:/tags/ControlPanel
caption: Appearance
! Theme
{{$:/snippets/themeswitcher}}
! Story View
{{$:/snippets/viewswitcher}}

View File

@@ -0,0 +1,23 @@
title: $:/core/ui/ControlPanel/Basics
tags: $:/tags/ControlPanel
caption: Basics
! Settings
|[[Title of this TiddlyWiki|SiteTitle]] |<$edit-text tiddler="SiteTitle" default="" tag="input"/> |
|[[Subtitle|SiteSubtitle]] |<$edit-text tiddler="SiteSubtitle" default="" tag="input"/> |
|[[Username for signing edits|$:/status/UserName]] |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|[[Animation duration|$:/config/AnimationDuration]] |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|[[DefaultTiddlers|$:/DefaultTiddlers]] |Choose which tiddlers are displayed at startup:<br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/> |
! Info
!! Your Stuff
* Number of tiddlers: <$count filter="[!is[system]]"/>
!! TiddlyWiki's Stuff
* Number of system tiddlers: <$count filter="[is[system]]"/>
* Number of shadow tiddlers: <$count filter="[is[shadow]]"/>
** Number of over-ridden shadow tiddlers: <$count filter="[!is[system]is[shadow]]"/>

View File

@@ -0,0 +1,5 @@
title: $:/core/ui/ControlPanel/Encryption
tags: $:/tags/ControlPanel
caption: Encryption
{{$:/snippets/encryptionstatus}}

View File

@@ -1,6 +1,6 @@
title: $:/ConfigInfo
This tiddler displays the internal configuration of this wiki, which can be useful for troubleshooting, or just to help understand how TiddlyWiki5 works.
title: $:/core/ui/ControlPanel/Internals
tags: $:/tags/ControlPanel
caption: Internals
! Tiddler fields

View File

@@ -0,0 +1,7 @@
title: $:/core/ui/ControlPanel/Plugins
tags: $:/tags/ControlPanel
caption: Plugins
<table><tbody><tr><th>Title</th><th>Description</th></tr><$list filter="[!has[draft.of]has[plugin-type]sort[title]]"><tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="description"/></td></tr></$list>
</tbody>
</table>

View File

@@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/Tools
tags: $:/tags/ControlPanel
caption: Tools
! Import
<$browse/>
Browse for files on your computer to import their contents (the individual tiddlers within TiddlyWiki HTML files are imported separately). You can also drag and drop files directly to the browser window.

View File

@@ -2,30 +2,6 @@ title: $:/core/ui/EditTemplate
modifier: JeremyRuston
\define frame-classes()
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<div class=<<frame-classes>>><span class="tw-tiddler-controls titlebar"> <$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}</$button> <$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button}}</$button> <$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button}}</$button> </span>
<$view field="title"/>
<$edit-text field="draft.title" class="titlebar tw-edit-texteditor"/>
<$transclude tiddler="$:/core/ui/TagsEditor"/>
<$reveal state="$:/ShowEditPreview" type="match" text="yes">
<$transclude tiddler="$:/core/ui/EditorHint"/> <$button type="set" set="$:/ShowEditPreview" setTo="no">hide preview</$button>
<div class="tw-tiddler-preview">
<div class="tw-tiddler-preview-preview">
<$transclude />
</div>
<div class="tw-tiddler-preview-edit">
<$edit field="text" class="tw-edit-texteditor"/>
</div>
</div>
</$reveal>
<$reveal state="$:/ShowEditPreview" type="nomatch" text="yes">
<$transclude tiddler="$:/core/ui/EditorHint"/> <$button type="set" set="$:/ShowEditPreview" setTo="yes">show preview</$button>
<$edit field="text" class="tw-edit-texteditor"/>
</$reveal>
<$transclude tiddler="$:/core/ui/FieldEditor"/></div>
<div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div>

View File

@@ -0,0 +1,18 @@
title: $:/core/ui/EditTemplate/body
tags: $:/tags/EditTemplate
<$reveal state="$:/ShowEditPreview" type="match" text="yes">
//<$transclude tiddler="$:/core/ui/EditorHint"/>// <$button type="set" set="$:/ShowEditPreview" setTo="no">hide preview</$button>
<div class="tw-tiddler-preview">
<div class="tw-tiddler-preview-preview">
<$transclude />
</div>
<div class="tw-tiddler-preview-edit">
<$edit field="text" class="tw-edit-texteditor"/>
</div>
</div>
</$reveal>
<$reveal state="$:/ShowEditPreview" type="nomatch" text="yes">
//<$transclude tiddler="$:/core/ui/EditorHint"/>// <$button type="set" set="$:/ShowEditPreview" setTo="yes">show preview</$button>
<$edit field="text" class="tw-edit-texteditor"/>
</$reveal>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/EditTemplate/controls
tags: $:/tags/EditTemplate
<span class="tw-tiddler-controls titlebar"> <$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> </span>

View File

@@ -0,0 +1,14 @@
title: $:/core/ui/EditTemplate/fields
tags: $:/tags/EditTemplate
<$fieldmangler><div class="tw-edit-fields">
<table class="tw-edit-fields"><tbody><$list filter="[is[current]fields[]] -title -tags -text -creator -created -modified -modifier -type -[[draft.title]] -[[draft.of]]" variable="currentField"><tr class="tw-edit-field"><td class="tw-edit-field-name"><<currentField>>:</td><td class="tw-edit-field-value"><$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder="field value"/></td><td class="tw-edit-field-remove"><$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button></td>
</tr>
</$list>
</tbody>
</table>
</div>
<div class="tw-edit-field-add">//Add a new field:// <span class="tw-edit-field-add-name"><$edit-text tiddler="$:/NewFieldName" tag="input" default="" placeholder="field name" class="tw-edit-texteditor"/></span> <span class="tw-edit-field-add-button"><$button message="tw-add-field" param={{$:/NewFieldName}} set="$:/NewFieldName" setTo="" class="">add</$button></span></div>
</$fieldmangler>

View File

@@ -0,0 +1,22 @@
title: $:/core/ui/EditTemplate/tags
tags: $:/tags/EditTemplate
\define tag-styles()
background-color:$(backgroundColor)$;
\end
<$fieldmangler><div class="tw-edit-tags-list"><$list filter="[is[current]tags[]sort[title]]" storyview="pop" itemClass="tw-tag-editor-label"><$set name="backgroundColor" value={{!!color}}><span style=<<tag-styles>> class="tw-tag-label"><$view field="title" format="text" /><$button message="tw-remove-tag" param={{!!title}} class="btn-invisible tw-remove-tag-button">&times;</$button></span></$set>
</$list></div>
<div class="tw-add-tag">//Add a new tag:// <span class="tw-add-tag-name"><$edit-text tiddler="$:/NewTagName" tag="input" default="" placeholder="tag name" focusPopup=<<qualify "$:/state/tagsAutoComplete">> class="tw-edit-texteditor"/></span> <$button popup=<<qualify "$:/state/tagsAutoComplete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button"><$button message="tw-add-tag" param={{$:/NewTagName}} set="$:/NewTagName" setTo="" class="">add</$button></span></div>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/tagsAutoComplete">> type="nomatch" text="" default="">
<div class="tw-block-dropdown">
<$linkcatcher set="$:/NewTagName" setTo="" message="tw-add-tag"><$list filter="[!is[shadow]tags[]search{$:/NewTagName}sort[title]]"><$link><$set name="backgroundColor" value={{!!color}}><span style=<<tag-styles>> class="tw-tag-label"><$view field="title" format="text"/></span></$set></$link>
</$list>
</$linkcatcher>
</div>
</$reveal>
</div>
</$fieldmangler>

View File

@@ -0,0 +1,6 @@
title: $:/core/ui/EditTemplate/title
tags: $:/tags/EditTemplate
<$view field="title"/>
<$edit-text field="draft.title" class="titlebar tw-edit-texteditor"/>

View File

@@ -0,0 +1,15 @@
title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate
<p>//Type:// <$edit-text field="type" tag="input" default="" placeholder="type" focusPopup=<<qualify "$:/state/typeDropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/typeDropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button></p>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$linkcatcher to="!!type">
<$list filter="[is[shadow]prefix[$:/docs/types/]] [!is[shadow]prefix[$:/docs/types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
</$list>
</$linkcatcher>
</div>
</$reveal>
</div>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/EditToolbar/cancel
tags: $:/tags/EditToolbar
<$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button}}</$button>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/EditToolbar/delete
tags: $:/tags/EditToolbar
<$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}</$button>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/EditToolbar/save
tags: $:/tags/EditToolbar
<$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button}}</$button>

View File

@@ -1,3 +1,3 @@
title: $:/core/ui/EditorHint
<span class="tw-tiddler-help">Use WikiText to add formatting, images, and dynamic features</span>
Use WikiText to add formatting, images, and dynamic features

View File

@@ -1,13 +0,0 @@
title: $:/core/ui/FieldEditor
<$fieldmangler><div class="tw-edit-fields">
<table class="tw-edit-fields"><tbody><$list filter="[is[current]fields[]] -title -tags -text -creator -created -modified -modifier -[[draft.title]] -[[draft.of]]" variable="currentField"><tr class="tw-edit-field"><td class="tw-edit-field-name"><<currentField>>:</td><td class="tw-edit-field-value"><$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder="field value"/></td><td class="tw-edit-field-remove"><$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button></td>
</tr>
</$list>
</tbody>
</table>
</div>
<div class="tw-edit-field-add">Add a new field: <span class="tw-edit-field-add-name"><$edit-text tiddler="$:/NewFieldName" tag="input" default="" placeholder="field name" class="tw-edit-texteditor"/></span> <span class="tw-edit-field-add-button"><$button message="tw-add-field" param={{$:/NewFieldName}} set="$:/NewFieldName" setTo="" class="">add</$button></span></div>
</$fieldmangler>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/PageControls/control-panel
tags: $:/tags/PageControls
<$link to="$:/ControlPanel">{{$:/core/images/options-button}}</$link>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/PageControls/new-tiddler
tags: $:/tags/PageControls
<$button message="tw-new-tiddler" class="btn-invisible">{{$:/core/images/new-button}}</$button>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/PageControls/save-wiki
tags: $:/tags/PageControls
<$button message="tw-save-wiki" class="btn-invisible">{{$:/core/images/save-button}}</$button>

View File

@@ -1,6 +1,6 @@
title: $:/core/ui/PageMacros
\define tabs(tabsList,default,state:"$:/currentTab")
\define tabs(tabsList,default,state:"$:/state/tab")
<div class="tw-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected"><$view tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$view> </$button>
</$list>
</div>

View File

@@ -12,10 +12,12 @@ title: $:/core/ui/PageTemplate
{{$:/LeftSideBar}}
<!-- The sidebar header -->
<header class="sidebar-header"><div class="titlebar">{{SiteTitle}}</div><div class="tw-subtitle">{{SiteSubtitle}}</div>
<header class="sidebar-header">
<div class="titlebar">{{SiteTitle}}</div>
<div class="tw-subtitle">{{SiteSubtitle}}</div>
<div class="tw-page-controls">
<$button message="tw-new-tiddler" class="btn-invisible">{{$:/core/images/new-button}}</$button><$link to="$:/ControlPanel">{{$:/core/images/options-button}}</$link><$button message="tw-save-wiki" class="btn-invisible">{{$:/core/images/save-button}}</$button>
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
{{$:/core/ui/SideBar}}

View File

@@ -24,7 +24,7 @@ title: $:/core/ui/SideBar
<$reveal state="$:/temp/search" type="match" text="">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/SideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/sidebartab">>
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/SideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
</$reveal>
</div>

View File

@@ -3,5 +3,5 @@ tags: $:/tags/SideBar
caption: More
<div class="tw-more-sidebar">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Open" "$:/moresidebartab">>
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Open" "$:/state/tab/moresidebar">>
</div>

View File

@@ -2,10 +2,6 @@ title: $:/core/ui/SideBar/Tools
tags: $:/tags/SideBar
caption: Tools
[[Wiki Info|$:/WikiInfo]]
---
{{$:/snippets/viewswitcher}}
---

View File

@@ -3,7 +3,7 @@ title: $:/core/ui/TagTemplate
\define tag-styles()
background-color:$(backgroundColor)$;
\end
<span class="tw-tag-list-item"><$setvariable name="backgroundColor" value={{!!color}}><$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-tag-label" style=<<tag-styles>>><$transclude tiddler={{!!icon}}/> <$view field="title" format="text" /></$button></$setvariable>
<span class="tw-tag-list-item"><$set name="backgroundColor" value={{!!color}}><$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-tag-label" style=<<tag-styles>>><$transclude tiddler={{!!icon}}/> <$view field="title" format="text" /></$button></$set>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>

View File

@@ -1,21 +0,0 @@
title: $:/core/ui/TagsEditor
\define tag-styles()
background-color:$(backgroundColor)$;
\end
<$fieldmangler><div class="tw-edit-tags-list"><$list filter="[is[current]tags[]sort[title]]" storyview="pop" itemClass="tw-tag-editor-label"><$setvariable name="backgroundColor" value={{!!color}}><span style=<<tag-styles>> class="tw-tag-label"><$view field="title" format="text" /><$button message="tw-remove-tag" param={{!!title}} class="btn-invisible tw-remove-tag-button">&times;</$button></span></$setvariable>
</$list></div>
<div class="tw-add-tag">Add a new tag: <span class="tw-add-tag-name"><$edit-text tiddler="$:/NewTagName" tag="input" default="" placeholder="tag name" focusPopup=<<qualify "$:/state/tagsAutoComplete">> class="tw-edit-texteditor"/></span> <$button popup=<<qualify "$:/state/tagsAutoComplete">> class="btn-invisible">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button"><$button message="tw-add-tag" param={{$:/NewTagName}} set="$:/NewTagName" setTo="" class="">add</$button></span></div>
<div class="tw-tags-autocomplete-wrapper">
<$reveal state=<<qualify "$:/state/tagsAutoComplete">> type="nomatch" text="" default="">
<div class="tw-tags-autocomplete">
<$linkcatcher set="$:/NewTagName" setTo="" message="tw-add-tag"><$list filter="[!is[shadow]tags[]search{$:/NewTagName}sort[title]]"><$link><$setvariable name="backgroundColor" value={{!!color}}><span style=<<tag-styles>> class="tw-tag-label"><$view field="title" format="text"/></span></$setvariable></$link>
</$list>
</$linkcatcher>
</div>
</$reveal>
</div>
</$fieldmangler>

View File

@@ -4,6 +4,6 @@ modifier: JeremyRuston
\define frame-classes()
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
</$tiddler>
</$tiddler></$set>

View File

@@ -4,11 +4,11 @@ tags: $:/tags/ViewTemplate
\define title-styles()
fill:$(foregroundColor)$;
\end
<div class="tw-tiddler-title"><div class="titlebar"><span class="tw-tiddler-controls"><$button popup=<<qualify "$:/state/tiddlerInfo">> class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button><$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button><$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button>
<div class="tw-tiddler-title"><div class="titlebar"><span class="tw-tiddler-controls"><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</span><$setvariable name="foregroundColor" value={{!!color}}><span style=<<title-styles>>><$transclude tiddler={{!!icon}}/></span></$setvariable> <span class="title"><$view field="title"/></span></div>
</span><$set name="foregroundColor" value={{!!color}}><span style=<<title-styles>>><$transclude tiddler={{!!icon}}/></span></$set> <span class="title"><$view field="title"/></span></div>
<$reveal type="nomatch" text="" default="" state=<<qualify "$:/state/tiddlerInfo">> class="tw-tiddler-info" animate="yes">
<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tw-tiddler-info tw-popup" animate="yes">
<$transclude tiddler="$:/core/ui/TiddlerInfo"/>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/ViewToolbar/close
tags: $:/tags/ViewToolbar
<$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/ViewToolbar/edit
tags: $:/tags/ViewToolbar
<$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button>

View File

@@ -0,0 +1,4 @@
title: $:/core/ui/ViewToolbar/info
tags: $:/tags/ViewToolbar
<$button popup=<<tiddlerInfoState>> class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button>

View File

@@ -1,28 +0,0 @@
title: $:/ControlPanel
''Initial setup''
| ![[Title of this TiddlyWiki|SiteTitle]]|<$edit-text tiddler="SiteTitle" default="" tag="input"/> |
| ![[Subtitle|SiteSubtitle]]|<$edit-text tiddler="SiteSubtitle" default="" tag="input"/> |
| ![[Username for signing edits|$:/status/UserName]]|<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
| ![[Animation duration|$:/config/AnimationDuration]]|<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
Edit [[DefaultTiddlers|$:/DefaultTiddlers]] to choose which tiddlers are displayed at startup
{{$:/snippets/encryptionstatus}}
''Add plugins and tiddlers to your ~TiddlyWiki''
:Browse for files on your computer to import their contents (the individual tiddlers within TiddlyWiki HTML files are imported separately). <$browse/>
''Visual appearance''
*{{$:/snippets/viewswitcher}}
*{{$:/snippets/themeswitcher}}
*Edit [[ThemeTweaks|$:/ControlPanel/ThemeTweaks]] to change the appearance of your ~TiddlyWiki
''Additional information about this ~TiddlyWiki''
*~TiddlyWiki5 version <<version>>
*[[Wiki Info|$:/WikiInfo]]
*[[Internal configuration information|$:/ConfigInfo]]

View File

@@ -1,6 +0,0 @@
title: $:/WikiInfo
* Tiddlers: <$count filter="[!is[system]]"/>
* System tiddlers: <$count filter="[is[system]]"/>
* Shadow tiddlers: <$count filter="[is[shadow]]"/>
** Over-ridden shadow tiddlers: <$count filter="[!is[system]is[shadow]]"/>

View File

@@ -4,8 +4,8 @@ title: $:/snippets/modules
{{$:/docs/moduletypes/$type$}}
\end
<$list filter="[moduletypes[]]">
!! <<listItem>>
<$macrocall $name="describeModuleType" type=<<listItem>>/>
!! <$macrocall $name="currentTiddler" $type="text/plain" $output="text/plain"/>
<$macrocall $name="describeModuleType" type=<<currentTiddler>>/>
<ul><$list filter="[is[current]modules[]]"><li><$link><<currentTiddler>></$link>
</li>
</$list>

View File

@@ -1,3 +1,3 @@
title: $:/moresidebartab-{$:/core/ui/SideBar|$:/core/ui/SideBar/More||}{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
title: $:/state/tab/moresidebar-{$:/core/ui/SideBar|$:/core/ui/SideBar/More||}{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
$:/core/ui/MoreSideBar/Tags

View File

@@ -1,3 +1,3 @@
title: $:/state/sideBarTabSet-{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
title: $:/state/tab/sidebar-{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
$:/core/ui/SideBar/Open

View File

@@ -0,0 +1,2 @@
title: $:/tags/ControlPanel
list: $:/core/ui/ControlPanel/Basics $:/core/ui/ControlPanel/Appearance $:/core/ui/ControlPanel/Encryption $:/core/ui/ControlPanel/Plugins $:/core/ui/ControlPanel/Tools $:/core/ui/ControlPanel/Internals

View File

@@ -0,0 +1,2 @@
title: $:/tags/EditTemplate
list: [[$:/core/ui/EditTemplate/controls]] [[$:/core/ui/EditTemplate/title]] [[$:/core/ui/EditTemplate/tags]] [[$:/core/ui/EditTemplate/body]] [[$:/core/ui/EditTemplate/type]] [[$:/core/ui/EditTemplate/fields]]

View File

@@ -0,0 +1,2 @@
title: $:/tags/EditToolbar
list: [[$:/core/ui/EditToolbar/delete]] [[$:/core/ui/EditToolbar/cancel]] [[$:/core/ui/EditToolbar/save]]

View File

@@ -0,0 +1,2 @@
title: $:/tags/PageControls
list: [[$:/core/ui/PageControls/new-tiddler]] [[$:/core/ui/PageControls/control-panel]] [[$:/core/ui/PageControls/save-wiki]]

View File

@@ -0,0 +1,2 @@
title: $:/tags/ViewToolbar
list: [[$:/core/ui/ViewToolbar/info]] [[$:/core/ui/ViewToolbar/edit]] [[$:/core/ui/ViewToolbar/close]]

View File

@@ -3,15 +3,6 @@ title: $:/snippets/themeswitcher
Current theme: {{$:/theme}}
<$linkcatcher to="$:/theme">
<$list filter="[plugin-type[theme]sort[title]]">
<$reveal state="$:/theme" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/theme" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}>
<$view field="name" format="text"/>
</$link>
<$list filter="[plugin-type[theme]sort[title]]"><div><$reveal state="$:/theme" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/theme" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="name" format="text"/></$link></div>
</$list>
</$linkcatcher>

View File

@@ -2,12 +2,7 @@ title: $:/snippets/viewswitcher
Current view: {{$:/view}}
<$linkcatcher to="$:/view">
<$list filter="classic zoomin pop">
<$reveal state="$:/view" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/view" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="title"/></$link>
<$linkcatcher to="$:/view"><$list filter="classic zoomin pop"><div><$reveal state="$:/view" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/view" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</$linkcatcher>

View File

@@ -16,10 +16,9 @@ describe("Widget module", function() {
var widget = require("$:/core/modules/widgets/widget.js");
function createWidgetNode(parseTreeNode,wiki,variables) {
function createWidgetNode(parseTreeNode,wiki) {
return new widget.widget(parseTreeNode,{
wiki: wiki,
variables: variables || {},
document: $tw.document
});
}
@@ -229,7 +228,7 @@ describe("Widget module", function() {
});
});
it("should deal with the setvariable widget", function() {
it("should deal with the set widget", function() {
var wiki = new $tw.Wiki();
// Add some tiddlers
wiki.addTiddlers([
@@ -239,7 +238,7 @@ describe("Widget module", function() {
{title: "TiddlerFour", text: "TiddlerTwo"}
]);
// Construct the widget node
var text = "My <$setvariable name='currentTiddler' value={{TiddlerFour}}><$transclude tiddler={{!!title}}/></$setvariable> is Jolly"
var text = "My <$set name='currentTiddler' value={{TiddlerFour}}><$transclude tiddler={{!!title}}/></$set> is Jolly"
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
var wrapper = renderWidgetNode(widgetNode);
@@ -264,18 +263,8 @@ describe("Widget module", function() {
it("should deal with attributes specified as macro invocations", function() {
var wiki = new $tw.Wiki();
// Construct the widget node
var text = "<div class=<<myMacro 'something' three:'thing'>>>Content</div>";
var variables = {
myMacro: {
value: "My something $one$, $two$ or other $three$",
params: [
{name: "one", "default": "paramOne"},
{name: "two"},
{name: "three", "default": "paramTwo"}
]
}
};
var widgetNode = createWidgetNode(parseText(text,wiki),wiki,variables);
var text = "\\define myMacro(one:\"paramOne\",two,three:\"paramTwo\")\nMy something $one$, $two$ or other $three$\n\\end\n<div class=<<myMacro 'something' three:'thing'>>>Content</div>";
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
// Render the widget node to the DOM
var wrapper = renderWidgetNode(widgetNode);
// Test the rendering

View File

@@ -98,7 +98,16 @@ describe("WikiText parser tests", function() {
it("should parse macro definitions", function() {
expect(parse("\\define myMacro()\nnothing\n\\end\n")).toEqual(
[ { type : 'setvariable', name : 'myMacro', params : [ ], text : 'nothing', attributes : { name : { type : 'string', value : 'myMacro' }, value : { type : 'string', value : 'nothing' } }, children : [ ] } ]
[ { type : 'set', name : 'myMacro', params : [ ], text : 'nothing', attributes : { name : { type : 'string', value : 'myMacro' }, value : { type : 'string', value : 'nothing' } }, children : [ ] } ]
);
});
it("should parse macro calls", function() {
expect(parse("<<john>><<paul>><<george>><<ringo>>")).toEqual(
[ { type : 'element', tag : 'p', children : [ { type : 'macrocall', name : 'john', params : [ ] }, { type : 'macrocall', name : 'paul', params : [ ] }, { type : 'macrocall', name : 'george', params : [ ] }, { type : 'macrocall', name : 'ringo', params : [ ] } ] } ]
);

View File

@@ -1,6 +1,6 @@
created: 201309091516000
creator: JeremyRuston
modified: 201311091538002
modified: 201311120855003
modifier: JeremyRuston
tags: community
title: Community
@@ -9,11 +9,13 @@ type: text/vnd.tiddlywiki
! Blog posts and articles about TiddlyWiki5
* A gamers guide to using TiddlyWiki5: "[[Shining Ark 7 Using TiddlyWiki|http://helugame.wordpress.com/2013/09/07/shining-ark-7-using-tiddlywiki/]]"
* An introduction to TiddlyWiki5 by [[Moongift (in Japanese)|http://www.moongift.jp/2013/11/tiddlywiki5-%E3%83%87%E3%82%B6%E3%82%A4%E3%83%B3%E5%88%B7%E6%96%B0%E3%80%82%E6%AC%A1%E3%81%AE25%E5%B9%B4%E3%82%92%E7%9B%AE%E6%8C%87%E3%81%99tiddlywiki-2/]]
! Hints and tips for TiddlyWiki5
* [[TW5 Mall|http://www.giffmex.org/tw5mall.htm]] - DaveGifford's growing catalogue of hints and tips
* A [[guide to creating a fixed top menu|https://dl.dropboxusercontent.com/u/2638511/TW5_Test.htm]] from TonGerner
* A new theme from [[Bob Robison|http://tw5gray.tiddlyspot.com]]
! Examples of TiddlyWiki5 being used in the wild

View File

@@ -18,8 +18,6 @@ This is the developer documentation hub for TiddlyWiki.
! Internal Objects and Mechanisms
{{mechanism}}
<$list filter="[tag[mechanism]sort[title]]" type="ul"/>
! Module types
@@ -29,8 +27,6 @@ See SyncAdaptorModules.
!! DeserializerModules
Deserializers are modules that read tiddlers from different text formats:
{{deserializers}}
Deserializers are modules that load tiddlers from different text formats:
<$list filter="[tag[deserializers]sort[title]]" type="ul"/>

View File

@@ -0,0 +1,14 @@
created: 201311101922007
creator: JeremyRuston
modified: 201311101922007
modifier: JeremyRuston
title: Release 5.0.0-alpha.14
tags: releasenote
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.13...v5.0.0-alpha.14]]//
This release has several bug fixes:
* Improved the layout of the [[control panel|$:/ControlPanel]]
* Fixed problem with using the CheckboxWidget to apply tags to tiddlers that don't have any existing tags
* Fixed problem with default password for the PasswordWidget being the string "null"

View File

@@ -0,0 +1,39 @@
created: 201311122050007
creator: JeremyRuston
modified: 201311122050007
modifier: JeremyRuston
title: Release 5.0.0-alpha.15
tags: releasenote
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.14...v5.0.0-alpha.15]]//
!! New Features
* Added a dropdown to the edit template for setting the tiddler type
* A saver module for Microsoft Internet Explorer version 10 and above. Clicking save in the sidebar causes the browser to pull up a bar at the bottom of the window where you can click ''save''. You then get a new copy of your wiki in the downloads folder.
* Support for new `tw-close-other-tiddlers` message (eg, <$button message="tw-close-other-tiddlers">close others</$button>)
* For http://five.tiddlywiki.com, add a tiddler info tab with a link to the static representation of the tiddler
* Make more UI elements extensible via system tags:
** [[$:/tags/ViewToolbar]] for the view mode tiddler toolbar
** [[$:/tags/EditTemplate]] for the edit template
** [[$:/tags/EditToolbar]] for the edit mode tiddler toolbar
** [[$:/tags/PageControls]] for the page control tools in the sidebar
!! Improvements
* Rename the `<$setvariable>` to `<$set>`
** `<$setvariable>` will temporarily remain as a synonym for `<$set>` for the next few releases
* Improve the popup mechanism so that the tiddler info panel doesn't close so easily
* Various improvements for working with TiddlyWeb, including:
** Updated control panel
!! Bug fixes
* Fixed bug when creating a tiddler title starting or ending with a space
* Fixed behaviour of tags editor dropdown when search box is empty
* Fixed problem with interpretation of `fields` and `index` attributes of the TranscludeWidget
* Fixed the module type names in the internal tab of the control panel
* Improved styling for embedded PDFs
* Fixed bug with second being omitted from serialised date formats
Contributors to this release include @jermolene and @grayeul.

View File

@@ -86,19 +86,13 @@ This will be monospaced
You can incorporate the content of one tiddler within another using the transclusion notation:
* `{{MyTiddler}}` transcludes a single tiddler
* `{{MyTiddler|tooltip}}` adds a tooltip
* `{{MyTiddler||TemplateTitle}}` displays the tiddler through a specified [[TiddlerTemplate|TiddlerTemplates]]
* `{{MyTiddler|tooltip||TemplateTitle}}` specifies both a tooltip and a template for the transcluded content
* `{{MyTiddler}width:40;height:50;}.firstClass.secondClass` transcludes a single tiddler, adding the specified styles and classes to the transcluded content
A similar syntax can be used to transclude a list of tiddlers matching a specified [[TiddlerFilter|TiddlerFilters]]:
```
{{{ [tag[mechanism]] }}}
{{{ [tag[mechanism]] |tooltip}}}
{{{ [tag[mechanism]] ||TemplateTitle}}}
{{{ [tag[mechanism]] |tooltip||TemplateTitle}}}
{{{ [tag[mechanism]] }}width:40;height:50;}.class.class
```
! Images
@@ -244,8 +238,6 @@ Here an attribute is specified as a macro invocation:
<a href=<<MyMacro "Brian">>>link</a>
```
* As a macro invocation
! Widgets
Widgets provide rich functionality within WikiText. For example, the `<$video>` widget can be used to embed videos from YouTube, Vimeo or the Internet Archive:

View File

@@ -9,9 +9,11 @@ I'm the inventor of TiddlyWiki. I am available through my company FederatialLimi
You can find me on these services:
* [[Jermolene on GitHub|https://github.com/Jermolene]]
* [[Jermolene on GitTip|https://www.gittip.com/Jermolene/]], a micropayment service
* [[@Jermolene on Twitter|http://twitter.com/#!/jermolene]]
* [[LinkedIn|http://www.linkedin.com/in/jermy]]
* [[Flickr|http://www.flickr.com/photos/jermy/]]
* [[Jermy on LinkedIn|http://www.linkedin.com/in/jermy]]
* [[Jermy on Flickr|http://www.flickr.com/photos/jermy/]]
Further information:

View File

@@ -0,0 +1,17 @@
title: $:/editions/tw5.com/TiddlerInfo/StaticLink
tags: $:/tags/TiddlerInfo
caption: Static Link
\define makeLink()
http://five.tiddlywiki.com/static/<$view tiddler=<<currentTiddler>> field="title" format="doubleurlencoded"/>.html
\end
\define outerMakeLink()
<$macrocall $name="makeLink" $output="text/plain"/>
\end
A static HTML representation of this tiddler is available at the URL:
<<outerMakeLink>>
<input value=<<outerMakeLink>> size="80"/>
//Note that editing the URL here won't have any effect; it is presented in a text box just to make it easier to copy and paste//

View File

@@ -1,18 +1,10 @@
title: SetVariableWidget
created: 201310241419
creator: JeremyRuston
modified: 201310300837
modified: 201311151827
modifier: JeremyRuston
tags: widget
! Introduction
The `<$setvariable>` widget has been renamed `<$set/>`; see SetWidget for more details.
The set variable widget assigns a value to a specified [[variable|WidgetVariables]]. The new value of the variable is availale to the content within the set variable widget.
! Content and Attributes
The content of the `<$setvariable>` widget is the scope for the value assigned to the variable.
|!Attribute |!Description |
|name |The name of the variable to assign |
|value |The value to assign to the variable |
For the moment, you can continue to use `<$setvariable>` as a synonym for `<$set/>`, but it will be removed for the beta.

View File

@@ -0,0 +1,18 @@
title: SetWidget
created: 201311151827
creator: JeremyRuston
modified: 201311151827
modifier: JeremyRuston
tags: widget
! Introduction
The set variable widget assigns a value to a specified [[variable|WidgetVariables]]. The new value of the variable is availale to the content within the set variable widget.
! Content and Attributes
The content of the `<$set>` widget is the scope for the value assigned to the variable.
|!Attribute |!Description |
|name |The name of the variable to assign |
|value |The value to assign to the variable |

View File

@@ -1,38 +1,27 @@
title: TiddlyWiki5 for TiddlyWeb
created: 201311152153
creator: JeremyRuston
modified: 201311152153
modifier: JeremyRuston
Experimenting with ~TiddlyWeb integration for ~TiddlyWiki5. Features:
! Features
* Loads skinny tiddlers from entire recipe at startup/login
* Subsequently syncs changes back to the server
* Polls for changes from the server
To do:
! Getting Started
* Use of `if-match` header
* Deleting tiddlers
* Routing newly created tiddlers to TiddlyWeb
To try it out, create a new space, include the space ''tw5tiddlyweb'', and then visit ''{myspace}.tiddlyspace.com/tw5''.
To try it out, create a new space, include the space `tw5tiddlyweb`, and then visit `<myspace>.tiddlyspace.com/tw5`.
If you want to make TiddlyWiki5 the default view for your space, then create a tiddler called ''ServerSettings'' and give it the text:
----
```
index: tw5
```
Current [[login status|$:/status/IsLoggedIn]]: {{$:/status/IsLoggedIn}}
! Issues
Current [[username|$:/status/UserName]]: {{$:/status/UserName}}
----
<$reveal state="$:/status/IsLoggedIn" type="nomatch" text="yes">
Log in to ~TiddlyWeb: <$button message="tw-login" class="btn btn-info">Login</$button>
</$reveal>
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
Log out of ~TiddlyWeb: <$button message="tw-logout" class="btn btn-warning">Logout</$button>
</$reveal>
<$button message="tw-server-refresh" class="btn btn-warning">Refresh</$button>
----
All tiddlers:
<$list filter="[!is[system]]" template="TiddlerListTemplate"/>
* ''$:/DefaultTiddlers'' doesn't work because thanks to lazy loading it is only loaded after it is needed
* Ignores ''if-match'' header, so doesn't detect clashes on save
* UI state (eg current tab status) is shared between all users of the wiki, meaning that the UI can spontaneously change in response to a server sync

View File

@@ -115,4 +115,4 @@ Tobias Beer, @tobibeer, 2013/09/21
Nate Cain, @natecain, 2013/09/30
Bob Robison, @grayeul, 2013/11/11

View File

@@ -1,7 +1,7 @@
{
"name": "tiddlywiki",
"preferGlobal": "true",
"version": "5.0.0-alpha.13",
"version": "5.0.0-alpha.15",
"author": "Jeremy Ruston <jeremy@jermolene.com>",
"description": "a non-linear personal web notebook",
"contributors": [

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/text/x-markdown
description: Markdown
name: text/x-markdown

View File

@@ -1,12 +1,16 @@
title: $:/core/ui/ServerControlPanel
----
title: $:/plugins/tiddlywiki/tiddlyweb/ServerControlPanel
caption: Server
tags: $:/tags/ControlPanel
<$reveal state="$:/status/IsLoggedIn" type="nomatch" text="yes">
Log in to ~TiddlyWeb: <$button message="tw-login" class="btn btn-info">Login</$button>
</$reveal>
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
Log out of ~TiddlyWeb: <$button message="tw-logout" class="btn btn-warning">Logout</$button>
Logged in as {{$:/status/UserName}} <$button message="tw-logout" class="btn btn-warning">Logout</$button>
</$reveal>
Host configuration: <$edit-text tiddler="$:/config/tiddlyweb/host" tag="input" default=""/>
<blockquote>//for example, `$protocol$//$host$/folder`, where `$protocol$` is replaced by the protocol (typically `http` or `https`), and `$host$` by the host name//</blockquote>
<$button message="tw-server-refresh" class="btn btn-warning">Refresh</$button> to fetch changes from the server immediately

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,10 @@
title: $:/ControlPanel/ThemeTweaks
title: $:/themes/tiddlywiki/snowwhite/themetweaks
tags: $:/tags/ControlPanel
caption: Theme Tweaks
You can tweak certain aspects of the ''Snow White'' theme.
//Currently, you need to toggle to a different theme and back (or save and restart) TiddlyWiki before these changes take effect. Also take care to preserve any backticks (&#96;) in the settings//
//Currently, you need to toggle to a different theme and back (or save and restart TiddlyWiki) before these changes take effect. Also take care to preserve any backticks (&#96;) in the settings//
! Colours

View File

@@ -139,9 +139,9 @@ table tfoot tr td {
max-width: 100%;
}
embed {
max-width: 100%;
max-height: 280px;
.tw-tiddler-frame embed {
width: 100%;
height: 600px;
}
/*
@@ -331,17 +331,15 @@ a.tw-tiddlylink-external {
}
.tw-page-controls svg {
height: 1.5em;
height: 1.75em;
min-width: 1px;
padding-right: 0.5em;
fill: #fff;
<<filter "drop-shadow(1px 1px 2px rgba(0,0,0,0.15))">>
<<transition "fill 150ms ease-in-out">>
}
.tw-page-controls svg:hover {
fill: #000;
<<filter "drop-shadow(1px 1px 2px rgba(255,255,255,0.9))">>
}
.tw-menu-list-item {
@@ -360,6 +358,15 @@ a.tw-tiddlylink-external {
padding-left: 7px;
}
.story-river {
position: relative;
}
.tw-story-spacer {
position: absolute;
min-height: 100%;
}
@media (max-width: {{$:/themes/tiddlywiki/snowwhite/metrics##storywidth}}) {
.sidebar-header {
padding: 14px;
@@ -382,7 +389,7 @@ a.tw-tiddlylink-external {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin: 0 0 0 -42px;
padding: 84px 0 28px 42px;
padding: 70px 0 28px 42px;
}
.story-river {
@@ -390,7 +397,7 @@ a.tw-tiddlylink-external {
left: {{$:/themes/tiddlywiki/snowwhite/metrics##storyleft}};
top: {{$:/themes/tiddlywiki/snowwhite/metrics##storytop}};
width: {{$:/themes/tiddlywiki/snowwhite/metrics##storywidth}};
padding: 42px;
padding: 56px 42px 42px 42px;
}
}
@@ -415,7 +422,6 @@ a.tw-tiddlylink-external {
}
.tw-tiddler-info {
overflow: hidden;
padding: 14px 42px 14px 42px;
background-color: #f8f8f8;
border-top: 1px solid #ddd;
@@ -565,6 +571,15 @@ canvas.tw-edit-bitmapeditor {
** Tiddler edit mode
*/
.tw-tiddler-edit-frame em {
color: #999;
font-style: normal;
}
.tw-edit-type-dropdown a.tw-tiddlylink-missing {
font-style: normal;
}
.tw-edit-tags-list {
margin: 14px 0 14px 0;
}
@@ -578,44 +593,6 @@ canvas.tw-edit-bitmapeditor {
padding-left: 4px;
}
.tw-tags-autocomplete-wrapper {
position: relative;
}
.tw-tags-autocomplete {
position: absolute;
min-width: 280px;
border: 1px solid {{$:/themes/tiddlywiki/snowwhite/colourmappings##dropdownborder}};
background-color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##dropdownbackground}};
<<border-radius 4px>>
<<box-shadow "2px 2px 10px rgba(0, 0, 0, 0.5)">>
padding: 0 0 0 0;
margin: 4px 0 0 0;
white-space: nowrap;
z-index: 1000;
}
.tw-tags-autocomplete a {
display: block;
padding: 4px 14px 4px 14px;
}
.tw-tags-autocomplete a:hover {
color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##linkbackground}};
background-color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##linkforeground}};
text-decoration: none;
}
.tw-add-tag {
color: #999;
}
.tw-add-tag svg {
height: 1em;
width: 1em;
fill: #999;
}
.tw-add-tag-name {
display: inline-block;
width: 15%;
@@ -673,10 +650,6 @@ canvas.tw-edit-bitmapeditor {
vertical-align: middle;
}
.tw-edit-field-add {
color: #999;
}
.tw-edit-field-add-name {
display: inline-block;
width: 15%;
@@ -691,6 +664,12 @@ canvas.tw-edit-bitmapeditor {
** Dropdowns
*/
.btn-dropdown svg {
height: 1em;
width: 1em;
fill: #999;
}
.tw-drop-down {
min-width: 280px;
border: 1px solid {{$:/themes/tiddlywiki/snowwhite/colourmappings##dropdownborder}};
@@ -726,6 +705,34 @@ canvas.tw-edit-bitmapeditor {
padding: 0 0.5em 0 0.5em;
}
.tw-block-dropdown-wrapper {
position: relative;
}
.tw-block-dropdown {
position: absolute;
min-width: 280px;
border: 1px solid {{$:/themes/tiddlywiki/snowwhite/colourmappings##dropdownborder}};
background-color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##dropdownbackground}};
<<border-radius 4px>>
<<box-shadow "2px 2px 10px rgba(0, 0, 0, 0.5)">>
padding: 0 0 0 0;
margin: 4px 0 0 0;
white-space: nowrap;
z-index: 1000;
}
.tw-block-dropdown a {
display: block;
padding: 4px 14px 4px 14px;
}
.tw-block-dropdown a:hover {
color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##linkbackground}};
background-color: {{$:/themes/tiddlywiki/snowwhite/colourmappings##linkforeground}};
text-decoration: none;
}
/*
** Modals
*/
@@ -840,8 +847,8 @@ canvas.tw-edit-bitmapeditor {
.tw-tab-buttons button {
color: #666;
margin-left: 4px;
margin-right: 4px;
margin-left: 2px;
margin-right: 2px;
font-weight: 300;
border: none;
background: inherit;
@@ -956,3 +963,15 @@ canvas.tw-edit-bitmapeditor {
width: 1em;
height: 1em;
}
/*
** Control panel
*/
.tw-control-panel td {
padding: 4px;
}
.tw-control-panel table, .tw-control-panel table input, .tw-control-panel table textarea {
width: 100%;
}

View File

@@ -1,7 +1,7 @@
title: $:/themes/tiddlywiki/snowwhite/colours
type: application/x-tiddler-dictionary
primary: `#5959C0`
primary: `#007dff`
background: `#fff`
foreground: `#333`
pagebackground: `#ececec`

View File

@@ -0,0 +1,5 @@
title: $:/themes/tiddlywiki/starlight/themetweaks
tags: $:/tags/ControlPanel
caption: Star Tweaks
Demo of a control panel tab dynamically loaded with a theme.