Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 8e84137

Browse files
committed
feat(snippets): CRUD + ace editor integration
1 parent 7787016 commit 8e84137

23 files changed

+836
-86
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
'global-require': 0,
2020
'import/no-unresolved': 0,
2121
'no-param-reassign': 0,
22+
'no-underscore-dangle': 0,
2223
'no-shadow': 0,
2324
'import/extensions': 0,
2425
'import/newline-after-import': 0,

LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Laurent Thiebault
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# code-notes
1+
# code-book
22

33
> A simple code snippet manager for developers built with Electron 🚀
44

package-lock.json

+95-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "code-notes",
2+
"name": "code-book",
33
"version": "0.0.0",
44
"author": "Laurent THIEBAULT <[email protected]>",
55
"description": "A simple code snippet manager for developers built with Electron 🚀",
@@ -23,7 +23,7 @@
2323
"postinstall": "npm run eslint:fix && npm run prettier"
2424
},
2525
"build": {
26-
"productName": "code-notes",
26+
"productName": "code-book",
2727
"appId": "org.simulatedgreg.electron-vue",
2828
"directories": {
2929
"output": "build"
@@ -58,12 +58,17 @@
5858
},
5959
"dependencies": {
6060
"axios": "^0.16.1",
61+
"brace": "^0.11.0",
62+
"buefy": "^0.6.2",
6163
"electron": "^1.7.5",
64+
"emmet": "^1.6.3",
65+
"font-awesome": "^4.7.0",
6266
"nedb": "^1.8.0",
63-
"vue": "^2.3.3",
67+
"source-sans-pro": "^2.0.10",
68+
"vue": "^2.5.13",
6469
"vue-electron": "^1.0.6",
65-
"vue-router": "^2.5.3",
66-
"vuex": "^2.3.1"
70+
"vue-router": "^3.0.1",
71+
"vuex": "^3.0.1"
6772
},
6873
"devDependencies": {
6974
"babel-core": "^6.25.0",
@@ -120,6 +125,7 @@
120125
"vue-loader": "^13.0.5",
121126
"vue-style-loader": "^3.0.1",
122127
"vue-template-compiler": "^2.4.2",
128+
"vue2-ace-editor": "0.0.3",
123129
"webpack": "^3.5.2",
124130
"webpack-dev-server": "^2.7.1",
125131
"webpack-hot-middleware": "^2.18.2",

src/index.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>code-notes</title>
5+
<title>code-book</title>
66
<% if (htmlWebpackPlugin.options.nodeModules) { %>
77
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
88
<script>

src/main/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { app, BrowserWindow } from 'electron'; // eslint-disable-line
55
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
66
*/
77
if (process.env.NODE_ENV !== 'development') {
8-
// eslint-disable-next-line
98
global.__static = require('path')
109
.join(__dirname, '/static')
1110
.replace(/\\/g, '\\\\'); // eslint-disable-line
@@ -22,9 +21,12 @@ function createWindow() {
2221
* Initial window options
2322
*/
2423
mainWindow = new BrowserWindow({
25-
height: 563,
2624
useContentSize: true,
27-
width: 1000,
25+
height: 700,
26+
titleBarStyle: 'hiddenInset',
27+
width: 1160,
28+
minHeight: 500,
29+
minWidth: 769
2830
});
2931

3032
mainWindow.loadURL(winURL);

src/renderer/App.vue

+25-18
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
<template>
22
<div id="app">
3-
<router-view></router-view>
3+
<cb-navbar></cb-navbar>
4+
<div id="content">
5+
<router-view></router-view>
6+
7+
<!--<div class="columns">
8+
<div class="column is-3">
9+
<cb-sidebar></cb-sidebar>
10+
</div>
11+
<div class="column is-9">
12+
<router-view></router-view>
13+
</div>
14+
</div>-->
15+
</div>
416
</div>
517
</template>
618

719
<script>
8-
export default {
9-
name: 'code-notes',
10-
};
20+
import Navbar from './Navbar';
21+
import Sidebar from './Sidebar';
22+
23+
export default {
24+
name: 'cb-app',
25+
components: {
26+
'cb-navbar': Navbar,
27+
'cb-sidebar': Sidebar
28+
}
29+
};
1130
</script>
1231

1332
<style lang="scss">
14-
1533
body {
1634
font-family: 'Source Sans Pro', sans-serif;
1735
}
1836
19-
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro');
20-
21-
* {
22-
box-sizing: border-box;
23-
margin: 0;
24-
padding: 0;
37+
#content {
38+
padding: 0 24px;
2539
}
26-
27-
#wrapper {
28-
height: 100vh;
29-
padding: 60px 80px;
30-
width: 100vw;
31-
}
32-
3340
</style>

src/renderer/Navbar.vue

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template>
2+
<nav>
3+
<img src="~@/assets/logo.png" alt="Code book logo">
4+
</nav>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'cb-navbar',
10+
data() {
11+
return {}
12+
},
13+
methods: {
14+
open(link) {
15+
this.$electron.shell.openExternal(link)
16+
}
17+
}
18+
};
19+
</script>
20+
21+
<style lang="scss" scoped>
22+
nav {
23+
-webkit-app-region: drag;
24+
background-color: $primary;
25+
text-align: center;
26+
position: fixed;
27+
top: 0;
28+
width: 100%;
29+
z-index: 1000;
30+
31+
img {
32+
padding: 10px 10px 4px 10px;
33+
width: 110px;
34+
}
35+
}
36+
</style>

0 commit comments

Comments
 (0)