]> Softwares of Agnibho - dietsurvey.git/blob - src/main.js
Table scroll on narrow screen
[dietsurvey.git] / src / main.js
1 /**********************************************************************
2 * Title: DietSurvey
3 * Description: Nutritional Assessment App
4 * Author: Agnibho Mondal
5 * Website: http://code.agnibho.com
6 **********************************************************************
7 Copyright (c) 2016 Agnibho Mondal
8 All rights reserved
9 **********************************************************************
10 This file is part of DietSurvey.
11
12 DietSurvey is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16
17 DietSurvey is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with DietSurvey. If not, see <http://www.gnu.org/licenses/>.
24 **********************************************************************/
25
26 //Icon
27 import "./assets/logo.png"
28
29 //CSS
30 import "bootstrap/dist/css/bootstrap.css";
31 import "./custom.css";
32
33 //JS libs
34 import "jquery";
35 import "bootstrap";
36 import "bootstrap-validator";
37
38 //Data file
39 import data from "./data.json";
40
41 //Vue Components
42 import Vue from "vue";
43 import Input from "./input.vue";
44 import Output from "./output.vue";
45
46 //Start app
47 new Vue({
48 el: "#app",
49 components: {
50 "app-input": Input,
51 "app-output": Output
52 },
53 data: {dataObj: {family: [], food: []}, dataRef: false},
54 created:function(){
55 try{
56 var loc=JSON.parse(localStorage.getItem(STORAGE));
57 if(loc.version>data.version){
58 this.dataRef=loc;
59 }
60 else{
61 this.dataRef=data;
62 localStorage.setItem(STORAGE, JSON.stringify(data));
63 }
64 }
65 catch(e){
66 if(!this.dataRef){
67 this.dataRef=data;
68 localStorage.setItem(STORAGE, JSON.stringify(data));
69 }
70 }
71 }
72 });
73 //Routine jobs
74 import "./routine.js";
75
76 //Source Map
77 //#sourceMappingURL=dist/bundle.js.map