Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
eallion committed Jun 26, 2021
0 parents commit f28287d
Show file tree
Hide file tree
Showing 15 changed files with 705 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
Binary file added 128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Charles Chin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 说明
一个通过浏览器插件发布哔哔的插件,同时支持拖拽、粘贴上传图片到7bu图床。

此版本为代发布版本,未修改任何内容。原作者:[DreamyTZK](https://www.antmoe.com/)

请期待后续改进版本。

[![UV4C4ybeBTsZt43U4xis](assets/UV4C4ybeBTsZt43U4xis.png)](https://chrome.google.com/webstore/detail/ispeak-bber%E6%97%B6%E5%85%89%E6%9C%BA/mmehomnjakoijcfmmofbmkaigcdkkbke)
22 changes: 22 additions & 0 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"actionTitle": {
"description": "按钮标题",
"message": "发送哔哔"
},
"clipperImageMenu": {
"description": "菜单(选中)",
"message": "发送选中图片"
},
"extDescription": {
"description": "扩展描述",
"message": "一键发送灵感时刻,珍藏你的记忆"
},
"extName": {
"description": "扩展名称",
"message": "iSpeak-bber时光机"
},
"selectionMenu": {
"description": "菜单(选中)",
"message": "发送选中内容"
}
}
Binary file added assets/UV4C4ybeBTsZt43U4xis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo_24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 173 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
.hide{
display: none;
}


.m-b-1{
margin-bottom: 10px;
}

.m-t-1{
margin-top: 10px;
}
.p-l-2{
padding-left: 20px;
}
.p-r-2{
padding-right: 20px;
}

input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], input[type="range"], input[type="date"], input[type="month"], input[type="week"], input[type="time"], input[type="datetime"], input[type="datetime-local"], input[type="color"], textarea {
color: #666;
border: none;
border-radius: 3px;
padding: 3px;
}

.label{
margin: 0;
margin-bottom: 10px;
font-size: 13px;
color: #697384;
}
body, button, input, select, optgroup, textarea {
color: #404040;
font-family: eafont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,STHeiti,WenQuanYi Micro Hei,Helvetica,Arial,sans-serif;
font-size: 16px;
font-size: 1rem;
line-height: 1.5;
}

#blog_info{
min-width: 50px;
min-height: 32px;
padding: 1px;
text-align: left;
white-space: normal;
background-color: #ffffff;
background-clip: padding-box;
-moz-box-shadow: 3px 3px 15px #aebfff2b;
-webkit-box-shadow: 3px 3px 15px #aebfff2b;
box-shadow: 3px 3px 15px #aebfff2b;
border-radius: 2px;
padding: 20px;
}
.body{
min-width: 350px;
}

.btn{
transition: box-shadow .3s,background .3s;
background-color: #ecf0f6;
color: #697384;
font-size: 13px;
line-height: 13px;
font-weight: 100;
padding: 9px 10px;
border-radius: 4px;
text-decoration: none;
display: -ms-inline-flexbox;
display: inline-flex;
-ms-flex-align: center;
align-items: center;
cursor: pointer;
}

.btn:hover {
background-color: #e3e9f3;
}

.textarea{
outline: none;
border: 1px solid #f9f9ff;
background: #ecf0f6;
min-height: 80px;
padding: 10px 12px;
font-size: 13px;
color: #72719c;
width: 95%;
}
.input{
padding: 5px 12px!important;
width: 95%;
outline: none;
background: #ecf0f6;
border-color: #eaebff;
resize: none;
font-size: 13px;
height: 25px;
}

.tip{
margin-left: 36%;
max-width: 640px;
position: fixed;
text-align: center;
top: 15px;
width: 58%;
z-index: 10001;
left: 50%;
margin-left: -320px;
}

.tip-info{
background: -webkit-gradient(linear,left top,right top,from(#9c51ff),to(#816bff));
background: -webkit-linear-gradient(90deg,#9c51ff,#816bff);
background: linear-gradient(90deg,#9c51ff,#816bff);
-moz-box-shadow: 3px 3px 20px #d7ceff38;
-webkit-box-shadow: 3px 3px 20px #d7ceff38;
box-shadow: 3px 3px 20px #d7ceff38;
color: #fff;
font-size: 14px;
padding: 18px 40px;
display: inline-block;
border-radius: 3px;
margin: 0;
line-height: 1;
font-weight: 300;
}

@-webkit-keyframes bounceIn {
0% {
opacity: 0;
-webkit-transform: scale(.3);
}
50% {
opacity: 1;
-webkit-transform: scale(1);
}
70% {
-webkit-transform: scale(.95);
}
100% {
-webkit-transform: scale(1);
}
}

@keyframes bounceIn {
0% {
opacity: 0;
transform: scale(.3);
}
50% {
opacity: 1;
transform: scale(1);
}
70% {
transform: scale(.95);
}
100% {
transform: scale(1);
}
}

.bounceIn {
-webkit-animation-name: bounceIn;
animation-name: bounceIn;
}
.animate {
-webkit-animation-duration: .3s;
animation-duration: .3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
94 changes: 94 additions & 0 deletions html/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>bber发射台</title>
<link rel="stylesheet" href="../css/main.css" />
</head>
<body class="p-l-2 p-r-2 body">
<div class="btn" id="blog_info_edit">绑定信息修改</div>
<div id="blog_info" class="m-b-1">
<div>
<label for="apiUrl" class="label">输入接口地址</label>
<input
id="apiUrl"
class="m-t-1 m-b-1 input"
name="apiUrl"
type="text"
value=""
maxlength="245"
placeholder=""
required
/>
</div>

<div>
<label for="key" class="label">输入Key</label>
<input
id="key"
class="m-t-1 m-b-1 input"
name="key"
type="text"
value=""
maxlength="245"
placeholder=""
required
/>
</div>
<div>
<label for="pic7bu" class="label">输入7bu图床Token</label>
<input
id="pic7bu"
class="m-t-1 m-b-1 input"
name="pic7bu"
type="text"
value=""
maxlength="245"
placeholder="7不图床的token,不输入则匿名上传"
/>
</div>

<div class="btn" type="submit" name="submit" id="saveKey">
<span class="text">保存绑定信息</span>
</div>
</div>

<div>
<label for="from" class="label">输入From</label>
<input
id="from"
class="m-t-1 m-b-1 input"
name="from"
type="text"
value="Chrome"
placeholder="输入该说说的来源,对应字段from"
maxlength="245"
placeholder=""
required
/>
</div>
<div class="m-t-1">
<textarea
class="textarea"
rows="5"
name="text"
id="content"
placeholder="输入你的灵感瞬间..."
required=""
></textarea>
</div>

<div class="btn" type="submit" name="submit" id="submit">
<span id="content_submit_text" class="text">发 表</span>
</div>

<script src="../js/jquery.min.js"></script>
<script src="../js/message.js"></script>
<script src="../js/oper.js"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions js/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: 420,
height: 200,
type: "popup"
});
});
}
});

chrome.contextMenus.create({
title: "发送这张图片到时光机",
contexts: ['image'],
onclick: function(info, tab){
console.log(info);
//设定打开页面的一些初始值
chrome.storage.sync.set({open_action: "upload_image",open_content:info.srcUrl}, function() {
chrome.windows.create({
url: chrome.extension.getURL("html/popup.html"),
left: 50,
top: 50,
width: 420,
height: 200,
type: "popup"
});
});
}
});


2 changes: 2 additions & 0 deletions js/jquery.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f28287d

Please sign in to comment.