2017-01-24 01:48:35 +01:00
|
|
|
var hotspots = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
|
|
|
|
|
|
|
exports.show = function (hotspot_list) {
|
|
|
|
$('.hotspot').hide();
|
|
|
|
for (var i = 0; i < hotspot_list.length; i += 1) {
|
2017-04-15 05:50:59 +02:00
|
|
|
$("#hotspot_".concat(hotspot_list[i].name)).show();
|
2017-01-24 01:48:35 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.initialize = function () {
|
|
|
|
exports.show(page_params.hotspots);
|
|
|
|
};
|
|
|
|
|
|
|
|
function mark_hotspot_as_read(hotspot) {
|
|
|
|
channel.post({
|
|
|
|
url: '/json/users/me/hotspots',
|
|
|
|
data: {hotspot: JSON.stringify(hotspot)},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function () {
|
2017-04-15 05:50:59 +02:00
|
|
|
$("#hotspot_click_to_reply").on('click', function (e) {
|
|
|
|
mark_hotspot_as_read("click_to_reply");
|
2017-01-24 01:48:35 +01:00
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
2017-04-15 05:50:59 +02:00
|
|
|
$("#hotspot_new_topic_button").on('click', function (e) {
|
|
|
|
mark_hotspot_as_read("new_topic_button");
|
2017-01-24 01:48:35 +01:00
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
2017-04-15 05:50:59 +02:00
|
|
|
$("#hotspot_stream_settings").on('click', function (e) {
|
|
|
|
mark_hotspot_as_read("stream_settings");
|
2017-01-24 01:48:35 +01:00
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return exports;
|
|
|
|
}());
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = hotspots;
|
|
|
|
}
|