Skip to content

Commit d3d286a

Browse files
committed
REWRITE using custom web components(no shadowRoot)
1 parent b7f1e5c commit d3d286a

38 files changed

+896
-377
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
package-lock*

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.exclude": {
3+
"**/node_modules": true,
4+
"**/package-lock*": true
5+
}
6+
}

api/delete.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import express from 'express'
2+
const router = express.Router()
3+
4+
router.post('/', function (req, res, next) {
5+
// req.params
6+
// req.body
7+
8+
res.json({ "from": "deleteRouter" })
9+
})
10+
11+
export default router

api/get.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import express from 'express'
2+
const router = express.Router()
3+
4+
router.get('/', function (req, res, next) {
5+
// req.params
6+
// req.body
7+
8+
res.json({ "from": "getRouter" })
9+
})
10+
11+
export default router

api/post.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import express from 'express'
2+
const router = express.Router()
3+
4+
router.post('/', function (req, res, next) {
5+
// req.params
6+
// req.body
7+
8+
res.json({ "from": "postRouter" })
9+
})
10+
11+
export default router

api/update.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import express from 'express'
2+
const router = express.Router()
3+
4+
router.post('/', function (req, res, next) {
5+
// req.params
6+
// req.body
7+
8+
res.json({ "from": "updateRouter" })
9+
})
10+
11+
export default router

config.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"server": false,
3+
"port": 2323,
4+
"tabURL": "",
5+
"state": true,
6+
"theme": "dark",
7+
"page": "auth",
8+
"editor": "css",
9+
"editorTab": 2,
10+
"editorState": true,
11+
"editorLock": false,
12+
"editorText": {
13+
"css": "/* CSS Editor */",
14+
"js": "// JS Editor",
15+
"text": "# Text Editor"
16+
}
17+
}

index.ejs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
<style>
9+
body {
10+
background: #eee;
11+
color: #000;
12+
padding: 60px;
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
<h1>SnipX</h1>
18+
19+
<script>
20+
console.log('from ejs!')
21+
</script>
22+
</body>
23+
</html>

issues.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- Opening SnipX on profile page requires a double click to go back.
2+
- Changing theme on profile page, causes page-change to editor.
3+
- Better server-is-live check. Add icon on header(green/red). Use ajax.
4+
- Better event handling. Use 'location.reload()' less!
5+
- Using 'Tab' in the editor breaks the history. 'ctrl+z' doesn't work.

manifest.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "SnipX",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"manifest_version": 3,
55
"description": "...",
6-
"action": {
7-
"default_popup": "src/index.html"
8-
},
9-
"background": {
10-
"service_worker": "src/background.js"
11-
},
6+
"action": {"default_popup": "src/index.html"},
7+
"background": {"service_worker": "src/background.js"},
128
"permissions": [
9+
"unlimitedStorage",
1310
"activeTab",
1411
"scripting",
12+
"storage",
1513
"tabs"
1614
],
15+
"web_accessible_resources": [{
16+
"resources": ["config.json"],
17+
"matches": ["<all_urls>"]
18+
}],
1719
"content_scripts": [
1820
{
1921
"matches": ["<all_urls>"],

0 commit comments

Comments
 (0)