Browse Source

move assets outside app

pull/44/head
Guillaume Vincent 8 years ago
parent
commit
a9aa25099b
39 changed files with 0 additions and 133 deletions
  1. +0
    -43
      app/router.js
  2. +0
    -55
      app/services/auth.js
  3. +0
    -35
      app/services/logging.js
  4. +0
    -0
      assets/favicons/android-chrome-144x144.png
  5. +0
    -0
      assets/favicons/android-chrome-192x192.png
  6. +0
    -0
      assets/favicons/android-chrome-36x36.png
  7. +0
    -0
      assets/favicons/android-chrome-48x48.png
  8. +0
    -0
      assets/favicons/android-chrome-72x72.png
  9. +0
    -0
      assets/favicons/android-chrome-96x96.png
  10. +0
    -0
      assets/favicons/apple-touch-icon-114x114.png
  11. +0
    -0
      assets/favicons/apple-touch-icon-120x120.png
  12. +0
    -0
      assets/favicons/apple-touch-icon-144x144.png
  13. +0
    -0
      assets/favicons/apple-touch-icon-152x152.png
  14. +0
    -0
      assets/favicons/apple-touch-icon-180x180.png
  15. +0
    -0
      assets/favicons/apple-touch-icon-57x57.png
  16. +0
    -0
      assets/favicons/apple-touch-icon-60x60.png
  17. +0
    -0
      assets/favicons/apple-touch-icon-72x72.png
  18. +0
    -0
      assets/favicons/apple-touch-icon-76x76.png
  19. +0
    -0
      assets/favicons/apple-touch-icon-precomposed.png
  20. +0
    -0
      assets/favicons/apple-touch-icon.png
  21. +0
    -0
      assets/favicons/browserconfig.xml
  22. +0
    -0
      assets/favicons/favicon-16x16.png
  23. +0
    -0
      assets/favicons/favicon-32x32.png
  24. +0
    -0
      assets/favicons/favicon-96x96.png
  25. +0
    -0
      assets/favicons/favicon.ico
  26. +0
    -0
      assets/favicons/manifest.json
  27. +0
    -0
      assets/favicons/mstile-144x144.png
  28. +0
    -0
      assets/favicons/mstile-150x150.png
  29. +0
    -0
      assets/favicons/mstile-310x150.png
  30. +0
    -0
      assets/favicons/mstile-310x310.png
  31. +0
    -0
      assets/favicons/mstile-70x70.png
  32. +0
    -0
      assets/favicons/safari-pinned-tab.svg
  33. +0
    -0
      assets/images/featurettes.svg
  34. +0
    -0
      assets/images/lesspass.svg
  35. +0
    -0
      assets/images/logo-white.svg
  36. +0
    -0
      assets/images/logo.svg
  37. +0
    -0
      assets/images/story-en.svg
  38. +0
    -0
      assets/images/story-fr.svg
  39. +0
    -0
      assets/robots.txt

+ 0
- 43
app/router.js View File

@@ -1,43 +0,0 @@
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;




+ 0
- 55
app/services/auth.js View File

@@ -1,55 +0,0 @@
var logging = require('./logging.js');

module.exports = {
user: {
authenticated: false
},

login(context, credentials, callback) {
var self = this;
context.$http.post('/api/sessions/', credentials).then(
function (response) {
localStorage.setItem('token', response.data.token);
self.user.authenticated = true;
if (callback) {
logging.success(this.$t('login.welcome'));
callback();
}
},
function () {
logging.error(this.$t('login.credentials_invalids'));
}
);
},

register(context, user) {
var self = this;
context.$http.post('/api/users/', user).then(
function (response) {
logging.warning(this.$t('register.beta'));
},
function (error) {
logging.warning(this.$t('register.beta'));
}
);
},

logout(callback) {
localStorage.removeItem('token');
this.user.authenticated = false;
if (callback) {
callback();
}
},

checkAuth() {
var jwt = localStorage.getItem('token');
this.user.authenticated = !!jwt;
},

getAuthHeader() {
return {
'Authorization': 'Bearer ' + localStorage.getItem('token')
}
}
};

