diff --git a/Gemfile.lock b/Gemfile.lock index ae3beac5..0788526e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,12 +134,12 @@ DEPENDENCIES devise formtastic formula - jbuilder + jbuilder (= 0.8.2) jquery-rails (= 2.1.2) json pg rails (= 3.2.11) rails3-jquery-autocomplete redis - sass-rails (= 3.2.3) + sass-rails uglifier (>= 1.0.3) diff --git a/app/assets/images/MMCCicon_add_map.png b/app/assets/images/MMCCicon_add_map.png new file mode 100644 index 00000000..af4832b7 Binary files /dev/null and b/app/assets/images/MMCCicon_add_map.png differ diff --git a/app/assets/images/MMCCicon_filter.png b/app/assets/images/MMCCicon_filter.png new file mode 100644 index 00000000..afb23324 Binary files /dev/null and b/app/assets/images/MMCCicon_filter.png differ diff --git a/app/assets/images/MMCCicon_realtime_junto.png b/app/assets/images/MMCCicon_realtime_junto.png new file mode 100644 index 00000000..4f687b4d Binary files /dev/null and b/app/assets/images/MMCCicon_realtime_junto.png differ diff --git a/app/assets/images/MMCCicon_save_layout.png b/app/assets/images/MMCCicon_save_layout.png new file mode 100644 index 00000000..d163dfb5 Binary files /dev/null and b/app/assets/images/MMCCicon_save_layout.png differ diff --git a/app/assets/images/MMCCicon_save_new_map.png b/app/assets/images/MMCCicon_save_new_map.png new file mode 100644 index 00000000..9138e632 Binary files /dev/null and b/app/assets/images/MMCCicon_save_new_map.png differ diff --git a/app/assets/images/MMCCicon_wand.png b/app/assets/images/MMCCicon_wand.png new file mode 100644 index 00000000..409d1948 Binary files /dev/null and b/app/assets/images/MMCCicon_wand.png differ diff --git a/app/assets/images/example.png b/app/assets/images/example.png index 29a9393a..549bfcc6 100644 Binary files a/app/assets/images/example.png and b/app/assets/images/example.png differ diff --git a/app/assets/images/foresight.png b/app/assets/images/foresight.png index ca3d7072..50cae5a4 100644 Binary files a/app/assets/images/foresight.png and b/app/assets/images/foresight.png differ diff --git a/app/assets/images/idea.png b/app/assets/images/idea.png index 25378e79..81744c1f 100644 Binary files a/app/assets/images/idea.png and b/app/assets/images/idea.png differ diff --git a/app/assets/images/knowledge.png b/app/assets/images/knowledge.png index ece21567..d6a5541f 100644 Binary files a/app/assets/images/knowledge.png and b/app/assets/images/knowledge.png differ diff --git a/app/assets/images/note.png b/app/assets/images/note.png index e4802f85..fb0ac60e 100644 Binary files a/app/assets/images/note.png and b/app/assets/images/note.png differ diff --git a/app/assets/images/openissue.png b/app/assets/images/openissue.png index a4968bbc..63ac1fe6 100644 Binary files a/app/assets/images/openissue.png and b/app/assets/images/openissue.png differ diff --git a/app/assets/images/opinion.png b/app/assets/images/opinion.png index 3e418b65..deb80bd3 100644 Binary files a/app/assets/images/opinion.png and b/app/assets/images/opinion.png differ diff --git a/app/assets/images/role.png b/app/assets/images/role.png index 3d6147c4..26db929a 100644 Binary files a/app/assets/images/role.png and b/app/assets/images/role.png differ diff --git a/app/assets/images/task.png b/app/assets/images/task.png index c9d8f081..99167fa7 100644 Binary files a/app/assets/images/task.png and b/app/assets/images/task.png differ diff --git a/app/assets/images/tool.png b/app/assets/images/tool.png index ab5097a3..cd421f1a 100644 Binary files a/app/assets/images/tool.png and b/app/assets/images/tool.png differ diff --git a/app/assets/images/trajectory.png b/app/assets/images/trajectory.png index bd9f8746..f6371031 100644 Binary files a/app/assets/images/trajectory.png and b/app/assets/images/trajectory.png differ diff --git a/app/assets/images/wildcard.png b/app/assets/images/wildcard.png index d72c4994..c57d455b 100644 Binary files a/app/assets/images/wildcard.png and b/app/assets/images/wildcard.png differ diff --git a/app/assets/javascripts/Jit/graphsettings-event-handlers.js b/app/assets/javascripts/Jit/graphsettings-event-handlers.js index 54af42c8..a11fbaa7 100644 --- a/app/assets/javascripts/Jit/graphsettings-event-handlers.js +++ b/app/assets/javascripts/Jit/graphsettings-event-handlers.js @@ -139,6 +139,80 @@ function selectNodeOnClickHandler(node, e) { Mconsole.plot(); }//selectNodeOnClickHandler + function selectNodeOnRightClickHandler(node, e) { + // the 'node' variable is a JIT node, the one that was clicked on + // the 'e' variable is the click event + + + if (Mconsole.busy) return; + + // delete old right click menu + $('.rightclickmenu').remove(); + // create new menu for clicked on node + var rightclickmenu = document.createElement("div"); + rightclickmenu.className = "rightclickmenu"; + + // add the proper options to the menu + var menustring = ''; + rightclickmenu.innerHTML = menustring; + + // position the menu where the click happened + $(rightclickmenu).css({ + left: e.clientX, + top: e.clientY + }); + //add the menu to the page + $('#wrapper').append(rightclickmenu); + + // attach events to clicks on the list items + + // delete the selected things from the database + $('.rc-delete').click(function() { + $('.rightclickmenu').remove(); + var n = MetamapsModel.selectedNodes.length; + var e = MetamapsModel.selectedEdges.length; + var ntext = n == 1 ? "1 topic" : n + " topics"; + var etext = e == 1 ? "1 synapse" : e + " synapses"; + var text = "You have " + ntext + " and " + etext + " selected. "; + + var r=confirm(text + "Are you sure you want to permanently delete them all? This will remove them from all maps they appear on."); + if (r == true) { + deleteSelectedEdges(); + deleteSelectedNodes(); + } + }); + + // remove the selected things from the map + $('.rc-remove').click(function() { + $('.rightclickmenu').remove(); + hideSelectedEdges(); + hideSelectedNodes(); + }); + + // hide selected nodes and synapses until refresh + $('.rc-hide').click(function() { + $('.rightclickmenu').remove(); + hideSelectedEdges(); + hideSelectedNodes(); + }); + + // open the entity in a new tab + $('.rc-popout').click(function() { + $('.rightclickmenu').remove(); + var win=window.open('/topics/' + node.id, '_blank'); + win.focus(); + }); + + } //selectNodeOnRightClickHandler + function canvasDoubleClickHandler(canvasLoc,e) { //grab the location and timestamp of the click var storedTime = MetamapsModel.lastCanvasClick; diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 9ff758c8..c58facd3 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -40,7 +40,7 @@ function graphSettings(type, embed) { Label: { type: 'Native', //Native or HTML size: 20, - family: 'LatoLight', + family: 'arial', textBaseline: 'hanging', color:'#000' //style: 'bold' @@ -127,7 +127,7 @@ function graphSettings(type, embed) { }, onRightClick: function (node, eventInfo, e) { if (node && !node.nodeFrom) { - // open right click menu + selectNodeOnRightClickHandler(node, e); } else if (node && node.nodeFrom) { // the variable 'node' is actually an edge/adjacency // open right click menu diff --git a/app/assets/javascripts/Jit/jit2.0.0.js b/app/assets/javascripts/Jit/jit2.0.0.js index 6f08f42c..7938a055 100644 --- a/app/assets/javascripts/Jit/jit2.0.0.js +++ b/app/assets/javascripts/Jit/jit2.0.0.js @@ -7232,23 +7232,25 @@ Graph.Label.Native = new Class({ //START METAMAPS CODE //render background ctx.fillStyle = 'rgba(255, 255, 255, 0.7)'; - var margin = 5; - var height = 16 + margin; //font size + margin - var CURVE = height / 2; //offset for curvy corners - var width = ctx.measureText(node.name).width + 2 * margin - 2 * CURVE; - var labelX = (pos.x - width/2) - margin + CURVE/2; - var labelY = pos.y + node.getData("height"); // - height + margin; - ctx.fillRect(labelX, labelY, width, height); - - //curvy corners woo - circles in place of last CURVE pixels of rect - ctx.beginPath(); - ctx.arc(labelX, labelY + CURVE, CURVE, 0.5 * Math.PI, 1.5 * Math.PI, false); - ctx.closePath(); - ctx.fill(); - ctx.beginPath(); - ctx.arc(labelX + width, labelY + CURVE, CURVE, 1.5 * Math.PI, 0.5 * Math.PI, false); - ctx.closePath(); - ctx.fill(); + var height = 25; //font size + margin + var width = ctx.measureText(node.name).width + 8; + var x = pos.x - width/2; + var y = pos.y + node.getData("height") + 5; + var radius = 3; + + ctx.beginPath(); + ctx.moveTo(x + radius, y); + ctx.lineTo(x + width - radius, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + radius); + ctx.lineTo(x + width, y + height - radius); + ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); + ctx.lineTo(x + radius, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - radius); + ctx.lineTo(x, y + radius); + ctx.quadraticCurveTo(x, y, x + radius, y); + ctx.closePath(); + ctx.stroke(); + ctx.fill(); ctx.fillStyle = ctx.strokeStyle = node.getLabelData('color'); // END METAMAPS CODE @@ -7274,7 +7276,7 @@ Graph.Label.Native = new Class({ var pos = node.pos.getc(true); //ctx.fillText(node.name, pos.x, pos.y + node.getData("height") / 2); // START METAMAPS CODE - ctx.fillText(node.name, pos.x, pos.y + node.getData("height")); + ctx.fillText(node.name, pos.x, pos.y + node.getData("height") + 5); // END METAMAPS CODE }, diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index eafc00ca..8dde6093 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -24,14 +24,209 @@ var viewMode = "list"; var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false, findOpen = false, analyzeOpen = false, organizeOpen = false, goRealtime = false, mapid = null, mapperm = false, touchPos, touchDragNode, mouseIsDown = false; $(document).ready(function() { - - var menuIsOpen = false, searchIsOpen = false, accountIsOpen = false; - + + function bindMainMenuHover() { + + var menuIsOpen = false + + // controls the sliding hover of the bottom left menu + var sliding1 = false; + var lT; + + var closeMenu = function() { + lT = setTimeout(function() { + if (! sliding1) { + sliding1 = true; + // $('.footer .menu').animate({ + // height: '0px' + // }, 300, function() { + // sliding1 = false; + // menuIsOpen = false; + // }); + $('.footer').css('border-top-right-radius','5px'); + $('.logo').animate({ + 'background-position-x':'-10px' + }, 200); + $('.footer .menu').fadeOut(200, function() { + sliding1 = false; + menuIsOpen = false; + }); + } + },500); + } + + var openMenu = function() { + clearTimeout(lT); + if (! sliding1) { + sliding1 = true; + + // $('.footer .menu').animate({ + // height: listLength + 'px' + // }, 300, function() { + // sliding1 = false; + // }); + $('.footer').css('border-top-right-radius','0'); + $('.logo').animate({ + 'background-position-x':'-7px' + }, 200); + $('.footer .menu').fadeIn(200, function() { + sliding1 = false; + }); + } + } + // bind the hover events + $(".logo").hover(openMenu, closeMenu); + + // when on touch screen, make touching on the logo do what hovering does on desktop + $("#mainTitle a").bind('touchend', function(evt) { + if (!menuIsOpen) { + openMenu(); + evt.preventDefault(); + evt.stopPropagation(); + } + }); + } + + function bindSearchHover() { + + var searchIsOpen = false + + // controls the sliding hover of the search + var sliding1 = false; + var lT; + + var openSearch = function() { + clearTimeout(lT); + if (!sliding1 && !searchIsOpen) { + hideCards(); + sliding1 = true; + $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ + width: '200px' + }, 200, function() { + $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 10px', width:'180px'}); + $('.sidebarSearchField').focus(); + sliding1 = false + searchIsOpen = true; + }); + } + } + var closeSearch = function(closeAfter) { + lT = setTimeout(function() { + if (!sliding1 && searchIsOpen) { + sliding1 = true; + $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 0', width:'200px'}); + $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ + width: '0' + }, 200, function() { + $('.sidebarSearchField').typeahead('setQuery',''); + sliding1 = false; + searchIsOpen = false; + }); + } + },closeAfter); + } + + // bind the hover events + $(".sidebarSearch").hover(function(){ openSearch() }, function() { closeSearch(800) }); + + $('.sidebarSearch').click(function(e) { + e.stopPropagation(); + }); + $('body').click(function(e) { + closeSearch(0); + }); + + // if the search is closed and user hits SHIFT+S + $('body').bind('keyup', function(e) { + switch(e.which) { + case 83: + if (e.shiftKey && !searchIsOpen) { + openSearch(); + } + break; + default: break; //console.log(e.which); + } + }); + + // initialize the search box autocomplete results + $('.sidebarSearchField').typeahead([ + { + name: 'topics', + template: $('.topicTemplate').html(), + remote: { + url: '/search/topics?term=%QUERY' + }, + engine: Hogan, + header: '

