mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-24 20:04:40 +00:00
Compare commits
9 Commits
confetti-p
...
rsoe-emerg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
584c4fce72 | ||
|
|
b0bb911103 | ||
|
|
111f71bcf5 | ||
|
|
2b1efac6ee | ||
|
|
94e0f05af5 | ||
|
|
eaa21589e6 | ||
|
|
207720cb30 | ||
|
|
9bf3c0602d | ||
|
|
a9f9ffd409 |
39
boot/boot.js
39
boot/boot.js
@@ -177,6 +177,7 @@ document: defaults to current document
|
||||
eventListeners: array of event listeners (this option won't work until $tw.utils.addEventListeners() has been loaded)
|
||||
*/
|
||||
$tw.utils.domMaker = function(tag,options) {
|
||||
var options = options || {};
|
||||
var doc = options.document || document;
|
||||
var element = doc.createElementNS(options.namespace || "http://www.w3.org/1999/xhtml",tag);
|
||||
if(options["class"]) {
|
||||
@@ -218,9 +219,34 @@ $tw.utils.error = function(err) {
|
||||
heading = dm("h1",{text: errHeading}),
|
||||
prompt = dm("div",{text: promptMsg, "class": "tc-error-prompt"}),
|
||||
message = dm("div",{text: err, "class":"tc-error-message"}),
|
||||
button = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
|
||||
form = dm("form",{children: [heading,prompt,message,button], "class": "tc-error-form"});
|
||||
closeButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
|
||||
downloadButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "download tiddlers" : $tw.language.getString("Buttons/EmergencyDownload/Caption") )})], "class": "tc-error-prompt"}),
|
||||
form = dm("form",{children: [heading,prompt,downloadButton,message,closeButton], "class": "tc-error-form"});
|
||||
document.body.insertBefore(form,document.body.firstChild);
|
||||
downloadButton.addEventListener("click",function(event) {
|
||||
if($tw && $tw.wiki) {
|
||||
var tiddlers = [];
|
||||
$tw.wiki.each(function(tiddler,title) {
|
||||
tiddlers.push(tiddler.fields);
|
||||
});
|
||||
var link = dm("a"),
|
||||
text = JSON.stringify(tiddlers);
|
||||
if(Blob !== undefined) {
|
||||
var blob = new Blob([text], {type: "text/html"});
|
||||
link.setAttribute("href", URL.createObjectURL(blob));
|
||||
} else {
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
}
|
||||
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
alert("Emergency tiddler download is not available");
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
},true);
|
||||
form.addEventListener("submit",function(event) {
|
||||
document.body.removeChild(form);
|
||||
event.preventDefault();
|
||||
@@ -1967,10 +1993,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
var value = tiddler[name];
|
||||
switch(fieldInfo.source) {
|
||||
case "subdirectories":
|
||||
value = path.relative(rootPath, filename).split('/').slice(0, -1);
|
||||
value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
|
||||
break;
|
||||
case "filepath":
|
||||
value = path.relative(rootPath, filename);
|
||||
value = path.relative(rootPath, filename).split(path.sep).join('/');
|
||||
break;
|
||||
case "filename":
|
||||
value = path.basename(filename);
|
||||
@@ -2438,6 +2464,7 @@ $tw.boot.initStartup = function(options) {
|
||||
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/vnd.microsoft.icon","base64",".ico",{flags:["image"]});
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
|
||||
$tw.utils.registerFileType("application/wasm","base64",".wasm");
|
||||
$tw.utils.registerFileType("application/font-woff","base64",".woff");
|
||||
$tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
|
||||
$tw.utils.registerFileType("application/font-woff2","base64",".woff2");
|
||||
@@ -2452,8 +2479,12 @@ $tw.boot.initStartup = function(options) {
|
||||
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
||||
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
|
||||
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.wordprocessingml.document","base64",".docx");
|
||||
$tw.utils.registerFileType("application/msword","base64",".doc");
|
||||
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","base64",".xlsx");
|
||||
$tw.utils.registerFileType("application/excel","base64",".xls");
|
||||
$tw.utils.registerFileType("application/vnd.ms-excel","base64",".xls");
|
||||
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.presentationml.presentation","base64",".pptx");
|
||||
$tw.utils.registerFileType("application/mspowerpoint","base64",".ppt");
|
||||
$tw.utils.registerFileType("text/x-bibtex","utf8",".bib",{deserializerType:"application/x-bibtex"});
|
||||
$tw.utils.registerFileType("application/x-bibtex","utf8",".bib");
|
||||
$tw.utils.registerFileType("application/epub+zip","base64",".epub");
|
||||
|
||||
@@ -28,6 +28,7 @@ Encryption/ClearPassword/Caption: clear password
|
||||
Encryption/ClearPassword/Hint: Clear the password and save this wiki without encryption
|
||||
Encryption/SetPassword/Caption: set password
|
||||
Encryption/SetPassword/Hint: Set a password for saving this wiki with encryption
|
||||
EmergencyDownload/Caption: download tiddlers as json
|
||||
ExportPage/Caption: export all
|
||||
ExportPage/Hint: Export all tiddlers
|
||||
ExportTiddler/Caption: export tiddler
|
||||
|
||||
@@ -289,7 +289,7 @@ exports.httpRequest = function(options) {
|
||||
return;
|
||||
}
|
||||
// Something went wrong
|
||||
options.callback($tw.language.getString("Error/XMLHttpRequest") + ": " + this.status,null,this);
|
||||
options.callback($tw.language.getString("Error/XMLHttpRequest") + ": " + this.status,this[returnProp],this);
|
||||
}
|
||||
};
|
||||
// Handle progress
|
||||
|
||||
@@ -155,6 +155,8 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
||||
};
|
||||
|
||||
LinkWidget.prototype.handleClickEvent = function(event) {
|
||||
// Force an error to try out the Red Screen Of Embarrassment
|
||||
var something = Everything;
|
||||
// Send the click on its way as a navigate event
|
||||
var bounds = this.domNodes[0].getBoundingClientRect();
|
||||
this.dispatchEvent({
|
||||
|
||||
@@ -4,17 +4,17 @@ type: application/json
|
||||
{
|
||||
"newTiddlerPosition": {"x": 360,"y": 100},
|
||||
"positions": {
|
||||
" ": {"x": 30,"y": 17,"w": 140,"h": 140, "r": -2},
|
||||
"Tiddlers": {"x": 60,"y": 15,"w": 140,"h": 140, "r": 10},
|
||||
"Links": {"x": 90,"y": 13,"w": 140,"h": 140, "r": -7},
|
||||
"Formatting": {"x": 120,"y": 18,"w": 140,"h": 140, "r": 5},
|
||||
"Images": {"x": 150,"y": 12,"w": 140,"h": 140, "r": -11},
|
||||
"Audio": {"x": 180,"y": 14,"w": 140,"h": 140, "r": 16},
|
||||
"Tags": {"x": 210,"y": 15,"w": 140,"h": 140, "r": 20},
|
||||
"Transclusion": {"x": 240,"y": 16,"w": 140,"h": 140, "r": -4},
|
||||
"Lists": {"x": 275,"y": 13,"w": 140,"h": 140, "r": 6},
|
||||
"Customisation": {"x": 310,"y": 19,"w": 140,"h": 140, "r": -5},
|
||||
"Plugins": {"x": 350,"y": 12,"w": 140,"h": 140, "r": 10},
|
||||
"Translations": {"x": 390,"y": 15,"w": 140,"h": 140, "r": 8}
|
||||
" ": {"x": 30,"y": 17,"w": 120,"h": 120, "r": -2},
|
||||
"Tiddlers": {"x": 60,"y": 15,"w": 120,"h": 120, "r": 10},
|
||||
"Links": {"x": 90,"y": 13,"w": 120,"h": 120, "r": -7},
|
||||
"Formatting": {"x": 120,"y": 18,"w": 120,"h": 120, "r": 5},
|
||||
"Images": {"x": 150,"y": 12,"w": 120,"h": 120, "r": -11},
|
||||
"Audio": {"x": 180,"y": 14,"w": 120,"h": 120, "r": 16},
|
||||
"Tags": {"x": 210,"y": 15,"w": 120,"h": 120, "r": 20},
|
||||
"Transclusion": {"x": 240,"y": 16,"w": 120,"h": 120, "r": -4},
|
||||
"Lists": {"x": 275,"y": 13,"w": 120,"h": 120, "r": 6},
|
||||
"Customisation": {"x": 310,"y": 19,"w": 120,"h": 120, "r": -5},
|
||||
"Plugins": {"x": 350,"y": 12,"w": 120,"h": 120, "r": 10},
|
||||
"Translations": {"x": 390,"y": 15,"w": 120,"h": 120, "r": 8}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
[
|
||||
{"title": " ", "text": "TiddlyWiki"}
|
||||
{"title": " ", "text": "[[TiddlyWiki]]"}
|
||||
]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
created: 20210101154635213
|
||||
modified: 20210110210929321
|
||||
modified: 20240131143350890
|
||||
tags: [[Community Themes]]
|
||||
title: "Notebook theme" by Nicolas Petton
|
||||
type: text/vnd.tiddlywiki
|
||||
url: https://nicolas.petton.fr/tw/notebook.html
|
||||
url: https://saqimtiaz.github.io/sq-tw/notebook.html
|
||||
|
||||
Notebook is a clean, uncluttered theme for ~TiddlyWiki.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user