Skip to content

Commit 742b13d

Browse files
authored
Merge pull request #31 from keliphan/comments
Cleanup & Testing
2 parents 0881618 + 40bf468 commit 742b13d

Some content is hidden

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

41 files changed

+1502
-1115
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ node_modules
1111
npm-debug.log*
1212
yarn-debug.log*
1313
yarn-error.log*
14-
/test
1514
/coverage
1615
package-lock.json
1716

HomeView.png

Lines changed: 0 additions & 1 deletion
This file was deleted.

Route2.png

Lines changed: 0 additions & 1 deletion
This file was deleted.

Route3.png

Lines changed: 0 additions & 1 deletion
This file was deleted.

quasar.conf.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ module.exports = function (ctx) {
8686
// analyze: true,
8787
// extractCSS: false,
8888
extendWebpack (cfg) {
89-
//cfg.module.rules.push({
89+
// cfg.module.rules.push({
9090
// enforce: 'pre',
9191
// test: /\.(js|vue)$/,
9292
// loader: 'eslint-loader',
9393
// exclude: /node_modules/,
9494
// options: {
9595
// formatter: require('eslint').CLIEngine.getFormatter('stylish')
9696
// }
97-
//})
97+
// })
9898
}
9999
},
100100

@@ -158,7 +158,7 @@ module.exports = function (ctx) {
158158
},
159159

160160
electron: {
161-
bundler:'builder',
161+
bundler: 'builder',
162162
// bundler: 'builder', // or 'packager'
163163

164164
extendWebpack (cfg) {
@@ -182,11 +182,11 @@ module.exports = function (ctx) {
182182
builder: {
183183
// https://www.electron.build/configuration/configuration
184184

185-
appId: 'com.electron.OverVue',
186-
win:{
187-
target:'nsis'
188-
},
185+
appId: 'com.electron.OverVue',
186+
win: {
187+
target: 'nsis'
188+
}
189189
}
190190
}
191191
}
192-
}
192+
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { app, BrowserWindow } from "electron";
1+
import { app, BrowserWindow } from 'electron'
22

33
/**
44
* Set `__statics` path to static files in production;
55
* The reason we are setting it here is that the path needs to be evaluated at runtime
66
*/
77
if (process.env.PROD) {
8-
global.__statics = require("path")
9-
.join(__dirname, "statics")
10-
.replace(/\\/g, "\\\\");
8+
global.__statics = require('path')
9+
.join(__dirname, 'statics')
10+
.replace(/\\/g, '\\\\')
1111
}
1212

13-
let mainWindow;
13+
let mainWindow
1414

15-
function createWindow() {
15+
function createWindow () {
1616
/**
1717
* Initial window options
1818
*/
@@ -24,25 +24,25 @@ function createWindow() {
2424
nodeIntegration: true,
2525
webSecurity: false
2626
}
27-
});
27+
})
2828

29-
mainWindow.loadURL(process.env.APP_URL);
29+
mainWindow.loadURL(process.env.APP_URL)
3030

31-
mainWindow.on("closed", () => {
32-
mainWindow = null;
33-
});
31+
mainWindow.on('closed', () => {
32+
mainWindow = null
33+
})
3434
}
3535

36-
app.on("ready", createWindow);
36+
app.on('ready', createWindow)
3737

