40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
(function (context, $) {
|
|
|
|
"use strict";
|
|
|
|
context.JK = context.JK || {};
|
|
|
|
context.JK.ShutdownDialog = function (app) {
|
|
var logger = context.JK.logger;
|
|
|
|
function show() {
|
|
context.JK.Banner.showAlert(
|
|
{ title: "Close JamKazam Application",
|
|
buttons: [
|
|
{name: 'Completely Shut Down the App', click: function() {context.jamClient.ShutdownApplication()}},
|
|
{name: 'Let App Run in Background', click: function() {
|
|
context.jamClient.RegisterQuitCallback("window.JK.ShutdownDialogCallback");
|
|
context.JK.Banner.hide();
|
|
}
|
|
}
|
|
],
|
|
html: $('#template-shutdown-prompt').html()});
|
|
}
|
|
|
|
function initialize() {
|
|
context.jamClient.RegisterQuitCallback("window.JK.ShutdownDialogCallback");
|
|
}
|
|
|
|
function quitCallback(options) {
|
|
logger.debug("shutdown event");
|
|
show();
|
|
}
|
|
|
|
this.initialize = initialize;
|
|
|
|
context.JK.ShutdownDialogCallback = quitCallback;
|
|
|
|
return this;
|
|
|
|
}
|
|
})(window, jQuery); |