84 lines
2.6 KiB
JavaScript
84 lines
2.6 KiB
JavaScript
let slideShowIndex = 0;
|
|
let slideShowSlides = []; //An array of arrays - each sub-array contains the image path, title, description, width, and height.//
|
|
let scrollerScrollTime = 3500;
|
|
let scrollerInitialDelay = 5000;
|
|
let scrollerTransitionTime = 1000;
|
|
|
|
window.status="";
|
|
|
|
//Handle the document ready event which is where any initialization code goes.
|
|
$(document).ready(function($) {
|
|
let contentDiv = $('#content');
|
|
//let viewName = "main-view";
|
|
//let view = $('[bs-view="' + viewName + '"]');
|
|
//if(!view || view.length != 1) {
|
|
// throw "View with name: '" + viewName + "' not found";
|
|
//}
|
|
//let layoutManager = new LayoutManager("main-view");
|
|
let layoutManager = new LayoutManager(contentDiv);
|
|
|
|
//layoutManager.defaultUrl = '!/holidays';
|
|
layoutManager.defaultUrl = '!/home';
|
|
layoutManager.pageClassFades = [
|
|
{cls: 'full', fadeIn: null, fadeOut: null}
|
|
];
|
|
layoutManager.viewMetadataDefaults = {classes: 'full'};
|
|
// layoutManager.viewMetadata = {
|
|
// weddings: {
|
|
// load: "element.data('scroller', new ItemScroller($('div.scrollViewport'), 142, scrollerScrollTime, scrollerInitialDelay, scrollerTransitionTime, false));",
|
|
// unload:"element.data('scroller').release(); element.data('scroller', undefined);"
|
|
// },
|
|
// home: {
|
|
// load: "$('#head').addClass('tall')",
|
|
// unload: "$('#head').removeClass('tall')"
|
|
// //load: "$('#head, #links').css({display: 'none'})",
|
|
// //unload: "$('#head, #links').css({display: 'block'})"
|
|
// }
|
|
// };
|
|
|
|
layoutManager.viewMetadata = {
|
|
// home: {
|
|
// load: "$('#head').addClass('tall');",
|
|
// unload: "$('#head').removeClass('tall')"
|
|
// },
|
|
// farm: {
|
|
// load: "$('#submenu-home').removeClass('hidden')",
|
|
// unload: "$('#submenu-home').addClass('hidden')"
|
|
// },
|
|
// food: {
|
|
// load: "$('#submenu-food').removeClass('hidden')",
|
|
// unload: "$('#submenu-food').addClass('hidden')"
|
|
// },
|
|
// canned: {
|
|
// load: "$('#submenu-food').removeClass('hidden')",
|
|
// unload: "$('#submenu-food').addClass('hidden')"
|
|
// },
|
|
// produce: {
|
|
// load: "$('#submenu-food').removeClass('hidden')",
|
|
// unload: "$('#submenu-food').addClass('hidden')"
|
|
// }
|
|
};
|
|
|
|
//Associate a function with the history jquery addon that will load the url content after the history is updated.
|
|
$.history.init(function(url) {
|
|
if(!url || url.length == 0) {
|
|
url = layoutManager.defaultUrl;
|
|
}
|
|
|
|
layoutManager.show(url);
|
|
});
|
|
/*
|
|
let websocket = new WebSocket('ws://petitteton.com/');
|
|
|
|
websocket.onopen = function() {
|
|
websocket.ping();
|
|
};
|
|
websocket.onerror = function(error) {
|
|
console.log('Websocket error: ' + error);
|
|
};
|
|
websocket.onmessage = function(message) {
|
|
console.log('Server: ' + message);
|
|
};
|
|
*/
|
|
});
|