2014-06-04 15:24:16 -04:00
|
|
|
/* authCanEditMapPage means:
|
|
|
|
1. being logged in and,
|
|
|
|
2. being on a Map page and having edit permissions (your map, or commons map)
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
// because anyone who can edit the map can collaborate on it in realtime
|
|
|
|
$(".sidebarCollaborateIcon").click(function (event) {
|
|
|
|
if (!goRealtime) {
|
2014-06-09 16:37:09 -04:00
|
|
|
window.realtime.sendRealtimeOn();
|
2014-06-04 15:24:16 -04:00
|
|
|
$('.sidebarCollaborate .tip').html('Stop Realtime Collaboration');
|
|
|
|
} else {
|
2014-06-09 16:37:09 -04:00
|
|
|
window.realtime.sendRealtimeOff();
|
2014-06-04 15:24:16 -04:00
|
|
|
$('.sidebarCollaborate .tip').html('Start Realtime Collaboration');
|
|
|
|
}
|
|
|
|
goRealtime = !goRealtime;
|
|
|
|
$(".sidebarCollaborateIcon").toggleClass("blue");
|
|
|
|
});
|
|
|
|
|
|
|
|
// because anyone who can edit the map can save a new map layout
|
|
|
|
$('.sidebarSave').click(function () {
|
|
|
|
saveLayoutAll();
|
|
|
|
});
|
|
|
|
|
|
|
|
// because anyone who can edit the map can change the map title
|
|
|
|
$('.mapInfoName .best_in_place_name').bind("ajax:success", function () {
|
|
|
|
var name = $(this).html();
|
|
|
|
$('.mapName').html(name);
|
|
|
|
});
|
|
|
|
|
|
|
|
}); // end document.ready
|