mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-24 11:54:41 +00:00
Compare commits
30 Commits
custom-cop
...
logging-im
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c11b04ae9a | ||
|
|
5d2a59d20d | ||
|
|
4be81b2bf4 | ||
|
|
423075e89d | ||
|
|
51ad11401b | ||
|
|
352272905e | ||
|
|
eb15dc8408 | ||
|
|
33bc77f46f | ||
|
|
4860b14315 | ||
|
|
913d15dc53 | ||
|
|
9e1babdf82 | ||
|
|
ea173ec83d | ||
|
|
40801f3c29 | ||
|
|
312b3b2037 | ||
|
|
f8ae96118a | ||
|
|
7337b6da63 | ||
|
|
416c6ee0d4 | ||
|
|
743bc4933f | ||
|
|
4055501f71 | ||
|
|
ac855b0065 | ||
|
|
7a50b2b554 | ||
|
|
65d9384261 | ||
|
|
da8d4ecfae | ||
|
|
6a84ae332d | ||
|
|
e35793bc38 | ||
|
|
3af2a0ae6f | ||
|
|
f3614c1e47 | ||
|
|
78fb4a2c1d | ||
|
|
3e27093c94 | ||
|
|
22a85e8fc7 |
@@ -393,6 +393,17 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# /plugins/tiddlywiki/geospatial/index.html Demo wiki with geospatial plugin
|
||||
# /plugins/tiddlywiki/geospatial/empty.html Empty wiki with geospatial plugin
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/geospatialdemo \
|
||||
--verbose \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/geospatial/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
######################################################
|
||||
#
|
||||
# Language editions
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
title: $:/boot/boot.css
|
||||
type: text/css
|
||||
|
||||
/*
|
||||
Basic styles used before we boot up the parsing engine
|
||||
*/
|
||||
@@ -25,11 +25,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"file": "boot.css",
|
||||
"fields": {
|
||||
"title": "$:/boot/boot.css",
|
||||
"type": "text/css"
|
||||
}
|
||||
"file": "boot.css.tid",
|
||||
"isTiddlerFile": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/core/images/default-layout
|
||||
title: $:/core/images/standard-layout
|
||||
tags: $:/tags/Image
|
||||
|
||||
\parameters (size:"22pt")
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-default-layout tc-image-button" viewBox="0 0 128 128">
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-standard-layout tc-image-button" viewBox="0 0 128 128">
|
||||
<path d="M71.93 72A8.07 8.07 0 0 1 80 80.07v7.86A8.071 8.071 0 0 1 71.93 96H8.07A8.067 8.067 0 0 1 0 87.93v-7.86A8.072 8.072 0 0 1 8.07 72h63.86Zm0 32a8.07 8.07 0 0 1 8.07 8.07v7.86a8.071 8.071 0 0 1-8.07 8.07H8.07A8.067 8.067 0 0 1 0 119.93v-7.86A8.072 8.072 0 0 1 8.07 104h63.86Zm0-104A8.068 8.068 0 0 1 80 8.07v47.86A8.073 8.073 0 0 1 71.93 64H8.07A8.07 8.07 0 0 1 0 55.93V8.07A8.072 8.072 0 0 1 8.07 0h63.86Zm48 0c2.14 0 4.193.85 5.706 2.364A8.067 8.067 0 0 1 128 8.07v111.86c0 2.14-.85 4.193-2.364 5.706A8.067 8.067 0 0 1 119.93 128H96.07c-2.14 0-4.193-.85-5.706-2.364A8.067 8.067 0 0 1 88 119.93V8.07c0-2.14.85-4.193 2.364-5.706A8.067 8.067 0 0 1 96.07 0h23.86ZM116 24h-16a3.995 3.995 0 0 0-2.828 1.172 3.995 3.995 0 0 0 0 5.656A3.995 3.995 0 0 0 100 32h16a3.995 3.995 0 0 0 2.828-1.172 3.995 3.995 0 0 0 0-5.656A3.995 3.995 0 0 0 116 24Z"/>
|
||||
</svg>
|
||||
@@ -70,7 +70,7 @@ No: No
|
||||
OfficialPluginLibrary: Official ~TiddlyWiki Plugin Library
|
||||
OfficialPluginLibrary/Hint: The official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
PageTemplate/Description: the default ~TiddlyWiki layout
|
||||
PageTemplate/Name: Default ~PageTemplate
|
||||
PageTemplate/Name: Standard Layout
|
||||
PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect
|
||||
RecentChanges/DateFormat: DDth MMM YYYY
|
||||
Shortcuts/Input/AdvancedSearch/Hint: Open the ~AdvancedSearch panel from within the sidebar search field
|
||||
|
||||
@@ -120,7 +120,7 @@ Command.prototype.fetchFile = function(url,options,callback,redirectCount) {
|
||||
}
|
||||
});
|
||||
response.on("error",function(e) {
|
||||
console.log("Error on GET request: " + e);
|
||||
self.commander.log("Error on GET request: " + e);
|
||||
callback(e);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ Render individual tiddlers and save the results to the specified files
|
||||
$tw.utils.each(tiddlers,function(title) {
|
||||
var filepath = path.resolve(self.commander.outputPath,wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]))[0]);
|
||||
if(self.commander.verbose) {
|
||||
console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
|
||||
self.commander.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
|
||||
}
|
||||
var parser = wiki.parseTiddler(template || title),
|
||||
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}),
|
||||
@@ -63,4 +63,4 @@ Render individual tiddlers and save the results to the specified files
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
|
||||
}
|
||||
});
|
||||
if(self.commander.verbose) {
|
||||
console.log("Saving \"" + title + "\" to \"" + fileInfo.filepath + "\"");
|
||||
self.commander.log("Saving \"" + title + "\" to \"" + filepath + "\"");
|
||||
}
|
||||
try {
|
||||
$tw.utils.saveTiddlerToFileSync(tiddler,fileInfo);
|
||||
|
||||
@@ -33,7 +33,13 @@ function Server(options) {
|
||||
this.routes = options.routes || [];
|
||||
this.authenticators = options.authenticators || [];
|
||||
this.wiki = options.wiki;
|
||||
this.logger = new $tw.utils.Logger("server",{colour: "cyan"});
|
||||
this.logger.setPrefix(":" + process.pid + "-" + (Number(new Date()) - 1095776640000));
|
||||
this.boot = options.boot || $tw.boot;
|
||||
// Name the server and init the boot state
|
||||
this.servername = $tw.utils.transliterateToSafeASCII(this.get("server-name") || this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
||||
this.boot.origin = this.get("origin")? this.get("origin"): this.protocol+"://"+this.get("host")+":"+this.get("port");
|
||||
this.boot.pathPrefix = this.get("path-prefix") || "";
|
||||
// Initialise the variables
|
||||
this.variables = $tw.utils.extend({},this.defaultVariables);
|
||||
if(options.variables) {
|
||||
@@ -92,10 +98,6 @@ function Server(options) {
|
||||
this.protocol = "https";
|
||||
}
|
||||
this.transport = require(this.protocol);
|
||||
// Name the server and init the boot state
|
||||
this.servername = $tw.utils.transliterateToSafeASCII(this.get("server-name") || this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
||||
this.boot.origin = this.get("origin")? this.get("origin"): this.protocol+"://"+this.get("host")+":"+this.get("port");
|
||||
this.boot.pathPrefix = this.get("path-prefix") || "";
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -287,9 +289,9 @@ Server.prototype.requestHandler = function(request,response,options) {
|
||||
var route = self.findMatchingRoute(request,state);
|
||||
// Optionally output debug info
|
||||
if(self.get("debug-level") !== "none") {
|
||||
console.log("Request path:",JSON.stringify(state.urlInfo));
|
||||
console.log("Request headers:",JSON.stringify(request.headers));
|
||||
console.log("authenticatedUsername:",state.authenticatedUsername);
|
||||
self.logger.log("Request path:",JSON.stringify(state.urlInfo.href));
|
||||
self.logger.log("Request headers:",JSON.stringify(request.headers));
|
||||
self.logger.log("authenticatedUsername:",state.authenticatedUsername);
|
||||
}
|
||||
// Return a 404 if we didn't find a route
|
||||
if(!route) {
|
||||
|
||||
@@ -29,7 +29,11 @@ var THROTTLE_REFRESH_TIMEOUT = 400;
|
||||
|
||||
exports.startup = function() {
|
||||
// Set up the title
|
||||
$tw.titleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TITLE_TITLE,{document: $tw.fakeDocument, parseAsInline: true});
|
||||
$tw.titleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TITLE_TITLE, {
|
||||
document: $tw.fakeDocument,
|
||||
parseAsInline: true,
|
||||
importPageMacros: true,
|
||||
});
|
||||
$tw.titleContainer = $tw.fakeDocument.createElement("div");
|
||||
$tw.titleWidgetNode.render($tw.titleContainer,null);
|
||||
document.title = $tw.titleContainer.textContent;
|
||||
|
||||
@@ -39,6 +39,7 @@ exports.startup = function() {
|
||||
method: params.method,
|
||||
body: params.body,
|
||||
binary: params.binary,
|
||||
useDefaultHeaders: params.useDefaultHeaders,
|
||||
oncompletion: params.oncompletion,
|
||||
onprogress: params.onprogress,
|
||||
bindStatus: params["bind-status"],
|
||||
@@ -47,7 +48,11 @@ exports.startup = function() {
|
||||
headers: getPropertiesWithPrefix(params,"header-"),
|
||||
passwordHeaders: getPropertiesWithPrefix(params,"password-header-"),
|
||||
queryStrings: getPropertiesWithPrefix(params,"query-"),
|
||||
passwordQueryStrings: getPropertiesWithPrefix(params,"password-query-")
|
||||
passwordQueryStrings: getPropertiesWithPrefix(params,"password-query-"),
|
||||
basicAuthUsername: params["basic-auth-username"],
|
||||
basicAuthUsernameFromStore: params["basic-auth-username-from-store"],
|
||||
basicAuthPassword: params["basic-auth-password"],
|
||||
basicAuthPasswordFromStore: params["basic-auth-password-from-store"]
|
||||
});
|
||||
});
|
||||
$tw.rootWidget.addEventListener("tm-http-cancel-all-requests",function(event) {
|
||||
@@ -68,7 +73,10 @@ exports.startup = function() {
|
||||
});
|
||||
// Install the copy-to-clipboard mechanism
|
||||
$tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) {
|
||||
$tw.utils.copyToClipboard(event.param);
|
||||
$tw.utils.copyToClipboard(event.param,{
|
||||
successNotification: event.paramObject && event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject && event.paramObject.failureNotification
|
||||
});
|
||||
});
|
||||
// Install the tm-focus-selector message
|
||||
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
|
||||
|
||||
@@ -93,7 +93,9 @@ exports.startup = function() {
|
||||
updateAddressBar: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_UPDATE_ADDRESS_BAR,"yes").trim() === "yes" ? "permalink" : "none",
|
||||
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
|
||||
targetTiddler: event.param || event.tiddlerTitle,
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permalink" : "none"
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permalink" : "none",
|
||||
successNotification: event.paramObject && event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject && event.paramObject.failureNotification
|
||||
});
|
||||
});
|
||||
// Listen for the tm-permaview message
|
||||
@@ -102,7 +104,9 @@ exports.startup = function() {
|
||||
updateAddressBar: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_UPDATE_ADDRESS_BAR,"yes").trim() === "yes" ? "permaview" : "none",
|
||||
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
|
||||
targetTiddler: event.param || event.tiddlerTitle,
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permaview" : "none"
|
||||
copyToClipboard: $tw.wiki.getTiddlerText(CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD,"yes").trim() === "yes" ? "permaview" : "none",
|
||||
successNotification: event.paramObject && event.paramObject.successNotification,
|
||||
failureNotification: event.paramObject && event.paramObject.failureNotification
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -177,6 +181,8 @@ options.updateAddressBar: "permalink", "permaview" or "no" (defaults to "permavi
|
||||
options.updateHistory: "yes" or "no" (defaults to "no")
|
||||
options.copyToClipboard: "permalink", "permaview" or "no" (defaults to "no")
|
||||
options.targetTiddler: optional title of target tiddler for permalink
|
||||
options.successNotification: optional title of tiddler to use as the notification in case of success
|
||||
options.failureNotification: optional title of tiddler to use as the notification in case of failure
|
||||
*/
|
||||
function updateLocationHash(options) {
|
||||
// Get the story and the history stack
|
||||
@@ -205,14 +211,18 @@ function updateLocationHash(options) {
|
||||
break;
|
||||
}
|
||||
// Copy URL to the clipboard
|
||||
var url = "";
|
||||
switch(options.copyToClipboard) {
|
||||
case "permalink":
|
||||
$tw.utils.copyToClipboard($tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler));
|
||||
url = $tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler);
|
||||
break;
|
||||
case "permaview":
|
||||
$tw.utils.copyToClipboard($tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList)));
|
||||
url = $tw.utils.getLocationPath() + "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList));
|
||||
break;
|
||||
}
|
||||
if(url) {
|
||||
$tw.utils.copyToClipboard(url,{successNotification: options.successNotification, failureNotification: options.failureNotification});
|
||||
}
|
||||
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events
|
||||
if($tw.utils.getLocationHash() !== $tw.locationHash) {
|
||||
if(options.updateHistory === "yes") {
|
||||
|
||||
@@ -292,7 +292,9 @@ exports.copyToClipboard = function(text,options) {
|
||||
} catch (err) {
|
||||
}
|
||||
if(!options.doNotNotify) {
|
||||
$tw.notifier.display(succeeded ? "$:/language/Notifications/CopiedToClipboard/Succeeded" : "$:/language/Notifications/CopiedToClipboard/Failed");
|
||||
var successNotification = options.successNotification || "$:/language/Notifications/CopiedToClipboard/Succeeded",
|
||||
failureNotification = options.failureNotification || "$:/language/Notifications/CopiedToClipboard/Failed"
|
||||
$tw.notifier.display(succeeded ? successNotification : failureNotification);
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ HttpClient.prototype.cancelAllHttpRequests = function() {
|
||||
for(var t=this.requests.length - 1; t--; t>=0) {
|
||||
var requestInfo = this.requests[t];
|
||||
requestInfo.request.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.requests = [];
|
||||
this.updateRequestTracker();
|
||||
@@ -100,6 +100,10 @@ headers: hashmap of header name to header value to be sent with the request
|
||||
passwordHeaders: hashmap of header name to password store name to be sent with the request
|
||||
queryStrings: hashmap of query string parameter name to parameter value to be sent with the request
|
||||
passwordQueryStrings: hashmap of query string parameter name to password store name to be sent with the request
|
||||
basicAuthUsername: plain username for basic authentication
|
||||
basicAuthUsernameFromStore: name of password store entry containing username
|
||||
basicAuthPassword: plain password for basic authentication
|
||||
basicAuthPasswordFromStore: name of password store entry containing password
|
||||
*/
|
||||
function HttpClientRequest(options) {
|
||||
var self = this;
|
||||
@@ -112,6 +116,7 @@ function HttpClientRequest(options) {
|
||||
this.method = options.method || "GET";
|
||||
this.body = options.body || "";
|
||||
this.binary = options.binary || "";
|
||||
this.useDefaultHeaders = options.useDefaultHeaders !== "false" ? true : false,
|
||||
this.variables = options.variables;
|
||||
var url = options.url;
|
||||
$tw.utils.each(options.queryStrings,function(value,name) {
|
||||
@@ -128,6 +133,11 @@ function HttpClientRequest(options) {
|
||||
$tw.utils.each(options.passwordHeaders,function(value,name) {
|
||||
self.requestHeaders[name] = $tw.utils.getPassword(value) || "";
|
||||
});
|
||||
this.basicAuthUsername = options.basicAuthUsername || (options.basicAuthUsernameFromStore && $tw.utils.getPassword(options.basicAuthUsernameFromStore)) || "";
|
||||
this.basicAuthPassword = options.basicAuthPassword || (options.basicAuthPasswordFromStore && $tw.utils.getPassword(options.basicAuthPasswordFromStore)) || "";
|
||||
if(this.basicAuthUsername && this.basicAuthPassword) {
|
||||
this.requestHeaders.Authorization = "Basic " + $tw.utils.base64Encode(this.basicAuthUsername + ":" + this.basicAuthPassword);
|
||||
}
|
||||
}
|
||||
|
||||
HttpClientRequest.prototype.send = function(callback) {
|
||||
@@ -156,6 +166,7 @@ HttpClientRequest.prototype.send = function(callback) {
|
||||
this.xhr = $tw.utils.httpRequest({
|
||||
url: this.url,
|
||||
type: this.method,
|
||||
useDefaultHeaders: this.useDefaultHeaders,
|
||||
headers: this.requestHeaders,
|
||||
data: this.body,
|
||||
returnProp: this.binary === "" ? "responseText" : "response",
|
||||
@@ -231,7 +242,8 @@ Make an HTTP request. Options are:
|
||||
exports.httpRequest = function(options) {
|
||||
var type = options.type || "GET",
|
||||
url = options.url,
|
||||
headers = options.headers || {accept: "application/json"},
|
||||
useDefaultHeaders = options.useDefaultHeaders !== false ? true : false,
|
||||
headers = options.headers || (useDefaultHeaders ? {accept: "application/json"} : {}),
|
||||
hasHeader = function(targetHeader) {
|
||||
targetHeader = targetHeader.toLowerCase();
|
||||
var result = false;
|
||||
@@ -257,7 +269,7 @@ exports.httpRequest = function(options) {
|
||||
if(hasHeader("Content-Type") && ["application/x-www-form-urlencoded","multipart/form-data","text/plain"].indexOf(getHeader["Content-Type"]) === -1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
},
|
||||
returnProp = options.returnProp || "responseText",
|
||||
request = new XMLHttpRequest(),
|
||||
@@ -307,10 +319,10 @@ exports.httpRequest = function(options) {
|
||||
request.setRequestHeader(headerTitle,header);
|
||||
});
|
||||
}
|
||||
if(data && !hasHeader("Content-Type")) {
|
||||
if(data && !hasHeader("Content-Type") && useDefaultHeaders) {
|
||||
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
|
||||
}
|
||||
if(!hasHeader("X-Requested-With") && !isSimpleRequest(type,headers)) {
|
||||
if(!hasHeader("X-Requested-With") && !isSimpleRequest(type,headers) && useDefaultHeaders) {
|
||||
request.setRequestHeader("X-Requested-With","TiddlyWiki");
|
||||
}
|
||||
// Send data
|
||||
|
||||
@@ -21,6 +21,7 @@ function Logger(componentName,options) {
|
||||
options = options || {};
|
||||
this.componentName = componentName || "";
|
||||
this.colour = options.colour || "white";
|
||||
this.prefix = options.prefix || "";
|
||||
this.enable = "enable" in options ? options.enable : true;
|
||||
this.save = "save" in options ? options.save : true;
|
||||
this.saveLimit = options.saveLimit || 100 * 1024;
|
||||
@@ -33,6 +34,20 @@ Logger.prototype.setSaveBuffer = function(logger) {
|
||||
this.saveBufferLogger = logger;
|
||||
};
|
||||
|
||||
/*
|
||||
Change the output colour
|
||||
*/
|
||||
Logger.prototype.setColour = function(colour) {
|
||||
this.colour = colour || "white";
|
||||
};
|
||||
|
||||
/*
|
||||
Change the prefix
|
||||
*/
|
||||
Logger.prototype.setPrefix = function(prefix) {
|
||||
this.prefix = prefix || "";
|
||||
};
|
||||
|
||||
/*
|
||||
Log a message
|
||||
*/
|
||||
|
||||
@@ -31,34 +31,49 @@ DataWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var jsonPayload = JSON.stringify(this.readDataTiddlerValues(),null,4);
|
||||
var textNode = this.document.createTextNode(jsonPayload);
|
||||
parent.insertBefore(textNode,nextSibling);
|
||||
this.domNodes.push(textNode);
|
||||
this.dataPayload = this.computeDataTiddlerValues(); // Array of $tw.Tiddler objects
|
||||
this.domNode = this.document.createTextNode(this.readDataTiddlerValuesAsJson());
|
||||
parent.insertBefore(this.domNode,nextSibling);
|
||||
this.domNodes.push(this.domNode);
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
DataWidget.prototype.execute = function() {
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
// Nothing to do here
|
||||
};
|
||||
|
||||
/*
|
||||
Read the tiddler value(s) from a data widget – must be called after the .render() method
|
||||
Read the tiddler value(s) from a data widget as an array of tiddler field objects (not $tw.Tiddler objects)
|
||||
*/
|
||||
DataWidget.prototype.readDataTiddlerValues = function() {
|
||||
var results = [];
|
||||
$tw.utils.each(this.dataPayload,function(tiddler,index) {
|
||||
results.push(tiddler.getFieldStrings());
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Read the tiddler value(s) from a data widget as an array of tiddler field objects (not $tw.Tiddler objects)
|
||||
*/
|
||||
DataWidget.prototype.readDataTiddlerValuesAsJson = function() {
|
||||
return JSON.stringify(this.readDataTiddlerValues(),null,4);
|
||||
};
|
||||
|
||||
/*
|
||||
Compute list of tiddlers from a data widget
|
||||
*/
|
||||
DataWidget.prototype.computeDataTiddlerValues = function() {
|
||||
var self = this;
|
||||
// Start with a blank object
|
||||
var item = Object.create(null);
|
||||
// Read any attributes not prefixed with $
|
||||
var item = Object.create(null);
|
||||
$tw.utils.each(this.attributes,function(value,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
item[name] = value;
|
||||
}
|
||||
});
|
||||
item = new $tw.Tiddler(item);
|
||||
// Deal with $tiddler, $filter or $compound-tiddler attributes
|
||||
var tiddlers = [],title;
|
||||
if(this.hasAttribute("$tiddler")) {
|
||||
@@ -86,21 +101,22 @@ DataWidget.prototype.readDataTiddlerValues = function() {
|
||||
tiddlers.push.apply(tiddlers,this.extractCompoundTiddler(title));
|
||||
}
|
||||
}
|
||||
// Convert the literal item to field strings
|
||||
item = item.getFieldStrings();
|
||||
if(tiddlers.length === 0) {
|
||||
// Return the literal item if none of the special attributes were used
|
||||
if(!this.hasAttribute("$tiddler") && !this.hasAttribute("$filter") && !this.hasAttribute("$compound-tiddler")) {
|
||||
if(Object.keys(item).length > 0 && !!item.title) {
|
||||
return [item];
|
||||
return [new $tw.Tiddler(item)];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
} else {
|
||||
var results = [];
|
||||
$tw.utils.each(tiddlers,function(tiddler,index) {
|
||||
var fields = tiddler.getFieldStrings();
|
||||
results.push($tw.utils.extend({},fields,item));
|
||||
});
|
||||
return results;
|
||||
// Apply the item fields to each of the tiddlers
|
||||
delete item.title; // Do not overwrite the title
|
||||
if(Object.keys(item).length > 0) {
|
||||
$tw.utils.each(tiddlers,function(tiddler,index) {
|
||||
tiddlers[index] = new $tw.Tiddler(tiddler,item);
|
||||
});
|
||||
}
|
||||
return tiddlers;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -134,12 +150,33 @@ DataWidget.prototype.extractCompoundTiddler = function(title) {
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
DataWidget.prototype.refresh = function(changedTiddlers) {
|
||||
// It would be expensive to calculate whether the changedTiddlers impact the filter
|
||||
// identified by the $filter attribute so we just refresh ourselves unconditionally
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
var changedAttributes = this.computeAttributes();
|
||||
var newPayload = this.computeDataTiddlerValues();
|
||||
if(hasPayloadChanged(this.dataPayload,newPayload)) {
|
||||
this.dataPayload = newPayload;
|
||||
this.domNode.textContent = this.readDataTiddlerValuesAsJson();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Compare two arrays of tiddlers and return true if they are different
|
||||
*/
|
||||
function hasPayloadChanged(a,b) {
|
||||
if(a.length === b.length) {
|
||||
for(var t=0; t<a.length; t++) {
|
||||
if(!(a[t].isEqual(b[t]))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
exports.data = DataWidget;
|
||||
|
||||
})();
|
||||
|
||||
@@ -74,6 +74,18 @@ ParametersWidget.prototype.execute = function() {
|
||||
self.setVariable(variableName,getValue(name));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// There is no parent transclude. i.e. direct rendering.
|
||||
// We use default values only.
|
||||
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(self.parseTreeNode),function(attr,index) {
|
||||
var name = attr.name;
|
||||
// If the attribute name starts with $$ then reduce to a single dollar
|
||||
if(name.substr(0,2) === "$$") {
|
||||
name = name.substr(1);
|
||||
}
|
||||
var value = self.getAttribute(attr.name,"");
|
||||
self.setVariable(name,value);
|
||||
});
|
||||
}
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
|
||||
@@ -316,7 +316,8 @@ Widget.prototype.getStateQualifier = function(name) {
|
||||
Make a fake widget with specified variables, suitable for variable lookup in filters
|
||||
*/
|
||||
Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
|
||||
var self = this;
|
||||
var self = this,
|
||||
variables = variables || {};
|
||||
return {
|
||||
getVariable: function(name,opts) {
|
||||
if($tw.utils.hop(variables,name)) {
|
||||
@@ -334,7 +335,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
|
||||
};
|
||||
} else {
|
||||
opts = opts || {};
|
||||
opts.variables = variables;
|
||||
opts.variables = $tw.utils.extend(variables,opts.variables);
|
||||
return self.getVariableInfo(name,opts);
|
||||
};
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
title: $:/core/ui/PageTemplate
|
||||
name: {{$:/language/PageTemplate/Name}}
|
||||
description: {{$:/language/PageTemplate/Description}}
|
||||
icon: $:/core/images/default-layout
|
||||
icon: $:/core/images/standard-layout
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
4
editions/geospatialdemo/tiddlers/DefaultTiddlers.tid
Normal file
4
editions/geospatialdemo/tiddlers/DefaultTiddlers.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/DefaultTiddlers
|
||||
|
||||
HelloThere
|
||||
$:/plugins/tiddlywiki/geospatial
|
||||
14
editions/geospatialdemo/tiddlers/Features.tid
Normal file
14
editions/geospatialdemo/tiddlers/Features.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: GeoFeatures
|
||||
tags: $:/tags/GeospatialDemo
|
||||
|
||||
This is a list of all the tiddlers containing ~GeoJSON feature collections in this wiki (identified by the tag <<tag "$:/tags/GeoFeature">>). A ~GeoJSON feature collection is a list of features, each of which consists of a geometry and associated metadata.
|
||||
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]]">
|
||||
<li>
|
||||
<$link>
|
||||
<$transclude field="caption"><$view field="title"/></$view>
|
||||
</$link>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
||||
27
editions/geospatialdemo/tiddlers/Flickr Demo.tid
Normal file
27
editions/geospatialdemo/tiddlers/Flickr Demo.tid
Normal file
@@ -0,0 +1,27 @@
|
||||
title: Flickr Demo
|
||||
caption: Flickr
|
||||
tags: $:/tags/GeospatialDemo
|
||||
|
||||
! Retrieve Geotagged Flickr Photos
|
||||
|
||||
This demo will not work until you have set a Flickr API key in the [[Geospatial plugin settings|$:/plugins/tiddlywiki/geospatial/settings]].
|
||||
|
||||
<$button>
|
||||
<$macrocall $name="flickr-get-album-items" albumID={{$:/config/flickr-param/album-id}}/>
|
||||
Get Flickr album
|
||||
</$button> <$edit-text tiddler="$:/config/flickr-param/album-id" tag="input"/> (parameter should be an album ID, e.g. 72157630297432522)
|
||||
|
||||
<$button>
|
||||
<$macrocall $name="flickr-get-interesting-items"/>
|
||||
Get Flickr interesting items
|
||||
</$button>
|
||||
|
||||
<$button>
|
||||
<$macrocall $name="flickr-get-photos-of-user-items" userID={{$:/config/flickr-param/user-id}}/>
|
||||
Get Flickr photos of user
|
||||
</$button> <$edit-text tiddler="$:/config/flickr-param/user-id" tag="input"/> (parameter should be a user ID, e.g. 35468148136@N01)
|
||||
|
||||
<$button>
|
||||
<$macrocall $name="flickr-get-group-items" groupID={{$:/config/flickr-param/group-id}}/>
|
||||
Get Flickr group
|
||||
</$button> <$edit-text tiddler="$:/config/flickr-param/group-id" tag="input"/> (parameter should be an group ID, e.g. 22075379@N00)
|
||||
BIN
editions/geospatialdemo/tiddlers/Geospatial Plugin Logo.png
Normal file
BIN
editions/geospatialdemo/tiddlers/Geospatial Plugin Logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 509 KiB |
@@ -0,0 +1,2 @@
|
||||
title: Geospatial Plugin Logo
|
||||
type: image/png
|
||||
37
editions/geospatialdemo/tiddlers/HelloThere.tid
Normal file
37
editions/geospatialdemo/tiddlers/HelloThere.tid
Normal file
@@ -0,0 +1,37 @@
|
||||
title: HelloThere
|
||||
|
||||
//The latest build of the Geospatial Plugin can be found at:// https://tiddlywiki5-git-geospatial-plugin-jermolene.vercel.app/plugins/tiddlywiki/geospatial/index.html
|
||||
|
||||
!! Introduction
|
||||
|
||||
{{$:/plugins/tiddlywiki/geospatial/readme}}
|
||||
|
||||
!! Prerequisites
|
||||
|
||||
This demo requires that the API keys needed to access external services be obtained by the end user and manually configured. These keys are stored in the browser and so only need to be set up once. See the ''Settings'' tab of [[the plugin|$:/plugins/tiddlywiki/geospatial]] for details.
|
||||
|
||||
!! Demos
|
||||
|
||||
* Visit the ~GeoFeatures and ~GeoMarkers tabs to see the data loaded into this wiki
|
||||
* Click on a link to a layer or marker to open the corresponding tiddler that includes a map
|
||||
* Use the Flickr tab to retrieve geotagged photographs from Flickr
|
||||
* Visit a ~GeoMarker tiddler and use the "Call ~TravelTime" button to calculate an isochrone from that location using the ~TravelTime API
|
||||
|
||||
! Map Showing All Features and Markers
|
||||
|
||||
<$geomap
|
||||
state=<<qualify "$:/state/demo-map">>
|
||||
startPosition="bounds"
|
||||
>
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoBaseLayer]]">
|
||||
<$geobaselayer title=<<currentTiddler>>/>
|
||||
</$list>
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
|
||||
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}} name={{!!caption}}/>
|
||||
</$list>
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoFeature]]">
|
||||
<$geolayer json={{!!text}} color={{!!color}} name={{!!caption}}/>
|
||||
</$list>
|
||||
</$geomap>
|
||||
|
||||
<<tabs tabsList:"[all[tiddlers+shadows]tag[$:/tags/GeospatialDemo]]" default:"GeoMarkers">>
|
||||
53
editions/geospatialdemo/tiddlers/Markers.tid
Normal file
53
editions/geospatialdemo/tiddlers/Markers.tid
Normal file
@@ -0,0 +1,53 @@
|
||||
title: GeoMarkers
|
||||
tags: $:/tags/GeospatialDemo
|
||||
|
||||
|
||||
|
||||
\procedure onsuccess()
|
||||
<$action-setfield
|
||||
$tiddler="CurrentLocation"
|
||||
tags="$:/tags/GeoMarker"
|
||||
timestamp=<<timestamp>>
|
||||
lat=<<latitude>>
|
||||
long=<<longitude>>
|
||||
alt=<<altitude>>
|
||||
accuracy=<<accuracy>>
|
||||
altitudeAccuracy=<<altitudeAccuracy>>
|
||||
heading=<<heading>>
|
||||
speed=<<speed>>
|
||||
/>
|
||||
\end
|
||||
\procedure onerror()
|
||||
<$action-setfield
|
||||
$tiddler="CurrentLocation"
|
||||
$field="text"
|
||||
$value=<<error>>
|
||||
/>
|
||||
\end
|
||||
\procedure onclick()
|
||||
<$action-sendmessage
|
||||
$message="tm-request-geolocation"
|
||||
actionsSuccess=<<onsuccess>>
|
||||
actionsError=<<onerror>>
|
||||
/>
|
||||
\end
|
||||
|
||||
This is a list of all the tiddlers containing ~GeoJSON markers in this wiki (identified by the tag <<tag "$:/tags/GeoMarker">>). A ~GeoJSON marker identifies a location via latitude and longitude (and optional altitude) and may also contain associated metadata in JSON format.
|
||||
|
||||
Click this button to create a marker from the current location. Your browser will ask for permission before granting the request. On some browsers it takes a couple of seconds for the location to appear.
|
||||
|
||||
<$button actions=<<onclick>>>
|
||||
Request location
|
||||
</$button>
|
||||
|
||||
{{CurrentLocation}}
|
||||
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]sort[caption]]">
|
||||
<li>
|
||||
<$link>
|
||||
<$view field="caption"><$view field="title"/></$view>
|
||||
</$link>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
||||
3
editions/geospatialdemo/tiddlers/SiteSubtitle.tid
Normal file
3
editions/geospatialdemo/tiddlers/SiteSubtitle.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/SiteSubtitle
|
||||
|
||||
Geographic Data Features for ~TiddlyWiki
|
||||
3
editions/geospatialdemo/tiddlers/SiteTitle.tid
Normal file
3
editions/geospatialdemo/tiddlers/SiteTitle.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/SiteTitle
|
||||
|
||||
[img width=200 [Geospatial Plugin Logo]]<br>Geospatial Plugin
|
||||
@@ -0,0 +1,6 @@
|
||||
title: $:/plugins/geospatial/demo/ViewTemplateBodyFilters
|
||||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
list-before: $:/config/ViewTemplateBodyFilters/stylesheet
|
||||
|
||||
[tag[$:/tags/GeoFeature]then[ui/geofeature]]
|
||||
[tag[$:/tags/GeoMarker]then[ui/geomarker]]
|
||||
@@ -0,0 +1,9 @@
|
||||
title: cities/LimehouseTownHall
|
||||
tags: $:/tags/GeoMarker
|
||||
caption: Limehouse Town Hall
|
||||
lat: 51.51216651476898
|
||||
long: -0.03138562132137639
|
||||
alt: 0
|
||||
|
||||
This is Limehouse Town Hall!
|
||||
|
||||
9
editions/geospatialdemo/tiddlers/cities/Motovun.tid
Normal file
9
editions/geospatialdemo/tiddlers/cities/Motovun.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: cities/Motovun
|
||||
tags: $:/tags/GeoMarker
|
||||
icon: Motovun Jack.svg
|
||||
caption: Motovun
|
||||
lat: 45.336453407749225
|
||||
long: 13.828231379455806
|
||||
alt: 0
|
||||
|
||||
This is Motovun!
|
||||
8
editions/geospatialdemo/tiddlers/cities/NewYork.tid
Normal file
8
editions/geospatialdemo/tiddlers/cities/NewYork.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: cities/NewYork
|
||||
tags: $:/tags/GeoMarker
|
||||
caption: New York
|
||||
lat: 40.712778
|
||||
long: -74.006111
|
||||
alt: 0
|
||||
|
||||
This is New York!
|
||||
8
editions/geospatialdemo/tiddlers/cities/Oxford.tid
Normal file
8
editions/geospatialdemo/tiddlers/cities/Oxford.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: cities/Oxford
|
||||
tags: $:/tags/GeoMarker
|
||||
caption: Oxford
|
||||
lat: 51.751944
|
||||
long: -1.257778
|
||||
alt: 0
|
||||
|
||||
This is Oxford!
|
||||
8
editions/geospatialdemo/tiddlers/cities/Toronto.tid
Normal file
8
editions/geospatialdemo/tiddlers/cities/Toronto.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: cities/Toronto
|
||||
tags: $:/tags/GeoMarker
|
||||
caption: Toronto
|
||||
lat: 43.651070
|
||||
long: -79.347015
|
||||
alt: 0
|
||||
|
||||
This is Toronto!
|
||||
8
editions/geospatialdemo/tiddlers/cities/Winchester.tid
Normal file
8
editions/geospatialdemo/tiddlers/cities/Winchester.tid
Normal file
@@ -0,0 +1,8 @@
|
||||
title: cities/Winchester
|
||||
tags: $:/tags/GeoMarker
|
||||
caption: Winchester
|
||||
lat: 51.0632
|
||||
long: -1.308
|
||||
alt: 0
|
||||
|
||||
This is Winchester!
|
||||
@@ -0,0 +1,5 @@
|
||||
title: $:/config/flickr-param/
|
||||
|
||||
album-id: 72157630297432522
|
||||
user-id: 35468148136@N01
|
||||
group-id: 22075379@N00
|
||||
4
editions/geospatialdemo/tiddlers/default-import-spec.tid
Normal file
4
editions/geospatialdemo/tiddlers/default-import-spec.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/config/plugins/tiddlywiki/xlsx-utils/default-import-spec
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
$:/_importspec/RealEstate/
|
||||
BIN
editions/geospatialdemo/tiddlers/favicon.png
Normal file
BIN
editions/geospatialdemo/tiddlers/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
2
editions/geospatialdemo/tiddlers/favicon.png.meta
Normal file
2
editions/geospatialdemo/tiddlers/favicon.png.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/png
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
title: $:/geospatialdemo/features/canada-census-subdivision-millesime
|
||||
caption: Canada Census Subdivisions Millesime
|
||||
type: application/json
|
||||
tags: $:/tags/GeoFeature
|
||||
color: #f8f
|
||||
109
editions/geospatialdemo/tiddlers/features/denver-bikerental.tid
Normal file
109
editions/geospatialdemo/tiddlers/features/denver-bikerental.tid
Normal file
@@ -0,0 +1,109 @@
|
||||
title: $:/geospatialdemo/features/denver/bikerental
|
||||
caption: Denver bike rentals as ~GeoJSON points
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: blue
|
||||
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9998241,
|
||||
39.7471494
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 51
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9983545,
|
||||
39.7502833
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 52
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9963919,
|
||||
39.7444271
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 54
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9960754,
|
||||
39.7498956
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 55
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9933717,
|
||||
39.7477264
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 57
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9913392,
|
||||
39.7432392
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 58
|
||||
},
|
||||
{
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-104.9788452,
|
||||
39.6933755
|
||||
]
|
||||
},
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is a B-Cycle Station. Come pick up a bike and pay by the hour. What a deal!"
|
||||
},
|
||||
"id": 74
|
||||
}
|
||||
]
|
||||
}
|
||||
63
editions/geospatialdemo/tiddlers/features/denver-campus.tid
Normal file
63
editions/geospatialdemo/tiddlers/features/denver-campus.tid
Normal file
@@ -0,0 +1,63 @@
|
||||
title: $:/geospatialdemo/features/denver/campus
|
||||
caption: Denver Auraria West Campus as ~GeoJSON multipolygons
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: purple
|
||||
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "This is the Auraria West Campus",
|
||||
"style": {
|
||||
"weight": 2,
|
||||
"color": "#999",
|
||||
"opacity": 1,
|
||||
"fillColor": "#B0DE5C",
|
||||
"fillOpacity": 0.8
|
||||
}
|
||||
},
|
||||
"geometry": {
|
||||
"type": "MultiPolygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[
|
||||
[-105.00432014465332, 39.74732195489861],
|
||||
[-105.00715255737305, 39.74620006835170],
|
||||
[-105.00921249389647, 39.74468219277038],
|
||||
[-105.01067161560059, 39.74362625960105],
|
||||
[-105.01195907592773, 39.74290029616054],
|
||||
[-105.00989913940431, 39.74078835902781],
|
||||
[-105.00758171081543, 39.74059036160317],
|
||||
[-105.00346183776855, 39.74059036160317],
|
||||
[-105.00097274780272, 39.74059036160317],
|
||||
[-105.00062942504881, 39.74072235994946],
|
||||
[-105.00020027160645, 39.74191033368865],
|
||||
[-105.00071525573731, 39.74276830198601],
|
||||
[-105.00097274780272, 39.74369225589818],
|
||||
[-105.00097274780272, 39.74461619742136],
|
||||
[-105.00123023986816, 39.74534214278395],
|
||||
[-105.00183105468751, 39.74613407445653],
|
||||
[-105.00432014465332, 39.74732195489861]
|
||||
],[
|
||||
[-105.00361204147337, 39.74354376414072],
|
||||
[-105.00301122665405, 39.74278480127163],
|
||||
[-105.00221729278564, 39.74316428375108],
|
||||
[-105.00283956527711, 39.74390674342741],
|
||||
[-105.00361204147337, 39.74354376414072]
|
||||
]
|
||||
],[
|
||||
[
|
||||
[-105.00942707061768, 39.73989736613708],
|
||||
[-105.00942707061768, 39.73910536278566],
|
||||
[-105.00685214996338, 39.73923736397631],
|
||||
[-105.00384807586671, 39.73910536278566],
|
||||
[-105.00174522399902, 39.73903936209552],
|
||||
[-105.00041484832764, 39.73910536278566],
|
||||
[-105.00041484832764, 39.73979836621592],
|
||||
[-105.00535011291504, 39.73986436617916],
|
||||
[-105.00942707061768, 39.73989736613708]
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
56
editions/geospatialdemo/tiddlers/features/denver-freebus.tid
Normal file
56
editions/geospatialdemo/tiddlers/features/denver-freebus.tid
Normal file
@@ -0,0 +1,56 @@
|
||||
title: $:/geospatialdemo/features/denver/freebus
|
||||
caption: Denver free bus routes as ~GeoJSON linestrings
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: green
|
||||
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[-105.00341892242432, 39.75383843460583],
|
||||
[-105.0008225440979, 39.751891803969535]
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"popupContent": "This is a free bus line that will take you across downtown.",
|
||||
"underConstruction": false
|
||||
},
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[-105.0008225440979, 39.751891803969535],
|
||||
[-104.99820470809937, 39.74979664004068]
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"popupContent": "This is a free bus line that will take you across downtown.",
|
||||
"underConstruction": true
|
||||
},
|
||||
"id": 2
|
||||
},
|
||||
{
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[-104.99820470809937, 39.74979664004068],
|
||||
[-104.98689651489258, 39.741052354709055]
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"popupContent": "This is a free bus line that will take you across downtown.",
|
||||
"underConstruction": false
|
||||
},
|
||||
"id": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
title: $:/geospatialdemo/features/denver/lightrail
|
||||
caption: Denver light rail stops as ~GeoJSON points
|
||||
tags: $:/tags/GeoFeature
|
||||
type: application/json
|
||||
color: red
|
||||
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "18th & California Light Rail Stop"
|
||||
},
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [-104.98999178409576, 39.74683938093904]
|
||||
}
|
||||
},{
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"popupContent": "20th & Welton Light Rail Stop"
|
||||
},
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [-104.98689115047453, 39.747924136466565]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
title: $:/geospatialdemo/features/harvard-volcanoes-of-the-world
|
||||
caption: Harvard Volcanoes of the World
|
||||
type: application/json
|
||||
tags: $:/tags/GeoFeature/Hidden
|
||||
color: #f88
|
||||
54
editions/geospatialdemo/tiddlers/features/us-states.geojson
Normal file
54
editions/geospatialdemo/tiddlers/features/us-states.geojson
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
title: $:/geospatialdemo/features/us-states
|
||||
caption: US State Boundaries
|
||||
type: application/json
|
||||
tags: $:/tags/GeoFeature
|
||||
color: #88f
|
||||
@@ -0,0 +1,99 @@
|
||||
title: real-estate-demo
|
||||
caption: Real Estate Demo
|
||||
tags: $:/tags/GeospatialDemo
|
||||
|
||||
\define default-display-filter() [<currentTiddler>get<fieldname>]
|
||||
\define default-limit() 10
|
||||
|
||||
This is a list of all the tiddlers containing ~GeoJSON markers in this wiki (identified by the tag <<tag "$:/tags/GeoMarker">>) viewed as both a map and a table.
|
||||
|
||||
<$let
|
||||
schema={{real-estate-demo/schema}}
|
||||
>
|
||||
<div>
|
||||
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
|
||||
<$let
|
||||
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
|
||||
>
|
||||
<div>
|
||||
<$checkbox tiddler=<<config>> field="visible" checked="yes" unchecked="no" default="yes">
|
||||
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
|
||||
</$checkbox>
|
||||
</div>
|
||||
</$let>
|
||||
</$list>
|
||||
</div>
|
||||
<div>
|
||||
Sorting by
|
||||
<$select tiddler="$:/config/geospatial/demo/real-estate-demo/sort-field" default="title">
|
||||
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
|
||||
<option value={{{ [<schema>jsonget[columns],<index>,[name]] }}}>
|
||||
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
|
||||
</option>
|
||||
</$list>
|
||||
</$select>
|
||||
<$checkbox tiddler="$:/config/geospatial/demo/real-estate-demo/sort-order" field="text" checked="reverse" unchecked="normal" default="normal">
|
||||
Reverse sort order
|
||||
</$checkbox>
|
||||
</div>
|
||||
<div>
|
||||
Search: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/search" tag="input"/>
|
||||
</div>
|
||||
<div>
|
||||
Limit: <$edit-text tiddler="$:/config/geospatial/demo/real-estate-demo/limit" tag="input" placeholder=<<default-limit>>/>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
|
||||
<$let
|
||||
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
|
||||
>
|
||||
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
|
||||
<th>
|
||||
<$text text={{{ [<schema>jsonget[columns],<index>,[caption]] }}}/>
|
||||
</th>
|
||||
</$list>
|
||||
</$let>
|
||||
</$list>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<$let
|
||||
sortField={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-field]get[text]else[title]] }}}
|
||||
sortOrder={{{ [[$:/config/geospatial/demo/real-estate-demo/sort-order]get[text]else[normal]] }}}
|
||||
limit={{{ [[$:/config/geospatial/demo/real-estate-demo/limit]get[text]] :else[<default-limit>] }}}
|
||||
>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]search:*{$:/config/geospatial/demo/real-estate-demo/search}nsort<sortField>order<sortOrder>limit<limit>]">
|
||||
<$let
|
||||
rowTiddler=<<currentTiddler>>
|
||||
>
|
||||
<$setmultiplevariables
|
||||
$names="[<schema>jsonindexes[variables]sort[]]"
|
||||
$values="[<schema>jsonindexes[variables]sort[]] :map[<schema>jsonget[variables],<currentTiddler>] :map[subfilter<currentTiddler>]"
|
||||
>
|
||||
<tr>
|
||||
<$list filter="[<schema>jsonindexes[columns]]" variable="index">
|
||||
<$let
|
||||
config={{{ [<schema>jsonget[columns],<index>,[name]addprefix[$:/config/geospatial/demo/real-estate-demo/columns/]] }}}
|
||||
>
|
||||
<$list filter="[<config>get[visible]else[yes]match[yes]]" variable="ignore">
|
||||
<td>
|
||||
<$let
|
||||
fieldname={{{ [<schema>jsonget[columns],<index>,[name]] }}}
|
||||
displayFilter={{{ [<schema>jsonget[columns],<index>,[display]] :else[<default-display-filter>] }}}
|
||||
>
|
||||
<$text text={{{ [subfilter<displayFilter>] }}}/>
|
||||
</$let>
|
||||
</td>
|
||||
</$list>
|
||||
</$let>
|
||||
</$list>
|
||||
</tr>
|
||||
</$setmultiplevariables>
|
||||
</$let>
|
||||
</$list>
|
||||
</$let>
|
||||
</tbody>
|
||||
</table>
|
||||
</$let>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"columns": [
|
||||
{"name": "address", "caption": "Address", "type": "string"},
|
||||
{"name": "broker", "caption": "Broker", "type": "string"},
|
||||
{"name": "city", "caption": "City", "type": "string"},
|
||||
{"name": "lat", "caption": "Latitude", "type": "number"},
|
||||
{"name": "long", "caption": "Longitude", "type": "number"},
|
||||
{"name": "price", "caption": "Price", "type": "number"},
|
||||
{"name": "salesagent", "caption": "Sales Agent", "type": "string"},
|
||||
{"name": "state", "caption": "State", "type": "string"},
|
||||
{"name": "title", "caption": "Title", "type": "string"},
|
||||
{"name": "zipcode", "caption": "Zip Code", "type": "string"},
|
||||
{"name": "census-province", "caption": "Census Province", "type": "string", "display": "[<census-data>jsonget[0],[prov_name_en],[0]]"},
|
||||
{"name": "census-division", "caption": "Census Division", "type": "string", "display": "[<census-data>jsonget[0],[cd_name_en],[0]]"},
|
||||
{"name": "census-subdivision", "caption": "Census Subdivision", "type": "string", "display": "[<census-data>jsonget[0],[csd_name_en],[0]]"},
|
||||
{"name": "nearest-volcano", "caption": "Nearest Volcano", "type": "string", "display": "[{$:/geospatialdemo/features/harvard-volcanoes-of-the-world}geonearestpoint<coords>]"}
|
||||
],
|
||||
"variables": {
|
||||
"coords": "[<rowTiddler>] :map[geopoint{!!long},{!!lat}]",
|
||||
"census-data": "[<rowTiddler>] :map[geopoint{!!long},{!!lat}geolookup{$:/geospatialdemo/features/canada-census-subdivision-millesime}]"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
title: real-estate-demo/schema
|
||||
type: application/json
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import-spec-role: row
|
||||
list: $:/_importspec/RealEstate/PropertiesRow/Field/long $:/_importspec/RealEstate/PropertiesRow/Field/lat $:/_importspec/RealEstate/PropertiesRow/Field/price $:/_importspec/RealEstate/PropertiesRow/Field/broker $:/_importspec/RealEstate/PropertiesRow/Field/salesagent $:/_importspec/RealEstate/PropertiesRow/Field/zipcode $:/_importspec/RealEstate/PropertiesRow/Field/state $:/_importspec/RealEstate/PropertiesRow/Field/city $:/_importspec/RealEstate/PropertiesRow/Field/tags $:/_importspec/RealEstate/PropertiesRow/Field/title $:/_importspec/RealEstate/PropertiesRow/Field/address
|
||||
tags:
|
||||
title: $:/_importspec/RealEstate/PropertiesRow
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: Address
|
||||
import-field-name: address
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/address
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: Broker
|
||||
import-field-name: broker
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/broker
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: City
|
||||
import-field-name: city
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/city
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import-field-column: Latitude
|
||||
import-field-name: lat
|
||||
import-field-type: number
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/lat
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import-field-column: Longitude
|
||||
import-field-name: long
|
||||
import-field-type: number
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/long
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import-field-column: Price
|
||||
import-field-name: price
|
||||
import-field-type: number
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/price
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: Sales Agent
|
||||
import-field-name: salesagent
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/salesagent
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: State
|
||||
import-field-name: state
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/state
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-spec-role: field
|
||||
import-field-name: tags
|
||||
import-field-type: string
|
||||
import-field-source: constant
|
||||
import-field-value: $:/tags/GeoMarker
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/tags
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -0,0 +1,8 @@
|
||||
import-field-column: Address
|
||||
import-field-name: title
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
import-field-skip-tiddler-if-blank: yes
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/title
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-field-column: Zip Code
|
||||
import-field-name: zipcode
|
||||
import-field-source: column
|
||||
import-spec-role: field
|
||||
title: $:/_importspec/RealEstate/PropertiesRow/Field/zipcode
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import-sheet-name: Final Day 1 and 2
|
||||
import-spec-role: sheet
|
||||
list: [[$:/_importspec/RealEstate/PropertiesRow]]
|
||||
tags:
|
||||
title: $:/_importspec/RealEstate/PropertiesSheet
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
caption: Real Estate Listing Demo
|
||||
import-spec-role: workbook
|
||||
list: [[$:/_importspec/RealEstate/PropertiesSheet]]
|
||||
tags:
|
||||
title: $:/_importspec/RealEstate/
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
2
editions/geospatialdemo/tiddlers/sidebarlayout.tid
Normal file
2
editions/geospatialdemo/tiddlers/sidebarlayout.tid
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
|
||||
text: fluid-fixed
|
||||
39
editions/geospatialdemo/tiddlers/ui/geofeature.tid
Normal file
39
editions/geospatialdemo/tiddlers/ui/geofeature.tid
Normal file
@@ -0,0 +1,39 @@
|
||||
title: ui/geofeature
|
||||
|
||||
\define create-intersection()
|
||||
<$let
|
||||
intersectLayer={{{ =[<currentTiddler>get[text]] =[<otherFeature>get[text]] +[geointersect[]] }}}
|
||||
>
|
||||
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<intersectLayer>] }}} tags="$:/tags/GeoFeature" caption={{{ [<captionThisFeature>addsuffix[ intersected with ]addsuffix<captionOtherFeature>] }}}/>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
!! Mapped
|
||||
|
||||
<$geomap
|
||||
state=<<qualify "$:/state/demo-map">>
|
||||
startPosition="bounds"
|
||||
>
|
||||
<$geolayer json={{!!text}} color={{!!color}}/>
|
||||
</$geomap>
|
||||
|
||||
!! Intersect with other features
|
||||
|
||||
<$let
|
||||
captionThisFeature={{{ [<currentTiddler>get[caption]else<currentTiddler>] }}}
|
||||
>
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]] -[<currentTiddler>]" variable="otherFeature">
|
||||
<$let
|
||||
captionOtherFeature={{{ [<otherFeature>get[caption]else<otherFeature>] }}}
|
||||
>
|
||||
<li>
|
||||
<$link to=<<otherFeature>>><$transclude tiddler=<<otherFeature>> field="caption"><$view tiddler=<<otherFeature>> field="title"/></$transclude></$link>
|
||||
<$button actions=<<create-intersection>>>
|
||||
Create intersection
|
||||
</$button>
|
||||
</li>
|
||||
</$let>
|
||||
</$list>
|
||||
</ul>
|
||||
</$let>
|
||||
128
editions/geospatialdemo/tiddlers/ui/geomarker.tid
Normal file
128
editions/geospatialdemo/tiddlers/ui/geomarker.tid
Normal file
@@ -0,0 +1,128 @@
|
||||
title: ui/geomarker
|
||||
|
||||
\define default-traveltime-time() 5400
|
||||
|
||||
\define completion-actions()
|
||||
<$action-log/>
|
||||
<$action-setfield $tiddler="$:/temp/_StatusCode" text=<<status>>/>
|
||||
<$action-setfield $tiddler="$:/temp/_StatusText" text=<<statusText>>/>
|
||||
<$action-setfield $tiddler="$:/temp/_Error" text=<<error>>/>
|
||||
<$action-setfield $tiddler="$:/temp/_Result" text=<<data>>/>
|
||||
<$action-setfield $tiddler="$:/temp/_Headers" text=<<headers>>/>
|
||||
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
|
||||
<$action-createtiddler $basetitle="$:/temp/_IsochroneLayer" text={{{ [<data>] }}} tags="$:/tags/GeoFeature" caption={{{ [<currentTiddler>get[caption]else<currentTiddler>addprefix[Travel time from ]] }}}/>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define progress-actions()
|
||||
<$action-log message="In progress-actions"/>
|
||||
<$action-log/>
|
||||
\end
|
||||
|
||||
\define payload-source()
|
||||
\rules only transcludeinline transcludeblock filteredtranscludeinline filteredtranscludeblock
|
||||
{
|
||||
"departure_searches": [
|
||||
{
|
||||
"id": "My first isochrone",
|
||||
"coords": {
|
||||
"lat": {{!!lat}},
|
||||
"lng": {{!!long}}
|
||||
},
|
||||
"departure_time": "2023-02-27T08:00:00Z",
|
||||
"travel_time": {{{ [[$:/config/plugins/geospatial/traveltime/time]get[text]else<default-traveltime-time>] }}},
|
||||
"transportation": {
|
||||
"type": "driving"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
\end
|
||||
|
||||
\define get-traveltime-actions()
|
||||
<$wikify name="payload" text=<<payload-source>>>
|
||||
<$action-log $message="Making payload"/>
|
||||
<$action-log/>
|
||||
<$action-sendmessage
|
||||
$message="tm-http-request"
|
||||
url="https://api.traveltimeapp.com/v4/time-map"
|
||||
method="POST"
|
||||
header-accept="application/geo+json"
|
||||
header-Content-Type="application/json"
|
||||
password-header-X-Api-Key="traveltime-secret-key"
|
||||
password-header-X-Application-Id="traveltime-application-id"
|
||||
body=<<payload>>
|
||||
var-currentTiddler=<<currentTiddler>>
|
||||
bind-status="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status"
|
||||
bind-progress="$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress"
|
||||
oncompletion=<<completion-actions>>
|
||||
onprogress=<<progress-actions>>
|
||||
/>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
!! Mapped
|
||||
|
||||
<$geomap
|
||||
state=<<qualify "$:/state/demo-map">>
|
||||
startPosition="bounds"
|
||||
>
|
||||
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
|
||||
</$geomap>
|
||||
|
||||
!! Distance to other markers
|
||||
|
||||
<$let
|
||||
thisLocation={{{ [geopoint{!!long},{!!lat}] }}}
|
||||
>
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoMarker]sort[caption]] -[<currentTiddler>]">
|
||||
<li>
|
||||
<$link><$view field="caption"><$view field="title"/></$view></$link>
|
||||
--
|
||||
<$let
|
||||
otherLocation={{{ [geopoint{!!long},{!!lat}] }}}
|
||||
>
|
||||
<$text text={{{ [geodistance<thisLocation>,<otherLocation>,[miles]fixed[0]] }}}/> miles
|
||||
</$let>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
||||
</$let>
|
||||
|
||||
!! GeoFeature Lookups
|
||||
|
||||
<$let
|
||||
thisLocation={{{ [geopoint{!!long},{!!lat}] }}}
|
||||
>
|
||||
<ul>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/GeoFeature]sort[caption]]">
|
||||
<li>
|
||||
<$text text={{{ [<currentTiddler>get[caption]] :else[<currentTiddler>] }}}/> --
|
||||
<$text text={{{ [<thisLocation>geolookup{!!text}] }}}/>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
||||
</$let>
|
||||
|
||||
!! Travel Time
|
||||
|
||||
<$button actions=<<get-traveltime-actions>>>
|
||||
Call ~TravelTime
|
||||
</$button>
|
||||
|
||||
Maximum time: <$edit-text tiddler="$:/config/plugins/geospatial/traveltime/time" default=<<default-traveltime-time>> tag="input"/> seconds
|
||||
|
||||
|Status |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/status}}/> |
|
||||
|Progress |<$text text={{$:/temp/plugins/tiddlywiki/geospatial/demo/traveltime/progress}}/> |
|
||||
|Status Code |<$text text={{$:/temp/_StatusCode}}/> |
|
||||
|Status Text |<$text text={{$:/temp/_StatusText}}/> |
|
||||
|Error |<$text text={{$:/temp/_Error}}/> |
|
||||
|
||||
<$list filter="[<currentTiddler>has[photo-url]]" variable="ignore">
|
||||
|
||||
!! Photo
|
||||
|
||||
<img src={{!!photo-url}}/>
|
||||
|
||||
</$list>
|
||||
23
editions/geospatialdemo/tiddlywiki.info
Normal file
23
editions/geospatialdemo/tiddlywiki.info
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"description": "Demo of the geospatial plugin for TiddlyWiki",
|
||||
"plugins": [
|
||||
"tiddlywiki/geospatial",
|
||||
"tiddlywiki/jszip",
|
||||
"tiddlywiki/xlsx-utils",
|
||||
"tiddlywiki/codemirror"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
"tiddlywiki/snowwhite"
|
||||
],
|
||||
"includeWikis": [
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--render","$:/core/save/all","index.html","text/plain"],
|
||||
"favicon": [],
|
||||
"static": [],
|
||||
"empty": [],
|
||||
"encrypted": []
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,20 @@ The new features include:
|
||||
* The new Confetti Plugin that allows animated bursts of confetti to be displayed
|
||||
* Improvements to the Dynannotate Plugin to add the ability to highlight screen elements using an animated spotlight effect
|
||||
|
||||
!! Geospatial Plugin
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7406">> new Geospatial Plugin that adds new primitives to the TiddlyWiki platform to enable non-developers to build sophisticated interactive geospatial applications.
|
||||
|
||||
The Geospatial Plugin incorporates a number of third party libraries and online services:
|
||||
|
||||
* [[Leaflet.js|https://leafletjs.com/]], an open source library to display interactive maps
|
||||
* [[Turf.js|https://turfjs.org/]], an open source library to perform geospatial calculations with [[GeoJSON|https://en.wikipedia.org/wiki/GeoJSON]] objects
|
||||
* [[TravelTime|https://traveltime.com/]], a commercial API for [[geocoding|https://traveltime.com/features/geocoding]], [[routing|https://traveltime.com/features/multi-modal-routing]] and [[isochrones|https://traveltime.com/features/isochrones]]
|
||||
* [[Flickr|https://www.flickr.com/services/api/]], a free API for retrieving geotagged photographs
|
||||
* [[OpenLocationCode|https://github.com/google/open-location-code]], Google's open source library for converting to and from Open Location Codes (also known as [[PlusCodes|https://maps.google.com/pluscodes/]])
|
||||
|
||||
Try it out at https://tiddlywiki.com/prerelease/plugins/tiddlywiki/geospatial/
|
||||
|
||||
!! <<.wlink TestCaseWidget>> Widget
|
||||
|
||||
<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7817">> new <<.wlink TestCaseWidget>> widget that is intended to solve a problem with the examples that we feature in the documentation. The existing macros are workable for simple, self-contained examples, but can be hard to follow in cases where the examples use additional tiddlers. The <<.wlink TestCaseWidget>> widget displays complete, self-contained interactive examples showing the output together with a tabbed display of the constituent tiddlers that produce it:
|
||||
@@ -41,6 +55,7 @@ The easiest way to use the <<.wlink TestCaseWidget>> is by creating TestCaseTidd
|
||||
Improvements to the following translations:
|
||||
|
||||
* Chinese
|
||||
* French
|
||||
* Macedonian
|
||||
* Polish
|
||||
|
||||
@@ -59,12 +74,15 @@ Improvements to the following translations:
|
||||
! Usability Improvements
|
||||
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/issues/8121">> new keyboard shortcut for refreshing the page
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/f3614c1e47e6ac5d5fec221b060699e975cd5ef6">> and simplified the splash screen for tiddlywiki.com. See [[Creating a splash screen]] for instructions on creating your own splash screen
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/7882">> infinite recursion handling using a custom exception
|
||||
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7966">> button to the JavaScript error popup allowing tiddlers to be saved to a local JSON file
|
||||
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/issues/8120">> to latest version of modern-normalize 2.0.0
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8211">> [[tm-permalink|WidgetMessage: tm-permalink]], [[tm-permaview|WidgetMessage: tm-permaview]] and [[tm-copy-to-clipboard|WidgetMessage: tm-copy-to-clipboard]] messages to allow the notification text to be customised
|
||||
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/8225">> [[WidgetMessage: tm-http-request]] to allow the default headers to be suppressed
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
@@ -85,6 +103,7 @@ Improvements to the following translations:
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/801ed0ea1164aab4f88547322f9d73704388143f">> crash with [[cycle Operator]] if the the step size is larger than the number of operands
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/8095">> proper DOCTYPE for the open window template
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7945">> theme font size settings to open in new window CSS
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8098">> backlink parser to prevent it parsing binary tiddlers
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
@@ -99,6 +118,7 @@ Improvements to the following translations:
|
||||
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8195">> issue with fakedom TW_Node inheritence
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8099">> SJCL library creating variables in global scope
|
||||
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/8179">> fix `widget.getVariableInfo()` to always return a `params` property
|
||||
|
||||
! Infrastructure Improvements
|
||||
|
||||
@@ -116,6 +136,7 @@ BramChen
|
||||
btheado
|
||||
BurningTreeC
|
||||
catter-fly
|
||||
Drevarr
|
||||
eschlon
|
||||
etardiff
|
||||
flibbles
|
||||
@@ -134,5 +155,6 @@ saqimtiaz
|
||||
sarna
|
||||
Telumire
|
||||
twMat
|
||||
xcazin
|
||||
yaisog
|
||||
""">>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
title: Data/ImportCompound
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Importing a compound payload tiddler and adding custom fields
|
||||
|
||||
title: Description
|
||||
text: Importing a compound payload tiddler and adding custom fields
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
|
||||
<$data $compound-tiddler="Compound" custom="Alpha"/>
|
||||
</$testcase>
|
||||
+
|
||||
title: Compound
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Payload Tiddler
|
||||
tags: Alpha Beta Gamma
|
||||
|
||||
This is a payload tiddler from a compound tiddler
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div><div>[{"title":"Payload Tiddler","tags":"Alpha Beta Gamma","text":"This is a payload tiddler from a compound tiddler","custom":"Alpha"}]</div></div></p>
|
||||
@@ -0,0 +1,28 @@
|
||||
title: Data/ImportFilter
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Importing a payload filter and adding custom fields
|
||||
|
||||
title: Description
|
||||
text: Importing a payload filter and adding custom fields
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
|
||||
<$data $filter="[tag[Definitions]]" custom="Alpha"/>
|
||||
</$testcase>
|
||||
+
|
||||
title: HelloThere
|
||||
tags: Definitions
|
||||
|
||||
This is the tiddler HelloThere
|
||||
+
|
||||
title: AnotherDefinition
|
||||
tags: Definitions
|
||||
|
||||
This is the tiddler AnotherDefinition
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div><div>[{"title":"AnotherDefinition","tags":"Definitions","text":"This is the tiddler AnotherDefinition","custom":"Alpha"},{"title":"HelloThere","tags":"Definitions","text":"This is the tiddler HelloThere","custom":"Alpha"}]</div></div></p>
|
||||
@@ -0,0 +1,23 @@
|
||||
title: Data/ImportTiddler
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Importing a payload tiddler and adding custom fields
|
||||
|
||||
title: Description
|
||||
text: Importing a payload tiddler and adding custom fields
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
|
||||
<$data $tiddler="HelloThere" custom="Alpha"/>
|
||||
</$testcase>
|
||||
+
|
||||
title: HelloThere
|
||||
tags: Definitions
|
||||
|
||||
This is the tiddler HelloThere
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div><div>[{"title":"HelloThere","tags":"Definitions","text":"This is the tiddler HelloThere","custom":"Alpha"}]</div></div></p>
|
||||
18
editions/test/tiddlers/tests/data/data-widget/Simple.tid
Normal file
18
editions/test/tiddlers/tests/data/data-widget/Simple.tid
Normal file
@@ -0,0 +1,18 @@
|
||||
title: Data/Simple
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
description: Standalone data widget to create individual tiddlers
|
||||
|
||||
title: Description
|
||||
text: Standalone data widget to create individual tiddlers
|
||||
+
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$testcase template="$:/core/ui/testcases/RawJSONTemplate">
|
||||
<$data title="Epsilon" text="Theta"/>
|
||||
</$testcase>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div><div>[{"title":"Epsilon","text":"Theta"}]</div></div></p>
|
||||
@@ -0,0 +1,21 @@
|
||||
title: Functions/FunctionFilterrunVariables3
|
||||
description: Nested functions in filter runs that set variables
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\define currentTiddler() old-current
|
||||
|
||||
\function .inner() [<currentTiddler>]
|
||||
\function .outer() [<currentTiddler>match[intermediate2]then[new-current]] :map[function[.inner]]
|
||||
\function .wrappertwo() [<currentTiddler>match[intermediate]addsuffix[2]] :map[function[.outer]]
|
||||
\function .wrapper() intermediate :map[.wrappertwo[]]
|
||||
|
||||
<$text text={{{ [.wrapper[]] }}}/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
new-current
|
||||
@@ -22,22 +22,30 @@ if($tw.node) {
|
||||
describe("every plugin should have the required standard fields", function() {
|
||||
var titles = Object.keys(tiddlers);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
it("plugin " + title + " should have the required standard fields",function() {
|
||||
var fields = tiddlers[title];
|
||||
expect(fields["plugin-type"]).toMatch(/^(?:plugin|language|theme)$/);
|
||||
switch(fields["plugin-type"]) {
|
||||
case "plugin":
|
||||
expect(!!(fields.name && fields.description && fields.list)).toEqual(true);
|
||||
expect(fields.stability).toMatch(/^(?:STABILITY_0_DEPRECATED|STABILITY_1_EXPERIMENTAL|STABILITY_2_STABLE|STABILITY_3_LEGACY)$/);
|
||||
break;
|
||||
case "language":
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
break;
|
||||
case "theme":
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
break;
|
||||
}
|
||||
var fields = tiddlers[title];
|
||||
it("plugin should have a recognised plugin-type field",function() {
|
||||
expect(["plugin","language","theme"].indexOf(fields["plugin-type"]) !== -1).toEqual(true);
|
||||
});
|
||||
switch(fields["plugin-type"]) {
|
||||
case "plugin":
|
||||
it("plugin " + title + " should have name, description and list fields",function() {
|
||||
expect(!!(fields.name && fields.description && fields.list)).toBe(true);
|
||||
});
|
||||
it("plugin " + title + " should have a valid stability field",function() {
|
||||
expect(["STABILITY_0_DEPRECATED","STABILITY_1_EXPERIMENTAL","STABILITY_2_STABLE","STABILITY_3_LEGACY"].indexOf(fields.stability) !== -1).toBe(true);
|
||||
});
|
||||
break;
|
||||
case "language":
|
||||
it("language " + title + " should have name and description fields",function() {
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
});
|
||||
break;
|
||||
case "theme":
|
||||
it("theme " + title + " should have name and description fields",function() {
|
||||
expect(!!(fields.name && fields.description)).toEqual(true);
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -816,6 +816,26 @@ describe("Widget module", function() {
|
||||
expect(wrapper.innerHTML).toBe("<p>Bval</p>");
|
||||
});
|
||||
|
||||
it("should use default $parameters if directly rendered", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
var text = "<$parameters bee=default $$dollar=bill nothing empty=''>bee=<<bee>>, $dollar=<<$dollar>>, nothing=<<nothing>>, empty=<<empty>></$parameters>";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// nothing = true in this attribute form because valueless attributes always equal true.
|
||||
expect(wrapper.innerHTML).toBe("<p>bee=default, $dollar=bill, nothing=true, empty=</p>");
|
||||
});
|
||||
|
||||
it("should use default \\parameters if directly rendered", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
var text = "\\parameters(bee:default $$dollar:bill nothing)\nbee=<<bee>>, $$dollar=<<$$dollar>>, nothing=<<nothing>>";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// nothing = true in this attribute form because valueless attributes always equal true.
|
||||
expect(wrapper.innerHTML).toBe("<p>bee=default, $$dollar=bill, nothing=</p>");
|
||||
});
|
||||
|
||||
it("can have more than one macroDef variable imported", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
wiki.addTiddlers([
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"description": "TiddlyWiki core tests",
|
||||
"plugins": [
|
||||
"tiddlywiki/jasmine"
|
||||
"tiddlywiki/jasmine",
|
||||
"tiddlywiki/geospatial"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
|
||||
@@ -8,6 +8,6 @@ op-input: a [[selection of titles|Title Selection]]
|
||||
op-parameter: none
|
||||
op-output: any non-[[system|SystemTiddlers]] titles that contain [[transclusion|Transclusion]] to the input titles
|
||||
|
||||
Each input title is processed in turn. The corresponding tiddler's list of backtranscludes is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output.
|
||||
<<.from-version 5.3.4>> Similar to [[backlinks|backlinks Operator]]. Each input title is processed in turn. The corresponding tiddler's list of backtranscludes is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output.
|
||||
|
||||
<<.operator-examples "backtranscludes">>
|
||||
|
||||
@@ -6,4 +6,4 @@ tags: shopping
|
||||
title: Brownies
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//This is a sample shopping list item for the [[Shopping List Example]]//
|
||||
//This is a sample shopping list item for the [[reduce Operator (Examples)]]//
|
||||
|
||||
@@ -6,4 +6,4 @@ tags: shopping
|
||||
title: Chick Peas
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//This is a sample shopping list item for the [[Shopping List Example]]//
|
||||
//This is a sample shopping list item for the [[reduce Operator (Examples)]]//
|
||||
|
||||
@@ -6,4 +6,4 @@ tags: shopping
|
||||
title: Milk
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//This is a sample shopping list item for the [[Shopping List Example]]//
|
||||
//This is a sample shopping list item for the [[reduce Operator (Examples)]]//
|
||||
|
||||
@@ -6,4 +6,4 @@ tags: shopping
|
||||
title: Rice Pudding
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//This is a sample shopping list item for the [[Shopping List Example]]//
|
||||
//This is a sample shopping list item for the [[reduce Operator (Examples)]]//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: tm-copy-to-clipboard
|
||||
created: 20171215150056004
|
||||
modified: 20171215150600888
|
||||
modified: 20240523174013095
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-copy-to-clipboard
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -11,6 +11,8 @@ It requires the following properties on the `event` object:
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Text to be copied to the clipboard |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
This message is usually generated with the ButtonWidget. It is handled by the TiddlyWiki core.
|
||||
|
||||
|
||||
@@ -19,10 +19,15 @@ The following parameters are used:
|
||||
|method |HTTP method (eg "GET", "POST") |
|
||||
|body |String data to be sent with the request |
|
||||
|binary |<<.from-version "5.3.1">> Set to "yes" to cause the response body to be treated as binary data and returned in base64 format |
|
||||
|useDefaultHeaders |<<.from-version "5.3.4">> Defaults to true. Set to "false" to prevent default headers from being added. This can be helpful when dealing with apis that restrict header fields. |
|
||||
|query-* |Query string parameters with string values |
|
||||
|header-* |Headers with string values |
|
||||
|password-header-* |Headers with values taken from the password store |
|
||||
|password-query-* |Query string parameters with values taken from the password store |
|
||||
|basic-auth-username |<<.from-version "5.3.4">> Optional username for HTTP basic authentication |
|
||||
|basic-auth-username-from-store |<<.from-version "5.3.4">> Optional username for HTTP basic authentication, specified as the name of the entry in the password store containing the username |
|
||||
|basic-auth-password |<<.from-version "5.3.4">> Optional password for HTTP basic authentication |
|
||||
|basic-auth-password-from-store |<<.from-version "5.3.4">> Optional password for HTTP basic authentication, specified as the name of the entry in the password store containing the password |
|
||||
|var-* |Variables to be passed to the completion and progress handlers (without the "var-" prefix) |
|
||||
|bind-status |Title of tiddler to which the status of the request ("pending", "complete", "error") should be bound |
|
||||
|bind-progress |Title of tiddler to which the progress of the request (0 to 100) should be bound |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140723103751357
|
||||
modified: 20140723103751357
|
||||
modified: 20240523174013095
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-permalink
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -12,5 +12,7 @@ The permalink message supports the following properties on the `event` object:
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be permalinked |
|
||||
|tiddlerTitle |The current tiddler (used by default if the tiddler title isn't specified in the `param`) |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
The permalink message can be generated by the ButtonWidget, and is handled by the story mechanism.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
created: 20140723103751357
|
||||
modified: 20140723103751357
|
||||
modified: 20240523174013095
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-permaview
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -12,5 +12,7 @@ The permaview message supports the following properties on the `event` object:
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be navigated within the permaview |
|
||||
|tiddlerTitle |The current tiddler (used by default if the tiddler title isn't specified in the `param`) |
|
||||
|successNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation succeeds |
|
||||
|failureNotification |<<.from-version "5.3.4">> Optional title of tiddler containing notification to be used if the operation fails |
|
||||
|
||||
The permaview message can be generated by the ButtonWidget, and is handled by the story mechanism.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20221123223127425
|
||||
modified: 20230117112244779
|
||||
tags: Pragma
|
||||
tags: Pragmas
|
||||
title: Pragma: \parsermode
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ This is the procedure, and the parameter is <<parameter>>.
|
||||
\end
|
||||
```
|
||||
|
||||
The name wrapped in double angled [[brackets|Brackets]] is used a shorthand way of [[transcluding|Transclusion]] the snippet. Each of these <<.def "procedure calls">> can supply a different set of parameters:
|
||||
The name wrapped in double angled [[brackets|Brackets]] is a shorthand way of [[transcluding|Transclusion]] the snippet. Each of these <<.def "procedure calls">> can supply a different set of parameters:
|
||||
|
||||
```
|
||||
<<my-procedure>>
|
||||
|
||||
@@ -113,7 +113,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</div>
|
||||
|
||||
<div class="tc-splash-text">
|
||||
Please wait while {{$:/SiteTitle}} is loading
|
||||
<strong>{{$:/SiteTitle}}</strong>
|
||||
<br/>
|
||||
is loading
|
||||
</div>
|
||||
|
||||
<!-- Demonstrating how to embed a bitmap graphic -->
|
||||
|
||||
@@ -20,4 +20,4 @@ title: Address
|
||||
14 Carrot Street, Vegetabletown
|
||||
+
|
||||
title: ExpectedResult
|
||||
text: <p>Good morning, my <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Name">name</a> is Robert Rabbit and I <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Address">live in</a> 14 Carrot Street, Vegetabletown</p>
|
||||
text: <p>Good morning, my <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Name">name</a> is Robert Rabbit and I <a class="tc-tiddlylink tc-tiddlylink-resolves" href="#Address">live in</a> 14 Carrot Street, Vegetabletown</p>
|
||||
@@ -28,6 +28,7 @@ Encryption/ClearPassword/Caption: résilier le mot de passe
|
||||
Encryption/ClearPassword/Hint: Résilie le mot de passe et sauvegarde ce wiki sans chiffrement
|
||||
Encryption/SetPassword/Caption: affecter un mot de passe
|
||||
Encryption/SetPassword/Hint: Affecte un mot de passe pour sauvegarde une version chiffrée de ce wiki
|
||||
EmergencyDownload/Caption: Télécharge les tidders au format json
|
||||
ExportPage/Caption: exporter tout
|
||||
ExportPage/Hint: Exporte tous les tiddlers
|
||||
ExportTiddler/Caption: exporter ce tiddler
|
||||
|
||||
@@ -206,6 +206,12 @@ Stylesheets/Caption: Feuilles de style
|
||||
Stylesheets/Expand/Caption: Tout déployer
|
||||
Stylesheets/Hint: Voici le rendu CSS courant pour les tiddlers feuilles de style tagués avec <<tag "$:/tags/Stylesheet">>
|
||||
Stylesheets/Restore/Caption: Restaurer
|
||||
TestCases/Caption: Scénarios de test
|
||||
TestCases/Hint: Les scénarios de test sont des exemples sans dépendance extérieure, conçus à des fins de tests et d'apprentissage
|
||||
TestCases/All/Caption: Tous les scénarios de test
|
||||
TestCases/All/Hint: Tous les scénarios de test définis dans ce wiki
|
||||
TestCases/Failed/Caption: Scénarios de test en échec
|
||||
TestCases/Failed/Hint: Seulement les scénarios de test qui échouent
|
||||
Theme/Caption: Thème
|
||||
Theme/Prompt: Thème courant :
|
||||
TiddlerFields/Caption: Champs des tiddlers
|
||||
|
||||
@@ -9,7 +9,7 @@ config: Données à inclure dans `$tw.config`.
|
||||
filteroperator: Méthodes d'opérateurs pour les filtres.
|
||||
global: Données globales à inclure dans `$tw`.
|
||||
info: Publie des informations système via le pseudo-plugin [[$:/temp/info-plugin]].
|
||||
isfilteroperator: Opérandes pour l'opérateur de filtre ''is''.
|
||||
isfilteroperator: Paramètres pour l'opérateur de filtre ''is''.
|
||||
library: Module générique pour les modules ~JavaScript de portée générale.
|
||||
macro: Définitions de macros ~JavaScript.
|
||||
parser: Parseurs pour divers types de contenu.
|
||||
|
||||
@@ -79,6 +79,9 @@ table-footer-background: Fond pour les bas de tableau
|
||||
table-header-background: Fond pour les en-têtes de tableau
|
||||
tag-background: Fond pour les tags
|
||||
tag-foreground: Premier plan pour les tags
|
||||
testcase-accent-level-1: Couleur d'accentuation des scénarios de test de premier niveau
|
||||
testcase-accent-level-2: Couleur d'accentuation des scénarios de test de profondeur 2
|
||||
testcase-accent-level-3: Couleur d'accentuation des scénarios de test de profondeur 3 et plus
|
||||
tiddler-background: Fond pour les tiddlers
|
||||
tiddler-border: Bordure pour les tiddlers
|
||||
tiddler-controls-foreground-hover: Premier plan au passage de la souris sur les boutons de commande d'un tiddler
|
||||
|
||||
@@ -4,6 +4,7 @@ _canonical_uri: L'URI complet vers le contenu externe d'un tiddler image
|
||||
author: Nom de l'auteur d'un plugin
|
||||
bag: Nom du <q>bag</q> d'où provient le tiddler
|
||||
caption: Texte à afficher sur un onglet ou un bouton
|
||||
class: La classe CSS appliquée à un tiddler lors de son rendu — voir [[Custom styles by user-class]]. Également utilisée pour les [[Modals]]
|
||||
code-body: Le template de visualisation affichera ce tiddler comme du code si la valeur est ''yes''
|
||||
color: Couleur CSS associée au tiddler
|
||||
component: Nom du composant responsable pour un [[tiddler d'alerte|AlertMechanism]]
|
||||
@@ -29,8 +30,9 @@ name: Dans le cas d'un tiddler plugin, le nom associé à ce plugin
|
||||
parent-plugin: Dans le cas d'un tiddler plugin, spécifie de quel plugin il est un sous-plugin
|
||||
plugin-priority: Dans le cas d'un tiddler plugin, un nombre indiquant sa priorité
|
||||
plugin-type: Dans le cas d'un tiddler plugin, le type du plugin
|
||||
revision: Numéro de révision du tiddler présent sur le serveur
|
||||
stability: Le statut de développement d'un plugin : deprecated, experimental, stable, ou legacy
|
||||
released: Date de version d'un TiddlyWiki
|
||||
revision: Numéro de révision du tiddler présent sur le serveur
|
||||
source: URL source associée à ce tiddler
|
||||
subtitle: Texte du sous-titre pour une fenêtre modale
|
||||
tags: Liste des tags associés à un tiddler
|
||||
|
||||
@@ -10,7 +10,7 @@ Lance la séquence des commandes retournées par un filtre
|
||||
Exemples
|
||||
|
||||
```
|
||||
--commands "[enlist{$:/commandes-build-sous-forme-de-texte}]"
|
||||
--commands "[enlist:raw{$:/commandes-build-sous-forme-de-texte}]"
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
@@ -12,8 +12,23 @@ description: Enregistre un wiki dans un nouveau dossier wiki
|
||||
* Les plugins appartenant à la bibliothèque officielle de plugins sont remplacés par des références à ces plugins dans le fichier `tiddlywiki.info`
|
||||
* Les plugins sur mesure sont déballés dans leur propre dossier
|
||||
|
||||
Les options suivantes sont acceptées :
|
||||
|
||||
* ''filter'': une expression filtre qui définit les tiddlers à inclure en sortie.
|
||||
* ''explodePlugins'': "yes" par défaut
|
||||
** ''yes'' "explosera" les plugins en fichiers séparés (un par tiddler) et les sauvegardera dans le répertoire plugin sous le dossier principal du wiki
|
||||
** ''no'' empêchera l'explosion des plugins en autant de fichiers que de tiddlers qui les constituaient. Le plugin sera sauvegardé en un seul tiddler JSON sous le dossier tiddlers/.
|
||||
|
||||
On notera que les deux options ''explodePlugins'' produiront des dossiers wiki qui ne changeront pas le wiki original. La différence réside dans la manière dont les plugins sont représentés sous le dossier principal du wiki.
|
||||
|
||||
On utilise typiquement cette commande avec la commande `--load` pour convertir un fichier TiddlyWiki HTML en un dossier wiki :
|
||||
|
||||
```
|
||||
tiddlywiki --load ./monwiki.html --savewikifolder ./mondossierwiki
|
||||
```
|
||||
|
||||
Sauvegarde des plugins directement sous le répertoire tiddlers/ du dossier wiki cible :
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder explodePlugins=no
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/language/Help/server
|
||||
description: Fournit une interface serveur HTTP à TiddlyWiki (déprécié en faveur de la nouvelle commande listen)
|
||||
description: (déprécié en faveur de la nouvelle commande 'listen') Fournit une interface serveur HTTP à TiddlyWiki
|
||||
|
||||
Ancienne commande pour servir un wiki sur HTTP.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user