-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Mulholland
committed
Apr 24, 2018
1 parent
37c783a
commit 4a84113
Showing
6 changed files
with
116 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div id="container" class="container-fluid"> | ||
<form> | ||
<p> | ||
<input :class="{ 'form-control': true, 'validate-danger': errors.has('url-dialog') }" type="text" id="url-dialog" name="url-dialog" v-validate="'url:true'" v-model="urlText"/> | ||
</p> | ||
<div v-show="errors.has('url-dialog')" class="row help validate-danger"> | ||
{{ errors.first('url-dialog')}} | ||
</div> | ||
<div class="submit-container"> | ||
<button id="submit" class="btn btn-default" @click.prevent="submit">{{submitText}}</button> <button id="cancel" class="btn btn-default" @click.prevent="cancel">Cancel</button> | ||
</div> | ||
</form> | ||
</div> | ||
</template> | ||
<script> | ||
import ValidationRules from '@/mixins/ValidationRules' | ||
import {ipcRenderer as ipc} from 'electron' | ||
export default { | ||
name: 'urldialog', | ||
data() { | ||
return { | ||
urlText: '', | ||
submitText: 'Open URL' | ||
} | ||
}, | ||
methods: { | ||
submit: function() { | ||
ipc.send('urlSubmitted', this.urlText) | ||
}, | ||
cancel: function() { | ||
ipc.send('urlCancelled') | ||
}, | ||
updateSubmitText: function(text) { | ||
this.submitText = text | ||
}, | ||
resetUrlTextOnError: function() { | ||
if (this.errors.has('url-dialog')) { | ||
this.urlText = '' | ||
} | ||
} | ||
}, | ||
mounted: function() { | ||
const vueUpdateSubmitText = this.updateSubmitText | ||
ipc.on('urlDialog', function(event, arg) { | ||
vueUpdateSubmitText(arg) | ||
}) | ||
} | ||
} | ||
</script> | ||
<style lang="styl" scoped> | ||
@import '~static/css/url-dialog' | ||
</style> | ||
<style lang="styl" scoped> | ||
@import '~static/css/validationrules' | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Data Curator - URL Dialog</title> | ||
<% if (htmlWebpackPlugin.options.nodeModules) { %> | ||
<!-- Add `node_modules/` to global paths so `require` works properly in development --> | ||
<script> | ||
require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>') | ||
</script> | ||
<% } %> | ||
</head> | ||
<body> | ||
<div id="urldialog" ></div> | ||
<!-- Set `__static` path to static files in production --> | ||
<script> | ||
if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\') | ||
</script> | ||
|
||
<!-- webpack builds are automatically injected --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.submit-container | ||
position absolute | ||
bottom 0 | ||
width 100% | ||
margin 0 0 0 -15px | ||
text-align right | ||
border-radius 0 | ||
border-bottom 0 | ||
padding 7px | ||
|
||
#urldialog | ||
margin 7px | ||
width 95% |