mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
up
This commit is contained in:
+7
-8
@@ -23,10 +23,9 @@ get_info(function (info) {
|
|||||||
$('#apiUrl').val(info.apiUrl)
|
$('#apiUrl').val(info.apiUrl)
|
||||||
if (info.open_action === 'upload_image') {
|
if (info.open_action === 'upload_image') {
|
||||||
//打开的时候就是上传图片
|
//打开的时候就是上传图片
|
||||||
console.log(info.open_content)
|
|
||||||
uploadImage(info.open_content)
|
uploadImage(info.open_content)
|
||||||
} else {
|
} else {
|
||||||
$('#content').val(info.open_content)
|
$("textarea[name=text]").val(info.open_content)
|
||||||
}
|
}
|
||||||
|
|
||||||
//从localstorage 里面读取数据
|
//从localstorage 里面读取数据
|
||||||
@@ -34,9 +33,9 @@ get_info(function (info) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//监听输入结束,保存未发送内容到本地
|
//监听输入结束,保存未发送内容到本地
|
||||||
$('#content').blur(function () {
|
$("textarea[name=text]").blur(function () {
|
||||||
chrome.storage.sync.set(
|
chrome.storage.sync.set(
|
||||||
{ open_action: 'save_text', open_content: $('#content').val() }
|
{ open_action: 'save_text', open_content: $("textarea[name=text]").val() }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -59,7 +58,7 @@ document.addEventListener('paste', function (e) {
|
|||||||
|
|
||||||
function initDrag() {
|
function initDrag() {
|
||||||
var file = null
|
var file = null
|
||||||
var obj = $('#content')[0]
|
var obj = $("textarea[name=text]")[0]
|
||||||
obj.ondragenter = function (ev) {
|
obj.ondragenter = function (ev) {
|
||||||
if (ev.target.className === 'common-editor-inputer') {
|
if (ev.target.className === 'common-editor-inputer') {
|
||||||
$.message({
|
$.message({
|
||||||
@@ -454,7 +453,7 @@ function get_info(callback) {
|
|||||||
|
|
||||||
//发送操作
|
//发送操作
|
||||||
$('#content_submit_text').click(function () {
|
$('#content_submit_text').click(function () {
|
||||||
var contentVal = $('#content').val()
|
var contentVal = $("textarea[name=text]").val()
|
||||||
if(contentVal){
|
if(contentVal){
|
||||||
sendText()
|
sendText()
|
||||||
}else{
|
}else{
|
||||||
@@ -468,7 +467,7 @@ function sendText() {
|
|||||||
//信息满足了
|
//信息满足了
|
||||||
$.message({message: '发送中~~'})
|
$.message({message: '发送中~~'})
|
||||||
//$("#content_submit_text").attr('disabled','disabled');
|
//$("#content_submit_text").attr('disabled','disabled');
|
||||||
let content = $('#content').val()
|
let content = $("textarea[name=text]").val()
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:info.apiUrl,
|
url:info.apiUrl,
|
||||||
type:"POST",
|
type:"POST",
|
||||||
@@ -489,7 +488,7 @@ function sendText() {
|
|||||||
message: '发送成功!😊'
|
message: '发送成功!😊'
|
||||||
})
|
})
|
||||||
//$("#content_submit_text").removeAttr('disabled');
|
//$("#content_submit_text").removeAttr('disabled');
|
||||||
$('#content').val('')
|
$("textarea[name=text]").val('')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},error:function(err){//清空open_action(打开时候进行的操作),同时清空open_content
|
},error:function(err){//清空open_action(打开时候进行的操作),同时清空open_content
|
||||||
|
|||||||
Reference in New Issue
Block a user