1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-01 08:20:46 +00:00

Merge branch 'master' into publishing-framework

This commit is contained in:
jeremy@jermolene.com 2021-04-05 12:31:46 +01:00
commit 45cdd7bdf7
40 changed files with 350 additions and 141 deletions

View File

@ -2152,6 +2152,7 @@ $tw.loadWikiTiddlers = function(wikiPath,options) {
fileInfo = $tw.boot.files[title];
if(fileInfo.isEditableFile) {
relativePath = path.relative($tw.boot.wikiTiddlersPath,fileInfo.filepath);
fileInfo.originalpath = relativePath;
output[title] =
path.sep === "/" ?
relativePath :
@ -2485,16 +2486,29 @@ $tw.boot.executeNextStartupTask = function(callback) {
};
/*
Returns true if we are running on one platforms specified in a task modules `platforms` array
Returns true if we are running on one of the platforms specified in taskModule's
`platforms` array; or if `platforms` property is not defined.
*/
$tw.boot.doesTaskMatchPlatform = function(taskModule) {
var platforms = taskModule.platforms;
if(platforms) {
for(var t=0; t<platforms.length; t++) {
if((platforms[t] === "browser" && !$tw.browser) || (platforms[t] === "node" && !$tw.node)) {
return false;
switch (platforms[t]) {
case "browser":
if ($tw.browser) {
return true;
}
break;
case "node":
if ($tw.node) {
return true;
}
break;
default:
$tw.utils.error("Module " + taskModule.name + ": '" + platforms[t] + "' in export.platforms invalid");
}
}
return false;
}
return true;
};

File diff suppressed because one or more lines are too long

View File

@ -167,10 +167,10 @@ WikiFolderMaker.prototype.saveTiddler = function(directory,tiddler) {
}
var fileInfo = $tw.utils.generateTiddlerFileInfo(tiddler,{
directory: path.resolve(this.wikiFolderPath,directory),
wiki: this.wiki,
pathFilters: pathFilters,
extFilters: extFilters,
originalpath: this.wiki.extractTiddlerDataItem("$:/config/OriginalTiddlerPaths",title, "")
wiki: this.wiki,
fileInfo: {}
});
try {
$tw.utils.saveTiddlerToFileSync(tiddler,fileInfo);

View File

@ -103,7 +103,11 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
var tiddler = this.wiki.getTiddler(this.editTitle);
if(tiddler) {
// If we've got a tiddler, the value to display is the field string value
value = tiddler.getFieldString(this.editField);
if(tiddler.hasField(this.editField)) {
value = tiddler.getFieldString(this.editField);
} else {
value = this.editDefault || "";
}
if(this.editField === "text") {
type = tiddler.fields.type || "text/vnd.tiddlywiki";
}

View File

@ -102,7 +102,7 @@ exports.escapecss = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
// escape any character with a special meaning in CSS using CSS.escape()
results.push(CSS.escape(title));
results.push($tw.utils.escapeCSS(title));
});
return results;
};

View File

@ -25,8 +25,9 @@ exports.handler = function(request,response,state) {
response.end();
} else {
// Redirect to the root wiki if login worked
var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: "/";
response.writeHead(302,{
Location: "/"
Location: location
});
response.end();
}

View File

@ -1,33 +1,28 @@
/*\
title: $:/core/modules/startup/CSSescape.js
title: $:/core/modules/utils/escapecss.js
type: application/javascript
module-type: startup
module-type: utils
Polyfill for CSS.escape()
Provides CSS.escape() functionality.
\*/
(function(root,factory){
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
/*global $tw: false, window: false */
"use strict";
// Export name and synchronous status
exports.name = "css-escape";
exports.platforms = ["browser"];
exports.after = ["startup"];
exports.synchronous = true;
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
// https://github.com/umdjs/umd/blob/master/returnExports.js
exports.startup = function() {factory(root);};
}(typeof global != 'undefined' ? global : this, function(root) {
if (root.CSS && root.CSS.escape) {
return;
exports.escapeCSS = (function() {
// use browser's native CSS.escape() function if available
if ($tw.browser && window.CSS && window.CSS.escape) {
return window.CSS.escape;
}
// https://drafts.csswg.org/cssom/#serialize-an-identifier
var cssEscape = function(value) {
// otherwise, a utility method is provided
// see also https://drafts.csswg.org/cssom/#serialize-an-identifier
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
return function(value) {
if (arguments.length == 0) {
throw new TypeError('`CSS.escape` requires an argument.');
}
@ -104,11 +99,6 @@ exports.startup = function() {factory(root);};
}
return result;
};
})();
if (!root.CSS) {
root.CSS = {};
}
Object.getPrototypeOf(root.CSS).escape = cssEscape;
}));
})();

View File

@ -213,13 +213,13 @@ Options include:
extFilters: optional array of filters to be used to generate the base path
wiki: optional wiki for evaluating the pathFilters,
fileInfo: an existing fileInfo to check against
originalpath: a preferred filepath if no pathFilters match
*/
exports.generateTiddlerFileInfo = function(tiddler,options) {
var fileInfo = {}, metaExt;
// Propagate the isEditableFile flag
if(options.fileInfo) {
fileInfo.isEditableFile = options.fileInfo.isEditableFile || false;
if(options.fileInfo && !!options.fileInfo.isEditableFile) {
fileInfo.isEditableFile = true;
fileInfo.originalpath = options.fileInfo.originalpath;
}
// Check if the tiddler has any unsafe fields that can't be expressed in a .tid or .meta file: containing control characters, or leading/trailing whitespace
var hasUnsafeFields = false;
@ -247,7 +247,7 @@ exports.generateTiddlerFileInfo = function(tiddler,options) {
fileInfo.hasMetaFile = true;
}
if(options.extFilters) {
// Check for extension override
// Check for extension overrides
metaExt = $tw.utils.generateTiddlerExtension(tiddler.fields.title,{
extFilters: options.extFilters,
wiki: options.wiki
@ -279,8 +279,7 @@ exports.generateTiddlerFileInfo = function(tiddler,options) {
directory: options.directory,
pathFilters: options.pathFilters,
wiki: options.wiki,
fileInfo: options.fileInfo,
originalpath: options.originalpath
fileInfo: options.fileInfo
});
return fileInfo;
};
@ -292,8 +291,7 @@ Options include:
wiki: optional wiki for evaluating the extFilters
*/
exports.generateTiddlerExtension = function(title,options) {
var self = this,
extension;
var extension;
// Check if any of the extFilters applies
if(options.extFilters && options.wiki) {
$tw.utils.each(options.extFilters,function(filter) {
@ -319,11 +317,10 @@ Options include:
fileInfo: an existing fileInfo object to check against
*/
exports.generateTiddlerFilepath = function(title,options) {
var self = this,
directory = options.directory || "",
var directory = options.directory || "",
extension = options.extension || "",
originalpath = options.originalpath || "",
filepath;
originalpath = (options.fileInfo && options.fileInfo.originalpath) ? options.fileInfo.originalpath : "",
filepath;
// Check if any of the pathFilters applies
if(options.pathFilters && options.wiki) {
$tw.utils.each(options.pathFilters,function(filter) {
@ -336,7 +333,7 @@ exports.generateTiddlerFilepath = function(title,options) {
}
});
}
if(!filepath && originalpath !== "") {
if(!filepath && !!originalpath) {
//Use the originalpath without the extension
var ext = path.extname(originalpath);
filepath = originalpath.substring(0,originalpath.length - ext.length);
@ -345,27 +342,35 @@ exports.generateTiddlerFilepath = function(title,options) {
// Remove any forward or backward slashes so we don't create directories
filepath = filepath.replace(/\/|\\/g,"_");
}
//If the path does not start with "." or ".." and a path seperator, then
// Replace any Windows control codes
filepath = filepath.replace(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i,"_$1_");
// Replace any leading spaces with the same number of underscores
filepath = filepath.replace(/^ +/,function (u) { return u.replace(/ /g, "_")});
//If the path does not start with "." or ".." && a path seperator, then
if(!/^\.{1,2}[/\\]/g.test(filepath)) {
// Don't let the filename start with any dots because such files are invisible on *nix
filepath = filepath.replace(/^\.+/g,"_");
filepath = filepath.replace(/^\.+/g,function (u) { return u.replace(/\./g, "_")});
}
// Replace any Unicode control codes
filepath = filepath.replace(/[\x00-\x1f\x80-\x9f]/g,"_");
// Replace any characters that can't be used in cross-platform filenames
filepath = $tw.utils.transliterate(filepath.replace(/<|>|~|\:|\"|\||\?|\*|\^/g,"_"));
// Replace any dots or spaces at the end of the extension with the same number of underscores
extension = extension.replace(/[\. ]+$/, function (u) { return u.replace(/[\. ]/g, "_")});
// Truncate the extension if it is too long
if(extension.length > 32) {
extension = extension.substr(0,32);
}
// If the filepath already ends in the extension then remove it
if(filepath.substring(filepath.length - extension.length) === extension) {
filepath = filepath.substring(0,filepath.length - extension.length);
}
// Remove any characters that can't be used in cross-platform filenames
filepath = $tw.utils.transliterate(filepath.replace(/<|>|~|\:|\"|\||\?|\*|\^/g,"_"));
// Truncate the filename if it is too long
if(filepath.length > 200) {
filepath = filepath.substr(0,200);
}
// Truncate the extension if it is too long
if(extension.length > 32) {
extension = extension.substr(0,32);
}
// If the resulting filename is blank (eg because the title is just punctuation characters)
if(!filepath) {
// If the resulting filename is blank (eg because the title is just punctuation)
if(!filepath || /^_+$/g.test(filepath)) {
// ...then just use the character codes of the title
filepath = "";
$tw.utils.each(title.split(""),function(char) {
@ -386,14 +391,15 @@ exports.generateTiddlerFilepath = function(title,options) {
count++;
} while(fs.existsSync(fullPath));
// If the last write failed with an error, or if path does not start with:
// the resolved options.directory, the resolved wikiPath directory, or the wikiTiddlersPath directory,
// then encodeURIComponent() and resolve to tiddler directory
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath),
// the resolved options.directory, the resolved wikiPath directory, the wikiTiddlersPath directory,
// or the 'originalpath' directory, then encodeURIComponent() and resolve to tiddler directory.
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath,fullPath),
encode = (options.fileInfo || {writeError: false}).writeError == true;
if(!encode) {
encode = !(fullPath.indexOf(path.resolve(directory)) == 0 ||
fullPath.indexOf(path.resolve($tw.boot.wikiPath)) == 0 ||
fullPath.indexOf($tw.boot.wikiTiddlersPath) == 0);
encode = !(writePath.indexOf($tw.boot.wikiTiddlersPath) == 0 ||
writePath.indexOf(path.resolve(directory)) == 0 ||
writePath.indexOf(path.resolve($tw.boot.wikiPath)) == 0 ||
writePath.indexOf(path.resolve($tw.boot.wikiTiddlersPath,originalpath)) == 0 );
}
if(encode) {
writePath = path.resolve(directory,encodeURIComponent(fullPath));
@ -413,7 +419,7 @@ exports.saveTiddlerToFile = function(tiddler,fileInfo,callback) {
if(fileInfo.hasMetaFile) {
// Save the tiddler as a separate body and meta file
var typeInfo = $tw.config.contentTypeInfo[tiddler.fields.type || "text/plain"] || {encoding: "utf8"};
fs.writeFile(fileInfo.filepath,tiddler.fields.text,typeInfo.encoding,function(err) {
fs.writeFile(fileInfo.filepath,tiddler.fields.text || "",typeInfo.encoding,function(err) {
if(err) {
return callback(err);
}
@ -455,7 +461,7 @@ exports.saveTiddlerToFileSync = function(tiddler,fileInfo) {
if(fileInfo.hasMetaFile) {
// Save the tiddler as a separate body and meta file
var typeInfo = $tw.config.contentTypeInfo[tiddler.fields.type || "text/plain"] || {encoding: "utf8"};
fs.writeFileSync(fileInfo.filepath,tiddler.fields.text,typeInfo.encoding);
fs.writeFileSync(fileInfo.filepath,tiddler.fields.text || "",typeInfo.encoding);
fs.writeFileSync(fileInfo.filepath + ".meta",tiddler.getFieldStringBlock({exclude: ["text","bag"]}),"utf8");
} else {
// Save the tiddler as a self contained templated file
@ -465,6 +471,7 @@ exports.saveTiddlerToFileSync = function(tiddler,fileInfo) {
fs.writeFileSync(fileInfo.filepath,JSON.stringify([tiddler.getFieldStrings({exclude: ["bag"]})],null,$tw.config.preferences.jsonSpaces),"utf8");
}
}
return fileInfo;
};
/*

View File

@ -515,6 +515,15 @@ exports.htmlEncode = function(s) {
}
};
// Converts like htmlEncode, but forgets the double quote for brevity
exports.htmlTextEncode = function(s) {
if(s) {
return s.toString().replace(/&/mg,"&amp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;");
} else {
return "";
}
};
// Converts all HTML entities to their character equivalents
exports.entityDecode = function(s) {
var converter = String.fromCodePoint || String.fromCharCode,

View File

@ -75,17 +75,8 @@ TranscludeWidget.prototype.execute = function() {
]}];
}
}
// Assign any variables set via attributes starting with $
var variables = Object.create(null);
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) === "$") {
variables[name.substr(1)] = attribute;
}
});
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes,{
variables: variables
});
this.makeChildWidgets(parseTreeNodes);
};
/*
@ -112,7 +103,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
TranscludeWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(Object.keys(changedAttributes).length || changedTiddlers[this.transcludeTitle]) {
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {
this.refreshSelf();
return true;
} else {

View File

@ -65,6 +65,9 @@ ViewWidget.prototype.execute = function() {
case "htmlencoded":
this.text = this.getValueAsHtmlEncoded();
break;
case "htmltextencoded":
this.text = this.getValueAsHtmlTextEncoded();
break;
case "urlencoded":
this.text = this.getValueAsUrlEncoded();
break;
@ -160,6 +163,10 @@ ViewWidget.prototype.getValueAsHtmlEncoded = function() {
return $tw.utils.htmlEncode(this.getValueAsText());
};
ViewWidget.prototype.getValueAsHtmlTextEncoded = function() {
return $tw.utils.htmlTextEncode(this.getValueAsText());
};
ViewWidget.prototype.getValueAsUrlEncoded = function() {
return encodeURIComponent(this.getValueAsText());
};

View File

@ -5,5 +5,5 @@ title: $:/core/templates/html-div-tiddler
This template is used for saving tiddlers as an HTML DIV tag with attributes representing the tiddler fields.
-->`<div`<$fields template=' $name$="$encoded_value$"'></$fields>`>
<pre>`<$view field="text" format="htmlencoded" />`</pre>
<pre>`<$view field="text" format="htmltextencoded" />`</pre>
</div>`

View File

@ -84,7 +84,7 @@ $value={{{ [<newFieldValueTiddler>get[text]] }}}/>
<$fieldmangler>
<div class="tc-edit-field-add">
<em class="tc-edit tc-big-gap-right">
<em class="tc-edit tc-small-gap-right">
<<lingo Fields/Add/Prompt>>
</em>
<$vars refreshTitle=<<qualify "$:/temp/fieldname/refresh">> storeTitle=<<newFieldNameInputTiddler>> searchListState=<<newFieldNameSelectionTiddler>>>

View File

@ -7,7 +7,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
\whitespace trim
<$set name="refreshTitle" value=<<qualify "$:/temp/type-search/refresh">>>
<div class="tc-edit-type-selector-wrapper">
<em class="tc-edit tc-big-gap-right"><<lingo Type/Prompt>></em>
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
<div class="tc-type-selector-dropdown-wrapper">
<div class="tc-type-selector"><$fieldmangler>
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>

View File

@ -6,25 +6,24 @@ $baseFilename$$(extension)$
\end
\define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers")
<span class="tc-popup-keep"><$button popup=<<qualify "$:/state/popup/export">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$vars hint={{{ [<__lingoBase__>addsuffix[Hint]get[text]] }}} caption={{{ [<__lingoBase__>addsuffix[Caption]get[text]] }}}>
<span class="tc-popup-keep"><$button popup=<<qualify "$:/state/popup/export">> tooltip=<<hint>> aria-label=<<caption>> class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/export-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$lingoBase$Caption}}/></span>
<span class="tc-btn-text"><$text text=<<caption>>/></span>
</$list>
</$button></span><$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
</$button></span></$vars><$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$set name="count" value={{{ [subfilter<__exportFilter__>count[]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]">
<$list filter="[<currentTiddler>has[condition]subfilter{!!condition}limit[1]] ~[<currentTiddler>!has[condition]then[true]]" variable="ignore">
<$set name="extension" value={{!!extension}}>
<$button class="tc-btn-invisible">
<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter=<<__exportFilter__>> filename=<<exportButtonFilename """$baseFilename$""">>/>
<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter=<<__exportFilter__>> filename={{{ [<__baseFilename__>addsuffix{!!extension}] }}}/>
<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/>
<$transclude field="description"/>
</$button>
</$set>
</$list>
</$list>
</$set>

View File

@ -7,9 +7,9 @@ $:/core/images/storyview-$(storyview)$
<div class="tc-chooser tc-viewswitcher">
<$list filter="[storyviews[]]" variable="storyview">
<$set name="cls" filter="[<storyview>prefix{$:/view}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item"><div class=<<cls>>>
<$link to=<<storyview>>><$transclude tiddler=<<icon>>/><$text text=<<storyview>>/></$link>
<$button tag="a" class="tc-tiddlylink tc-btn-invisible" to=<<storyview>>><$transclude tiddler=<<icon>>/><$text text=<<storyview>>/></$button>
</div>
</$set>
</$list>
</div>
</$linkcatcher>
</$linkcatcher>

View File

@ -11,16 +11,111 @@ type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.23...master]]//
<div class="doc-plain-list">
! Performance Improvements
! Improvements
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5380">> (and again [[here|https://github.com/Jermolene/TiddlyWiki5/pull/5488]]) the efficiency of the linked list implementation
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5362">> [[all Operator]] to use new linked list implementation
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5369">> [[links Operator]] to use new linked list implementation
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5383">> unneeded escaping of double quotes in tiddler DIVs inside single file wikis (saving about 10% from the size of empty.html)
*
! Usability Improvements
! Contributors
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/a360adbba924d222c5b55709133c18890c04398d">> dropzone size when story river is empty
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5326">> fill colour for "remove tag" button
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5370">> page title so that the separating em-dash is only used if the site subtitle is present
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5397">> broken aria-label in $:/PaletteManager
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5451">> macro calls to use the same parser as that used for widget attributes
! Hackability Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/9eda02868f21e9dd1733ffe26352bd7ac96285b4">> new MessageCatcherWidget
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/d25e540dd2f0decf61c52fdc665a28a5dfeda93f">> support for `image/vnd.microsoft.icon` content type
! Client-server Improvements
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/e96a54c7531a2d9e07745e27d2015d8d7d09588f">> crash running in client server configuration when 'etag' header is missing
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5423">> blank favicon when using lazily loaded images
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/4461">> web server issue with custom path prefix and basic authentication
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/5366">> crash on Node.js with ActionSetFieldWidget when type field is given a value upon new tiddler creation
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5329">> issue with tiddler titles that already end in the required extension
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5465">> several consistency issues with the filesystem plugin
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/5483">> issue with encoding of $:/config/OriginalTiddlerPaths outside the wiki folder
! Plugin Improvements
!! [[XLSX Utilities Plugin]]
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/5400">> crash with the XLSX Utils plugin
!! [[KaTeX Plugin]]
* <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/commit/f2aba29d94cddcff6d7c188c4aa0b668995d8002">> to KaTeX v0.12.0
!! [[Freelinks Plugin]]
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/commit/0ed32fded996826a59832d7a7555bb16c4a57864">> the Freelinks plugin with a filter to determine which tiddlers can be the targets of freelinks
!! [[Menubar Plugin]]
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/discussions/5533">> Menu plugin to support optional ''dropdown-position'' field
!! [[BibTeX Plugin]]
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/5581">> BibTeX Plugin to report errors more sensibly
! Developer Experience Improvements
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/5279">> support for [[server sent events|https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events]]
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5382">> the widget subclassing mechanism to work with widgets that add event listeners in their constructor
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5377">> the Jasmine test suite output
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/commit/9f9ce6595b08032a602981f82940ca113cff8211">> wikitext parser with a subclassing mechanism
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/ef76349c37662e9706acfffc2c2edb51a920183d">> added support for ''utils-browser'' modules
! Other Bug Fixes
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5376">> issue with [[lookup Operator]] returning "undefined" under some circumstances
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/5396">> crash with unterminated wikitext comments
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5453">> tiddler info area content bleeding on close animation
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5452">> inline/block widget parsing glitch
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5401">> runaway regexp when parsing filters
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5440">> right margin of tag pill when used outside of the tags wrapper
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/pull/5455">> upload saver to optionally work without a username or password
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/5e4430dbf9ff66d9a18fbdf3005abcd716efc07d">> RadioWidget to refresh selectively, and to use the ''checked'' attribute correctly
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5542">> "invert" option of `wiki.search()` method
* <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/commit/e157d16b724172f752da0ff714847e0c0ca9664d">> ''data-tag-title'' attribute to tag pills
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/7b1a0c6e6a8bd2d3badf8766af0cd3f5f7ac5ec8">> ES5 compatibility issue
* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/commit/a38dc1730010c6a2b6a011aff4818bbc67c04055">> RenderCommand to allow multiple variables to be passed
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/226df2ad7d2978d3d7400d94767a0503e495cf98">> exporting of tiddlers that begin and end with double quotes
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/commit/d56e8764a1f02a214df5da1cc95191be2da2491b">> accessibility of button widget when controlling a popup
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/d6ea369f5ef9d3092a360a4286a99902df37782b">> EditTextWidget to use default text for missing fields
* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/5552">> css-escape-polyfill to work under Node.js
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
* <<contributor Jermolene>>
</div>
* <<contributor Arlen22
* <<contributor BlueGreenMagick>>
* <<contributor BramChen>>
* <<contributor BurningTreeC>>
* <<contributor cdruan>>
* <<contributor clutterstack>>
* <<contributor CodaCodr>>
* <<contributor dixonge>>
* <<contributor donmor>>
* <<contributor FlashSystems>>
* <<contributor flibbles>>
* <<contributor hoelzro>>
* <<contributor jeremyredhead>>
* <<contributor joebordes>>
* <<contributor joshuafontany>>
* <<contributor kookma>>
* <<contributor laomaiweng>>
* <<contributor leehawk787>>
* <<contributor morosanuae>>
* <<contributor neumark>>
* <<contributor NicolasPetton>>
* <<contributor OdinJorna>>
* <<contributor pmario>>
* <<contributor saqimtias>>
* <<contributor simonbaird>>
* <<contributor slaymaker1907>>
* <<contributor twMat>>

View File

@ -796,6 +796,17 @@ function runTests(wiki) {
expect(wiki.filterTiddlers("[[12]pad[9],[abc]]").join(",")).toBe("abcabca12");
expect(wiki.filterTiddlers("[[12]pad:suffix[9],[abc]]").join(",")).toBe("12abcabca");
});
it("should handle the escapecss operator", function() {
expect(wiki.filterTiddlers("[[Hello There]escapecss[]]").join(",")).toBe("Hello\\ There");
expect(wiki.filterTiddlers('\'"Reveal.js" by Devin Weaver[1]\' +[escapecss[]]').join(",")).toBe('\\"Reveal\\.js\\"\\ by\\ Devin\\ Weaver\\[1\\]');
expect(wiki.filterTiddlers(".foo#bar (){} '--a' 0 \0 +[escapecss[]]").join(",")).toBe("\\.foo\\#bar,\\(\\)\\{\\},--a,\\30 ,\ufffd");
expect(wiki.filterTiddlers("'' +[escapecss[]]").join(",")).toBe("");
expect(wiki.filterTiddlers("1234 +[escapecss[]]").join(",")).toBe("\\31 234");
expect(wiki.filterTiddlers("'-25' +[escapecss[]]").join(",")).toBe("-\\32 5");
expect(wiki.filterTiddlers("'-' +[escapecss[]]").join(",")).toBe("\\-");
});
}
});

View File

@ -0,0 +1,5 @@
created: 20210322152203906
list: [[Documentation Macros]] HelloThere GettingStarted Community
modified: 20210322152237613
title: $:/StoryList
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,10 @@
title: Community Links Aggregator
tags: Community
modified: 20210322151848025
created: 20210322151848025
The ~TiddlyWiki Community Links Aggregator is a collection of regularly updated links to useful and interesting TiddlyWiki material curated by our team of community editors. The site aggregates links curated by individual members of the TiddlyWiki community. It lets you see the latest links, and explore them through categories and timelines.
https://links.tiddlywiki.com/
This site works best with a crowd of people posting links. The pressure on individuals is reduced because not everybody needs to catch every interesting link that flies past. The aggregation effects reduce the impact of mistakes. For example, if one person mis-tags a link under an inappropriate topic, the site will show that only one person added that tag, versus the majority using more appropriate tags. In that way, we hope that a sort of wisdom of the crowds will emerge, with consensus emerging as to the most useful ways to describe and categorise links.

View File

@ -1,9 +1,11 @@
created: 20130909151600000
modified: 20210106151027426
modified: 20210322152237662
tags: TableOfContents
title: Community
type: text/vnd.tiddlywiki
Here we gather the latest and most useful material from the TiddlyWiki community.
<<.tip "The latest and most useful links are now being gathered in the [[Community Links Aggregator]].">>
Once all the relevant links have been transferred over these entries will be removed from the main tiddlywiki.com site.
<<tabs "Forums Latest Tutorials [[Community Editions]] [[Community Plugins]] [[Community Themes]] [[Community Palettes]] [[Other Resources]] Examples Articles Meetups" "Latest">>

View File

@ -1,17 +1,59 @@
created: 20131101111400000
modified: 20190115165616599
modified: 20210402095728684
tags: Community
title: Contributing
type: text/vnd.tiddlywiki
We welcome contributions to the code and documentation of TiddlyWiki in several ways:
Here we focus on contributions via GitHub Pull Requests but there are many other ways that anyone can help the TiddlyWiki project, such as [[reporting bugs|ReportingBugs]] or helping to [[improve our documentation|Improving TiddlyWiki Documentation]].
* ReportingBugs
* Helping to [[improve our documentation|Improving TiddlyWiki Documentation]]
* Contributing to the code via [[GitHub|https://github.com/Jermolene/TiddlyWiki5]]
** See https://tiddlywiki.com/dev for more details
! Rules for Pull Requests
There are other ways to [[help TiddlyWiki|HelpingTiddlyWiki]] too.
PRs must meet these minimum requirements before they can be considered for merging:
* The material in the PR must be free of licensing restrictions. Which means that either:
** The author must hold the copyright in all of the material themselves
** The material must be licensed under a license compatible with TiddlyWiki's BSD license
* The author must sign the Contributors License Agreement (see below)
* Each PR should only make a single feature change
* The title of the PR should be 50 characters or less
* The title of the PR should be capitalised, and should not end with a period
* The title of the PR should be written in the imperative mood. See below
* Adequate explanation in the body of the PR for the motivation and implementation of the change. Focus on the //why// and //what//, rather than the //how//
* PRs must be self-contained. Although they can link to material elsewhere, everything needed to understand the intention of the PR should be included
* Documentation as appropriate for end-users or developers
* Observe the coding style
* Read the developers documentation
* Please open a consultation issue prior to investing time in making a large PR
!! Imperative Mood for PR Titles
The "imperative mood" means written as if giving a command or instruction. See [[this post|https://chris.beams.io/posts/git-commit/#imperative]] for more details, but the gist is that the title of the PR should make sense when used to complete the sentence "If applied, this commit will...". So for example, these are good PR titles:
* If applied, this commit will //update the contributing guidelines//
* If applied, this commit will //change css-escape-polyfill to a $tw.utils method//
* If applied, this commit will //make it easier to subclass the wikitext parser with a custom rule set//
These a poorly worded PR titles:
* ~~If applied, this commit will //edit text widgets should use default text for missing fields//~~
* ~~If applied, this commit will //signing the CLA//~~
* ~~If applied, this commit will //don't crash if options.event is missing//~~
PR titles may also include a short prefix to indicate the subsystem to which they apply. For example:
* //Menu plugin: Include menu text in aerial rotator//
! Commenting on Pull Requests
One of the principles of open source is that many pairs of eyes on the code can improve quality. So, we welcome comments and critiques of pending PRs. [[Conventional Comments|https://conventionalcomments.org]] has some techcniques to help make comments as constructive and actionable as possible. Notably, they recommend prefixing a comment with a label to clarify the intention:
|praise |Praises highlight something positive. Try to leave at least one of these comments per review. Do not leave false praise (which can actually be damaging). Do look for something to sincerely praise |
|nitpick |Nitpicks are small, trivial, but necessary changes. Distinguishing nitpick comments significantly helps direct the reader's attention to comments requiring more involvement |
|suggestion |Suggestions are specific requests to improve the subject under review. It is assumed that we all want to do what's best, so these comments are never dismissed as “mere suggestions”, but are taken seriously |
|issue |Issues represent user-facing problems. If possible, it's great to follow this kind of comment with a suggestion |
|question |Questions are appropriate if you have a potential concern but are not quite sure if it's relevant or not. Asking the author for clarification or investigation can lead to a quick resolution |
|thought |Thoughts represent an idea that popped up from reviewing. These comments are non-blocking by nature, but they are extremely valuable and can lead to more focused initiatives and mentoring opportunities |
|chore |Chores are simple tasks that must be done before the subject can be “officially” accepted. Usually, these comments reference some common process. Try to leave a link to the process description so that the reader knows how to resolve the chore |
! Contributor License Agreement
@ -24,9 +66,3 @@ There are other ways to [[help TiddlyWiki|HelpingTiddlyWiki]] too.
---
//The CLA documents used for this project were created using [[Harmony Project Templates|http://www.harmonyagreements.org]]. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity".//
!! Remarks
''If you do not own the copyright in the entire work of authorship'':
In this case, please clearly state so and provide links and any additional information that clarify under which license the rest of the code is distributed.

View File

@ -1,6 +1,6 @@
created: 202101061831
modified: 20210110204503082
tags: [[Community Plugins]]
tags: [[Community Plugins]] [[Community Editions]]
title: Projectify by Nicolas Petton
type: text/vnd.tiddlywiki
url: https://projectify.wiki

View File

@ -28,11 +28,11 @@ These are the system tags defined by the ~TiddlyWiki core:
!! System tags defined by ~TiddlyWiki plugins
|<<tag "$:/tags/HelpPanel>> |can be seen at: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]] see: top left page control bubble|
|<<tag "$:/tags/HelpPanel/Videos>> |help panel "videos" tab|
|<<tag "$:/tags/MakeQR>> |can be seen at: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]]. see: Tiddler toolbar |
|<<tag "$:/tags/TranslationGroup>> |used by the [[translators edition|https://tiddlywiki.com/editions/translators/]] |
|<<tag "$:/tags/TwitterUsage>> |twitter plugin |
|<<tag "$:/tags/ViewToolbarButton/QRcode>> |see: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]] |
|<<tag "$:/tags/test-spec>> |tiddlywiki test suite |
|<<tag "$:/tags/HelpPanel">> |can be seen at: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]] see: top left page control bubble|
|<<tag "$:/tags/HelpPanel/Videos">> |help panel "videos" tab|
|<<tag "$:/tags/MakeQR">> |can be seen at: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]]. see: Tiddler toolbar |
|<<tag "$:/tags/TranslationGroup">> |used by the [[translators edition|https://tiddlywiki.com/editions/translators/]] |
|<<tag "$:/tags/TwitterUsage">> |twitter plugin |
|<<tag "$:/tags/ViewToolbarButton/QRcode">> |see: [[tiddlywiki prerelease|https://tiddlywiki.com/prerelease/]] |
|<<tag "$:/tags/test-spec">> |tiddlywiki test suite |

View File

@ -1,5 +1,5 @@
created: 20150414070451144
list: [[HelloThumbnail - Introduction Video]] [[HelloThumbnail - Gentle Guide]] [[HelloThumbnail - Firefox Apocalypse]] [[HelloThumbnail - Latest Version]] [[HelloThumbnail - TiddlyMap]] [[HelloThumbnail - HelpingTiddlyWiki]] [[HelloThumbnail - Developers]] [[HelloThumbnail - Classic]]
list: [[HelloThumbnail - Introduction Video]] [[HelloThumbnail - Gentle Guide]] [[HelloThumbnail - Firefox Apocalypse]] [[HelloThumbnail - Latest Version]] [[HelloThumbnail - TiddlyWikiLinks]] [[HelloThumbnail - TiddlyMap]] [[HelloThumbnail - HelpingTiddlyWiki]] [[HelloThumbnail - Developers]] [[HelloThumbnail - Classic]]
modified: 20150414070948246
title: HelloThumbnail
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,6 @@
title: HelloThumbnail - TiddlyWikiLinks
tags: HelloThumbnail
color: #D5B7EA
image: TiddlyWikiLinks
caption: links.tiddlywiki.com
link: Community Links Aggregator

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,3 @@
title: TiddlyWikiLinks
type: image/png
tags: picture

View File

@ -12,8 +12,6 @@ type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.22...v5.1.23]]//
<div class="doc-plain-list">
! Performance Improvements
* <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/5206">> filter execution to use a more efficient linked list structure for intermediate results
@ -293,5 +291,3 @@ Please note that using this plugin does not guarantee compliance with any partic
* <<contributor saqimtiaz>>
* <<contributor twMat>>
* <<contributor xcazin>>
</div>

View File

@ -217,9 +217,3 @@ tr.doc-table-subheading {
.doc-link-badge:hover {
text-decoration: underline;
}
.doc-plain-list ul,
.doc-plain-list ol {
list-style: none;
padding-left: 0;
}

View File

@ -53,6 +53,17 @@ This example sets the title of the current wiki [[$:/SiteTitle]] to one of a lis
<option>The Dice Man</option>
</$select>"/>
!!! Simple List with Placeholder Value
To display a default value that is also disabled, effectively functioning as a placeholder, the following form can be used. Note that the targeted field must be empty, or not exist, for the placeholder to show in the widget:
<$macrocall $name="wikitext-example-without-html" src="<$select tiddler='New Tiddler' field='text' default='Choose a new text'>
<option disabled>Choose a new text</option>
<option>A Tale of Two Cities</option>
<option>A New Kind of Science</option>
<option>The Dice Man</option>
</$select>"/>
!! Value lists
In this example the `value` attribute has been used to specify the text that should be used as the value of the entry instead of the display text.
@ -117,4 +128,4 @@ This example uses the `multiple` keyword to specify that we should be able to se
<$list filter='[list[$:/generated-list-demo-state!!testing]]'>
<$view field='title' /><br />
</$list>
"/>
"/>

View File

@ -1,5 +1,5 @@
created: 20130824142500000
modified: 20210319150601867
modified: 20140717175900970
tags: Widgets
title: TranscludeWidget
type: text/vnd.tiddlywiki
@ -17,7 +17,6 @@ The TranscludeWidget dynamically imports content from another tiddler.
|index |The index of a property in a [[DataTiddler|DataTiddlers]] |
|subtiddler |Optional SubTiddler title when the target tiddler is a [[plugin|Plugins]] (see below) |
|mode |Override the default parsing mode for the transcluded text to "block" or "inline" |
|//(attributes starting with $)// |<<.from-version "5.1.24">> The $ is removed from each attribute name to specify a variable name that is assigned the specified value for the scope of the transclusion |
The TranscludeWidget treats any contained content as a fallback if the target of the transclusion is not defined (ie a missing tiddler or a missing field).

View File

@ -1,6 +1,6 @@
caption: view
created: 20131024141900000
modified: 20180730201626985
modified: 20210402093330113
tags: Widgets
title: ViewWidget
type: text/vnd.tiddlywiki
@ -29,6 +29,7 @@ The following formats can be specified in the `format` attribute:
|!Format |!Description |
|''text'' |Plain text (default) |
|''htmlencoded'' |The field is displayed with HTML encoding |
|''htmltextencoded'' |<<.from-version "5.1.24">> The field is displayed with HTML encoding, only double quotes (") are not escaped. This creates a more compact htmlencoding appropriate for html text content, but //not// for attributes. |
|''urlencoded'' |The field is displayed with URL encoding |
|''doubleurlencoded'' |The field is displayed with double URL encoding |
|''htmlwikified'' |The field is wikified according to the mode attribute and the resulting HTML returned as plain text (ie HTML elements will appear in plain text) |

View File

@ -1,7 +1,7 @@
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
Copyright (c) 2004-2007, Jeremy Ruston
Copyright (c) 2007-2020, UnaMesa Association
Copyright (c) 2007-2021, UnaMesa Association
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -445,3 +445,7 @@ Yoonchae Lee, @BlueGreenMagick, 2021/01/21
Dyllon Gagnier, @slaymaker1907, 2021/01/24
J. Wilhelm, @jeremyredhead, 2021/01/27
Quentin Minster, @laomaiweng, 2021/03/10
Cindy Ruan, @cdruan, 2021/03/18

View File

@ -28,7 +28,8 @@ exports["application/x-bibtex"] = function(text,fields) {
}
if(typeof data === "string") {
return [{
title: "BibTeX import error: " + data,
title: "BibTeX import error",
text: data
}];
}
// Convert each entry

View File

@ -53,7 +53,8 @@ It is the responsibility of the filesystem adaptor to update this.boot.files for
*/
FileSystemAdaptor.prototype.getTiddlerFileInfo = function(tiddler,callback) {
// Always generate a fileInfo object when this fuction is called
var title = tiddler.fields.title, newInfo, pathFilters, extFilters;
var title = tiddler.fields.title, newInfo, pathFilters, extFilters,
fileInfo = this.boot.files[title];
if(this.wiki.tiddlerExists("$:/config/FileSystemPaths")) {
pathFilters = this.wiki.getTiddlerText("$:/config/FileSystemPaths","").split("\n");
}
@ -65,8 +66,7 @@ FileSystemAdaptor.prototype.getTiddlerFileInfo = function(tiddler,callback) {
pathFilters: pathFilters,
extFilters: extFilters,
wiki: this.wiki,
fileInfo: this.boot.files[title],
originalpath: this.wiki.extractTiddlerDataItem("$:/config/OriginalTiddlerPaths",title,"")
fileInfo: fileInfo
});
callback(null,newInfo);
};

View File

@ -5,5 +5,5 @@ title: $:/core/templates/html-div-tiddler
This template is used for saving tiddlers as an HTML DIV tag with attributes representing the tiddler fields. This version includes the tiddler changecount as the field `revision`.
-->`<div`<$fields exclude='text revision bag' template=' $name$="$encoded_value$"'></$fields>` revision="`<<changecount>>`" bag="default">
<pre>`<$view field="text" format="htmlencoded" />`</pre>
<pre>`<$view field="text" format="htmltextencoded" />`</pre>
</div>`

File diff suppressed because one or more lines are too long

View File

@ -2999,6 +2999,19 @@ Publishing UI
** Other utility classes
*/
.tc-tiny-gap {
margin-left: .25em;
margin-right: .25em;
}
.tc-tiny-gap-left {
margin-left: .25em;
}
.tc-tiny-gap-right {
margin-right: .25em;
}
.tc-small-gap {
margin-left: .5em;
margin-right: .5em;