@@ -0,0 +1,38 @@ | |||||
<style> | |||||
#toast-container > div { | |||||
opacity: 1; | |||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); | |||||
filter: alpha(opacity=100); | |||||
} | |||||
body { | |||||
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; | |||||
font-size: 14px; | |||||
line-height: 1.4; | |||||
background: #D3D8E8; | |||||
color: #252830; | |||||
} | |||||
.blue { | |||||
color: #0275D8; | |||||
} | |||||
</style> | |||||
<template> | |||||
<div> | |||||
<lesspass-header></lesspass-header> | |||||
<router-view></router-view> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import LesspassHeader from './components/header.vue'; | |||||
export default { | |||||
data: function () { | |||||
return {} | |||||
}, | |||||
components: { | |||||
LesspassHeader | |||||
} | |||||
} | |||||
</script> |
@@ -1,19 +1,10 @@ | |||||
<style> | <style> | ||||
@import '../node_modules/bootstrap/dist/css/bootstrap.css'; | |||||
@import '../node_modules/toastr/build/toastr.min.css'; | |||||
#toast-container > div { | |||||
opacity: 1; | |||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); | |||||
filter: alpha(opacity=100); | |||||
} | |||||
body { | body { | ||||
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; | font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||||
font-size: 14px; | font-size: 14px; | ||||
line-height: 1.5; | |||||
color: #cfd2da; | |||||
background-color: #252830; | |||||
line-height: 1.4; | |||||
background: #D3D8E8; | |||||
color: #252830; | |||||
} | } | ||||
.blue { | .blue { | ||||
@@ -22,19 +13,13 @@ | |||||
</style> | </style> | ||||
<template> | <template> | ||||
<div> | |||||
<div id="App"> | |||||
<lesspass-header></lesspass-header> | <lesspass-header></lesspass-header> | ||||
<router-view></router-view> | <router-view></router-view> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
var $ = require('jquery'); | |||||
window.jQuery = $; | |||||
window.Tether = require('tether'); | |||||
window.$ = $; | |||||
var bootstrap = require('bootstrap/dist/js/umd/collapse.js'); | |||||
import LesspassHeader from './components/header.vue'; | |||||
var LesspassHeader = require('./components/header.vue'); | |||||
export default { | export default { | ||||
data: function () { | data: function () { | ||||
@@ -1,13 +1,14 @@ | |||||
<style> | <style> | ||||
.lesspass-features { | .lesspass-features { | ||||
background-color: #0275D8; | background-color: #0275D8; | ||||
color: #D3D8E8; | |||||
} | } | ||||
.lesspass-features ul { | .lesspass-features ul { | ||||
line-height: 1.8em; | line-height: 1.8em; | ||||
font-size: 1.15em; | font-size: 1.15em; | ||||
margin: 0px auto; | |||||
padding: 0px; | |||||
margin: 0 auto; | |||||
padding: 0; | |||||
list-style-type: none; | list-style-type: none; | ||||
} | } | ||||
@@ -23,11 +24,11 @@ | |||||
} | } | ||||
</style> | </style> | ||||
<template> | <template> | ||||
<div class="lesspass-features p-y-3 m-t-2"> | |||||
<div class="lesspass-features p-y-3"> | |||||
<div class="container"> | <div class="container"> | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-lg-8 col-lg-offset-2"> | <div class="col-lg-8 col-lg-offset-2"> | ||||
<h2>{{ $t('features.you_should_use_lesspass') }}</h2> | |||||
<h3>{{ $t('features.you_should_use_lesspass') }}</h3> | |||||
<ul> | <ul> | ||||
<li>{{{ $t('features.unique_password') }}} ;</li> | <li>{{{ $t('features.unique_password') }}} ;</li> | ||||
<li>{{{ $t('features.love_open_source') }}} ;</li> | <li>{{{ $t('features.love_open_source') }}} ;</li> | ||||
@@ -1,85 +1,73 @@ | |||||
<style> | <style> | ||||
.header { | |||||
background-color: #D8E4EA; | |||||
#navbar { | |||||
height: 86px; | height: 86px; | ||||
} | |||||
.header { | |||||
color: #252830; | |||||
} | |||||
.navbar { | |||||
padding: 1.5rem 0; | padding: 1.5rem 0; | ||||
} | } | ||||
</style> | </style> | ||||
<template> | <template> | ||||
<div class="collapse" id="SignInCollapseNavbar"> | |||||
<div class="bg-inverse p-a-1"> | |||||
<div class="container"> | |||||
<div class="col-lg-12"> | |||||
<form class="form-inline pull-md-right"> | |||||
<div class="form-group form"> | |||||
<div id="header"> | |||||
<div id="SignInCollapseNavbar" class="bg-inverse collapse"> | |||||
<div class="container p-t-1"> | |||||
<form> | |||||
<div class="form-group row"> | |||||
<div class="col-lg-2 col-lg-offset-4 m-b-1"> | |||||
<label class="sr-only" for="email">{{$t('header.Email')}}</label> | <label class="sr-only" for="email">{{$t('header.Email')}}</label> | ||||
<input type="email" class="form-control form-control-sm" id="email" | <input type="email" class="form-control form-control-sm" id="email" | ||||
placeholder="{{$t('header.Email')}}" | placeholder="{{$t('header.Email')}}" | ||||
v-model="credentials.email"> | v-model="credentials.email"> | ||||
</div> | </div> | ||||
<div class="form-group"> | |||||
<div class="col-lg-2 m-b-1"> | |||||
<label class="sr-only" for="password">{{$t('header.Password')}}</label> | <label class="sr-only" for="password">{{$t('header.Password')}}</label> | ||||
<input type="password" class="form-control form-control-sm" id="password" | <input type="password" class="form-control form-control-sm" id="password" | ||||
placeholder="{{$t('header.Password')}}" | placeholder="{{$t('header.Password')}}" | ||||
v-model="credentials.password"> | v-model="credentials.password"> | ||||
</div> | </div> | ||||
<div class="form-group row"> | |||||
<div class="col-lg-12"> | |||||
<button type="submit" class="btn btn-primary btn-sm btn-block" @click="signin()"> | |||||
{{$t('header.Sign_in')}} | |||||
</button> | |||||
</div> | |||||
<div class="col-lg-2 m-b-1"> | |||||
<button type="submit" class="btn btn-primary btn-sm btn-block" @click="signin()"> | |||||
{{$t('header.Sign_in')}} | |||||
</button> | |||||
</div> | </div> | ||||
<div class="form-group row"> | |||||
<div class="col-lg-12"> | |||||
<button type="submit" class="btn btn-primary-outline btn-sm btn-block" | |||||
@click="register()"> | |||||
{{$t('header.Register')}} | |||||
</button> | |||||
</div> | |||||
<div class="col-lg-2 m-b-1"> | |||||
<button type="submit" class="btn btn-primary-outline btn-sm btn-block" | |||||
@click="register()"> | |||||
{{$t('header.Register')}} | |||||
</button> | |||||
</div> | </div> | ||||
</form> | |||||
</div> | |||||
</div> | |||||
</form> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="header"> | |||||
<nav class="navbar"> | |||||
<div class="container"> | |||||
<ul class="nav navbar-nav"> | |||||
<li class="nav-item"> | |||||
<a class="" href="#"> | |||||
<img src="../assets/images/logo_text.png" alt="logo"> | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<ul class="nav navbar-nav pull-xs-right"> | |||||
<li class="nav-item" v-if="!user.authenticated"> | |||||
<button class="navbar-toggler" type="button" data-toggle="collapse" | |||||
data-target="#SignInCollapseNavbar"> | |||||
☰ | |||||
</button> | |||||
</li> | |||||
<li class="nav-item" v-if="user.authenticated"> | |||||
<a class="btn btn-primary" @click="logout()"> | |||||
logout | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
</div> | |||||
</nav> | |||||
<div class="container"> | |||||
<nav id="navbar" class="navbar"> | |||||
<div class="container"> | |||||
<ul class="nav navbar-nav"> | |||||
<li class="nav-item"> | |||||
<a class="" href="#"> | |||||
<img src="../assets/images/logo_text.png" alt="logo"> | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<!--<ul class="nav navbar-nav pull-xs-right"> | |||||
<li class="nav-item" v-if="!user.authenticated"> | |||||
<button class="navbar-toggler" type="button" data-toggle="collapse" | |||||
data-target="#SignInCollapseNavbar"> | |||||
☰ | |||||
</button> | |||||
</li> | |||||
<li class="nav-item" v-if="user.authenticated"> | |||||
<a class="btn btn-primary" @click="logout()"> | |||||
logout | |||||
</a> | |||||
</li> | |||||
</ul>--> | |||||
</div> | |||||
</nav> | |||||
</div> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import auth from '../services/auth' | |||||
import {router} from '../main' | |||||
var auth = require('../services/auth.js'); | |||||
var router = require('../router.js'); | |||||
export default { | export default { | ||||
data: function () { | data: function () { | ||||
@@ -98,7 +86,7 @@ | |||||
email: this.credentials.email, | email: this.credentials.email, | ||||
password: this.credentials.password | password: this.credentials.password | ||||
}; | }; | ||||
auth.login(this, credentials, function(){ | |||||
auth.login(this, credentials, function () { | |||||
$('#SignInCollapseNavbar').collapse('hide'); | $('#SignInCollapseNavbar').collapse('hide'); | ||||
router.go('/'); | router.go('/'); | ||||
}); | }); | ||||
@@ -111,7 +99,7 @@ | |||||
auth.register(this, credentials) | auth.register(this, credentials) | ||||
}, | }, | ||||
logout() { | logout() { | ||||
auth.logout(function(){ | |||||
auth.logout(function () { | |||||
router.go('/presentation/'); | router.go('/presentation/'); | ||||
}) | }) | ||||
} | } | ||||
@@ -1,30 +1,39 @@ | |||||
<style> | <style> | ||||
.headlines { | |||||
color: #252830; | |||||
background-color: #D8E4EA; | |||||
padding: 5em 0 7em; | |||||
} | |||||
.headlines .title { | .headlines .title { | ||||
font-size: 1.5rem; | |||||
font-size: 1.4rem; | |||||
} | } | ||||
.headlines .subtitle { | .headlines .subtitle { | ||||
font-size: 1.3rem; | |||||
font-size: 1.2rem; | |||||
} | } | ||||
@media (min-width: 550px) { | @media (min-width: 550px) { | ||||
.headlines { | |||||
padding: 1em 0 3em; | |||||
} | |||||
.headlines .title { | .headlines .title { | ||||
font-size: 2.5rem; | |||||
margin-top: 1em; | |||||
font-size: 2.3rem; | |||||
} | } | ||||
} | } | ||||
</style> | </style> | ||||
<template> | <template> | ||||
<section class="headlines text-xs-center"> | |||||
<section class="headlines"> | |||||
<div class="container"> | <div class="container"> | ||||
<div class="col-lg-10 col-lg-offset-1"> | |||||
<div class="col-lg-6 hidden-xs-down"> | |||||
<div v-if="$t('lang') == 'en'"> | |||||
<img src="../assets/images/story-en.png" class="img-fluid" alt="what is lesspass"/> | |||||
</div> | |||||
<div v-if="$t('lang') == 'fr'"> | |||||
<img src="../assets/images/story-fr.png" class="img-fluid" alt="qu'est ce que lesspass"/> | |||||
</div> | |||||
<small>© Nanou</small> | |||||
</div> | |||||
<div class="col-lg-6 m-t-3"> | |||||
<h2 class="title text-primary">{{{ $t('header.title') }}}</h2> | <h2 class="title text-primary">{{{ $t('header.title') }}}</h2> | ||||
<h4 class="subtitle hidden-xs-down"> | |||||
<h4 class="subtitle"> | |||||
<span class="text-primary"> LessPass</span> {{ $t('header.subtitle') }} | <span class="text-primary"> LessPass</span> {{ $t('header.subtitle') }} | ||||
</h4> | </h4> | ||||
</div> | </div> | ||||
@@ -0,0 +1,29 @@ | |||||
<template> | |||||
<lesspass-headlines></lesspass-headlines> | |||||
<password-generator></password-generator> | |||||
<lesspass-features></lesspass-features> | |||||
<lesspass-faq></lesspass-faq> | |||||
<lesspass-footer></lesspass-footer> | |||||
</template> | |||||
<script> | |||||
import LesspassHeadlines from './headlines.vue'; | |||||
import PasswordGenerator from './password-generator.vue'; | |||||
import LesspassFeatures from './features.vue'; | |||||
import LesspassFaq from './faq.vue'; | |||||
import LesspassFooter from './footer.vue'; | |||||
export default { | |||||
data: function () { | |||||
return {} | |||||
}, | |||||
components: { | |||||
LesspassHeadlines, | |||||
PasswordGenerator, | |||||
LesspassFeatures, | |||||
LesspassFaq, | |||||
LesspassFooter | |||||
} | |||||
} | |||||
</script> |
@@ -1,6 +1,8 @@ | |||||
<template> | <template> | ||||
<div id="password-generator" class="container m-y-3"> | |||||
<form> | |||||
<div id="password-generator" class="container p-y-3"> | |||||
<div class="row"> | |||||
<div class="col-lg-12"> | |||||
<form> | |||||
<div class="form-group row"> | <div class="form-group row"> | ||||
<div class="col-lg-3 m-t-1"> | <div class="col-lg-3 m-t-1"> | ||||
<label for="pg-email" class="sr-only"> | <label for="pg-email" class="sr-only"> | ||||
@@ -18,12 +20,17 @@ | |||||
<label for="pg-masterpassword" class="sr-only"> | <label for="pg-masterpassword" class="sr-only"> | ||||
{{ $t('passwordgenerator.password') }} | {{ $t('passwordgenerator.password') }} | ||||
</label> | </label> | ||||
<input id="pg-masterpassword" | |||||
class="form-control" | |||||
type="password" | |||||
placeholder="{{ $t('passwordgenerator.password') }}" | |||||
v-model="password" | |||||
v-on:blur="updateMasterPassword"> | |||||
<div class="input-group"> | |||||
<input id="pg-masterpassword" | |||||
class="form-control" | |||||
type="password" | |||||
placeholder="{{ $t('passwordgenerator.password') }}" | |||||
v-model="password" | |||||
v-on:blur="updateMasterPassword"> | |||||
<span class="input-group-btn" @click="changeType('pg-masterpassword')"> | |||||
<button class="btn btn-secondary" type="button"><i class="fa fa-eye"></i></button> | |||||
</span> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="col-lg-3 m-t-1"> | <div class="col-lg-3 m-t-1"> | ||||
<label for="pg-site" class="sr-only"> | <label for="pg-site" class="sr-only"> | ||||
@@ -78,7 +85,8 @@ | |||||
</div> | </div> | ||||
<div class="col-lg-3"> | <div class="col-lg-3"> | ||||
<label class="c-input c-checkbox"> | <label class="c-input c-checkbox"> | ||||
<input type="checkbox" id="numbers" value="numbers" v-model="passwordInfo.settings" | |||||
<input type="checkbox" id="numbers" value="numbers" | |||||
v-model="passwordInfo.settings" | |||||
checked> | checked> | ||||
<span class="c-indicator"></span> | <span class="c-indicator"></span> | ||||
{{ $t('passwordgenerator.numbers_options') }} | {{ $t('passwordgenerator.numbers_options') }} | ||||
@@ -86,7 +94,8 @@ | |||||
</div> | </div> | ||||
<div class="col-lg-3"> | <div class="col-lg-3"> | ||||
<label class="c-input c-checkbox"> | <label class="c-input c-checkbox"> | ||||
<input type="checkbox" id="symbols" value="symbols" v-model="passwordInfo.settings" | |||||
<input type="checkbox" id="symbols" value="symbols" | |||||
v-model="passwordInfo.settings" | |||||
checked> | checked> | ||||
<span class="c-indicator"></span> | <span class="c-indicator"></span> | ||||
{{ $t('passwordgenerator.symbols_options') }} | {{ $t('passwordgenerator.symbols_options') }} | ||||
@@ -125,12 +134,13 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import Lesspass from '../lesspass' | import Lesspass from '../lesspass' | ||||
import Clipboard from 'clipboard'; | import Clipboard from 'clipboard'; | ||||
export default { | export default { | ||||
@@ -154,9 +164,16 @@ | |||||
var password = this.password; | var password = this.password; | ||||
if (email && password) { | if (email && password) { | ||||
Lesspass.createMasterPassword(email, password).then(function (masterPassword) { | Lesspass.createMasterPassword(email, password).then(function (masterPassword) { | ||||
self.$set('masterPassword', masterPassword) | |||||
self.$set('masterPassword', masterPassword); | |||||
}); | }); | ||||
} | } | ||||
}, | |||||
changeType: function (id) { | |||||
if (document.getElementById(id).type == 'password') { | |||||
document.getElementById(id).type = 'text' | |||||
} else { | |||||
document.getElementById(id).type = 'password' | |||||
} | |||||
} | } | ||||
}, | }, | ||||
computed: { | computed: { | ||||
@@ -1,3 +1,6 @@ | |||||
var I18n = require('vue-i18n'); | |||||
var Vue = require('vue'); | |||||
const locales = { | const locales = { | ||||
"en": { | "en": { | ||||
"lang": "en", | "lang": "en", | ||||
@@ -84,6 +87,9 @@ const locales = { | |||||
"create_account": "Create an account", | "create_account": "Create an account", | ||||
"welcome": "Login successful, welcome on LessPass", | "welcome": "Login successful, welcome on LessPass", | ||||
"credentials_invalids": "The email address or password you entered is not valid." | "credentials_invalids": "The email address or password you entered is not valid." | ||||
}, | |||||
"register": { | |||||
"beta": "Registration for LessPass Entreprise is not yet possible.<br><a href='mailto:contact@oslab.fr?subject=Invitation%20to%20LessPass&body=Hello%0d%0acan%20you%20send%20me%20an%20invitation%20for%20LessPass%20Entreprise%20?%0d%0aThank%20you'><b>Ask your invite here</b></a>" | |||||
} | } | ||||
}, | }, | ||||
"fr": { | "fr": { | ||||
@@ -172,10 +178,17 @@ const locales = { | |||||
"credentials_invalids": "L' adresse e-mail et/ou mot de passe sont invalides" | "credentials_invalids": "L' adresse e-mail et/ou mot de passe sont invalides" | ||||
}, | }, | ||||
"register": { | "register": { | ||||
"beta" : "LessPass Application est pour l'instant en version beta. Vous pouvez utilisez LessPass <a href='#password-generator'><b>en mode deconnecté</b></a>" | |||||
"beta": "L'inscription à LessPass Entreprise n'est pas encore possible.<br><a href='mailto:contact@oslab.fr?subject=Invitation%20à%20LessPass&body=Bonjour%0d%0apouvez-vous%20me%20faire%20parvenir%20une%20invitation%20pour%20LessPass%20Entreprise%20?%0d%0aMerci'><b>Demandez une invitation</b></a>" | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
export default locales; | |||||
var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0]; | |||||
var lang = browserLanguage in locales ? browserLanguage : 'en'; | |||||
Vue.use(I18n, { | |||||
lang: lang, | |||||
locales: locales | |||||
}); | |||||
module.exports = locales; |
@@ -1,51 +1,13 @@ | |||||
import Vue from 'vue' | |||||
import Router from 'vue-router'; | |||||
import Resource from 'vue-resource'; | |||||
import i18n from 'vue-i18n'; | |||||
require('../node_modules/bootstrap/dist/css/bootstrap.css'); | |||||
require('../node_modules/font-awesome/css/font-awesome.min.css'); | |||||
require('../node_modules/bootstrap/dist/js/umd/collapse.js'); | |||||
import locales from './locales/locales'; | |||||
import App from './app.vue'; | |||||
import IndexView from './components/index.vue'; | |||||
import Dashboard from './components/dashboard.vue'; | |||||
import auth from './services/auth'; | |||||
Vue.use(Resource); | |||||
Vue.use(Router); | |||||
var Vue = require('vue'); | |||||
Vue.config.debug = true; | |||||
var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0]; | |||||
var lang = browserLanguage in locales ? browserLanguage : 'en'; | |||||
Vue.use(i18n, { | |||||
lang: lang, | |||||
locales: locales | |||||
}); | |||||
require('./locales.js'); | |||||
require('./router.js'); | |||||
Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('token'); | |||||
auth.checkAuth(); | |||||
export var router = new Router(); | |||||
router.map({ | |||||
'/': { | |||||
auth: true, | |||||
component: Dashboard | |||||
}, | |||||
'/presentation/': { | |||||
component: IndexView | |||||
} | |||||
}); | |||||
router.redirect({ | |||||
'*': '/' | |||||
}); | |||||
router.start(App, '#app'); | |||||
router.beforeEach(function (transition) { | |||||
if (transition.to.auth && !auth.user.authenticated) { | |||||
transition.redirect('/presentation/') | |||||
} else { | |||||
transition.next() | |||||
} | |||||
}); | |||||
var Resource = require('vue-resource'); | |||||
Vue.use(Resource); |
@@ -0,0 +1,51 @@ | |||||
import Vue from 'vue' | |||||
import Router from 'vue-router'; | |||||
import Resource from 'vue-resource'; | |||||
import i18n from 'vue-i18n'; | |||||
import locales from './locales/locales'; | |||||
import App from './app.vue'; | |||||
import IndexView from './components/index.vue'; | |||||
import Dashboard from './components/dashboard.vue'; | |||||
import auth from './services/auth'; | |||||
Vue.use(Resource); | |||||
Vue.use(Router); | |||||
var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0]; | |||||
var lang = browserLanguage in locales ? browserLanguage : 'en'; | |||||
Vue.use(i18n, { | |||||
lang: lang, | |||||
locales: locales | |||||
}); | |||||
Vue.http.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('token'); | |||||
auth.checkAuth(); | |||||
export var router = new Router(); | |||||
router.map({ | |||||
'/': { | |||||
auth: true, | |||||
component: Dashboard | |||||
}, | |||||
'/presentation/': { | |||||
component: IndexView | |||||
} | |||||
}); | |||||
router.redirect({ | |||||
'*': '/' | |||||
}); | |||||
router.start(App, '#app'); | |||||
router.beforeEach(function (transition) { | |||||
if (transition.to.auth && !auth.user.authenticated) { | |||||
transition.redirect('/presentation/') | |||||
} else { | |||||
transition.next() | |||||
} | |||||
}); |
@@ -0,0 +1,43 @@ | |||||
var Vue = require('vue'); | |||||
var Router = require('vue-router'); | |||||
var App = require('./app.vue'); | |||||
var IndexView = require('./components/index.vue'); | |||||
var Dashboard = require('./components/dashboard.vue'); | |||||
Vue.use(Router); | |||||
var router = new Router(); | |||||
router.map({ | |||||
'/': { | |||||
auth: true, | |||||
component: Dashboard | |||||
}, | |||||
'/presentation/': { | |||||
component: IndexView | |||||
} | |||||
}); | |||||
router.redirect({ | |||||
'*': '/' | |||||
}); | |||||
router.start(App, '#app'); | |||||
var Auth = require('./services/auth.js'); | |||||
Auth.checkAuth(); | |||||
router.beforeEach(function (transition) { | |||||
if (transition.to.auth && !Auth.user.authenticated) { | |||||
transition.redirect('/presentation/') | |||||
} else { | |||||
transition.next() | |||||
} | |||||
}); | |||||
module.exports = router; | |||||
@@ -1,7 +1,6 @@ | |||||
import {router} from '../main' | |||||
import logging from './logging' | |||||
var logging = require('./logging.js'); | |||||
export default { | |||||
module.exports = { | |||||
user: { | user: { | ||||
authenticated: false | authenticated: false | ||||
}, | }, | ||||
@@ -53,4 +52,4 @@ export default { | |||||
'Authorization': 'Bearer ' + localStorage.getItem('token') | 'Authorization': 'Bearer ' + localStorage.getItem('token') | ||||
} | } | ||||
} | } | ||||
} | |||||
}; |
@@ -1,4 +1,5 @@ | |||||
import toastr from 'toastr' | |||||
var toastr = require('toastr'); | |||||
require('toastr/build/toastr.min.css'); | |||||
toastr.options = { | toastr.options = { | ||||
"closeButton": true, | "closeButton": true, | ||||
@@ -10,7 +11,7 @@ toastr.options = { | |||||
"onclick": null, | "onclick": null, | ||||
"showDuration": "300", | "showDuration": "300", | ||||
"hideDuration": "1000", | "hideDuration": "1000", | ||||
"timeOut": "5000", | |||||
"timeOut": "10000", | |||||
"extendedTimeOut": "1000", | "extendedTimeOut": "1000", | ||||
"showEasing": "swing", | "showEasing": "swing", | ||||
"hideEasing": "linear", | "hideEasing": "linear", | ||||
@@ -18,7 +19,7 @@ toastr.options = { | |||||
"hideMethod": "fadeOut" | "hideMethod": "fadeOut" | ||||
}; | }; | ||||
export default { | |||||
module.exports = { | |||||
error(message){ | error(message){ | ||||
toastr.error(message); | toastr.error(message); | ||||
}, | }, | ||||
@@ -31,4 +32,4 @@ export default { | |||||
clear(){ | clear(){ | ||||
toastr.clear(); | toastr.clear(); | ||||
} | } | ||||
} | |||||
}; |
@@ -26,6 +26,6 @@ | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<div id="app"></div> | <div id="app"></div> | ||||
<script src="dist/app.js"></script> | |||||
<script src="dist/bundle.js"></script> | |||||
</body> | </body> | ||||
</html> | </html> |
@@ -9,7 +9,7 @@ | |||||
"predev": "npm install", | "predev": "npm install", | ||||
"dev": "webpack-dev-server --inline --hot --host 0.0.0.0", | "dev": "webpack-dev-server --inline --hot --host 0.0.0.0", | ||||
"prebuild": "rimraf dist && npm prune && npm install", | "prebuild": "rimraf dist && npm prune && npm install", | ||||
"build": "NODE_ENV=production webpack --progress --hide-modules", | |||||
"build": "NODE_ENV=production webpack -p", | |||||
"start": "NODE_ENV=production node server.js" | "start": "NODE_ENV=production node server.js" | ||||
}, | }, | ||||
"repository": { | "repository": { | ||||
@@ -28,22 +28,22 @@ | |||||
"homepage": "https://github.com/guillaumevincent/lesspass#readme", | "homepage": "https://github.com/guillaumevincent/lesspass#readme", | ||||
"dependencies": { | "dependencies": { | ||||
"bootstrap": "^4.0.0-alpha.2", | "bootstrap": "^4.0.0-alpha.2", | ||||
"clipboard": "^1.5.5", | |||||
"clipboard": "^1.5.8", | |||||
"express": "^4.13.4", | "express": "^4.13.4", | ||||
"font-awesome": "^4.5.0", | "font-awesome": "^4.5.0", | ||||
"jquery": "^2.2.0", | "jquery": "^2.2.0", | ||||
"tether": "^1.1.1", | "tether": "^1.1.1", | ||||
"toastr": "^2.1.2", | "toastr": "^2.1.2", | ||||
"vue": "^1.0.15", | |||||
"vue-i18n": "^2.3.3", | |||||
"vue": "^1.0.16", | |||||
"vue-i18n": "^2.4.0", | |||||
"vue-resource": "^0.7.0", | "vue-resource": "^0.7.0", | ||||
"vue-router": "^0.7.10" | "vue-router": "^0.7.10" | ||||
}, | }, | ||||
"devDependencies": { | "devDependencies": { | ||||
"babel-core": "^6.4.5", | |||||
"babel-loader": "^6.2.1", | |||||
"babel-plugin-transform-runtime": "^6.4.3", | |||||
"babel-preset-es2015": "^6.3.13", | |||||
"babel-core": "^6.5.1", | |||||
"babel-loader": "^6.2.2", | |||||
"babel-plugin-transform-runtime": "^6.5.0", | |||||
"babel-preset-es2015": "^6.5.0", | |||||
"babel-runtime": "^5.8.34", | "babel-runtime": "^5.8.34", | ||||
"css-loader": "^0.23.1", | "css-loader": "^0.23.1", | ||||
"eslint": "^1.10.3", | "eslint": "^1.10.3", | ||||
@@ -57,16 +57,17 @@ | |||||
"nodemon": "latest", | "nodemon": "latest", | ||||
"npm-run-all": "latest", | "npm-run-all": "latest", | ||||
"rimraf": "^2.5.1", | "rimraf": "^2.5.1", | ||||
"style-loader": "^0.13.0", | |||||
"template-html-loader": "0.0.3", | "template-html-loader": "0.0.3", | ||||
"uglify-js": "^2.6.1", | "uglify-js": "^2.6.1", | ||||
"url-loader": "^0.5.7", | "url-loader": "^0.5.7", | ||||
"vue-hot-reload-api": "^1.2.2", | |||||
"vue-hot-reload-api": "^1.3.2", | |||||
"vue-html-loader": "^1.1.0", | "vue-html-loader": "^1.1.0", | ||||
"vue-loader": "^8.0.2", | |||||
"vue-loader": "^8.1.1", | |||||
"vue-style-loader": "^1.0.0", | "vue-style-loader": "^1.0.0", | ||||
"vueify": "^8.3.2", | |||||
"vueify": "^8.3.5", | |||||
"vueify-insert-css": "^1.0.0", | "vueify-insert-css": "^1.0.0", | ||||
"webpack": "^1.12.12", | |||||
"webpack": "^1.12.13", | |||||
"webpack-dev-server": "^1.14.1" | "webpack-dev-server": "^1.14.1" | ||||
}, | }, | ||||
"babel": { | "babel": { | ||||
@@ -1,61 +1,38 @@ | |||||
var webpack = require('webpack'); | var webpack = require('webpack'); | ||||
module.exports = { | module.exports = { | ||||
entry: ['./app/main.js'], | |||||
context: __dirname + "/app", | |||||
entry: "./main.js", | |||||
output: { | output: { | ||||
path: './dist', | |||||
path: __dirname + "/dist", | |||||
publicPath: '/dist/', | publicPath: '/dist/', | ||||
filename: 'app.js' | |||||
}, | |||||
devServer: { | |||||
port: 8080 | |||||
filename: "bundle.js" | |||||
}, | }, | ||||
module: { | module: { | ||||
loaders: [ | loaders: [ | ||||
{ | |||||
test: /\.scss$/, | |||||
loaders: ['css', 'sass'] | |||||
}, | |||||
//{test: /\.js$/, loader: 'babel-loader', query: {presets: ['es2015']}}, | |||||
{ | { | ||||
test: /\.js$/, | test: /\.js$/, | ||||
exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//, | exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//, | ||||
loader: 'babel' | loader: 'babel' | ||||
}, | }, | ||||
{ | |||||
test: /\.vue$/, | |||||
loader: 'vue' | |||||
}, | |||||
{ | |||||
test: /\.(png|jpe?g|gif)$/, | |||||
loader: 'url', | |||||
query: { | |||||
limit: 10000, | |||||
name: '[name].[ext]?[hash]' | |||||
} | |||||
} | |||||
{test: /\.css$/, loader: 'style-loader!css-loader'}, | |||||
{test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}, | |||||
{test: /\.vue$/, loader: 'vue'}, | |||||
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"}, | |||||
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"}, | |||||
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"}, | |||||
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"}, | |||||
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"} | |||||
] | ] | ||||
}, | }, | ||||
babel: { | |||||
presets: ['es2015'], | |||||
plugins: ['transform-runtime'] | |||||
} | |||||
}; | |||||
if (process.env.NODE_ENV === 'production') { | |||||
module.exports.plugins = [ | |||||
new webpack.DefinePlugin({ | |||||
'process.env': { | |||||
NODE_ENV: '"production"' | |||||
} | |||||
}), | |||||
new webpack.optimize.UglifyJsPlugin({ | |||||
compress: { | |||||
warnings: false | |||||
}, | |||||
comments: false | |||||
}), | |||||
new webpack.optimize.OccurenceOrderPlugin() | |||||
plugins: [ | |||||
new webpack.ProvidePlugin({ | |||||
$: "jquery", | |||||
jQuery: "jquery", | |||||
"window.jQuery": "jquery" | |||||
}) | |||||
] | ] | ||||
} else { | |||||
module.exports.devtool = '#source-map' | |||||
} | |||||
}; |
@@ -0,0 +1,86 @@ | |||||
var webpack = require('webpack'); | |||||
module.exports = { | |||||
entry: ['./app/main.js'], | |||||
output: { | |||||
path: './dist', | |||||
publicPath: '/dist/', | |||||
filename: 'app.js' | |||||
}, | |||||
devServer: { | |||||
port: 8080 | |||||
}, | |||||
module: { | |||||
loaders: [ | |||||
{ | |||||
test: /\.scss$/, | |||||
loaders: ['css', 'sass'] | |||||
}, | |||||
{ | |||||
test: /\.js$/, | |||||
exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//, | |||||
loader: 'babel' | |||||
}, | |||||
{ | |||||
test: /\.vue$/, | |||||
loader: 'vue' | |||||
}, | |||||
{ | |||||
test: /\.(png|jpe?g|gif)$/, | |||||
loader: 'url', | |||||
query: { | |||||
limit: 10000, | |||||
name: '[name].[ext]?[hash]' | |||||
} | |||||
}, | |||||
{ | |||||
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, | |||||
loader: "url?limit=10000&mimetype=application/font-woff" | |||||
}, | |||||
{ | |||||
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, | |||||
loader: "url?limit=10000&mimetype=application/font-woff" | |||||
}, | |||||
{ | |||||
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, | |||||
loader: "url?limit=10000&mimetype=application/octet-stream" | |||||
}, | |||||
{ | |||||
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, | |||||
loader: "file" | |||||
}, | |||||
{ | |||||
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, | |||||
loader: "url?limit=10000&mimetype=image/svg+xml" | |||||
} | |||||
] | |||||
}, | |||||
babel: { | |||||
presets: ['es2015'], | |||||
plugins: ['transform-runtime'] | |||||
}, | |||||
plugins: [ | |||||
new webpack.ProvidePlugin({ | |||||
$: "jquery", | |||||
jQuery: "jquery", | |||||
"window.jQuery": "jquery" | |||||
}) | |||||
] | |||||
}; | |||||
if (process.env.NODE_ENV === 'production') { | |||||
module.exports.plugins = [ | |||||
new webpack.DefinePlugin({ | |||||
'process.env': { | |||||
NODE_ENV: '"production"' | |||||
} | |||||
}), | |||||
new webpack.optimize.UglifyJsPlugin({ | |||||
compress: { | |||||
warnings: false | |||||
}, | |||||
comments: false | |||||
}), | |||||
new webpack.optimize.OccurenceOrderPlugin() | |||||
] | |||||
} |