mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-26 12:53:42 +00:00
Compare commits
61 Commits
v5.0.0-alp
...
v5.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1e909278c | ||
|
|
8d3613e8b4 | ||
|
|
3fd3e408fc | ||
|
|
a2fcc59648 | ||
|
|
223e9c4747 | ||
|
|
b63f7a7416 | ||
|
|
905d3e6e1e | ||
|
|
90a0eca2f5 | ||
|
|
7658789971 | ||
|
|
9257c8205f | ||
|
|
b117f74666 | ||
|
|
3b35d7dfe4 | ||
|
|
29c0f7156b | ||
|
|
0d2ed8f112 | ||
|
|
99a6b1bcc0 | ||
|
|
da4cdf2d3b | ||
|
|
26cc62cff7 | ||
|
|
b1992714ed | ||
|
|
ecca7a3ea9 | ||
|
|
4b84d9bfe5 | ||
|
|
92b1932fcf | ||
|
|
9a6e404215 | ||
|
|
939ad11eae | ||
|
|
6785c49734 | ||
|
|
45c51481de | ||
|
|
874bd7b2b8 | ||
|
|
fc6dd83f2f | ||
|
|
a8129874fb | ||
|
|
c7d5905242 | ||
|
|
02d3620d93 | ||
|
|
b304e3fe40 | ||
|
|
06a66cf24e | ||
|
|
145e3ece78 | ||
|
|
24e361da77 | ||
|
|
1b9614eb9d | ||
|
|
791033d751 | ||
|
|
9748709759 | ||
|
|
b885743efe | ||
|
|
8ec92405fd | ||
|
|
e68ab95ecb | ||
|
|
d2dbc73448 | ||
|
|
4a5a8dd773 | ||
|
|
439dfcb172 | ||
|
|
f6a4ea6b0f | ||
|
|
8681e0228d | ||
|
|
c1123cb3e9 | ||
|
|
d64590a12b | ||
|
|
e274a0c7d1 | ||
|
|
51fe1e20e8 | ||
|
|
9c4ffae1b3 | ||
|
|
3d0c6cf41e | ||
|
|
3800d3b2b1 | ||
|
|
da54236f5a | ||
|
|
c930d84d01 | ||
|
|
2317f779e9 | ||
|
|
c501e70512 | ||
|
|
8357d90e59 | ||
|
|
efef6261b8 | ||
|
|
95b7a5d4fe | ||
|
|
2c55c7ca82 | ||
|
|
02dda51269 |
@@ -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),
|
||||
|
||||
3
core/docs/types/image_gif.tid
Normal file
3
core/docs/types/image_gif.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/image/gif
|
||||
description: GIF image
|
||||
name: image/gif
|
||||
3
core/docs/types/image_jpeg.tid
Normal file
3
core/docs/types/image_jpeg.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/image/jpeg
|
||||
description: JPEG image
|
||||
name: image/jpeg
|
||||
3
core/docs/types/image_png.tid
Normal file
3
core/docs/types/image_png.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/image/png
|
||||
description: PNG image
|
||||
name: image/png
|
||||
3
core/docs/types/text_plain.tid
Normal file
3
core/docs/types/text_plain.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/text/plain
|
||||
description: Plain text
|
||||
name: text/plain
|
||||
3
core/docs/types/text_vnd.tiddlywiki.tid
Normal file
3
core/docs/types/text_vnd.tiddlywiki.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/text/vnd.tiddlywiki
|
||||
description: TW5 wikitext
|
||||
name: text/vnd.tiddlywiki
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -40,9 +40,7 @@ exports.parse = function() {
|
||||
var transcludeNode = {
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
attributes: {
|
||||
tiddler: {type: "string", value: template || targetTitle}
|
||||
},
|
||||
attributes: {},
|
||||
isBlock: true
|
||||
};
|
||||
var tiddlerNode = {
|
||||
@@ -54,11 +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(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];
|
||||
};
|
||||
|
||||
@@ -40,9 +40,7 @@ exports.parse = function() {
|
||||
var transcludeNode = {
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
attributes: {
|
||||
tiddler: {type: "string", value: template || targetTitle}
|
||||
}
|
||||
attributes: {}
|
||||
};
|
||||
var tiddlerNode = {
|
||||
type: "element",
|
||||
@@ -52,11 +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(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];
|
||||
};
|
||||
|
||||
56
core/modules/savers/msdownload.js
Normal file
56
core/modules/savers/msdownload.js
Normal 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);
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
})();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
18
core/ui/EditTemplate/body.tid
Normal file
18
core/ui/EditTemplate/body.tid
Normal 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>
|
||||
4
core/ui/EditTemplate/controls.tid
Normal file
4
core/ui/EditTemplate/controls.tid
Normal 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>
|
||||
14
core/ui/EditTemplate/fields.tid
Normal file
14
core/ui/EditTemplate/fields.tid
Normal 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>
|
||||
22
core/ui/EditTemplate/tags.tid
Normal file
22
core/ui/EditTemplate/tags.tid
Normal 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">×</$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>
|
||||
6
core/ui/EditTemplate/title.tid
Normal file
6
core/ui/EditTemplate/title.tid
Normal 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"/>
|
||||
15
core/ui/EditTemplate/type.tid
Normal file
15
core/ui/EditTemplate/type.tid
Normal 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>
|
||||
4
core/ui/EditToolbar/cancel.tid
Normal file
4
core/ui/EditToolbar/cancel.tid
Normal 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>
|
||||
4
core/ui/EditToolbar/delete.tid
Normal file
4
core/ui/EditToolbar/delete.tid
Normal 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>
|
||||
4
core/ui/EditToolbar/save.tid
Normal file
4
core/ui/EditToolbar/save.tid
Normal 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>
|
||||
@@ -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
|
||||
@@ -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>
|
||||
4
core/ui/PageControls/controlpanel.tid
Normal file
4
core/ui/PageControls/controlpanel.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/PageControls/control-panel
|
||||
tags: $:/tags/PageControls
|
||||
|
||||
<$link to="$:/ControlPanel">{{$:/core/images/options-button}}</$link>
|
||||
4
core/ui/PageControls/newtiddler.tid
Normal file
4
core/ui/PageControls/newtiddler.tid
Normal 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>
|
||||
4
core/ui/PageControls/savewiki.tid
Normal file
4
core/ui/PageControls/savewiki.tid
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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">×</$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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
4
core/ui/ViewToolbar/close.tid
Normal file
4
core/ui/ViewToolbar/close.tid
Normal 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>
|
||||
4
core/ui/ViewToolbar/edit.tid
Normal file
4
core/ui/ViewToolbar/edit.tid
Normal 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>
|
||||
4
core/ui/ViewToolbar/info.tid
Normal file
4
core/ui/ViewToolbar/info.tid
Normal 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>
|
||||
@@ -4,8 +4,8 @@ title: $:/snippets/modules
|
||||
{{$:/docs/moduletypes/$type$}}
|
||||
\end
|
||||
<$list filter="[moduletypes[]]">
|
||||
!! <$macrocall $name="listItem" $type="text/plain" $output="text/plain"/>
|
||||
<$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>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
2
core/wiki/tags/EditTemplate.tid
Normal file
2
core/wiki/tags/EditTemplate.tid
Normal 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]]
|
||||
2
core/wiki/tags/EditToolbar.tid
Normal file
2
core/wiki/tags/EditToolbar.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/EditToolbar
|
||||
list: [[$:/core/ui/EditToolbar/delete]] [[$:/core/ui/EditToolbar/cancel]] [[$:/core/ui/EditToolbar/save]]
|
||||
2
core/wiki/tags/PageControls.tid
Normal file
2
core/wiki/tags/PageControls.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/PageControls
|
||||
list: [[$:/core/ui/PageControls/new-tiddler]] [[$:/core/ui/PageControls/control-panel]] [[$:/core/ui/PageControls/save-wiki]]
|
||||
2
core/wiki/tags/ViewToolbar.tid
Normal file
2
core/wiki/tags/ViewToolbar.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/tags/ViewToolbar
|
||||
list: [[$:/core/ui/ViewToolbar/info]] [[$:/core/ui/ViewToolbar/edit]] [[$:/core/ui/ViewToolbar/close]]
|
||||
@@ -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
|
||||
|
||||
@@ -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 : [ ] } ] } ]
|
||||
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
39
editions/tw5.com/tiddlers/Release 5.0.0alpha15.tid
Normal file
39
editions/tw5.com/tiddlers/Release 5.0.0alpha15.tid
Normal 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.
|
||||
@@ -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:
|
||||
|
||||
|
||||
17
editions/tw5.com/tiddlers/system/StaticLink.tid
Normal file
17
editions/tw5.com/tiddlers/system/StaticLink.tid
Normal 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//
|
||||
@@ -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.
|
||||
|
||||
18
editions/tw5.com/tiddlers/widgets/SetWidget.tid
Normal file
18
editions/tw5.com/tiddlers/widgets/SetWidget.tid
Normal 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 |
|
||||
@@ -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
|
||||
|
||||
@@ -115,4 +115,4 @@ Tobias Beer, @tobibeer, 2013/09/21
|
||||
|
||||
Nate Cain, @natecain, 2013/09/30
|
||||
|
||||
|
||||
Bob Robison, @grayeul, 2013/11/11
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "tiddlywiki",
|
||||
"preferGlobal": "true",
|
||||
"version": "5.0.0-alpha.14",
|
||||
"version": "5.0.0-alpha.15",
|
||||
"author": "Jeremy Ruston <jeremy@jermolene.com>",
|
||||
"description": "a non-linear personal web notebook",
|
||||
"contributors": [
|
||||
|
||||
3
plugins/tiddlywiki/markdown/docs_type_markdown.tid
Normal file
3
plugins/tiddlywiki/markdown/docs_type_markdown.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/text/x-markdown
|
||||
description: Markdown
|
||||
name: text/x-markdown
|
||||
@@ -6,7 +6,11 @@ tags: $:/tags/ControlPanel
|
||||
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
|
||||
|
||||
@@ -4,7 +4,7 @@ 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 (`) 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 (`) in the settings//
|
||||
|
||||
! Colours
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -358,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;
|
||||
@@ -380,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 {
|
||||
@@ -388,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,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;
|
||||
@@ -563,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;
|
||||
}
|
||||
@@ -576,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%;
|
||||
@@ -671,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%;
|
||||
@@ -689,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}};
|
||||
@@ -724,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
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/themes/tiddlywiki/snowwhite/colours
|
||||
type: application/x-tiddler-dictionary
|
||||
|
||||
primary: `#5959C0`
|
||||
primary: `#007dff`
|
||||
background: `#fff`
|
||||
foreground: `#333`
|
||||
pagebackground: `#ececec`
|
||||
|
||||
Reference in New Issue
Block a user