Skip to content

Commit

Permalink
紧急修复
Browse files Browse the repository at this point in the history
- [修复]ajax get模式下callback不触发的问题
- [修复]fullyLoad只传一个参数时报错问题
- [修复]parent, next, prev返回对象不是VelFun对象的BUG
  • Loading branch information
velade authored May 29, 2024
1 parent 27dbfb6 commit 675cb9f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Help/Developer Manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<title>VelFun4开发者手册 - 4.50</title>
<title>VelFun4开发者手册 - 4.51</title>
<link rel="stylesheet" href="help_data/styles/style.css?ver=2.50" />
<link rel="stylesheet" href="help_data/styles/w3.css" />
<script src="help_data/scripts/velfun4.js?ver=4.50" type="text/javascript"></script>
Expand Down Expand Up @@ -43,7 +43,7 @@
<body>
<div class="top">
<img src="help_data/images/Logo.png" alt="VelFun4" />
<div class="version">Ver 4.50</div>
<div class="version">Ver 4.51</div>
</div>
<div class="menu">
<div class="type">
Expand Down
18 changes: 10 additions & 8 deletions Help/help_data/scripts/velfun4.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/********************
腳本名:VelFun
版本號:4-4.50
版本號:4-4.51
通 道:Release
作 者:龍翔翎(Velade)
更新日期:2024-05-29
********************/
; (function (window, undefined) {
const isOffline = !location.origin.match(/^(http:|https:)\/\//);
const version = "4-4.50";
const version = "4-4.51";
const channel = "Release";
const author = "Velade";
const releaseDate = "2024-05-29";
Expand Down Expand Up @@ -966,7 +966,7 @@
for (let i = 0; i < times; i++) {
parent = parent.parentElement;
}
return parent;
return _(parent);
}
/**
* 返回元素的下一个元素,注意不是节点,因此#TEXT节点不会被捕获
Expand All @@ -980,7 +980,7 @@
for (let i = 0; i < times; i++) {
next = next.nextElementSibling;
}
return next;
return _(next);
}
/**
* 返回元素的上一个元素,注意不是节点,因此#TEXT节点不会被捕获
Expand All @@ -994,7 +994,7 @@
for (let i = 0; i < times; i++) {
prev = prev.previousElementSibling;
}
return prev;
return _(prev);
}
/**
* 遍历VelFun对象
Expand Down Expand Up @@ -1953,10 +1953,12 @@
fetch(url)
.then(response => response.text())
.then(text => {
resolve(text);
if (typeof callback == "function") callback(text);
else resolve(text);
})
.catch(reason => {
reject(reason)
if (typeof callback == "function") callback(text);
else reject(reason)
})
} else if (method.toLowerCase() == "post") {
fetch(url, { method: 'POST', body: data })
Expand Down Expand Up @@ -2336,7 +2338,7 @@
* @returns {Promise<function>} 返回Promise对象
*/

velfun.test.fullyLoad = async function (area, callback, logs = true) {
velfun.test.fullyLoad = async function (area, callback = ()=>{}, logs = true) {
if (typeof callback == "boolean") {
logs = callback;
callback = () => { };
Expand Down
18 changes: 10 additions & 8 deletions velfun4.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/********************
腳本名:VelFun
版本號:4-4.50
版本號:4-4.51
通 道:Release
作 者:龍翔翎(Velade)
更新日期:2024-05-29
********************/
; (function (window, undefined) {
const isOffline = !location.origin.match(/^(http:|https:)\/\//);
const version = "4-4.50";
const version = "4-4.51";
const channel = "Release";
const author = "Velade";
const releaseDate = "2024-05-29";
Expand Down Expand Up @@ -966,7 +966,7 @@
for (let i = 0; i < times; i++) {
parent = parent.parentElement;
}
return parent;
return _(parent);
}
/**
* 返回元素的下一个元素,注意不是节点,因此#TEXT节点不会被捕获
Expand All @@ -980,7 +980,7 @@
for (let i = 0; i < times; i++) {
next = next.nextElementSibling;
}
return next;
return _(next);
}
/**
* 返回元素的上一个元素,注意不是节点,因此#TEXT节点不会被捕获
Expand All @@ -994,7 +994,7 @@
for (let i = 0; i < times; i++) {
prev = prev.previousElementSibling;
}
return prev;
return _(prev);
}
/**
* 遍历VelFun对象
Expand Down Expand Up @@ -1953,10 +1953,12 @@
fetch(url)
.then(response => response.text())
.then(text => {
resolve(text);
if (typeof callback == "function") callback(text);
else resolve(text);
})
.catch(reason => {
reject(reason)
if (typeof callback == "function") callback(text);
else reject(reason)
})
} else if (method.toLowerCase() == "post") {
fetch(url, { method: 'POST', body: data })
Expand Down Expand Up @@ -2336,7 +2338,7 @@
* @returns {Promise<function>} 返回Promise对象
*/

velfun.test.fullyLoad = async function (area, callback, logs = true) {
velfun.test.fullyLoad = async function (area, callback = ()=>{}, logs = true) {
if (typeof callback == "boolean") {
logs = callback;
callback = () => { };
Expand Down

0 comments on commit 675cb9f

Please sign in to comment.