1
0
mirror of https://github.com/Dreamer-Paul/Pio.git synced 2025-04-22 19:22:36 +08:00

Feat: Custom Content Title Support ()

* 调整 Custom 类型为 read 及 link 的文字获取方式,有 title 属性则取 title 属性值,无则取默认的 innerText

Co-authored-by: Wenbin.Wang <WenBin.Wang@gshopper.com>
This commit is contained in:
fantasticbin 2022-08-03 18:51:35 +08:00 committed by GitHub
parent 37a1d9a8be
commit 8511d884d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,12 +197,14 @@ var Paul_Pio = function (prop) {
for(var j = 0; j < e.length; j++){
if(t.type === "read"){
e[j].onmouseover = function () {
modules.render("想阅读 %t 吗?".replace(/%t/, "“" + this.innerText + "”"));
var text = this.getAttribute("title") || this.innerText;
modules.render("想阅读 %t 吗?".replace(/%t/, "“" + text + "”"));
}
}
else if(t.type === "link"){
e[j].onmouseover = function () {
modules.render("想了解一下 %t 吗?".replace(/%t/, "“" + this.innerText + "”"));
var text = this.getAttribute("title") || this.innerText;
modules.render("想了解一下 %t 吗?".replace(/%t/, "“" + text + "”"));
}
}
else if(t.text){