mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
2023.03.10 修复发布后调用最新一条 Memos。
This commit is contained in:
@@ -8,6 +8,8 @@ Chrome 应用商店:<https://chrome.google.com/webstore/detail/memos-bber/cbhj
|
||||
|
||||
## 更新日志
|
||||
|
||||
2023.03.10 修复发布后调用最新一条 Memos。
|
||||
|
||||
2023.03.09 新增右键发送文本至 Memos 输入框。
|
||||
|
||||

|
||||
|
||||
+18
-26
@@ -126,7 +126,6 @@ function initDrag() {
|
||||
obj.ondragleave = function (ev) {
|
||||
ev.preventDefault()
|
||||
if (ev.target.className === 'common-editor-inputer') {
|
||||
console.log('ondragleave' + ev.target.tagName)
|
||||
$.message({
|
||||
message: '取消上传'
|
||||
})
|
||||
@@ -159,9 +158,7 @@ function uploadImage(data) {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: 'json',
|
||||
|
||||
success: function (result) {
|
||||
console.log(result)
|
||||
if (result.data.id) {
|
||||
//获取到图片
|
||||
relistNow.push(result.data.id)
|
||||
@@ -224,23 +221,6 @@ $('#opensite').click(function () {
|
||||
})
|
||||
})
|
||||
|
||||
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.apiUrl) {
|
||||
@@ -252,7 +232,6 @@ $('#tags').click(function () {
|
||||
tagDom += '<span class="item-container">#'+obj+'</span>'
|
||||
});
|
||||
tagDom += '<svg id="hideTag" class="hidetag" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M78.807 362.435c201.539 314.275 666.962 314.188 868.398-.241 16.056-24.99 13.143-54.241-4.04-62.54-17.244-8.377-40.504 3.854-54.077 24.887-174.484 272.338-577.633 272.41-752.19.195-13.573-21.043-36.874-33.213-54.113-24.837-17.177 8.294-20.06 37.545-3.978 62.536z" fill="#fff"/><path d="M894.72 612.67L787.978 494.386l38.554-34.785 106.742 118.251-38.554 34.816zM635.505 727.51l-49.04-147.123 49.255-16.41 49.054 147.098-49.27 16.435zm-236.18-12.001l-49.568-15.488 43.29-138.48 49.557 15.513-43.28 138.455zM154.49 601.006l-38.743-34.565 95.186-106.732 38.763 34.566-95.206 106.731z" fill="#fff"/></svg>'
|
||||
//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: '网络问题,发送失败!😭'
|
||||
})
|
||||
}
|
||||
)},
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user