Topics

' + }, + { + name: 'maps', + template: $('.mapTemplate').html(), + remote: { + url: '/search/maps?term=%QUERY' + }, + engine: Hogan, + header: '

Maps

' + }, + { + name: 'mappers', + template: $('.mapperTemplate').html(), + remote: { + url: '/search/mappers?term=%QUERY' + }, + engine: Hogan, + header: '

Mappers

' + } + ]); + } // end bindSearchHover + + function bindAccountHover() { + + var accountIsOpen = false + + // controls the sliding hover of the bottom left menu + var sliding1 = false; + var lT; + + var closeAccount = function() { + lT = setTimeout(function() { + if (! sliding1) { + sliding1 = true; + $('.sidebarAccountIcon').css('background-color','rgba(0,0,0,0.7)'); + $('.sidebarAccountBox').fadeOut(200, function() { + sliding1 = false; + accountIsOpen = false; + }); + } + },300); + } + + var openAccount = function() { + clearTimeout(lT); + if (! sliding1) { + sliding1 = true; + $('.sidebarAccountIcon').css('background-color','rgba(0,0,0,0.9)'); + $('.sidebarAccountBox').fadeIn(200, function() { + sliding1 = false; + accountIsOpen = true; + }); + } + } + // bind the hover events + $(".sidebarAccount").hover(openAccount, closeAccount); + } // end bindAccountHover + + // bind hover events + bindMainMenuHover(); + bindSearchHover(); + bindAccountHover(); + + // disable right click events on the new topic and new synapse input fields $('#new_topic, #new_synapse').bind('contextmenu', function(e){ return false; }); - - /// this is for the topic creation autocomplete field + + // initialize the autocomplete results for the metacode spinner $('#topic_name').typeahead([ { name: 'topic_autocomplete', @@ -42,6 +237,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, engine: Hogan } ]); + // tell the autocomplete to submit the form with the topic you clicked on if you pick from the autocomplete $('#topic_name').bind('typeahead:selected', function (event, datum, dataset) { $('#topic_grabTopic').val(datum.id); $('.new_topic').submit(); @@ -49,179 +245,16 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, event.stopPropagation(); }); + // when either form submits, don't leave the page $('.new_topic, .new_synapse').bind('submit', function(event, data){ event.preventDefault(); }); - // this is for the search box - $('.sidebarSearchField').typeahead([ - { - name: 'topics', - template: $('.topicTemplate').html(), - remote: { - url: '/search/topics?term=%QUERY' - }, - engine: Hogan, - header: '

