var Start = {
battle: function (){
this.inits();
this.styling();
},
firstLoad: function (){
BottomNavigation.init();
Navigation.init();
this.battle();
ProgressBar.load();
ViewAssembler.init();
if(LocalStorage.keyExists('last-page-name')) {
var lastPage = LocalStorage.get('last-page-name');
if(Views[lastPage]) {
Views[lastPage]();
}
else {
Views.loadView(lastPage);
}
}
else {
LocalStorage.set('last-page-name', GlobalSettings.initialPage);
Views[GlobalSettings.initialPage]();
}
new FastClick(document.body);
switch(GlobalSettings.env) {
case "web":
break;
case "cordova":
$.getScript("../components/cordova/index.js");
CordovaApp.initialize();
break;
}
},
inits: function (){
OrientationCheck.init();
ScrollingFixes.init();
Slider.init();
},
styling: function (){
var formElements = {
'input[type="button"]': 'btn',
'input[type="checkbox"]': 'checkbox',
'input[type="file"]': 'file',
'input[type="image"]': 'image',
'input[type="password"]': 'password',
'input[type="radio"]': 'radio',
'input[type="submit"]': 'submit btn',
'input[type="reset"]': 'reset',
'input[type="text"]': 'text',
'input[type="email"]': 'email',
'input[type="url"]': 'url',
'input[type="search"]': 'search',
'input[type="tel"]': 'tel',
'input[type="date"]': 'date',
'input[type="datetime"]': 'datetime',
'input[type="range"]': 'range'
};
for(var element in formElements) {
$(element).addClass(formElements[element]);
}
ProgressBar.init();