1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-31 23:53:00 +00:00

Merge branch 'master' into parameterised-transclusions

This commit is contained in:
jeremy@jermolene.com
2022-08-02 17:49:28 +01:00
49 changed files with 246 additions and 58 deletions

View File

@@ -359,8 +359,9 @@ Server.prototype.listen = function(port,host,prefix) {
}
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
server.on("listening",function() {
var address = server.address();
$tw.utils.log("Serving on " + self.protocol + "://" + address.address + ":" + address.port + prefix,"brown/orange");
var address = server.address(),
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix;
$tw.utils.log("Serving on " + url,"brown/orange");
$tw.utils.log("(press ctrl-C to exit)","red");
});
// Listen

View File

@@ -62,12 +62,14 @@ function loadIFrame(url,callback) {
Unload library iframe for given url
*/
function unloadIFrame(url){
$tw.utils.each(document.getElementsByTagName('iframe'), function(iframe) {
var iframes = document.getElementsByTagName('iframe');
for(var t=iframes.length-1; t--; t>=0) {
var iframe = iframes[t];
if(iframe.getAttribute("library") === "true" &&
iframe.getAttribute("src") === url) {
iframe.parentNode.removeChild(iframe);
}
});
}
}
function saveIFrameInfoTiddler(iframeInfo) {

View File

@@ -111,6 +111,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt);
}
if(this.lazyLoading && tag === "img") {
domNode.setAttribute("loading",this.lazyLoading);
}
// Add classes when the image loads or fails
$tw.utils.addClass(domNode,"tc-image-loading");
domNode.addEventListener("load",function() {
@@ -137,6 +140,7 @@ ImageWidget.prototype.execute = function() {
this.imageClass = this.getAttribute("class");
this.imageTooltip = this.getAttribute("tooltip");
this.imageAlt = this.getAttribute("alt");
this.lazyLoading = this.getAttribute("loading");
};
/*