diff --git a/README.md b/README.md index de992ab..80daa69 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## 更新日志 +2023.02.07 新增发布后显示最新一条 Memo ,具体一条新增归档按钮。 + 2023.02.06 新增搜索按钮;新增图片灯箱。  diff --git a/css/main.css b/css/main.css index 45ed61f..7361161 100644 --- a/css/main.css +++ b/css/main.css @@ -18,6 +18,7 @@ input::placeholder ,.common-editor-inputer::placeholder { input:focus::placeholder ,.common-editor-inputer:focus::placeholder { color: #d3d3d3 } +.title{cursor: pointer;} .body{ min-width:460px; background-color: #f6f5f4; @@ -51,7 +52,10 @@ a{color: #555;} padding: 1rem; } .random-time{font-size:13px;margin-bottom:6px;color: #999;font-style:italic;} -#random-link{float: right;margin-top: -5px;cursor: pointer;} +.random-time span{float: right;margin-top: -3px;cursor: pointer;} +.random-time span svg.icon{width:15px;height:15px;padding:4px 6px 0;opacity: 0.6;margin-left:4px;} +.random-time span svg.icon:hover{opacity: 1;} + .random-image{width:180px;height:180px;max-width:100%;object-fit: cover;border-radius: .25rem;margin:5px 5px 5px 0;} .random-content{width:100%; max-width:100%; diff --git a/js/oper.js b/js/oper.js index e381cfc..7960e99 100644 --- a/js/oper.js +++ b/js/oper.js @@ -109,7 +109,7 @@ function uploadImage(data) { if (info.status) { formData.append('file', data) $.ajax({ - url: info.apiUrl.replace(/api\/memo/,'api/resource'), + url: info.apiUrl.replace(/api\/memo/,'api/resource/blob'), data: formData, type: 'post', cache: false, @@ -175,9 +175,30 @@ $('#saveKey').click(function () { ) }) +$('#getone').click(function () { + getOne() +}) + +function getOne(){ + get_info(function (info) { + if (info.apiUrl) { + $("#randomlist").html('').hide() + var getUrl = info.apiUrl+'&rowStatus=NORMAL&limit=1' + $.get(getUrl,function(data){ + var getData = data.data[0] + randDom(getData) + }); + } else { + $.message({ + message: '请先填写好 API 链接' + }) + } + }) +} + $('#tags').click(function () { get_info(function (info) { - if (info.status) { + if (info.apiUrl) { var tagUrl = info.apiUrl.replace(/api\/memo/,'api/tag') var tagDom = "" $.get(tagUrl,function(data){ @@ -218,7 +239,7 @@ $('#search').click(function () { const fuse = new Fuse(data.data, options); var searchData = fuse.search(pattern) for(var i=0;i < searchData.length;i++){ - searchDom += '