Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
add new sorting method, Code of Conduct, refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsdev committed Jun 28, 2018
1 parent 3ae837c commit 1db5dc8
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 32 deletions.
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dokdrop",
"version": "0.1.0",
"version": "0.1.1",
"author": "Julien Gelmar <[email protected]>",
"description": "Dokdrop",
"license": null,
Expand All @@ -20,6 +20,19 @@
"publish": "electron-builder --x64 --win -p always"
},
"build": {
"nsis": {
"oneClick": true,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": false,
"deleteAppDataOnUninstall": true,
"createDesktopShortcut": true,
"installerIcon": "build/icons/icon.ico",
"uninstallerIcon": "build/icons/icon.ico",
"uninstallDisplayName": "Uninstall Dokdrop",
"runAfterFinish": true
},
"buildVersion": "0.1.1",
"productName": "dokdrop",
"appId": "org.juliengelmar.dokdrop",
"directories": {
Expand Down Expand Up @@ -54,9 +67,6 @@
},
"linux": {
"icon": "build/icons/png"
},
"nsis": {
"oneClick": true
}
},
"dependencies": {
Expand Down
18 changes: 7 additions & 11 deletions src/renderer/components/Fix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<label for="track">Track</label>
<multiselect v-model="form.track" track-by="search" label="name" value="search" :options="tracks"></multiselect>
</div>
<div v-if="saving === 'season'" class="mt-2">
<div v-if="saving.startsWith('season')" class="mt-2">
<label for="season">Season</label>
<multiselect v-model="form.season" track-by="search" label="name" value="search" :options="seasons"></multiselect>
</div>
Expand Down Expand Up @@ -47,26 +47,22 @@
this.notify('error', 'Please set a track.')
return false
}
if (this.saving === 'season' && !this.form.season) {
if (this.saving.startsWith('season') && !this.form.season) {
this.notify('error', 'Please set a season.')
return false
}
var newpath
if (this.saving === 'season') {
if (this.saving === 'season' || this.saving === 'seasonfirst') {
newpath = this.createFolders(this.form.car.folder, this.form.track.search, this.form.season.search)
} else if (this.saving === 'track') {
newpath = this.createFolders(this.form.car.folder, this.form.track.search)
} else {
newpath = this.createFolders(this.form.car.folder)
}
console.log(newpath + this.filename)
this.$fs.copy(this.path, newpath + this.filename).then(() => {
this.notify('success', 'File successfully copied')
this.$router.push('landing-page')
}).catch(err => {
console.log(err)
this.notify('error', 'Some kind of error happened')
})
this.copySetup(
this.path,
newpath + this.filename
)
}
},
created () {
Expand Down
15 changes: 6 additions & 9 deletions src/renderer/components/LandingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="col-xs-4">
<strong>Car</strong><br>
{{ guess.car ? guess.car[1] : 'Not guessed' }}<br>
<p class="mt-4" v-if="(saving === 'car' && guess.car) || (saving === 'track' && guess.car && guess.track) || (saving === 'season' && guess.car && guess.track && guess.season)">
<p class="mt-4" v-if="(saving === 'car' && guess.car) || (saving === 'track' && guess.car && guess.track) || (saving.startsWith('season') && guess.car && guess.track && guess.season)">
<a @click="copyFile" class="text-primary">Correct!</a> or <a @click="fix" class="text-primary">Wrong :(</a>
</p>
<p class="mt-4" v-else>
Expand All @@ -28,7 +28,7 @@
<strong>Track</strong><br>
{{ guess.track ? guess.track[1] : 'Not guessed' }}<br>
</div>
<div class="col-xs-4 mx-2" v-if="saving === 'season'">
<div class="col-xs-4 mx-2" v-if="saving.startsWith('season')">
<strong>Season</strong><br>
{{ guess.season ? guess.season[1] : 'Not guessed'}}
</div>
Expand Down Expand Up @@ -68,13 +68,10 @@
},
copyFile () {
let season = (typeof this.guess.season === 'undefined') ? null : this.guess.season[1]
var newpath = this.createFolders(this.guess.car[2], this.guess.track[0], season)
this.$fs.copy(this.guess.path, newpath + this.guess.name).then(() => {
this.notify('success', 'File successfully copied')
}).catch(err => {
console.log(err)
this.notify('error', 'Some kind of error happened')
})
this.copySetup(
this.guess.path,
this.createFolders(this.guess.car[2], this.guess.track[0], season) + this.guess.name
)
},
fix () {
this.$router.push({path: 'fix', query: { filename: this.guess.name, path: this.guess.path }})
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h4 class="card-title">About</h4>
<p class="card-body">
Made by <a class="text-primary" @click="external('https://gelmar.app')">Julien Gelmar</a><br>
Version 0.1
Version 0.1.1
</p>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/partials/SettingCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<div class="col-sm-12">
<input type="radio" v-model="inputs.saving" value="season"> car\track\season\setup.sto
</div>
<div class="col-sm-12">
<input type="radio" v-model="inputs.saving" value="seasonfirst"> car\season\track\setup.sto
</div>
<div class="col-sm-12">
<input type="radio" v-model="inputs.saving" value="track"> car\track\setup.sto
</div>
Expand Down
44 changes: 37 additions & 7 deletions src/renderer/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,52 @@ Vue.mixin({
text: msg
})
},
createFolders (car, track, season) {
createCarFolder (car) {
let folder = localStorage.getItem('folder') + '\\' + car
if (!this.$fs.existsSync(folder)) {
this.$fs.mkdirSync(folder)
}
return folder
},
createTrackFolder (folder, track) {
if (!this.$fs.existsSync(folder + '\\' + track)) {
this.$fs.mkdirSync(folder + '\\' + track)
}
return folder + '\\' + track
},
createSeasonFolder (folder, season) {
if (!this.$fs.existsSync(folder + '\\' + season)) {
this.$fs.mkdirSync(folder + '\\' + season)
}
return folder + '\\' + season
},
createFolders (car, track, season) {
var folder = this.createCarFolder(car)
if (localStorage.getItem('saving') === 'car') {
return folder + '\\'
}
if (!this.$fs.existsSync(folder + '\\' + track)) {
this.$fs.mkdirSync(folder + '\\' + track)
if (localStorage.getItem('saving') === 'seasonfirst') {
folder = this.createSeasonFolder(folder, season)
return this.createTrackFolder(folder, track) + '\\'
}
folder = this.createTrackFolder(folder, track)
if (localStorage.getItem('saving') === 'season') {
return this.createSeasonFolder(folder, season) + '\\'
}
if (localStorage.getItem('saving') === 'season' && !this.$fs.existsSync(folder + '\\' + track)) {
this.$fs.mkdirSync(folder + '\\' + track + '\\' + season)
return folder + '\\' + track + '\\' + season + '\\'
return folder + '\\'
},
copySetup (path, newpath) {
if (this.$fs.existsSync(newpath)) {
this.notify('error', 'File already exists.')
} else {
this.$fs.copy(path, newpath).then(() => {
this.notify('success', 'File successfully copied')
this.$modal.hide('guess')
}).catch(err => {
console.log(err)
this.notify('error', 'Some kind of error happened')
})
}
return folder + '\\' + track + '\\'
}
}
})

0 comments on commit 1db5dc8

Please sign in to comment.