Topics

' - }, - { - name: 'maps', - template: $('.mapTemplate').html(), - remote: { - url: '/search/maps?term=%QUERY' - }, - engine: Hogan, - header: '

Maps

' - }, - { - name: 'mappers', - template: $('.mapperTemplate').html(), - remote: { - url: '/search/mappers?term=%QUERY' - }, - engine: Hogan, - header: '

Mappers

' - } - ]); + $(".scroll").mCustomScrollbar(); - - $(".scroll").mCustomScrollbar(); - - $('.headertop').draggable(); - var positionLeft = $(window).width() - $('.headertop').width() - 50; - $('.headertop').css('left', positionLeft + 'px'); $('.notice.metamaps').delay(10000).fadeOut('fast'); $('.alert.metamaps').delay(10000).fadeOut('fast'); - - //$('.nodemargin').css('padding-top',$('.focus').css('height')); - - // controls the sliding hover of the menus at the top - var sliding1 = false; - var lT; - - var closeMenu = function() { - lT = setTimeout(function() { - if (! sliding1) { - sliding1 = true; - // $('.footer .menu').animate({ - // height: '0px' - // }, 300, function() { - // sliding1 = false; - // menuIsOpen = false; - // }); - $('.footer').css('border-top-right-radius','5px'); - $('.logo').animate({ - 'background-position-x':'-10px' - }, 300); - $('.footer .menu').fadeOut(300, function() { - sliding1 = false; - menuIsOpen = false; - }); - } - },800); - } - - var openMenu = function() { - //closeAccount(); - //closeSearch(); - $('.menuflag').hide(); - clearTimeout(lT); - if (! sliding1) { - sliding1 = true; - - // $('.footer .menu').animate({ - // height: listLength + 'px' - // }, 300, function() { - // sliding1 = false; - // }); - $('.footer').css('border-top-right-radius','0'); - $('.logo').animate({ - 'background-position-x':'-7px' - }, 300); - $('.footer .menu').fadeIn(300, function() { - sliding1 = false; - }); - } - } - // bind the hover events - $(".logo").hover(openMenu, closeMenu); - - // when on touch screen, make touching on the logo do what hovering does on desktop - $("#mainTitle a").bind('touchend', function(evt) { - if (!menuIsOpen) { - openMenu(); - evt.preventDefault(); - evt.stopPropagation(); - } - }); - - - // start account section - $('.sidebarAccountIcon').click(function(e) { - if (!accountIsOpen) openAccount(); - else if (accountIsOpen) closeAccount(); - e.stopPropagation(); - }); - $('.sidebarAccountBox').click(function(e) { - e.stopPropagation(); - }); - - function openAccount() { - //closeMenu(); - //closeSearch(); - if (!accountIsOpen) { - $('.sidebarAccountBox').fadeIn(300, function() { - //$('.sidebarSearchField').css({padding:'5px 10px', width:'180px'}).focus(); - accountIsOpen = true; - }); - } - } - function closeAccount() { - if (accountIsOpen) { - $('.sidebarAccountBox').fadeOut(300, function() { - accountIsOpen = false; - }); - } - } - // end account section - - // start search section - $('.sidebarSearchIcon').click(function(e) { - if (!searchIsOpen) openSearch(); - else if (searchIsOpen) closeSearch(); - e.stopPropagation(); - }); - $('.sidebarSearch .twitter-typeahead').click(function(e) { - e.stopPropagation(); - }); - - function openSearch() { - hideCards(); - $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ - width: '200px' - }, 300, function() { - $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 10px', width:'180px'}); - $('.sidebarSearchField').focus(); - searchIsOpen = true; - }); - } - function closeSearch() { - if (searchIsOpen) { - $('.sidebarSearchField, .sidebarSearch .tt-hint').css({padding:'5px 0', width:'200px'}); - $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ - width: '0' - }, 300, function() { - searchIsOpen = false; - }); - } - } - // end search section - - $('body').click(function() { - closeSearch(); - closeAccount(); - }); addHoverForSettings(); @@ -240,12 +273,10 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, var link = $(this).html(); $(this).parents('.CardOnGraph').find('.go-link').attr('href', link); }); - - // this is to save the layout of maps when you're on a map page - $("#saveLayout").click(function(event) { - event.preventDefault(); - saveLayoutAll(); - }); + + $('.addMap').click(function(event) { + createNewMap(); + }); // bind keyboard handlers $('body').bind('keyup', function(e) { @@ -313,6 +344,7 @@ function addHoverForSettings() { // this is to save the layout of a map function saveLayoutAll() { + $('.wandSaveLayout').html('Saving...'); var coor = ""; if (gType == "arranged" || gType == "chaotic") { Mconsole.graph.eachNode(function(n) { @@ -330,8 +362,8 @@ function saveLayout(id) { $('#map_coordinates').val(n.getData("mappingid") + '/' + n.pos.x + '/' + n.pos.y); $('#saveMapLayout').submit(); dragged = 0; - $('#saveLayout').attr('value','Saved!'); - setTimeout(function(){$('#saveLayout').attr('value','Save Layout')},1500); + $('.wandSaveLayout').html('Saved!'); + setTimeout(function(){$('.wandSaveLayout').html('Save Layout')},1500); } // this is to save your console to a map @@ -368,6 +400,10 @@ function saveToMap() { $('#map_topicsToMap').val(nodes_data); $('#map_synapsesToMap').val(synapses_data); + $('#fork_map').fadeIn('fast'); +} + +function createNewMap() { $('#new_map').fadeIn('fast'); } diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 7aa738c2..3ec38b23 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -149,6 +149,10 @@ box-shadow: 0 1px 0 rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.2); #barometer_tab { display:none; } + +#saveMapLayout { + display:none; +} #error_explanation { background: #612127; @@ -429,7 +433,7 @@ box-shadow: 6px 6px 8px rgba(0,0,0,0.4); position:absolute; top:0; left:-45px; - background: rgba(0,0,0,0.7) url('MMCCicon_help.png') no-repeat center center; + background: rgba(0,0,0,0.3) url('MMCCicon_help.png') no-repeat center center; background-size: 32px 32px; border:1px solid #000; border-radius:5px; @@ -437,6 +441,9 @@ box-shadow: 6px 6px 8px rgba(0,0,0,0.4); width:36px; cursor:pointer; } +.wrapper div.index .openCheatsheet:hover { + background-color: rgba(0,0,0,0.5); +} .wrapper div.index span { float:left; } @@ -480,7 +487,7 @@ box-shadow: 6px 6px 8px rgba(0,0,0,0.4); .sidebarAccount { position:absolute; top:5px; -right:5px; +right:0; z-index:200; width: 35px; height:35px; @@ -490,7 +497,7 @@ height:35px; position:absolute; width: 35px; height: 35px; -background: #69a3a4 url('MMCCicon_mapper.png') no-repeat center center; +background: rgba(0,0,0,0.7) url('MMCCicon_mapper.png') no-repeat center center; background-size: 28px 28px; cursor:pointer; } @@ -498,8 +505,8 @@ cursor:pointer; position:absolute; display:none; height:auto; - background: rgba(0,0,0,0.7); - top: 36px; + background: rgba(0,0,0,0.9); + top: 35px; right:0; padding: 10px; border: 1px solid black; @@ -522,13 +529,16 @@ cursor:pointer; list-style:none; } .sidebarAccountBox li.accountIcon { -padding: 6px 0 6px 25px; +padding: 0; background-size: 18px 18px; background-repeat: no-repeat; background-position: 0px 6px; font-size: 18px; line-height: 20px; } +li.accountIcon:hover { +background-position: 4px 6px; +} li.accountMaps { background-image: url('MMCCicon_map.png'); } @@ -543,6 +553,7 @@ li.accountLogout { } li.accountIcon a { display:block; + padding: 6px 0 6px 25px; } .sidebarAccountBox a { @@ -584,12 +595,115 @@ text-align: start; margin-top:5px; } +/* collaborate */ + +.sidebarCollaborate { +position:absolute; +top:5px; +right:35px; +z-index:200; +width: 35px; +height:35px; +border-right:1px solid black; +} + +.sidebarCollaborateIcon { +position:absolute; +width: 35px; +height: 35px; +background: rgba(0,0,0,0.7) url('MMCCicon_realtime_junto.png') no-repeat -3px -1px; +background-size: 40px 40px; +cursor:pointer; +} +.sidebarCollaborateBox { + position:absolute; + display:none; + height:auto; + width:auto; + background: rgba(0,0,0,0.9); + top: 36px; + right:0; + padding: 10px; + border: 1px solid black; + min-width:120px; + font-family: 'LatoLight', helvetica, sans-serif; +} + +/* end collaborate */ + +/* wand */ + +.sidebarWand { +position:absolute; +top:5px; +right:71px; +z-index:200; +width: 35px; +height:35px; +border-right:1px solid black; +} +.sidebarWand.topicView { + right:35px; +} +.sidebarWand.topicView .sidebarWandBox { + right:-36px; +} + +.sidebarWandIcon { +position:absolute; +width: 35px; +height: 35px; +background: rgba(0,0,0,0.7) url('MMCCicon_wand.png') no-repeat center center; +background-size: 28px 28px; +cursor:pointer; +} +.sidebarWandBox { + position:absolute; + display:none; + height:auto; + width:169px; + background: rgba(0,0,0,0.9); + top: 35px; + right:-72px; + padding: 10px; + border: 1px solid black; + min-width:120px; + font-family: 'LatoLight', helvetica, sans-serif; +} +.sidebarWandBox ul { + list-style:none; +} +.sidebarWandBox li.wandIcon { +padding: 6px 0 6px 25px; +background-size: 18px 18px; +background-repeat: no-repeat; +background-position: 0px 6px; +font-size: 18px; +line-height: 20px; +color:white; +cursor:pointer; +} +li.wandIcon:hover { +background-position: 4px 6px; +} +li.wandSaveLayout { + background-image: url('MMCCicon_save_layout.png'); +} +li.wandForkMap { + background-image: url('MMCCicon_save_new_map.png'); +} +li.wandFilter{ + background-image: url('MMCCicon_filter.png'); +} + +/* end wand */ + /* search */ .sidebarSearch { position:absolute; top:5px; -left:5px; +left:0; height: 35px; z-index:200; } @@ -598,7 +712,7 @@ z-index:200; float:left; width: 35px; height: 35px; -background: #cf8e88 url('search_icon_32x32.png') no-repeat center center; +background: rgba(0,0,0,0.7) url('search_icon_32x32.png') no-repeat center center; background-size: 25px 25px; cursor:pointer; } @@ -831,6 +945,32 @@ left: 84px; margin-left:50px; } +/* right click menu */ + +.rightclickmenu { + position:absolute; + background:white; + z-index: 20; + border-radius: 2px; + color: black; +} + +.rightclickmenu ul li { + list-style: none; + padding: 2px 7px; +} + +.rightclickmenu ul li:hover { + background: #e4e4e4; + cursor:pointer; +} + +.rightclickmenu p { + padding:7px; +} + +/* end right click menu */ + /* --- styling the logo button ---*/ /*.footer { width: 188px; @@ -867,6 +1007,23 @@ left: 84px; border-top-right-radius:5px; } +.addMap { +position: absolute; +right: -50px; +top: -1px; +width: 44px; +height: 35px; +background: rgba(185,182,237,0.3) url('MMCCicon_add_map.png') no-repeat 3px -4px; +background-size: 40px 40px; +border-left: 1px solid rgba(255,255,255,0.6); +border-radius: 5px; +border: 1px solid black; +cursor:pointer; +} +.addMap:hover { +background-color: rgba(185,182,237,0.5); +} + .logo { z-index:12; display:block; @@ -896,7 +1053,7 @@ background-size: 22px 20px; border:none; bottom:36px; left:-1px; - height:142px; + height:124px; z-index:12; width:151px; color: #67AF9F; @@ -927,13 +1084,7 @@ background-size: 22px 20px; text-align:center; } -li.meta .button { - background: #89aa7b; - margin:7px; -} - li.beta { - margin: 4px 0 0 !important; border-top: 1px solid black; border-bottom: 1px solid black; position: relative; @@ -963,17 +1114,17 @@ font-size: 12px; margin: 0; } -li.tutorial, li.exploreMaps { +li.meta, li.tutorial, li.exploreMaps { height:30px; line-height:30px; font-size:20px; } -li.tutorial a, li.exploreMaps a { +li.meta a, li.tutorial a, li.exploreMaps a { display:block; } -li.exploreMaps { +li.tutorial, li.exploreMaps { border-top:1px solid white; } @@ -981,29 +1132,6 @@ li.exploreMaps { color: #FFF; } - - -.menuflag { -position: absolute; -left: 71px; -bottom: 52px; -width: 100px; -height: 54px; -} -.menuflag .menuarrow { -background: url('white-curved-arrow.png') no-repeat; -background-size: contain; -width: 40px; -height: 40px; -float: left; -margin-top: 12px; -margin-right: 4px; -} -.menuflag .menutext { -float: left; -font-size: 21px; -} - .home_bg { display:block; height:100%; diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 29931110..69350057 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -91,7 +91,10 @@ class MapsController < ApplicationController @map.permission = params[:map][:permission] @map.user = @user @map.arranged = false - @map.save + @map.save + + #this variable specifies to the js file whether it's a brand new map or a forked one + @forked = false if params[:map][:topicsToMap] @all = params[:map][:topicsToMap] @@ -123,14 +126,13 @@ class MapsController < ApplicationController @map.arranged = true @map.save - respond_to do |format| - format.js { respond_with(@map) } - end - else - respond_to do |format| - format.html { respond_with(@user, location: map_path(@map)) } - end - end + + @forked = true + end + + respond_to do |format| + format.js { respond_with(@map, @forked) } + end end # GET maps/:id/edit diff --git a/app/views/layouts/_searchtemplates.html.erb b/app/views/layouts/_searchtemplates.html.erb index 8c1ac4b1..0362ef01 100644 --- a/app/views/layouts/_searchtemplates.html.erb +++ b/app/views/layouts/_searchtemplates.html.erb @@ -14,7 +14,7 @@
- <% if controller_name == 'maps' && action_name == 'show' && @map.authorize_to_edit(@current) %> + <% if controller_name == 'maps' && action_name == 'show' && authenticated? && @map.authorize_to_edit(@current) %> add to map <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5a9f0156..c9af03e6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -65,32 +65,36 @@ <% end %> - <%= render :partial => 'layouts/ga' if Rails.env.production? %> <% if authenticated? %> + <% # this is the create new map form %> + <%= render :partial => 'maps/new' %> + <% end %> + + <%= render :partial => 'layouts/ga' if Rails.env.production? %> + - - <% end %> diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index 09860786..784016a4 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -7,9 +7,6 @@ <% content_for :title, "Home | Metamaps" %>
-

- To get in touch, follow or tweet @metamapps, or join our Google+ community. -

@@ -23,7 +20,8 @@

Status: INVITE-ONLY BETA
- request invite : visit the blog + request invite : visit the blog
+ To get in touch, follow or tweet @metamapps, or join our Google+ community.

@@ -33,11 +31,6 @@
- -