提交 2aa310d5 编写于 作者: 智布道's avatar 智布道 👁

💬 更新云存储选择的逻辑

上级 2e7a308b
......@@ -120,7 +120,7 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇
- [ ] 5. 待续...
...
# 已经在用OneBlog的网站 ( 排名按照留言先后顺序 )
# 在用OneBlog的网站 (排名按照留言先后顺序 )
- [张亚东博客](https://www.zhyd.me)
- [攻城狮不是猫博客](http://www.jsdblog.com)
- [刘辉辉的博客](http://www.axxo.top)
......@@ -133,6 +133,11 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇
- [https://blog.itourshare.net/](https://blog.itourshare.net/)
- [码农擎天柱](http://blog.qinlei.vip/)
- [陈晓雷的博客](http://www.csxll.top)
- [小猩博客](http://www.cmhblog.com/)
- [宋高俊博客](http://www.senghor.cn/)
- [Li Pan's 博客](http://www.lipan.xyz/)
- [MTR小站](https://www.itmtr.cn/)
- [老揭博客](http://www.laojieblog.com/)
- 更多待续...
烦请各位使用OneBlog的朋友,能留下你的网址(没别的意思,只是看看有多少人而已) - [点这儿](https://gitee.com/yadong.zhang/DBlog/issues/ILIAQ)
......
......@@ -583,16 +583,16 @@
<@footer>
<script type="text/javascript">
$(function () {
var oldStorageType;
var oldStorageType, firstLoad = true;
$.ajax({
url: '/config/get',
type: 'POST',
success: function (json) {
var data = json.data;
oldStorageType = data.storageType;
$("#myTabContent").find("input, select, textarea").each(function () {
clearText($(this), this.type, data);
});
oldStorageType = data.storageType;
changeMaintenance(data.maintenance && data.maintenance == 1, data.maintenance);
data.zfbPraiseCode && $("#zfbPraiseCodePreview").html('<img src="' + data.fileStoragePath + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
data.wxPraiseCode && $("#wxPraiseCodePreview").html('<img src="' + data.fileStoragePath + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
......@@ -620,24 +620,32 @@
if (!$("#" + thisValue).hasClass("hide")) {
return;
}
if(oldStorageType !== thisValue) {
$.alert.confirm("您确定要切换云存储类型吗?切换后原文件将不可访问!", function () {
oldStorageType = thisValue;
$(".storage-box").each(function () {
var $box = $(this);
if ($box.attr("id") === thisValue) {
$box.removeClass("hide").find("input").removeAttr("disabled").removeAttr("readonly");
} else {
$box.addClass("hide").find("input").attr("disabled", "disabled").attr("readonly", "readonly");
}
});
}, function () {
$("#tab_storage input[name=storageType]").each(function () {
var $this = $(this);
$this.iCheck((oldStorageType !== $this.val()) ? 'uncheck' : 'check');
});
function changeStorageBox() {
$(".storage-box").each(function () {
var $box = $(this);
if ($box.attr("id") === thisValue) {
$box.removeClass("hide").find("input").removeAttr("disabled").removeAttr("readonly");
} else {
$box.addClass("hide").find("input").attr("disabled", "disabled").attr("readonly", "readonly");
}
});
}
if(firstLoad) {
changeStorageBox();
firstLoad = false;
} else {
if(oldStorageType !== thisValue) {
$.alert.confirm("您确定要切换云存储类型吗?切换后原文件将不可访问!", function () {
oldStorageType = thisValue;
changeStorageBox();
}, function () {
$("#tab_storage input[name=storageType]").each(function () {
var $this = $(this);
$this.iCheck((oldStorageType !== $this.val()) ? 'uncheck' : 'check');
});
});
}
}
});
$("#tab_setting input[name=maintenance]").on('ifChanged', function (event) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册