Files
dss/static/js/app/lib/utils.js
2013-06-17 19:10:25 +01:00

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);