first commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------------------
|
||||
| Initialize Framework7
|
||||
| For more parameters visit https://framework7.io/docs/init-app.html
|
||||
|------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
window.myApp = new Framework7({
|
||||
cache: false,
|
||||
init: false,
|
||||
material: true,
|
||||
modalTitle: 'Nectar',
|
||||
notificationCloseButtonText: 'OK',
|
||||
scrollTopOnNavbarClick: true
|
||||
});
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------------------
|
||||
| Initialize Main View
|
||||
|------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
window.mainView = myApp.addView('.view-main');
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------------------
|
||||
| Assign Dom7 Global Function to a variable $$ to prevent conflicts with other
|
||||
| libraries like jQuery or Zepto.
|
||||
|------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
window.$$ = Dom7;
|
||||
|
||||
})();
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------------------
|
||||
| Function performed on every AJAX request
|
||||
|------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$$(document).on('ajaxStart', function (e) {
|
||||
myApp.showIndicator();
|
||||
});
|
||||
|
||||
$$(document).on('ajaxComplete', function (e) {
|
||||
myApp.hideIndicator();
|
||||
});
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------------------
|
||||
| Set last saved color and layout theme
|
||||
|------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$$(document).on('pageInit', function(e) {
|
||||
if (sessionStorage.getItem('nectarMaterialThemeColor')) {
|
||||
$$('body').removeClass('theme-red theme-pink theme-purple theme-deeppurple theme-indigo theme-blue theme-lightblue theme-cyan theme-teal theme-green theme-lightgreen theme-lime theme-yellow theme-amber theme-orange theme-deeporange theme-brown theme-gray theme-bluegray theme-white theme-black');
|
||||
$$('body').addClass('theme-' + sessionStorage.getItem('nectarMaterialThemeColor'));
|
||||
}
|
||||
|
||||
if (sessionStorage.getItem('nectarMaterialThemeLayout')) {
|
||||
switch(sessionStorage.getItem('nectarMaterialThemeLayout')) {
|
||||
case 'dark':
|
||||
$$('body').removeClass('layout-dark');
|
||||
$$('body').addClass('layout-' + sessionStorage.getItem('nectarMaterialThemeLayout'));
|
||||
break;
|
||||
default:
|
||||
$$('body').removeClass('layout-dark');
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
myApp.onPageInit('themes', function(page) {
|
||||
|
||||
if (sessionStorage.getItem('nectarMaterialThemeColor')) {
|
||||
$$('.page[data-page=themes] input[name=theme-color][value=' + sessionStorage.getItem('nectarMaterialThemeColor') + ']').prop('checked', true);
|
||||
}
|
||||
|
||||
/* Change Color Theme */
|
||||
$$('.page[data-page=themes] input[name=theme-color]').on('change', function() {
|
||||
if (this.checked) {
|
||||
$$('body').removeClass('theme-red theme-pink theme-purple theme-deeppurple theme-indigo theme-blue theme-lightblue theme-cyan theme-teal theme-green theme-lightgreen theme-lime theme-yellow theme-amber theme-orange theme-deeporange theme-brown theme-gray theme-bluegray theme-white theme-black');
|
||||
$$('body').addClass('theme-' + $$(this).val());
|
||||
sessionStorage.setItem('nectarMaterialThemeColor', $$(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
if (sessionStorage.getItem('nectarMaterialThemeLayout')) {
|
||||
$$('.page[data-page=themes] input[name=theme-layout][value=' + sessionStorage.getItem('nectarMaterialThemeLayout') + ']').prop('checked', true);
|
||||
}
|
||||
|
||||
/* Change Layout Theme */
|
||||
$$('.page[data-page=themes] input[name=theme-layout]').on('change', function() {
|
||||
if (this.checked) {
|
||||
switch($$(this).val()) {
|
||||
case 'dark':
|
||||
$$('body').removeClass('layout-dark');
|
||||
$$('body').addClass('layout-' + $$(this).val());
|
||||
break;
|
||||
default:
|
||||
$$('body').removeClass('layout-dark');
|
||||
break;
|
||||
}
|
||||
sessionStorage.setItem('nectarMaterialThemeLayout', $$(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user