38-
app.on("window-all-closed", () => {
39-
if (process.platform !== "darwin") {
40-
app.quit();
38+
app.on('window-all-closed', () => {
39+
if (process.platform !== 'darwin') {
40+
app.quit()
4141
}
42-
});
42+
})
4343

44-
app.on("activate", () => {
44+
app.on('activate', () => {
4545
if (mainWindow === null) {
46-
createWindow();
46+
createWindow()
4747
}
48-
});
48+
})

src/App.vue

Lines changed: 23 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,28 @@
55
</template>
66

77
<script>
8-
import { SET_ACTIVE_COMPONENT } from './store/types'
98
const deepEqual = require('lodash.isequal')
109
const cloneDeep = require('lodash.clonedeep')
1110
const throttle = require('lodash.throttle')
1211
import { defaultState } from './store/state/index.js'
1312
14-
15-
//use this to make sure these actions don't count as things you "undo"
13+
// use this to make sure these actions don't count as things you "undo"
1614
const ignoredActions = new Set([
17-
"setActiveComponent",
18-
"setActiveLayer",
19-
"upOneLayer",
20-
"setActiveHTML"
21-
])
22-
15+
'setActiveComponent',
16+
'setActiveLayer',
17+
'upOneLayer',
18+
'setActiveHTML'
19+
])
2320
2421
let redoMixin = {
2522
data () {
2623
return {
27-
// banana:[],
2824
doneAction: [],
2925
undoneAction: [],
3026
isTimetraveling: false,
3127
initialState: {}
3228
}
3329
},
34-
3530
created () {
3631
this.$store.subscribeAction((action, state) => {
3732
// console.log("We are saving this action!", action)
@@ -45,7 +40,7 @@ let redoMixin = {
4540
// console.log("Are these equal to each other?", action == this.undoneAction[this.undoneAction.length-1])
4641
if (!this.isTimetraveling) {
4742
if (this.undoneAction[this.undoneAction.length - 1]) {
48-
if (action.type == this.undoneAction[this.undoneAction.length - 1].type &&
43+
if (action.type === this.undoneAction[this.undoneAction.length - 1].type &&
4944
deepEqual(action.payload, this.undoneAction[this.undoneAction.length - 1].payload)) {
5045
this.undoneAction.pop()
5146
} else {
@@ -54,13 +49,11 @@ let redoMixin = {
5449
}
5550
}
5651
})
57-
// this.blankState = cloneDeep(this.$store)
5852
},
5953
6054
mounted () {
61-
62-
const throttledUndo = throttle(this.undo,300)
63-
const throttledRedo = throttle(this.redo,300)
55+
const throttledUndo = throttle(this.undo, 300)
56+
const throttledRedo = throttle(this.redo, 300)
6457
6558
window.addEventListener('keydown', event => {
6659
if (event.ctrlKey && event.key === 'z') {
@@ -75,62 +68,39 @@ let redoMixin = {
7568
}
7669
})
7770
78-
// commented code for hotkeys for debuging///////////////////////
79-
// window.addEventListener('keydown', event => {
80-
// if (event.ctrlKey && event.key === 'a') {
81-
// event.preventDefault()
82-
// if (this.$store.state.activeHTML !== '') {
83-
// this.$store.dispatch('setActiveLayer', {id:this.$store.state.activeHTML, text:"banana"})
84-
// }
85-
// }
86-
// });
87-
// window.addEventListener('keydown', event => {
88-
// if (event.ctrlKey && event.key === 'd') {
89-
// event.preventDefault()
90-
// if (this.$store.state.activeLayer.id !== '') {
91-
// this.$store.dispatch('upOneLayer', this.$store.state.activeLayer.id)
92-
// }
93-
// }
94-
// });
95-
//////////////////////////////////////////////////////////////////////
96-
97-
// console.log("do we want this? or this.$store.state?", this.$store.state)
9871
this.initialState = defaultState(this.$store.state)
9972
},
10073
10174
methods: {
10275
undo: function () {
103-
// do {
104-
// console.log("How far back?")
105-
if(this.doneAction.length ===0){
76+
if (this.doneAction.length === 0) {
10677
return
10778
}
10879
10980
this.isTimetraveling = true
11081
11182
let undone = this.doneAction.pop()
11283
113-
// assuming we have have something to undo, we check if we are undoing an action that has no feedback
114-
// like say changing active elements or active components or going up and down a layer since these can be obscured from immediate feedback
115-
// will just feel bad to undo (Imagine someone just clicking around out of boredom and then deciding to undo
116-
// will force them to have to undo the 30 highlights they just did instead of the last "Real" action)
117-
// if this happens we keep popping the doneAction queue and building up the redo queue.
84+
/* assuming we have have something to undo, we check if we are undoing an action that has no feedback
85+
e.g.: changing active elements or active components or going up and down a layer since these can be obscured from immediate feedback.
86+
these will feel bad to undo (imagine someone clicking around out of boredom and then deciding to undo
87+
this will force them to have to undo the 30 highlights they just did instead of the last "Real" action)
88+
if this happens we keep popping the doneAction queue and building up the redo queue. */
11889
if (undone !== undefined) {
11990
this.undoneAction.push(undone)
12091
if (ignoredActions.has(undone.type)) {
121-
// console.log('We did something useless!')
92+
// console.log('We undid an ignored action!')
12293
while (this.doneAction[this.doneAction.length - 1] &&
123-
ignoredActions.has(this.doneAction[this.doneAction.length - 1].type)){
94+
ignoredActions.has(this.doneAction[this.doneAction.length - 1].type)) {
12495
this.undoneAction.push(this.doneAction.pop())
12596
}
126-
// if we get here, that means we have undone all "useless" actions
127-
// so we have to do one more final pop and push, have to make sure it isn't null though
97+
/* if we get here, that means we have undone all "useless" actions
98+
so we have to do one more final pop and push, have to make sure it isn't null though */
12899
let finalPop = this.doneAction.pop()
129-
if(finalPop !== undefined){
100+
if (finalPop !== undefined) {
130101
this.undoneAction.push(finalPop)
131102
}
132103
}
133-
134104
}
135105
136106
let payload = {
@@ -139,8 +109,7 @@ let redoMixin = {
139109
}
140110
this.$store.commit('EMPTY_STATE', payload)
141111
this.doneAction.forEach(action => {
142-
//console.log('In the loop', this.$store)
143-
// this.$store.commit(`${mutation.type}`, mutation.payload);
112+
// console.log('in the undo loop', this.$store)
144113
this.$store.dispatch(action.type, cloneDeep(action.payload))
145114
this.doneAction.pop()
146115
})
@@ -150,14 +119,14 @@ let redoMixin = {
150119
redo: function () {
151120
let action = this.undoneAction.pop()
152121
153-
//we have to set timeTraveling to true to preserve the undoneAction array while we make changes
122+
// we have to set timeTraveling to true to preserve the undoneAction array while we make changes
154123
this.isTimetraveling = true
155124
if (action) {
156125
this.$store.dispatch(action.type, cloneDeep(action.payload))
157126
}
158127
this.isTimetraveling = false
159128
if (action && ignoredActions.has(action.type)) {
160-
//console.log('WE GOTTA DO MORE')
129+
// console.log('in the redo loop')
161130
this.redo()
162131
}
163132
}

src/components/ChildrenMultiselect.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
Description:
3+
Is not imported in current version of OverVue
4+
Functionality includes: N/A
5+
-->
6+
17
<template>
28
<div id="child-select">
39
<br />
@@ -13,11 +19,6 @@
1319
:option-height="20"
1420
:searchable="false"
1521
></multiselect>
16-
<!-- <q-select
17-
:options="options"
18-
label="Select children"
19-
multiple
20-
/> -->
2122
</div>
2223
</template>
2324

@@ -32,7 +33,6 @@ export default {
3233
computed: {
3334
...mapState([
3435
'routes',
35-
// comes from store/state/index.js
3636
'componentMap',
3737
'activeComponent',
3838
'componentChildrenMultiselectValue',
@@ -52,9 +52,7 @@ export default {
5252
'updateComponentChildrenMultiselectValue',
5353
'updateActiveComponentChildrenValue'
5454
]),
55-
//
5655
handleSelect (value) {
57-
// if (this.modalOpen) this.updateActiveComponentChildrenValue(value)
5856
// console.log('Multiselect: ', value)
5957
this.updateActiveComponentChildrenValue(value)
6058
this.updateComponentChildrenMultiselectValue(value)

0 commit comments

Comments
 (0)