From a39d4b9a2af5e1743a34e0b985aa54b8d798d76e Mon Sep 17 00:00:00 2001 From: lmm214 Date: Fri, 10 Mar 2023 22:05:54 +0800 Subject: [PATCH] =?UTF-8?q?2023.03.10=20=E4=BF=AE=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=90=8E=E8=B0=83=E7=94=A8=E6=9C=80=E6=96=B0=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=20Memos=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ js/oper.js | 44 ++++++++++++++++++-------------------------- manifest.json | 2 +- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index a4459e4..6d9c802 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Chrome 应用商店:' }); tagDom += '' - //console.log(tagDom) $("#taglist").html(tagDom).slideToggle(500) }); } else { @@ -364,7 +343,6 @@ $('#random').click(function () { var creatorId = data.data[0].creatorId var randomUrl1 = info.apiUrl.replace(/api\/memo.*/,'api/memo/stats?creatorId=')+creatorId $.get(randomUrl1,function(data){ - console.log(data.data.length) let randomNum = Math.floor(Math.random() * (data.data.length)) + 1; var randomUrl2 = info.apiUrl+'&rowStatus=NORMAL&limit=1&offset='+randomNum $.get(randomUrl2,function(data){ @@ -497,7 +475,6 @@ $('#blog_info_edit').click(function () { $('#blog_info').slideToggle() }) -//发送操作 $('#content_submit_text').click(function () { var contentVal = $("textarea[name=text]").val() if(contentVal){ @@ -507,10 +484,25 @@ $('#content_submit_text').click(function () { } }) +function getOne(memosId){ + get_info(function (info) { + if (info.apiUrl) { + $("#randomlist").html('').hide() + var getUrl = info.apiUrl.replace(/api\/memo(.*)/,'api/memo/'+memosId+'$1') + $.get(getUrl,function(data){ + randDom(data.data) + }); + } else { + $.message({ + message: '请先填写好 API 链接' + }) + } + }) +} + function sendText() { get_info(function (info) { if (info.status) { - //信息满足了 $.message({message: '发送中~~'}) //$("#content_submit_text").attr('disabled','disabled'); let content = $("textarea[name=text]").val() @@ -537,7 +529,7 @@ function sendText() { dataType:"json", success: function(result){ //发送成功 - getOne() + getOne(result.data.id) chrome.storage.sync.set( { open_action: '', open_content: '',resourceIdList:''}, function () { @@ -553,7 +545,7 @@ function sendText() { { open_action: '', open_content: '',resourceIdList:'' }, function () { $.message({ - message: '网络问题,发送失败!😭(记得点下小锁图标,设置一下状态哦)' + message: '网络问题,发送失败!😭' }) } )}, diff --git a/manifest.json b/manifest.json index cbb3a9f..72b5804 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "__MSG_extName__", - "version": "2023.03.09", + "version": "2023.03.10", "action": { "default_popup": "popup.html", "default_icon": "assets/logo_24x24.png",