Skip to content

Commit b00bfb7

Browse files
committed
Init based on bookmarking-app
0 parents  commit b00bfb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+15650
-0
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directory
27+
node_modules
28+
29+
# Optional npm cache directory
30+
.npm
31+
32+
# Optional REPL history
33+
.node_repl_history
34+
35+
# Build directory
36+
dist

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Barayuda Gautama
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

TujuanAplikasi.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# TUJUAN APLIKASI
2+
---
3+
User bisa membuat beberapa timer untuk kebutuhannya saat didepan layar monitor.
4+
Misal membuat timer untuk mengingatkan berdiri, minum, mengerjakan project
5+
atau mengingatkan rapat misalnya.
6+
7+
Aplikasi ini juga dapat berjalan secara background serta start-up otomatis saat
8+
komputer dihidupkan. Goalnya, aplikasi ini dapat mengingatkan penggunanya.
9+
10+
Aplikasi ini akan dikembangkan dengan user dapat menyimpan beberapa timer-set
11+
dengan memanfaatkan firebase sebagai database.
12+
13+
```
14+
Teknologi yang digunakan: VueJS, Artyom.JS, Electron, NodeJS, FireBase
15+
```
16+
17+
## MVP : User bisa set timer, dan suara saat timer 0
18+
## Alpha :
19+
---

app/App.vue

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<template>
2+
<div id="app">
3+
<sidebar
4+
:categories="categories"
5+
v-on:category-selected="setSelectedCategory">
6+
<!-- bind 'selected-category event to the event handler setSelectedCategory' -->
7+
</sidebar>
8+
<timer-area></timer-area>
9+
<bookmark-list
10+
:bookmarks="bookmarks | filterByCategory selectedCategory"
11+
:categories="categories">
12+
</bookmark-list>
13+
</div>
14+
</template>
15+
16+
<script>
17+
import store from './store'
18+
import Sidebar from './components/Sidebar.vue'
19+
import TimerArea from './components/TimerArea.vue'
20+
import BookmarkList from './components/BookmarkList.vue'
21+
import { filterByCategory } from './filters'
22+
23+
export default {
24+
25+
components: {
26+
Sidebar,
27+
BookmarkList,
28+
TimerArea
29+
},
30+
31+
data () {
32+
return {
33+
categories: {},
34+
bookmarks: {},
35+
selectedCategory: ''
36+
}
37+
},
38+
39+
filters: {
40+
filterByCategory
41+
},
42+
43+
created () {
44+
store.on('data-updated', this.updateListings)
45+
},
46+
47+
methods: {
48+
updateListings (categories, bookmarks) {
49+
this.categories = categories
50+
this.bookmarks = bookmarks
51+
},
52+
53+
setSelectedCategory (category) {
54+
this.selectedCategory = category;
55+
}
56+
57+
}
58+
59+
}
60+
</script>

app/components/Bookmark.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div @click="openLink" class="item">
3+
<div class="content">
4+
<i @click.stop="deleteBookmark" class="icon remove right-float"></i>
5+
<a class="header">{{title}}</a>
6+
<div class="description">
7+
{{url}}
8+
<a class="ui {{categoryColor}} tiny label right-float">{{category}}</a>
9+
</div>
10+
</div>
11+
</div>
12+
</template>
13+
14+
<script>
15+
import { shell } from 'electron'
16+
import store from '../store'
17+
18+
export default {
19+
props: ['id', 'title', 'url', 'category', 'categoryColor'],
20+
21+
methods: {
22+
deleteBookmark () {
23+
store.deleteBookmark(this.id)
24+
},
25+
26+
openLink () {
27+
shell.openExternal(this.url)
28+
}
29+
}
30+
31+
}
32+
</script>

app/components/BookmarkList.vue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div id="links-container">
3+
<div id="toolbar">
4+
<div class="ui inverted icon fluid input">
5+
<input v-model="query" type="text" placeholder="Cari Bookmark...">
6+
<i class="search icon"></i>
7+
</div>
8+
</div>
9+
<div class="ui relaxed divided selection list">
10+
<bookmark v-for="(id, bookmark) in bookmarks | filterByTitle query"
11+
:id="id"
12+
:title="bookmark.title"
13+
:url="bookmark.url"
14+
:category="bookmark.category"
15+
:category-color="categories[bookmark.category]">
16+
</bookmark>
17+
</div>
18+
</div>
19+
</template>
20+
21+
<script>
22+
import Bookmark from './Bookmark.vue'
23+
import { filterByTitle } from '../filters'
24+
25+
export default {
26+
27+
data () {
28+
return {
29+
query: ''
30+
}
31+
},
32+
33+
props: ['bookmarks', 'categories'],
34+
35+
components: {
36+
Bookmark
37+
},
38+
39+
filters: {
40+
filterByTitle
41+
}
42+
43+
}
44+
45+
</script>

