OcttKB Cross-Repo Sync (HTML to Raw)

This commit is contained in:
2023-03-24 11:58:33 +00:00
parent e0528394e6
commit dc21b3c71c
1537 changed files with 93 additions and 1028 deletions

View File

@ -0,0 +1,39 @@
/*\
module-type: library
This handles all logging and alerts Relink emits.
\*/
exports.getString = function(outputType, title, options) {
title = "$:/plugins/flibbles/relink/language/" + title;
return options.wiki.renderTiddler(outputType, title, options);
};
var logger;
exports.warn = function(string, options) {
if (!logger) {
logger = new $tw.utils.Logger("Relinker");
}
logger.alert(string);
};
exports.reportFailures = function(failureList, options) {
var alertString = this.getString("text/html", "Error/ReportFailedRelinks", options)
var alreadyReported = Object.create(null);
var reportList = [];
$tw.utils.each(failureList, function(f) {
if (!alreadyReported[f]) {
if ($tw.browser) {
// This might not make the link if the title is complicated.
// Whatever.
reportList.push("\n* [[" + f + "]]");
} else {
reportList.push("\n* " + f);
}
alreadyReported[f] = true;
}
});
this.warn(alertString + "\n" + reportList.join(""));
};