+ 0
- 35
app/services/logging.js View File

@@ -1,35 +0,0 @@
var toastr = require('toastr');
require('toastr/build/toastr.min.css');

toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-center",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "10000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};

module.exports = {
error(message){
toastr.error(message);
},
success(message){
toastr.success(message);
},
warning(message){
toastr.warning(message);
},
clear(){
toastr.clear();
}
};

app/assets/favicons/android-chrome-144x144.png → assets/favicons/android-chrome-144x144.png View File


app/assets/favicons/android-chrome-192x192.png → assets/favicons/android-chrome-192x192.png View File


app/assets/favicons/android-chrome-36x36.png → assets/favicons/android-chrome-36x36.png View File


app/assets/favicons/android-chrome-48x48.png → assets/favicons/android-chrome-48x48.png View File


app/assets/favicons/android-chrome-72x72.png → assets/favicons/android-chrome-72x72.png View File


app/assets/favicons/android-chrome-96x96.png → assets/favicons/android-chrome-96x96.png View File


app/assets/favicons/apple-touch-icon-114x114.png → assets/favicons/apple-touch-icon-114x114.png View File


app/assets/favicons/apple-touch-icon-120x120.png → assets/favicons/apple-touch-icon-120x120.png View File


app/assets/favicons/apple-touch-icon-144x144.png → assets/favicons/apple-touch-icon-144x144.png View File


app/assets/favicons/apple-touch-icon-152x152.png → assets/favicons/apple-touch-icon-152x152.png View File


app/assets/favicons/apple-touch-icon-180x180.png → assets/favicons/apple-touch-icon-180x180.png View File


app/assets/favicons/apple-touch-icon-57x57.png → assets/favicons/apple-touch-icon-57x57.png View File


app/assets/favicons/apple-touch-icon-60x60.png → assets/favicons/apple-touch-icon-60x60.png View File


app/assets/favicons/apple-touch-icon-72x72.png → assets/favicons/apple-touch-icon-72x72.png View File


app/assets/favicons/apple-touch-icon-76x76.png → assets/favicons/apple-touch-icon-76x76.png View File


app/assets/favicons/apple-touch-icon-precomposed.png → assets/favicons/apple-touch-icon-precomposed.png View File


app/assets/favicons/apple-touch-icon.png → assets/favicons/apple-touch-icon.png View File


app/assets/favicons/browserconfig.xml → assets/favicons/browserconfig.xml View File


app/assets/favicons/favicon-16x16.png → assets/favicons/favicon-16x16.png View File


app/assets/favicons/favicon-32x32.png → assets/favicons/favicon-32x32.png View File


app/assets/favicons/favicon-96x96.png → assets/favicons/favicon-96x96.png View File


app/assets/favicons/favicon.ico → assets/favicons/favicon.ico View File


app/assets/favicons/manifest.json → assets/favicons/manifest.json View File


app/assets/favicons/mstile-144x144.png → assets/favicons/mstile-144x144.png View File


app/assets/favicons/mstile-150x150.png → assets/favicons/mstile-150x150.png View File


app/assets/favicons/mstile-310x150.png → assets/favicons/mstile-310x150.png View File


app/assets/favicons/mstile-310x310.png → assets/favicons/mstile-310x310.png View File


app/assets/favicons/mstile-70x70.png → assets/favicons/mstile-70x70.png View File


app/assets/favicons/safari-pinned-tab.svg → assets/favicons/safari-pinned-tab.svg View File


app/assets/images/featurettes.svg → assets/images/featurettes.svg View File


app/assets/images/lesspass.svg → assets/images/lesspass.svg View File


app/assets/images/logo-white.svg → assets/images/logo-white.svg View File


app/assets/images/logo.svg → assets/images/logo.svg View File


app/assets/images/story-en.svg → assets/images/story-en.svg View File


app/assets/images/story-fr.svg → assets/images/story-fr.svg View File


app/assets/robots.txt → assets/robots.txt View File


Loading…
Cancel
Save