-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
349 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,20 @@ | ||
# Logs | ||
logs | ||
*.log | ||
.DS_Store | ||
node_modules/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
lerna-debug.log* | ||
test/unit/coverage | ||
test/e2e/reports | ||
selenium-debug.log | ||
|
||
ext-dev/ | ||
!ext-dev/manifest.json | ||
!ext-dev/hot-reload.js | ||
|
||
# Editor directories and files | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>斗图插件</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="text/javascript" src="popup.js"></script></body> | ||
<script src="content.js"></script> | ||
</body> | ||
|
||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Vue from 'vue' | ||
import Content from './content.vue' | ||
|
||
new Vue({ | ||
el: '#app', | ||
render: h => h(Content) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<section class="dev-page"> | ||
<app></app> | ||
</section> | ||
</template> | ||
|
||
<script> | ||
import App from '../src/content/app.vue' | ||
export default { | ||
components: { | ||
App | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
html, body { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
#app { | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
} | ||
.dev-page { | ||
height: 100%; | ||
width: 100%; | ||
padding: 40px; | ||
.code-input { | ||
width: 600px; | ||
height: 400px; | ||
border: 1px solid #eee; | ||
border-radius: 4px; | ||
padding: 10px; | ||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
} | ||
</style> | ||
|
||
|
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "AIDUO", | ||
"version": "1.0", | ||
"description": "斗图插件", | ||
"background": { | ||
"scripts": [ | ||
"vendor.js", | ||
"background.js" | ||
], | ||
"persistent": true | ||
}, | ||
"permissions": [ | ||
"*://*/", | ||
"storage", | ||
"contextMenus" | ||
], | ||
"content_scripts": [{ | ||
"matches": ["*://github.com/*"], | ||
"js": ["vendor.js", "content.js"] | ||
}] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// 表情包的搜索接口 | ||
const API = 'https://pic.sogou.com/pics/json.jsp' | ||
export const API = 'https://pic.sogou.com/pics/json.jsp' | ||
|
||
// 默认参数 | ||
const DEFAULT_PARAMS = { | ||
query: '', | ||
export const DEFAULT_PARAMS = { | ||
query: 'bug 表情', | ||
st: 5, | ||
start: 0, | ||
xml_len: 100 | ||
} | ||
|
||
export default { | ||
API, DEFAULT_PARAMS | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
import config from './config' | ||
import axios from 'axios' | ||
import { API, DEFAULT_PARAMS } from './config' | ||
import { | ||
serialize, | ||
fetchImgToBase64 | ||
// dataURItoBlob | ||
} from './util' | ||
|
||
console.log(config) | ||
const queryURL = `${API}?${serialize(DEFAULT_PARAMS)}` | ||
|
||
chrome.runtime.onMessage.addListener(function (evt, sender, sendResponse) { | ||
const { type } = evt | ||
if (type === 'fetchImg') { | ||
axios.get(queryURL).then(({ data }) => { | ||
const imgRes = data.items.map(it => { | ||
return fetchImgToBase64(it.locImageLink).then(base64 => { | ||
return { | ||
base64, | ||
link: it.locImageLink | ||
} | ||
}) | ||
}) | ||
Promise.all(imgRes).then(res => { | ||
console.log(res[0], res.length) | ||
sendResponse(res[0]) | ||
}) | ||
}) | ||
} | ||
return true | ||
}) | ||
|
||
// const data = new window.FormData() | ||
// data.append('smfile', dataURItoBlob(base64, 'temp.png')) | ||
// axios.post('https://sm.ms/api/upload', data).then(res => { | ||
// console.log(res) | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function upSmPicBed () {} |
Oops, something went wrong.