2014-06-30 20:44:28 +00:00
|
|
|
(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: [
|
2017-09-16 16:29:23 +00:00
|
|
|
{name: 'CANCEL', click: function() {
|
2017-07-10 02:21:29 +00:00
|
|
|
logger.debug("'CANCEL SHUTDOWN' selected")
|
|
|
|
|
context.JK.Banner.hide();
|
|
|
|
|
}},
|
2017-10-19 12:38:20 +00:00
|
|
|
{name: 'SHUT DOWN', click: function() {
|
|
|
|
|
logger.debug("'COMPLETELY SHUT DOWN THE APP' selected")
|
|
|
|
|
context.jamClient.ShutdownApplication()
|
|
|
|
|
}},
|
|
|
|
|
|
2014-06-30 20:44:28 +00:00
|
|
|
],
|
|
|
|
|
html: $('#template-shutdown-prompt').html()});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initialize() {
|
2014-07-13 18:20:30 +00:00
|
|
|
// guard against old clients
|
|
|
|
|
if(context.jamClient.RegisterQuitCallback) {
|
|
|
|
|
context.jamClient.RegisterQuitCallback("window.JK.ShutdownDialogCallback");
|
|
|
|
|
}
|
2014-06-30 20:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function quitCallback(options) {
|
2014-07-02 20:43:38 +00:00
|
|
|
logger.debug("shutdown event");
|
2014-06-30 20:44:28 +00:00
|
|
|
show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.initialize = initialize;
|
|
|
|
|
|
|
|
|
|
context.JK.ShutdownDialogCallback = quitCallback;
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})(window, jQuery);
|