mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-22 09:18:44 +00:00
Merge branch 'master' into feat-ai-tools
This commit is contained in:
@@ -82,6 +82,10 @@ ClassicStoryView.prototype.remove = function(widget) {
|
|||||||
removeElement = function() {
|
removeElement = function() {
|
||||||
widget.removeChildDomNodes();
|
widget.removeChildDomNodes();
|
||||||
};
|
};
|
||||||
|
// Blur the focus if it is within the descendents of the node we are removing
|
||||||
|
if($tw.utils.domContains(targetElement,targetElement.ownerDocument.activeElement)) {
|
||||||
|
targetElement.ownerDocument.activeElement.blur();
|
||||||
|
}
|
||||||
// Abandon if the list entry isn't a DOM element (it might be a text node)
|
// Abandon if the list entry isn't a DOM element (it might be a text node)
|
||||||
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE) {
|
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE) {
|
||||||
removeElement();
|
removeElement();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*\
|
/*\
|
||||||
title: test-tags-operator.js
|
title: test-tags-operator.js
|
||||||
type: application/javascript
|
type: application/javascript
|
||||||
tags: [[$:/tags/test-specX]]
|
tags: [[$:/tags/test-spec]]
|
||||||
|
|
||||||
Tests the tagging mechanism.
|
Tests the tagging mechanism.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
created: 20240710161501472
|
created: 20240710161501472
|
||||||
list-after: $:/core/ui/ViewTemplate/body
|
list-after:
|
||||||
modified: 20240713020832439
|
modified: 20240719201317702
|
||||||
tags: $:/tags/ViewTemplate
|
tags: $:/tags/ViewTemplate
|
||||||
title: $:/editions/tw5.com/empty-tag-node-template
|
title: $:/editions/tw5.com/empty-tag-node-template
|
||||||
type:
|
type:
|
||||||
|
|
||||||
<$list filter='[<storyTiddler>!has[text]] :filter[tagging[]]'>
|
<$list filter='[<storyTiddler>!has[text]!has[tags]] :filter[tagging[]]'>
|
||||||
The following tiddlers are tagged with <<tag>>:
|
The following tiddlers are tagged with <<tag>>:
|
||||||
</$list>
|
</$list>
|
||||||
<<list-links filter:"[<storyTiddler>!has[text]tagging[]]" class:"multi-columns">>
|
<<list-links filter:"[<storyTiddler>!has[text]!has[tags]tagging[]]" class:"multi-columns">>
|
||||||
@@ -13,15 +13,15 @@ Text editor operation to make a markdown link
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
exports["make-markdown-link"] = function(event,operation) {
|
exports["make-markdown-link"] = function(event,operation) {
|
||||||
var rx = /[()\\]/g, rs = '\\$&';
|
var rx = /[()<>\\]/g, rs = '\\$&';
|
||||||
|
|
||||||
if(operation.selection) {
|
if(operation.selection) {
|
||||||
var desc = operation.selection.replace(/[\[\]\\]/g, rs);
|
var desc = operation.selection.replace(/[\[\]\\]/g, rs);
|
||||||
|
|
||||||
if(event.paramObject.text.indexOf("://") !== -1) {
|
if(event.paramObject.text.indexOf("://") !== -1) {
|
||||||
operation.replacement = "[" + desc + "](" + event.paramObject.text.replace(rx, rs) + ")";
|
operation.replacement = "[" + desc + "](" + event.paramObject.text.replace(/[()\\]/g, rs) + ")";
|
||||||
} else {
|
} else {
|
||||||
operation.replacement = "[" + desc + "](#" + encodeURIComponent(event.paramObject.text).replace(rx, rs) + ")";
|
operation.replacement = "[" + desc + "](<#" + event.paramObject.text.replace(rx, rs) + ">)";
|
||||||
}
|
}
|
||||||
operation.cutStart = operation.selStart;
|
operation.cutStart = operation.selStart;
|
||||||
operation.cutEnd = operation.selEnd;
|
operation.cutEnd = operation.selEnd;
|
||||||
@@ -31,7 +31,7 @@ exports["make-markdown-link"] = function(event,operation) {
|
|||||||
return encodeURI(m);
|
return encodeURI(m);
|
||||||
}) + ">";
|
}) + ">";
|
||||||
} else {
|
} else {
|
||||||
operation.replacement = "[](#" + encodeURIComponent(event.paramObject.text).replace(rx, rs) + ")";
|
operation.replacement = "[](<#" + event.paramObject.text.replace(rx, rs) + ">)";
|
||||||
}
|
}
|
||||||
operation.cutStart = operation.selStart;
|
operation.cutStart = operation.selStart;
|
||||||
operation.cutEnd = operation.selEnd;
|
operation.cutEnd = operation.selEnd;
|
||||||
|
|||||||
Reference in New Issue
Block a user