diff --git a/app/assets/images/MMCCicon_realtime_blue.png b/app/assets/images/MMCCicon_realtime_blue.png index e821e243..98bd1982 100644 Binary files a/app/assets/images/MMCCicon_realtime_blue.png and b/app/assets/images/MMCCicon_realtime_blue.png differ diff --git a/app/assets/images/MMCCicon_realtime_junto.png b/app/assets/images/MMCCicon_realtime_junto.png index 4f687b4d..587065b4 100644 Binary files a/app/assets/images/MMCCicon_realtime_junto.png and b/app/assets/images/MMCCicon_realtime_junto.png differ diff --git a/app/assets/javascripts/Jit/graphsettings-model.js b/app/assets/javascripts/Jit/graphsettings-model.js index 3416be8c..5877e47b 100644 --- a/app/assets/javascripts/Jit/graphsettings-model.js +++ b/app/assets/javascripts/Jit/graphsettings-model.js @@ -9,6 +9,10 @@ var MetamapsModel = new Object(); MetamapsModel.embed = false; +// if you're on a map, this will be an object that has a reference to each user that has loaded the map, and whether they are +// in realtime or not +MetamapsModel.mappersOnMap = {}; + MetamapsModel.metacodeScrollerInit = false; // indicates whether the scrollbar in the custom metacode set space has been init diff --git a/app/assets/javascripts/jquery/AllMappingPages.js b/app/assets/javascripts/jquery/AllMappingPages.js index c4077c4d..c3f519d3 100644 --- a/app/assets/javascripts/jquery/AllMappingPages.js +++ b/app/assets/javascripts/jquery/AllMappingPages.js @@ -56,9 +56,9 @@ $(document).ready(function () { // hide the other two $('.sidebarAccountBox').hide(); - $('.sidebarWandBox').hide(); + $('.sidebarCollaborateBox').hide(); $('.sidebarAccountIcon').css('background-color', '#0F1519'); - $('.sidebarWandIcon').css('background-color', '#0F1519'); + $('.sidebarCollaborateIcon').css('background-color', '#0F1519'); $('.sidebarFilterIcon').css('background-color', '#000'); $('.sidebarFilterBox').fadeIn(200, function () { diff --git a/app/assets/javascripts/jquery/AuthCanEditMapPage.js b/app/assets/javascripts/jquery/AuthCanEditMapPage.js index 0800caec..6c79ffb3 100644 --- a/app/assets/javascripts/jquery/AuthCanEditMapPage.js +++ b/app/assets/javascripts/jquery/AuthCanEditMapPage.js @@ -7,28 +7,91 @@ $(document).ready(function () { + function bindRealtimeHover() { + + var realtimeIsOpen = false + + // controls the sliding hover of the bottom left menu + var sliding1 = false; + var lT; + + var closeRealtime = function () { + lT = setTimeout(function () { + if (!sliding1) { + sliding1 = true; + $('.sidebarCollaborateIcon').css('background-color', '#0F1519'); + $('.sidebarCollaborateBox').fadeOut(200, function () { + sliding1 = false; + realtimeIsOpen = false; + }); + } + }, 300); + } + + var openRealtime = function () { + clearTimeout(lT); + if (!sliding1) { + sliding1 = true; + + // hide the other two + $('.sidebarFilterBox').hide(); + $('.sidebarAccountBox').hide(); + $('.sidebarFilterIcon').css('background-color', '#0F1519'); + $('.sidebarAccountIcon').css('background-color', '#0F1519'); + + $('.sidebarCollaborateIcon').css('background-color', '#000'); + $('.sidebarCollaborateBox').fadeIn(200, function () { + sliding1 = false; + realtimeIsOpen = true; + }); + } + } + // bind the hover events + $(".sidebarCollaborate").hover(openRealtime, closeRealtime); + } // end bindRealtimeHover + + function bindSaveHover() { + var closeSave = function () { + + } + + var openSave = function () { + // hide the other three + $('.sidebarFilterBox, .sidebarAccountBox, .sidebarCollaborateBox').hide(); + $('.sidebarFilterIcon, .sidebarAccountIcon, .sidebarCollaborateIcon').css('background-color', '#0F1519'); + } + // bind the hover events + $(".sidebarSave").hover(openSave, closeSave); + } // end bindSaveHover + + // bind hover events + bindRealtimeHover(); + bindSaveHover(); + // because anyone who can edit the map can collaborate on it in realtime - $(".sidebarCollaborateIcon").click(function (event) { + $(".realtimeOnOff").click(function (event) { if (!goRealtime) { window.realtime.sendRealtimeOn(); - $('.sidebarCollaborate .tip').html('Stop Realtime Collaboration'); + $(this).html('ON').removeClass('rtOff').addClass('rtOn'); + $(".rtMapperSelf").removeClass('littleRtOff').addClass('littleRtOn'); } else { window.realtime.sendRealtimeOff(); - $('.sidebarCollaborate .tip').html('Start Realtime Collaboration'); + $(this).html('OFF').removeClass('rtOn').addClass('rtOff'); + $(".rtMapperSelf").removeClass('littleRtOn').addClass('littleRtOff'); } 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 \ No newline at end of file diff --git a/app/assets/javascripts/jquery/AuthCanEditMappingPages.js b/app/assets/javascripts/jquery/AuthCanEditMappingPages.js index e952e338..ba9794a9 100644 --- a/app/assets/javascripts/jquery/AuthCanEditMappingPages.js +++ b/app/assets/javascripts/jquery/AuthCanEditMappingPages.js @@ -9,6 +9,23 @@ this code adds required jQuery for creating, or pulling in, topics and synapses $(document).ready(function () { + function bindForkHover() { + var closeFork = function () { + + } + + var openFork = function () { + // hide the other three + $('.sidebarFilterBox, .sidebarAccountBox, .sidebarCollaborateBox').hide(); + $('.sidebarFilterIcon, .sidebarAccountIcon, .sidebarCollaborateIcon').css('background-color', '#0F1519'); + } + // bind the hover events + $(".sidebarFork").hover(openFork, closeFork); + } // end bindForkHover + + // bind hover events + bindForkHover(); + ////// ////// //// TOPIC CREATION diff --git a/app/assets/javascripts/jquery/EveryPage.js b/app/assets/javascripts/jquery/EveryPage.js index 1d9ade1f..2898883d 100644 --- a/app/assets/javascripts/jquery/EveryPage.js +++ b/app/assets/javascripts/jquery/EveryPage.js @@ -371,9 +371,9 @@ $(document).ready(function () { // hide the other two $('.sidebarFilterBox').hide(); - $('.sidebarWandBox').hide(); + $('.sidebarCollaborateBox').hide(); $('.sidebarFilterIcon').css('background-color', '#0F1519'); - $('.sidebarWandIcon').css('background-color', '#0F1519'); + $('.sidebarCollaborateIcon').css('background-color', '#0F1519'); $('.sidebarAccountIcon').css('background-color', '#000'); $('.sidebarAccountBox').fadeIn(200, function () { diff --git a/app/assets/javascripts/realtime/realtime.js b/app/assets/javascripts/realtime/realtime.js index 2428e3f3..a63126ca 100644 --- a/app/assets/javascripts/realtime/realtime.js +++ b/app/assets/javascripts/realtime/realtime.js @@ -26,6 +26,17 @@ window.realtime.setupSocket = function () { socket.on(userid + '-' + mapid + '-UpdateMapperList', function (data) { // data.userid // data.username + // data.userrealtime + + MetamapsModel.mappersOnMap[data.userid] = { + name: data.username, + realtime: data.userrealtime + }; + + var onOff = data.userrealtime ? "On" : "Off"; + var mapperListItem = '