mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-06 00:44:16 +00:00
34 lines
980 B
JavaScript
34 lines
980 B
JavaScript
// Generated by CoffeeScript 1.3.3
|
|
(function() {
|
|
|
|
define(['jquery', 'bootstrap'], function($, bootstrap) {
|
|
return {
|
|
modal: function(url) {
|
|
if (url.indexOf("#") === 0) {
|
|
$(url).modal("open");
|
|
} else {
|
|
$.get(url, function(data) {
|
|
return $("<div class=\"modal hide fade\">" + data + "</div>").modal().on("hidden", function() {
|
|
return $(this).remove();
|
|
});
|
|
}).success(function() {
|
|
return $("input:text:visible:first").focus();
|
|
});
|
|
}
|
|
return true;
|
|
},
|
|
checkPlayCount: function() {
|
|
if (document.cookie.indexOf("sessionId")) {
|
|
$.getJSON("/ajax/session_play_count", function(data) {
|
|
if ((data.play_count !== 0) && (data.play_count % 1) === 0) {
|
|
return com.podnoms.utils.modal("tpl/PlayCountLoginAlert");
|
|
}
|
|
});
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
});
|
|
|
|
}).call(this);
|