mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-04-25 03:58:37 +09:00
v3
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
chrome.contextMenus.create({
|
||||
title: "记下 “%s”",
|
||||
contexts: ['selection'],
|
||||
onclick: function(info, tab){
|
||||
//设定打开页面的一些初始值
|
||||
console.log(info);
|
||||
chrome.storage.sync.set({open_action: "save_text",open_content:info.selectionText}, function() {
|
||||
chrome.windows.create({
|
||||
url: chrome.extension.getURL("html/popup.html"),
|
||||
left: 50,
|
||||
top: 50,
|
||||
width: 550,
|
||||
height: 300,
|
||||
type: "popup"
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
+4
-3
@@ -48,7 +48,7 @@ $('#tags').click(function () {
|
||||
tagDom += '<span class="item-container">#'+obj+'</span>'
|
||||
});
|
||||
//console.log(tagDom)
|
||||
$("#taglist").html(tagDom).slideToggle()
|
||||
$("#taglist").html(tagDom).slideToggle(500)
|
||||
});
|
||||
} else {
|
||||
$.message({
|
||||
@@ -62,15 +62,16 @@ $(document).on("click",".item-container",function () {
|
||||
var tagHtml = $(this).text()+" "
|
||||
add(tagHtml);
|
||||
})
|
||||
|
||||
$('#getlink').click(function () {
|
||||
chrome.tabs.getSelected(null, function (tab) {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, ([tab]) => {
|
||||
var linkHtml = " ["+tab.title+"]("+tab.url+") "
|
||||
if(tab.url){
|
||||
add(linkHtml);
|
||||
}else{
|
||||
$.message({message: '获取失败 😂'})
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
function add(str) {
|
||||
|
||||
Reference in New Issue
Block a user