Guest User

Untitled

a guest
Nov 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. import 'babel-polyfill'
  2. import FastClick from 'fastClick'
  3. import Vue from 'vue'
  4. import App from './components/App.vue'
  5. import Trackly from './plugins/trackly'
  6. import Routemanager from './plugins/routemanager'
  7. import store from './store'
  8. import router from './routes'
  9. import detectPrivateMode from './lib/PrivateModeDetection'
  10. import updateAppConfig from './lib/UpdateAppConfig'
  11. import './filters'
  12. import 'moment/locale/en-gb'
  13. import 'moment/locale/sv'
  14. import 'moment/locale/da'
  15. import 'moment/locale/de'
  16. import 'moment/locale/nb'
  17. import MQ from 'vue-match-media'
  18. import VueConstants from 'vue-constants'
  19.  
  20. Trackly.gaPageView(router)
  21. Vue.use(Trackly)
  22. Vue.use(Routemanager)
  23. Vue.use(MQ)
  24. Vue.use(VueConstants)
  25.  
  26. router.beforeEach((to, from, next) => {
  27. document.body.scrollTop = document.documentElement.scrollTop = 0
  28. next()
  29. })
  30.  
  31. // Disable double tap to zoom
  32. window.addEventListener('load', function () {
  33. FastClick.attach(document.body)
  34. }, false)
  35.  
  36. window.addEventListener('DOMContentLoaded', () => {
  37. // Use array foreach if no native NodeList foreach support
  38. if (!NodeList.prototype.forEach) {
  39. NodeList.prototype.forEach = Array.prototype.forEach
  40. }
  41. // Detect private mode
  42. // @TODO: Handle this better once vuex-persistedstate has replaced persist!
  43. detectPrivateMode().then((result) => {
  44. store.dispatch('setPrivateMode', result)
  45. })
  46.  
  47. // Create Vue instance
  48. new Vue({
  49. store,
  50. router,
  51. render: h => h(App),
  52. methods: {
  53. computedImage (derivative, parentImageUrl) {
  54. return parentImageUrl + '_gen/derivatives/' +
  55. derivative + '/' + parentImageUrl.split(/\//).pop()
  56. }
  57. },
  58. mq: {
  59. // hero image derivatives
  60. heroImgb435h290: '(max-width: 435px)',
  61. heroImgb450h150: '(min-width: 436px) and (max-width: 450px)',
  62. heroImgb460h230: '(min-width: 451px) and (max-width: 460px)',
  63. heroImgb580h290: '(min-width: 461px) and (max-width: 580px)',
  64. heroImgb600h150: '(min-width: 581px) and (max-width: 600px)',
  65. heroImgb690h230: '(min-width: 601px) and (max-width: 690px)',
  66. heroImgb750h150: '(min-width: 691px) and (max-width: 750px)',
  67. heroImgb870h290: '(min-width: 751px) and (max-width: 870px)',
  68. heroImgb920h230: '(min-width: 871px)',
  69. // product list image derivatives
  70. prdctListImgb410h410: '(max-width: 410px)',
  71. prdctListImgb615h410: '(min-width: 411px) and (max-width: 615px)',
  72. prdctListImgb820h410: '(min-width: 616px) and (max-width: 820px)',
  73. // carousel image derivatives
  74. carouselImgb460h460: '(max-width: 460px)',
  75. carouselImgb690h460: '(min-width: 461px) and (max-width: 690px)',
  76. carouselImgb920h460: '(min-width: 691px) and (max-width: 920px)'
  77.  
  78. },
  79. beforeCreate () {
  80. updateAppConfig()
  81. }
  82. }).$mount('#booking-app')
  83. })
Add Comment
Please, Sign In to add comment