app/components/BookmarkModal.vue

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<template>
2+
3+
<div id="bookmark-modal" class="ui small modal">
4+
<i class="close icon"></i>
5+
<div class="header">
6+
Tambah Bookmark
7+
</div>
8+
<div class="content">
9+
10+
<form class="ui form">
11+
<div class="field">
12+
<label>Nama Bookmark</label>
13+
<input v-model="bookmarkTitle" type="text" placeholder="Tulis nama bookmark...">
14+
</div>
15+
<div class="field">
16+
<label>URL</label>
17+
<input v-model="bookmarkUrl" type="text" placeholder="Masukkan URL bookmark...">
18+
</div>
19+
<div class="field">
20+
<label>Kategori</label>
21+
<select v-model="bookmarkCategory" class="ui simple dropdown">
22+
<option value="">Select a category</option>
23+
<template v-for="(name, color) in categories">
24+
<option value="{{ name }}">{{ name }}</option>
25+
</template>
26+
</select>
27+
</div>
28+
</form>
29+
30+
</div>
31+
<div class="actions">
32+
<div @click="addBookmark" class="ui inverted purple button">Simpan</div>
33+
</div>
34+
</div>
35+
36+
</template>
37+
38+
<script>
39+
import store from '../store'
40+
41+
export default {
42+
43+
data () {
44+
return {
45+
bookmarkTitle: '',
46+
bookmarkUrl: '',
47+
bookmarkCategory: ''
48+
}
49+
},
50+
51+
props: ['categories'],
52+
53+
methods: {
54+
55+
addBookmark () {
56+
const newBookmark = {
57+
title: this.bookmarkTitle,
58+
url: this.bookmarkUrl,
59+
category: this.bookmarkCategory
60+
}
61+
store.addBookmark(newBookmark)
62+
$('#bookmark-modal').modal('hide')
63+
}
64+
65+
},
66+
67+
events: {
68+
69+
'add-bookmark': function () {
70+
this.bookmarkTitle = this.bookmarkUrl = this.bookmarkCategory = ''
71+
$('#bookmark-modal').modal('show')
72+
}
73+
74+
}
75+
76+
}
77+
</script>

app/components/CategoryModal.vue

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<template>
2+
3+
<div id="cat-modal" class="ui small modal">
4+
<i class="close icon"></i>
5+
<div class="header">
6+
Tambah Kategori
7+
</div>
8+
<div class="content">
9+
10+
<form class="ui form">
11+
<div class="field">
12+
<label>Nama Kategori</label>
13+
<input v-model="catName" type="text" placeholder="Tulis nama kategori...">
14+
</div>
15+
<div class="field">
16+
<label>Warna</label>
17+
<select v-model="catColor" class="ui simple dropdown">
18+
<option value="">Pilih warna</option>
19+
<option v-for="color in categoryColors"
20+
value="{{color}}">
21+
{{color | capitalize}}
22+
</option>
23+
</select>
24+
</div>
25+
</form>
26+
27+
</div>
28+
<div class="actions">
29+
<div @click="addCategory" class="ui purple inverted button">Simpan</div>
30+
</div>
31+
</div>
32+
33+
</template>
34+
35+
<script>
36+
import store from '../store'
37+
38+
export default {
39+
40+
data () {
41+
return {
42+
catName: '',
43+
catColor: '',
44+
categoryColors: ['red', 'orange', 'yellow', 'olive', 'green',
45+
'teal', 'blue', 'violet', 'purple', 'pink', 'brown', 'grey', 'black']
46+
}
47+
},
48+
49+
methods: {
50+
51+
addCategory () {
52+
var newCategory = {}
53+
newCategory[this.catName] = this.catColor
54+
store.addCategory(newCategory)
55+
$('#cat-modal').modal('hide')
56+
}
57+
58+
},
59+
60+
events: {
61+
62+
'add-category': function () {
63+
this.catName = this.catColor = ''
64+
$('#cat-modal').modal('show')
65+
}
66+
67+
}
68+
69+
}
70+
</script>

0 commit comments

Comments
 (0)