diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index dc80f8d2..534e538e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -18,4 +18,5 @@ //= require_directory ./librariesForAllPages //= require ./metamaps/Metamaps.GlobalUI //= require ./metamaps/Metamaps.Router -//= require ./metamaps/Metamaps.Backbone \ No newline at end of file +//= require ./metamaps/Metamaps.Backbone +//= require ./metamaps/Metamaps.Views \ No newline at end of file diff --git a/app/assets/javascripts/librariesForAllPages/canvasloader.min.js b/app/assets/javascripts/librariesForAllPages/canvasloader.min.js new file mode 100644 index 00000000..a17ee48a --- /dev/null +++ b/app/assets/javascripts/librariesForAllPages/canvasloader.min.js @@ -0,0 +1,12 @@ +(function(w){var k=function(b,c){typeof c=="undefined"&&(c={});this.init(b,c)},a=k.prototype,o,p=["canvas","vml"],f=["oval","spiral","square","rect","roundRect"],x=/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,v=navigator.appVersion.indexOf("MSIE")!==-1&&parseFloat(navigator.appVersion.split("MSIE")[1])===8?true:false,y=!!document.createElement("canvas").getContext,q=true,n=function(b,c,a){var b=document.createElement(b),d;for(d in a)b[d]=a[d];typeof c!=="undefined"&&c.appendChild(b);return b},m=function(b, +c){for(var a in c)b.style[a]=c[a];return b},t=function(b,c){for(var a in c)b.setAttribute(a,c[a]);return b},u=function(b,c,a,d){b.save();b.translate(c,a);b.rotate(d);b.translate(-c,-a);b.beginPath()};a.init=function(b,c){if(typeof c.safeVML==="boolean")q=c.safeVML;try{this.mum=document.getElementById(b)!==void 0?document.getElementById(b):document.body}catch(a){this.mum=document.body}c.id=typeof c.id!=="undefined"?c.id:"canvasLoader";this.cont=n("div",this.mum,{id:c.id});if(y)o=p[0],this.can=n("canvas", +this.cont),this.con=this.can.getContext("2d"),this.cCan=m(n("canvas",this.cont),{display:"none"}),this.cCon=this.cCan.getContext("2d");else{o=p[1];if(typeof k.vmlSheet==="undefined"){document.getElementsByTagName("head")[0].appendChild(n("style"));k.vmlSheet=document.styleSheets[document.styleSheets.length-1];var d=["group","oval","roundrect","fill"],e;for(e in d)k.vmlSheet.addRule(d[e],"behavior:url(#default#VML); position:absolute;")}this.vml=n("group",this.cont)}this.setColor(this.color);this.draw(); +m(this.cont,{display:"none"})};a.cont={};a.can={};a.con={};a.cCan={};a.cCon={};a.timer={};a.activeId=0;a.diameter=40;a.setDiameter=function(b){this.diameter=Math.round(Math.abs(b));this.redraw()};a.getDiameter=function(){return this.diameter};a.cRGB={};a.color="#000000";a.setColor=function(b){this.color=x.test(b)?b:"#000000";this.cRGB=this.getRGB(this.color);this.redraw()};a.getColor=function(){return this.color};a.shape=f[0];a.setShape=function(b){for(var c in f)if(b===f[c]){this.shape=b;this.redraw(); +break}};a.getShape=function(){return this.shape};a.density=40;a.setDensity=function(b){this.density=q&&o===p[1]?Math.round(Math.abs(b))<=40?Math.round(Math.abs(b)):40:Math.round(Math.abs(b));if(this.density>360)this.density=360;this.activeId=0;this.redraw()};a.getDensity=function(){return this.density};a.range=1.3;a.setRange=function(b){this.range=Math.abs(b);this.redraw()};a.getRange=function(){return this.range};a.speed=2;a.setSpeed=function(b){this.speed=Math.round(Math.abs(b))};a.getSpeed=function(){return this.speed}; +a.fps=24;a.setFPS=function(b){this.fps=Math.round(Math.abs(b));this.reset()};a.getFPS=function(){return this.fps};a.getRGB=function(b){b=b.charAt(0)==="#"?b.substring(1,7):b;return{r:parseInt(b.substring(0,2),16),g:parseInt(b.substring(2,4),16),b:parseInt(b.substring(4,6),16)}};a.draw=function(){var b=0,c,a,d,e,h,k,j,r=this.density,s=Math.round(r*this.range),l,i,q=0;i=this.cCon;var g=this.diameter;if(o===p[0]){i.clearRect(0,0,1E3,1E3);t(this.can,{width:g,height:g});for(t(this.cCan,{width:g,height:g});b< +r;){l=b<=s?1-1/s*b:l=0;k=270-360/r*b;j=k/180*Math.PI;i.fillStyle="rgba("+this.cRGB.r+","+this.cRGB.g+","+this.cRGB.b+","+l.toString()+")";switch(this.shape){case f[0]:case f[1]:c=g*0.07;e=g*0.47+Math.cos(j)*(g*0.47-c)-g*0.47;h=g*0.47+Math.sin(j)*(g*0.47-c)-g*0.47;i.beginPath();this.shape===f[1]?i.arc(g*0.5+e,g*0.5+h,c*l,0,Math.PI*2,false):i.arc(g*0.5+e,g*0.5+h,c,0,Math.PI*2,false);break;case f[2]:c=g*0.12;e=Math.cos(j)*(g*0.47-c)+g*0.5;h=Math.sin(j)*(g*0.47-c)+g*0.5;u(i,e,h,j);i.fillRect(e,h-c*0.5, +c,c);break;case f[3]:case f[4]:a=g*0.3,d=a*0.27,e=Math.cos(j)*(d+(g-d)*0.13)+g*0.5,h=Math.sin(j)*(d+(g-d)*0.13)+g*0.5,u(i,e,h,j),this.shape===f[3]?i.fillRect(e,h-d*0.5,a,d):(c=d*0.55,i.moveTo(e+c,h-d*0.5),i.lineTo(e+a-c,h-d*0.5),i.quadraticCurveTo(e+a,h-d*0.5,e+a,h-d*0.5+c),i.lineTo(e+a,h-d*0.5+d-c),i.quadraticCurveTo(e+a,h-d*0.5+d,e+a-c,h-d*0.5+d),i.lineTo(e+c,h-d*0.5+d),i.quadraticCurveTo(e,h-d*0.5+d,e,h-d*0.5+d-c),i.lineTo(e,h-d*0.5+c),i.quadraticCurveTo(e,h-d*0.5,e+c,h-d*0.5))}i.closePath();i.fill(); +i.restore();++b}}else{m(this.cont,{width:g,height:g});m(this.vml,{width:g,height:g});switch(this.shape){case f[0]:case f[1]:j="oval";c=140;break;case f[2]:j="roundrect";c=120;break;case f[3]:case f[4]:j="roundrect",c=300}a=d=c;e=500-d;for(h=-d*0.5;b=1;)b.removeChild(b.firstChild)}};a.redraw=function(){this.clean();this.draw()};a.reset=function(){typeof this.timer=== +"number"&&(this.hide(),this.show())};a.tick=function(b){var a=this.con,f=this.diameter;b||(this.activeId+=360/this.density*this.speed);o===p[0]?(a.clearRect(0,0,f,f),u(a,f*0.5,f*0.5,this.activeId/180*Math.PI),a.drawImage(this.cCan,0,0,f,f),a.restore()):(this.activeId>=360&&(this.activeId-=360),m(this.vml,{rotation:this.activeId}))};a.show=function(){if(typeof this.timer!=="number"){var a=this;this.timer=self.setInterval(function(){a.tick()},Math.round(1E3/this.fps));m(this.cont,{display:"block"})}}; +a.hide=function(){typeof this.timer==="number"&&(clearInterval(this.timer),delete this.timer,m(this.cont,{display:"none"}))};a.kill=function(){var a=this.cont;typeof this.timer==="number"&&this.hide();o===p[0]?(a.removeChild(this.can),a.removeChild(this.cCan)):a.removeChild(this.vml);for(var c in this)delete this[c]};w.CanvasLoader=k})(window); \ No newline at end of file diff --git a/app/assets/javascripts/metamaps/JIT.js b/app/assets/javascripts/metamaps/JIT.js index 4bdf9d79..de6aacb7 100644 --- a/app/assets/javascripts/metamaps/JIT.js +++ b/app/assets/javascripts/metamaps/JIT.js @@ -1888,7 +1888,12 @@ var MouseEventsManager = new Class({ for(var id in graph.nodes) { var n = graph.nodes[id], geom = n && ntypes[n.getData('type')], - contains = geom && geom.contains && geom.contains.call(fx, n, this.getPos()); + + // START METAMAPS CODE + contains = n.getData('alpha') !== 0 && geom && geom.contains && geom.contains.call(fx, n, this.getPos()); + // END METAMAPS CODE + // ORIGINAL CODE contains = geom && geom.contains && geom.contains.call(fx, n, this.getPos()); + if(contains) { this.contains = contains; return that.node = this.node = n; @@ -1907,7 +1912,11 @@ var MouseEventsManager = new Class({ if(edgeId in hashset) continue; var e = edgeFrom[edgeId], geom = e && etypes[e.getData('type')], - contains = geom && geom.contains && geom.contains.call(fx, e, this.getPos()); + + // START METAMAPS CODE + contains = e.getData('alpha') !== 0 && geom && geom.contains && geom.contains.call(fx, e, this.getPos()); + // END METAMAPS CODE + // ORIGINAL CODE contains = geom && geom.contains && geom.contains.call(fx, n, this.getPos()); if(contains) { this.contains = contains; return that.edge = this.edge = e; @@ -2645,9 +2654,12 @@ var Canvas; opt.injectInto:opt.injectInto.id, type = opt.type, idLabel = id + "-label", - wrapper = $(id), - width = opt.width || wrapper.offsetWidth, - height = opt.height || wrapper.offsetHeight; + // ORIGINAL CODE wrapper = $(id), + // START METAMAPS CODE + //wrapper = Metamaps.Famous.viz.surf, + // END METAMAPS CODE + width = opt.width, // || wrapper.offsetWidth, + height = opt.height; // || wrapper.offsetHeight; this.id = id; //canvas options var canvasOptions = { @@ -2692,7 +2704,16 @@ var Canvas; } } this.element.appendChild(this.labelContainer); - wrapper.appendChild(this.element); + + // START METAMAPS CODE + var m = Metamaps.Famous.viz.surf; + m.setContent(this.element); + m.deploy(m._currTarget); + + // END METAMAPS CODE + // ORIGINAL CODE wrapper.appendChild(this.element); + + //Update canvas position when the page is scrolled. var timer = null, that = this; $.addEvent(window, 'scroll', function() { diff --git a/app/assets/javascripts/metamaps/Metamaps.Backbone.js b/app/assets/javascripts/metamaps/Metamaps.Backbone.js index 5c326970..6b858bda 100644 --- a/app/assets/javascripts/metamaps/Metamaps.Backbone.js +++ b/app/assets/javascripts/metamaps/Metamaps.Backbone.js @@ -1,18 +1,80 @@ Metamaps.Backbone = {}; Metamaps.Backbone.Map = Backbone.Model.extend({ urlRoot: '/maps', - blacklist: ['created_at', 'updated_at'], + blacklist: ['created_at', 'updated_at', 'map', 'topics', 'synapses', 'mappings', 'mappers'], toJSON: function (options) { return _.omit(this.attributes, this.blacklist); }, authorizeToEdit: function (mapper) { if (mapper && (this.get('permission') === "commons" || this.get('user_id') === mapper.get('id'))) return true; else return false; + }, + getUser: function () { + return Metamaps.Mapper.get(this.get('user_id')); + }, + getTopics: function () { + if (!this.get('topics')) { + this.fetch({async: false}); + } + return this.get('topics'); + }, + getSynapses: function () { + if (!this.get('synapses')) { + this.fetch({async: false}); + } + return this.get('synapses'); + }, + attrForCards: function () { + var obj = { + id: this.id, + name: this.get('name'), + desc: this.get('desc'), + username: this.getUser().get('name'), + mkPermission: this.get("permission").substring(0, 2), + editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit', + topicCount: this.getTopics().length, + synapseCount: this.getSynapses().length, + createdAt: this.get('created_at') + }; + return obj; } }); Metamaps.Backbone.MapsCollection = Backbone.Collection.extend({ model: Metamaps.Backbone.Map, - url: '/maps' + initialize: function(models, options) { + this.id = options.id; + this.sortBy = options.sortBy; + }, + url: function() { + return '/explore/' + this.id + '.json'; + }, + comparator: function (a, b) { + a = a.get(this.sortBy); + b = b.get(this.sortBy); + if (this.sortBy === 'name') { + a = a.toLowerCase(); + b = b.toLowerCase(); + } + return a > b ? 1 : a < b ? -1 : 0; + }, + getMaps: function () { + + Metamaps.Loading.loader.show(); + + var self = this; + + this.fetch({ + reset: true, + success: function (collection, response, options) { + // you can pass additional options to the event you trigger here as well + self.trigger('successOnFetch'); + }, + error: function (collection, response, options) { + // you can pass additional options to the event you trigger here as well + self.trigger('errorOnFetch'); + } + }); + } }); Metamaps.Backbone.Mapper = Backbone.Model.extend({ diff --git a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js index 33a1d5e0..12f9e6ea 100644 --- a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js @@ -40,8 +40,7 @@ Metamaps.Active = { Topic: null, Mapper: null }; -Metamaps.Maps = {}; // will be initialized in Metamaps.Backbone.js as a MapCollection -Metamaps.Mappers = {}; // will be initialized in Metamaps.Backbone.js as a MapperCollection +Metamaps.Maps = {}; $(document).ready(function () { @@ -83,12 +82,16 @@ Metamaps.GlobalUI = { // initialize global backbone models and collections if (Metamaps.Active.Mapper) Metamaps.Active.Mapper = new Metamaps.Backbone.Mapper(Metamaps.Active.Mapper); - Metamaps.Mappers = new Metamaps.Backbone.MapperCollection([Metamaps.Active.Mapper]); - Metamaps.Maps = {}; - Metamps.Maps.Mine = new Metamaps.Backbone.MapsCollection(); - Metamps.Maps.Featured = new Metamaps.Backbone.MapsCollection(); - Metamps.Maps.Active = new Metamaps.Backbone.MapsCollection(); - Metamps.Maps.New = new Metamaps.Backbone.MapsCollection(); + Metamaps.Mappers = new Metamaps.Backbone.MapperCollection([Metamaps.Active.Mapper]); + + var myCollection = Metamaps.Maps.Mine ? Metamaps.Maps.Mine : []; + var featuredCollection = Metamaps.Maps.Featured ? Metamaps.Maps.Featured : []; + var activeCollection = Metamaps.Maps.Active ? Metamaps.Maps.Active : []; + var newCollection = Metamaps.Maps.New ? Metamaps.Maps.New : []; + Metamaps.Maps.Mine = new Metamaps.Backbone.MapsCollection(myCollection, {id: 'mine', sortBy: 'name'}); + Metamaps.Maps.Featured = new Metamaps.Backbone.MapsCollection(featuredCollection, {id: 'featured', sortBy: 'name'}); + Metamaps.Maps.Active = new Metamaps.Backbone.MapsCollection(activeCollection, {id: 'active', sortBy: 'updated_at'}); + Metamaps.Maps.New = new Metamaps.Backbone.MapsCollection(newCollection, {id: 'new', sortBy: 'created_at'}); }, openLightbox: function (which) { var self = Metamaps.GlobalUI; @@ -151,18 +154,23 @@ Metamaps.GlobalUI = { } self.lightbox = null; }, - notifyUser: function (message) { + notifyUser: function (message, leaveOpen) { var self = Metamaps.GlobalUI; - if ($('.notice.metamaps').length == 0) { - $('body').prepend('
'); + Metamaps.Famous.toast.surf.setContent(message); + Metamaps.Famous.toast.show(); + clearTimeout(self.notifyTimeOut); + if (!leaveOpen) { + self.notifyTimeOut = setTimeout(function () { + Metamaps.Famous.toast.hide(); + }, 8000); } - $('.notice.metamaps').hide().html(message).fadeIn('fast'); + }, + clearNotify: function() { + var self = Metamaps.GlobalUI; clearTimeout(self.notifyTimeOut); - self.notifyTimeOut = setTimeout(function () { - $('.notice.metamaps').fadeOut('fast'); - }, 8000); + Metamaps.Famous.toast.hide(); } }; @@ -281,6 +289,9 @@ Metamaps.GlobalUI.Account = { open: function () { var self = Metamaps.GlobalUI.Account; + Metamaps.Realtime.close(true); + Metamaps.Filter.close(true); + clearTimeout(self.timeOut); if (!self.isOpen && !self.changing) { self.changing = true; @@ -290,9 +301,11 @@ Metamaps.GlobalUI.Account = { }); } }, - close: function () { + close: function (force) { var self = Metamaps.GlobalUI.Account; + var time = force ? 0 : 500; + self.timeOut = setTimeout(function () { if (!self.changing) { self.changing = true; @@ -301,13 +314,14 @@ Metamaps.GlobalUI.Account = { self.isOpen = false; }); } - }, 500); + }, time); } }; Metamaps.GlobalUI.Search = { + locked: false, isOpen: false, timeOut: null, changing: false, @@ -337,7 +351,7 @@ Metamaps.GlobalUI.Search = { $('body').bind('keydown', function (e) { switch (e.which) { case 191: - if (e.ctrlKey && !self.isOpen) { + if ((e.ctrlKey && !self.isOpen) || (e.ctrlKey && self.locked)) { self.open(); } break; @@ -353,38 +367,47 @@ Metamaps.GlobalUI.Search = { self.startTypeahead(); }, + lock: function() { + var self = Metamaps.GlobalUI.Search; + self.locked = true; + }, + unlock: function() { + var self = Metamaps.GlobalUI.Search; + self.locked = false; + }, open: function () { var self = Metamaps.GlobalUI.Search; clearTimeout(self.timeOut); - if (!self.isOpen && !self.changing) { + if (!self.isOpen && !self.changing && !self.locked) { self.changing = true; $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ - width: '200px' - }, 200, function () { + width: '400px' + }, 300, function () { $('.sidebarSearchField, .sidebarSearch .tt-hint').css({ - padding: '5px 10px', - width: '180px' + padding: '10px 10px 0 10px', + width: '380px' }); $('.sidebarSearchField').focus(); self.changing = false; self.isOpen = true; }); } + else if (self.locked) $('.sidebarSearchField').focus(); }, close: function (closeAfter, bypass) { var self = Metamaps.GlobalUI.Search; self.timeOut = setTimeout(function () { - if (!self.changing && self.isOpen && (bypass || $('.sidebarSearchField').val() == '')) { + if (!self.locked && !self.changing && self.isOpen && (bypass || $('.sidebarSearchField').val() == '')) { self.changing = true; $('.sidebarSearchField, .sidebarSearch .tt-hint').css({ - padding: '5px 0', - width: '200px' + padding: '10px 0 0 0', + width: '400px' }); $('.sidebarSearch .twitter-typeahead, .sidebarSearch .tt-hint, .sidebarSearchField').animate({ width: '0' - }, 200, function () { + }, 300, function () { $('.sidebarSearchField').typeahead('setQuery', ''); $('.sidebarSearchField').blur(); self.changing = false; @@ -392,6 +415,11 @@ Metamaps.GlobalUI.Search = { }); } }, closeAfter); + + if (self.locked) { + $('.sidebarSearchField').typeahead('setQuery', ''); + $('.sidebarSearchField').blur(); + } }, startTypeahead: function () { var self = Metamaps.GlobalUI.Search; diff --git a/app/assets/javascripts/metamaps/Metamaps.JIT.js b/app/assets/javascripts/metamaps/Metamaps.JIT.js index 41ff23ba..cf0738c1 100644 --- a/app/assets/javascripts/metamaps/Metamaps.JIT.js +++ b/app/assets/javascripts/metamaps/Metamaps.JIT.js @@ -1,13 +1,11 @@ Metamaps.JIT = { vizData: [], // contains the visualization-compatible graph - graphRendered: false, // flag indicates if we have rendered the data so we don't bother doing it again wastefully /** * This method will bind the event handlers it is interested and initialize the class. */ init: function () { var self = Metamaps.JIT; - self.prepareVizData(); $(".zoomIn").click(self.zoomIn); $(".zoomOut").click(self.zoomOut); $(".centerMap").click(self.centerMap); @@ -26,6 +24,10 @@ Metamaps.JIT = { var edge; var edges = []; + // reset/empty vizData + self.vizData = []; + Metamaps.Visualize.loadLater = false; + Metamaps.Topics.each(function (t) { node = t.createNode(); nodes[node.id] = node; @@ -62,7 +64,7 @@ Metamaps.JIT = { Metamaps.Visualize.loadLater = true; } - Metamaps.Visualize.render("infovis", self.vizData); + Metamaps.Visualize.render(); }, // prepareVizData edgeRender: function (adj, canvas) { //get nodes cartesian coordinates @@ -193,7 +195,7 @@ Metamaps.JIT = { animateFDLayout: { modes: ['linear'], transition: $jit.Trans.Elastic.easeOut, - duration: 2500, + duration: 800, onComplete: function () { Metamaps.Visualize.mGraph.busy = false; } @@ -210,9 +212,9 @@ Metamaps.JIT = { panning: 'avoid nodes', zooming: 28 //zoom speed. higher is more sensible }, - background: { - type: 'Metamaps' - }, + //background: { + // type: 'Metamaps' + //}, //NodeStyles: { // enable: true, // type: 'Native', @@ -522,7 +524,7 @@ Metamaps.JIT = { RGraph: { animate: { modes: ['polar'], - duration: 2000, + duration: 800, onComplete: function () { Metamaps.Visualize.mGraph.busy = false; } @@ -540,7 +542,7 @@ Metamaps.JIT = { levelDistance: 200 }, onMouseEnter: function (edge) { - + if (edge.getData('alpha') === 0) return; // don't do anything if the edge is filtered $('canvas').css('cursor', 'pointer'); var edgeIsSelected = Metamaps.Selected.Edges.indexOf(edge); //following if statement only executes if the edge being hovered over is not selected @@ -558,6 +560,7 @@ Metamaps.JIT = { } }, // onMouseEnter onMouseLeave: function (edge) { + if (edge.getData('alpha') === 0) return; // don't do anything if the edge is filtered $('canvas').css('cursor', 'default'); var edgeIsSelected = Metamaps.Selected.Edges.indexOf(edge); //following if statement only executes if the edge being hovered over is not selected @@ -1229,6 +1232,8 @@ Metamaps.JIT = { // the 'node' variable is a JIT node, the one that was clicked on // the 'e' variable is the click event + if (adj.getData('alpha') === 0) return; // don't do anything if the edge is filtered + var authorized; e.preventDefault(); diff --git a/app/assets/javascripts/metamaps/Metamaps.Router.js b/app/assets/javascripts/metamaps/Metamaps.Router.js index 6e989d3b..30cbe567 100644 --- a/app/assets/javascripts/metamaps/Metamaps.Router.js +++ b/app/assets/javascripts/metamaps/Metamaps.Router.js @@ -1,4 +1,7 @@ (function () { + + Metamaps.currentPage = ""; + var Router = Backbone.Router.extend({ routes: { "": "home", // #home @@ -7,30 +10,130 @@ }, home: function () { - document.title = 'My Maps | Metamaps'; - $('#cards').show(); + if (Metamaps.Active.Mapper) document.title = 'My Maps | Metamaps'; + else document.title = 'Home | Metamaps'; + + Metamaps.currentSection = ""; + Metamaps.currentPage = ""; + $('.wrapper').removeClass('mapPage'); + + var classes = Metamaps.Active.Mapper ? "homePage explorePage" : "homePage"; + $('.wrapper').addClass(classes); + + // all this only for the logged in home page + if (Metamaps.Active.Mapper) { + Metamaps.Famous.explore.set('mine'); + Metamaps.Famous.explore.show(); + + $('.yield').fadeOut(300); + $('.mapsWrapper').fadeIn(300); + + Metamaps.GlobalUI.Search.open(); + Metamaps.GlobalUI.Search.lock(); + + Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps.Mine ); + if (Metamaps.Maps.Mine.length === 0) { + Metamaps.Maps.Mine.getMaps(); // this will trigger an explore maps render + } + else { + Metamaps.Views.exploreMaps.render(); + } + } + // logged out home page + else { + Metamaps.Famous.explore.hide(); + + Metamaps.GlobalUI.Search.unlock(); + Metamaps.GlobalUI.Search.close(0, true); + + $('.yield').fadeIn(300); + $('.mapsWrapper').fadeOut(300); + } + + Metamaps.Famous.viz.hide(); + Metamaps.Active.Map = null; + + setTimeout(function(){ + Metamaps.Router.navigate(""); + }, 500); }, explore: function (section) { var capitalize = section.charAt(0).toUpperCase() + section.slice(1); document.title = 'Explore ' + capitalize + ' Maps | Metamaps'; - //$('#cards').hide(); + + $('.wrapper').removeClass('homePage mapPage'); + $('.wrapper').addClass('explorePage'); + + Metamaps.currentSection = "explore"; + Metamaps.currentPage = section; + + Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps[capitalize] ); + if (Metamaps.Maps[capitalize].length === 0) { + Metamaps.Maps[capitalize].getMaps(); // this will trigger an explore maps render + } + else { + Metamaps.Views.exploreMaps.render(); + } + + Metamaps.GlobalUI.Search.open(); + Metamaps.GlobalUI.Search.lock(); + + $('.yield').fadeOut(300); + $('.mapsWrapper').fadeIn(300); + + Metamaps.Famous.explore.set(section); + Metamaps.Famous.explore.show(); + + Metamaps.Famous.viz.hide(); + Metamaps.Active.Map = null; + + setTimeout(function(){ + Metamaps.Router.navigate("/explore/" + section); + }, 500); }, maps: function (id) { document.title = 'Map ' + id + ' | Metamaps'; - $('#cards').hide(); + + Metamaps.currentSection = "map"; + Metamaps.currentPage = id; + + $('.wrapper').removeClass('homePage explorePage'); + $('.wrapper').addClass('mapPage'); + + $('.yield').fadeOut(300); + $('.mapsWrapper').fadeOut(300); + + Metamaps.Famous.explore.hide(); + + // clear the visualization, if there was one, before showing its div again + if (Metamaps.Visualize.mGraph) { + Metamaps.Visualize.mGraph.graph.empty(); + Metamaps.Visualize.mGraph.plot(); + Metamaps.JIT.centerMap(); + } + Metamaps.Famous.viz.show(); + + Metamaps.GlobalUI.Search.unlock(); + Metamaps.GlobalUI.Search.close(0, true); + + Metamaps.Map.launch(id); } }); + Metamaps.Router = new Router(); + Metamaps.Router.init = function () { Backbone.history.start({ + silent: true, pushState: true, root: '/' }); - console.log('router started'); $(document).on("click", "a:not([data-bypass])", function (evt) { + var segments; + var href = { prop: $(this).prop("href"), attr: $(this).attr("href") @@ -41,7 +144,14 @@ if (href.prop && href.prop.slice(0, root.length) === root) { evt.preventDefault(); - Backbone.history.navigate(href.attr, true); + + segments = href.attr.split('/'); + segments.splice(0,1); // pop off the element created by the first / + + if (href.attr === "") Metamaps.Router.home(); + else { + Metamaps.Router[segments[0]](segments[1]); + } } }); } diff --git a/app/assets/javascripts/metamaps/Metamaps.Views.js b/app/assets/javascripts/metamaps/Metamaps.Views.js index 396f6beb..91588f33 100644 --- a/app/assets/javascripts/metamaps/Metamaps.Views.js +++ b/app/assets/javascripts/metamaps/Metamaps.Views.js @@ -1,12 +1,20 @@ (function () { Metamaps.Views = {}; +Metamaps.Views.init = function () { + Metamaps.Views.MapCard = Backbone.View.extend({ + template: Hogan.compile( $('#mapCardTemplate').html() ), + tagName: "div", className: "map", + id: function() { + return this.model.id; + }, + events: { "click .icon": "open", "click .button.edit": "openEditDialog", @@ -18,9 +26,45 @@ }, render: function () { - + this.$el.html( this.template.render(this.model.attrForCards()) ); + return this; } }); + var mapsWrapper = Backbone.View.extend({ + + el: '.mapsWrapper', + + initialize: function (opts) { + + }, + setCollection: function (collection) { + if (this.collection) this.stopListening(this.collection); + this.collection = collection; + this.listenTo(this.collection, 'successOnFetch', this.handleSuccess); + this.listenTo(this.collection, 'errorOnFetch', this.handleError); + }, + render: function () { + var that = this; + this.$el.empty(); + + this.collection.each(function (map) { + var view = new Metamaps.Views.MapCard({ model: map }); + + that.$el.append( view.render().el ); + }); + }, + handleSuccess: function () { + Metamaps.Loading.loader.hide(); + this.render(); + }, + handleError: function () { + alert('error!'); + } + }); + + Metamaps.Views.exploreMaps = new mapsWrapper(); +}; + })(); \ No newline at end of file diff --git a/app/assets/javascripts/metamaps/Metamaps.js b/app/assets/javascripts/metamaps/Metamaps.js index c9808092..b3d3b2b6 100644 --- a/app/assets/javascripts/metamaps/Metamaps.js +++ b/app/assets/javascripts/metamaps/Metamaps.js @@ -64,12 +64,6 @@ Metamaps.Selected = { Edges: [] }; -Metamaps.Metacodes = {}; // will be initialized in Metamaps.Backbone.init as a MetacodeCollection -Metamaps.Topics = {}; // will be initialized in Metamaps.Backbone.init as a TopicCollection -Metamaps.Synapses = {}; // will be initialized in Metamaps.Backbone.init as a SynapseCollection -Metamaps.Mappings = {}; // will be initialized in Metamaps.Backbone.init as a MappingCollection - - /* * * BACKBONE @@ -323,26 +317,24 @@ Metamaps.Backbone.init = function () { url: '/mappings' }); - Metamaps.Metacodes = new self.MetacodeCollection(Metamaps.Metacodes); - - Metamaps.Topics = new self.TopicCollection(Metamaps.Topics); + Metamaps.Metacodes = Metamaps.Metacodes ? new self.MetacodeCollection(Metamaps.Metacodes) : new self.MetacodeCollection(); + Metamaps.Topics = Metamaps.Topics ? new self.TopicCollection(Metamaps.Topics) : new self.TopicCollection(); Metamaps.Topics.on("add remove", function(topic){ Metamaps.Filter.checkMetacodes(); Metamaps.Filter.checkMappers(); }); - Metamaps.Synapses = new self.SynapseCollection(Metamaps.Synapses); - + Metamaps.Synapses = Metamaps.Synapses ? new self.SynapseCollection(Metamaps.Synapses) : new self.SynapseCollection(); Metamaps.Synapses.on("add remove", function(synapse){ Metamaps.Filter.checkSynapses(); Metamaps.Filter.checkMappers(); }); - Metamaps.Mappers = new self.MapperCollection(Metamaps.Mappers) + Metamaps.Mappers = Metamaps.Mappers ? new self.MapperCollection(Metamaps.Mappers) : new self.MapperCollection(); if (Metamaps.Active.Map) { - Metamaps.Mappings = new self.MappingCollection(Metamaps.Mappings); + Metamaps.Mappings = Metamaps.Mappings ? new self.MappingCollection(Metamaps.Mappings) : new self.MappingCollection(); Metamaps.Mappings.on("add remove", function(synapse){ Metamaps.Filter.checkMetacodes(); @@ -350,7 +342,6 @@ Metamaps.Backbone.init = function () { }); Metamaps.Active.Map = new self.Map(Metamaps.Active.Map); - Metamaps.Maps.add(Metamaps.Active.Map); } if (Metamaps.Active.Topic) Metamaps.Active.Topic = new self.Topic(Metamaps.Active.Topic); @@ -1110,12 +1101,10 @@ Metamaps.SynapseCard = { * */ Metamaps.Visualize = { - mGraph: {}, // a reference to the graph object. + mGraph: null, // a reference to the graph object. cameraPosition: null, // stores the camera position when using a 3D visualization type: "ForceDirected", // the type of graph we're building, could be "RGraph", "ForceDirected", or "ForceDirected3D" - savedLayout: true, // indicates whether the map has a saved layout or not loadLater: false, // indicates whether there is JSON that should be loaded right in the offset, or whether to wait till the first topic is created - target: null, // the selector representing the location to render the graph init: function () { var self = Metamaps.Visualize; // disable awkward dragging of the canvas element that would sometimes happen @@ -1142,12 +1131,6 @@ Metamaps.Visualize = { Metamaps.Touch.touchDragNode = false; }); }, - render: function (targetID, vizData) { - var self = Metamaps.Visualize; - self.mGraph = {}; - self.target = targetID; - self.__buildGraph(vizData); - }, computePositions: function () { var self = Metamaps.Visualize, mapping; @@ -1171,7 +1154,7 @@ Metamaps.Visualize = { pos.setc(-200, -200); }); self.mGraph.compute('end'); - } else if (self.type == "ForceDirected" && self.savedLayout) { + } else if (self.type == "ForceDirected") { var i, l, startPos, endPos, topic, synapse; self.mGraph.graph.eachNode(function (n) { @@ -1194,51 +1177,78 @@ Metamaps.Visualize = { n.setPos(startPos, 'start'); n.setPos(endPos, 'end'); }); - } else if (self.type == "ForceDirected3D" || !self.savedLayout) { + } else if (self.type == "ForceDirected3D") { self.mGraph.compute(); } }, /** - * __buildGraph does the heavy lifting of creating the engine that renders the graph with the properties we desire + * render does the heavy lifting of creating the engine that renders the graph with the properties we desire * * @param vizData a json structure containing the data to be rendered. */ - __buildGraph: function (vizData) { - var self = Metamaps.Visualize + render: function () { + var self = Metamaps.Visualize, RGraphSettings, FDSettings; + + if (self.type == "RGraph" && !self.mGraph) { + RGraphSettings = $.extend(true, {}, Metamaps.JIT.ForceDirected.graphSettings); - if (self.type == "RGraph") { $jit.RGraph.Plot.NodeTypes.implement(Metamaps.JIT.ForceDirected.nodeSettings); $jit.RGraph.Plot.EdgeTypes.implement(Metamaps.JIT.ForceDirected.edgeSettings); + RGraphSettings.width = $(document).width(); + RgraphSettings.height = $(document).height(); RGraphSettings.background = Metamaps.JIT.RGraph.background; RGraphSettings.levelDistance = Metamaps.JIT.RGraph.levelDistance; self.mGraph = new $jit.RGraph(RGraphSettings); - } else if (self.type == "ForceDirected") { + + } else if (self.type == "ForceDirected" && !self.mGraph) { + + FDSettings = $.extend(true, {}, Metamaps.JIT.ForceDirected.graphSettings); + $jit.ForceDirected.Plot.NodeTypes.implement(Metamaps.JIT.ForceDirected.nodeSettings); $jit.ForceDirected.Plot.EdgeTypes.implement(Metamaps.JIT.ForceDirected.edgeSettings); - self.mGraph = new $jit.ForceDirected(Metamaps.JIT.ForceDirected.graphSettings); - } else if (self.type == "ForceDirected3D") { + + FDSettings.width = $(document).width(); + FDSettings.height = $(document).height(); + + self.mGraph = new $jit.ForceDirected(FDSettings); + + } else if (self.type == "ForceDirected3D" && !self.mGraph) { // init ForceDirected3D self.mGraph = new $jit.ForceDirected3D(Metamaps.JIT.ForceDirected3D.graphSettings); self.cameraPosition = self.mGraph.canvas.canvases[0].camera.position; } + else { + self.mGraph.graph.empty(); + } + Metamaps.Loading.loader.hide(); // load JSON data, if it's not empty if (!self.loadLater) { //load JSON data. - self.mGraph.loadJSON(vizData); + self.mGraph.loadJSON(Metamaps.JIT.vizData); //compute positions and plot. self.computePositions(); if (self.type == "RGraph") { - self.mGraph.fx.animate(Metamaps.JIT.RGraph.animate); - } else if (self.type == "ForceDirected" && self.savedLayout) { - Metamaps.Organize.loadSavedLayout(); - } else if (self.type == "ForceDirected3D" || !self.savedLayout) { + self.mGraph.animate(Metamaps.JIT.RGraph.animate); + } else if (self.type == "ForceDirected") { + self.mGraph.animate(Metamaps.JIT.ForceDirected.animateSavedLayout); + } else if (self.type == "ForceDirected3D") { self.mGraph.animate(Metamaps.JIT.ForceDirected.animateFDLayout); } } + + // update the url now that the map is ready + setTimeout(function(){ + var m = Metamaps.Active.Map; + + if (m && window.location.pathname !== "/maps/" + m.id) { + Metamaps.Router.navigate("/maps/" + m.id); + } + }, 800); + } }; // end Metamaps.Visualize @@ -1347,6 +1357,9 @@ Metamaps.Realtime = { open: function () { var self = Metamaps.Realtime; + Metamaps.GlobalUI.Account.close(true); + Metamaps.Filter.close(true); + clearTimeout(self.timeOut); if (!self.isOpen && !self.changing) { self.changing = true; @@ -1356,9 +1369,11 @@ Metamaps.Realtime = { }); } }, - close: function () { + close: function (force) { var self = Metamaps.Realtime; + var time = force ? 0 : 500; + self.timeOut = setTimeout(function () { if (!self.changing) { self.changing = true; @@ -1367,7 +1382,7 @@ Metamaps.Realtime = { self.isOpen = false; }); } - }, 500); + }, time); }, setupSocket: function () { var self = Metamaps.Realtime; @@ -1742,6 +1757,7 @@ Metamaps.Control = { Metamaps.Filter.checkMappers(); }, selectEdge: function (edge) { + if (edge.getData('alpha') === 0) return; // don't do anything if the edge is filtered if (Metamaps.Selected.Edges.indexOf(edge) != -1) return; edge.setData('showDesc', true, 'current'); if (!Metamaps.Settings.embed) { @@ -1772,6 +1788,7 @@ Metamaps.Control = { Metamaps.Visualize.mGraph.plot(); }, deselectEdge: function (edge) { + if (edge.getData('alpha') === 0) return; // don't do anything if the edge is filtered edge.setData('showDesc', false, 'current'); edge.setDataset('end', { lineWidth: 2, @@ -1937,16 +1954,15 @@ Metamaps.Filter = { $('.sidebarFilterBox .hideAllSynapses').click(self.filterAllSynapses); $('.sidebarFilterBox .hideAllMappers').click(self.filterAllMappers); - // toggle visibility of topics with metacodes based on status in the filters list - $('#filter_by_metacode ul li').click(self.toggleMetacode); - $('#filter_by_mapper ul li').click(self.toggleMapper); - $('#filter_by_synapse ul li').click(self.toggleSynapse); - + self.bindLiClicks(); self.getFilterData(); }, open: function () { var self = Metamaps.Filter; + Metamaps.GlobalUI.Account.close(true); + Metamaps.Realtime.close(true); + clearTimeout(self.timeOut); if (!self.isOpen && !self.changing) { self.changing = true; @@ -1957,9 +1973,11 @@ Metamaps.Filter = { }); } }, - close: function () { + close: function (force) { var self = Metamaps.Filter; + var time = force ? 0 : 500; + self.timeOut = setTimeout(function () { if (!self.changing) { self.changing = true; @@ -1969,121 +1987,110 @@ Metamaps.Filter = { self.isOpen = false; }); } - }, 500); + }, time); }, - checkMetacodes: function () { - var self = Metamaps.Filter; - - var newMetacodeList = []; - var removedMetacodes = []; - var addedMetacodes = []; - - Metamaps.Topics.each(function(topic) { - if (newMetacodeList.indexOf(topic.get('metacode_id')) === -1) { - newMetacodeList.push(topic.get('metacode_id').toString()); - } - }); - - removedMetacodes = _.difference(self.filters.metacodes, newMetacodeList); - addedMetacodes = _.difference(newMetacodeList, self.filters.metacodes); - - _.each(removedMetacodes, function(metacode_id) { - $('#filter_by_metacode li[data-id="' + metacode_id + '"]').fadeOut('fast',function(){ - $(this).remove(); - }); - }); - - var synapse, li, jQueryLi; + /* + Most of this data essentially depends on the ruby function which are happening for filter inside view filterBox + But what these function do is load this data into three accessible array within java : metacodes, mappers and synapses + */ + getFilterData: function () { + var self = Metamaps.Filter; + + var metacode, mapper, synapse; + + $('#filter_by_metacode li').each(function() { + metacode = $( this ).attr('data-id'); + self.filters.metacodes.push(metacode); + self.visible.metacodes.push(metacode); + }); + + $('#filter_by_mapper li').each(function() { + mapper = ($( this ).attr('data-id')); + self.filters.mappers.push(mapper); + self.visible.mappers.push(mapper); + }); + + $('#filter_by_synapse li').each(function() { + synapse = ($( this ).attr('data-id')); + self.filters.synapses.push(synapse); + self.visible.synapses.push(synapse); + }); + }, + bindLiClicks: function () { + var self = Metamaps.Filter; + $('#filter_by_metacode ul li').unbind().click(self.toggleMetacode); + $('#filter_by_mapper ul li').unbind().click(self.toggleMapper); + $('#filter_by_synapse ul li').unbind().click(self.toggleSynapse); + }, + // an abstraction function for checkMetacodes, checkMappers, checkSynapses to reduce + // code redundancy + /* + @param + */ + updateFilters: function (topicsSynapsesOrBoth, propertyToCheck, correlatedModel, filtersToUse, listToModify) { + var self = Metamaps.Filter; + + var newList = []; + var removed = []; + var added = []; + + var check = function (topicsOrSynapses) { + Metamaps[topicsOrSynapses].each(function(model) { + var prop = model.get(propertyToCheck) ? model.get(propertyToCheck).toString() : false; + if (prop && newList.indexOf(prop) === -1) { + newList.push(prop); + } + }); + } + if (topicsSynapsesOrBoth === "both") { + check('Synapses'); + check('Topics'); + } + else check(topicsSynapsesOrBoth); + + removed = _.difference(self.filters[filtersToUse], newList); + added = _.difference(newList, self.filters[filtersToUse]); + + // remove the list items for things no longer present on the map + _.each(removed, function(identifier) { + $('#filter_by_' + listToModify + ' li[data-id="' + identifier + '"]').fadeOut('fast',function(){ + $(this).remove(); + }); + }); + + var model, li, jQueryLi; function sortAlpha(a,b){ return a.childNodes[1].innerText.toLowerCase() > b.childNodes[1].innerText.toLowerCase() ? 1 : -1; } - _.each(addedMetacodes, function(metacode_id) { - metacode = Metamaps.Metacodes.get(metacode_id); - li = metacode.prepareLiForFilter(); - jQueryLi = $(li).hide(); - $('li', '#filter_by_metacode ul').add(jQueryLi.fadeIn("fast")) - .sort(sortAlpha).appendTo('#filter_by_metacode ul'); + // for each new filter to be added, create a list item for it and fade it in + _.each(added, function (identifier) { + model = Metamaps[correlatedModel].get(identifier) || + Metamaps[correlatedModel].find(function (model) { + return model.get(propertyToCheck) === identifier; + }); + li = model.prepareLiForFilter(); + jQueryLi = $(li).hide(); + $('li', '#filter_by_' + listToModify + ' ul').add(jQueryLi.fadeIn("fast")) + .sort(sortAlpha).appendTo('#filter_by_' + listToModify + ' ul'); }); - self.filters.metacodes = newMetacodeList; + + // update the list of filters with the new list we just generated + self.filters[filtersToUse] = newList; + + // make sure clicks on list items still trigger the right events + self.bindLiClicks(); + }, + checkMetacodes: function () { + var self = Metamaps.Filter; + self.updateFilters('Topics', 'metacode_id', 'Metacodes', 'metacodes', 'metacode'); }, checkMappers: function () { var self = Metamaps.Filter; - - var newMappersList = []; - var removedMappersList = []; - var addedMappers = []; - - Metamaps.Topics.each(function(topic) { - if (newMappersList.indexOf(topic.get('user_id')) === -1) { - newMappersList.push(topic.get('user_id').toString()); - } - }); - Metamaps.Synapses.each(function(synapse) { - if (newMappersList.indexOf(synapse.get('user_id')) === -1) { - newMappersList.push(synapse.get('user_id').toString()); - } - }); - - - removedMappersList = _.difference(self.filters.mappers, newMappersList); - addedMappers = _.difference(newMappersList, self.filters.mappers); - - _.each(removedMappersList, function(user_id) { - $('#filter_by_mapper li[data-id="' + user_id + '"]').fadeOut('fast',function(){ - $(this).remove(); - }); - }); - - var mapper, li, jQueryLi; - function sortAlpha(a,b){ - return a.childNodes[1].innerText.toLowerCase() > b.childNodes[1].innerText.toLowerCase() ? 1 : -1; - } - _.each(addedMappers, function(user_id) { - mapper = Metamaps.Mapper.get(user_id); - li = mapper.prepareLiForFilter(); - jQueryLi = $(li).hide(); - $('li', '#filter_by_mapper ul').add(jQueryLi.fadeIn("fast")) - .sort(sortAlpha).appendTo('#filter_by_mapper ul'); - }); - - self.filters.mappers = newMappersList; - + self.updateFilters('both', 'user_id', 'Mapper', 'mappers', 'mapper'); }, checkSynapses: function () { var self = Metamaps.Filter; - - var newSynapsesList = []; - var removedSynapses = []; - var addedSynapses = []; - - Metamaps.Synapses.each(function(synapse) { - if (synapse.get('desc') && newSynapsesList.indexOf(synapse.get('desc')) === -1) { - newSynapsesList.push(synapse.get('desc').toString()); - } - }); - - removedSynapses = _.difference(self.filters.synapses, newSynapsesList); - addedSynapses = _.difference(newSynapsesList, self.filters.synapses); - - _.each(removedSynapses, function(synapse_desc) { - $('#filter_by_synapse li[data-id="' + synapse_desc + '"]').fadeOut('fast',function(){ - $(this).remove(); - }); - }); - - var synapse, li, jQueryLi; - function sortAlpha(a,b){ - return a.innerHTML.toLowerCase() > b.innerHTML.toLowerCase() ? 1 : -1; - } - _.each(addedSynapses, function(synapse_desc) { - synapse = Metamaps.Synapses.findWhere({desc:synapse_desc}); - li = synapse.prepareLiForFilter(); - jQueryLi = $(li).hide(); - $('li', '#filter_by_synapse ul').add(jQueryLi.fadeIn("fast")) - .sort(sortAlpha).appendTo('#filter_by_synapse ul'); - }); - - self.filters.synapses = newSynapsesList; + self.updateFilters('Synapses', 'desc', 'Synapses', 'synapses', 'synapse'); }, filterAllMetacodes: function (e) { var self = Metamaps.Filter; @@ -2120,80 +2127,37 @@ Metamaps.Filter = { $('#filter_by_synapse ul li').removeClass('toggledOff'); self.visible.synapses = self.filters.synapses.slice(); self.passFilters(); - - }, - /* - Most of this data essentially depends on the ruby function which are happening for filter inside view filterBox - But what these function do is load this data into three accessible array within java : metacodes, mappers and synapses - */ - getFilterData: function () { - var self = Metamaps.Filter; - - var metacode, mapper, synapse; - - $('#filter_by_metacode li').each(function() { - metacode = $( this ).find('img').attr('data-id'); - self.filters.metacodes.push(metacode); - self.visible.metacodes.push(metacode); - }); - - $('#filter_by_mapper li').each(function() { - mapper = ($( this ).find('img').attr('data-id')); - self.filters.mappers.push(mapper); - self.visible.mappers.push(mapper); - }); - - $('#filter_by_synapse li').each(function() { - synapse = ($( this ).find('p').text()); - self.filters.synapses.push(synapse); - self.visible.synapses.push(synapse); - }); + // an abstraction function for toggleMetacode, toggleMapper, toggleSynapse + // to reduce code redundancy + // gets called in the context of a list item in a filter box + toggleLi: function (whichToFilter) { + var self = Metamaps.Filter, index; + var id = $(this).attr("data-id"); + if (self.visible[whichToFilter].indexOf(id) == -1) { + self.visible[whichToFilter].push(id); + $(this).removeClass('toggledOff'); + } + else { + index = self.visible[whichToFilter].indexOf(id); + self.visible[whichToFilter].splice(index, 1); + $(this).addClass('toggledOff'); + } + self.passFilters(); }, toggleMetacode: function () { - var self = Metamaps.Filter, index; - - var metacode_id = $(this).attr("data-id"); - if (self.visible.metacodes.indexOf(metacode_id) == -1) { - self.visible.metacodes.push(metacode_id); - $(this).removeClass('toggledOff'); - } - else { - index = self.visible.metacodes.indexOf(metacode_id); - self.visible.metacodes.splice(index, 1); - $(this).addClass('toggledOff'); - } - self.passFilters(); + var self = Metamaps.Filter; + self.toggleLi.call(this, 'metacodes'); }, toggleMapper: function () { - var self = Metamaps.Filter, index; + var self = Metamaps.Filter; - var user_id = $(this).attr("data-id"); - if (self.visible.mappers.indexOf(user_id) == -1) { - self.visible.mappers.push(user_id); - $(this).removeClass('toggledOff'); - } - else { - index = self.visible.mappers.indexOf(user_id); - self.visible.mappers.splice(index, 1); - $(this).addClass('toggledOff'); - } - self.passFilters(); + self.toggleLi.call(this, 'mappers'); }, toggleSynapse: function () { - var self = Metamaps.Filter, index; + var self = Metamaps.Filter; - var synapse_desc = $(this).attr("data-id"); - if (self.visible.synapses.indexOf(synapse_desc) == -1) { - self.visible.synapses.push(synapse_desc); - $(this).removeClass('toggledOff'); - } - else { - index = self.visible.synapses.indexOf(synapse_desc); - self.visible.synapses.splice(index, 1); - $(this).addClass('toggledOff'); - } - self.passFilters(); + self.toggleLi.call(this, 'synapses'); }, passFilters: function () { var self = Metamaps.Filter; @@ -2216,7 +2180,7 @@ Metamaps.Filter = { n.setData('alpha', 1, 'end'); } else { - n.setData('alpha', 0.0, 'end'); + n.setData('alpha', 0, 'end'); } }); Metamaps.Synapses.each(function(synapse) { @@ -2234,7 +2198,7 @@ Metamaps.Filter = { e.setData('alpha', 1, 'end'); } else { - e.setData('alpha', 0.0, 'end'); + e.setData('alpha', 0, 'end'); } }); @@ -2260,11 +2224,11 @@ Metamaps.Listeners = { $(document).on('keydown', function (e) { switch (e.which) { case 13: - Metamaps.JIT.enterKeyHandler(); + if (Metamaps.Active.Map) Metamaps.JIT.enterKeyHandler(); e.preventDefault(); break; case 27: - Metamaps.JIT.escKeyHandler(); + if (Metamaps.Active.Map) Metamaps.JIT.escKeyHandler(); break; default: break; //alert(e.which); @@ -2399,11 +2363,7 @@ Metamaps.Organize = { var newOriginY = (lowY + highY) / 2; } else alert('please call function with a valid layout dammit!'); - }, - loadSavedLayout: function (id) { - Metamaps.Visualize.computePositions(); - Metamaps.Visualize.mGraph.animate(Metamaps.JIT.ForceDirected.animateSavedLayout); - }, + } }; // end Metamaps.Organize @@ -2747,34 +2707,28 @@ Metamaps.Map = { self.InfoBox.init(); self.CheatSheet.init(); }, - // this function is to retrieve a map JSON object from the database - // @param id = the id of the map to retrieve - get: function (id, callback) { - // if the desired topic is not yet in the local topic repository, fetch it - if (Metamaps.Maps.get(id) == undefined) { - if (!callback) { - var e = $.ajax({ - url: "/maps/" + id + ".json", - async: false - }); - Metamaps.Maps.add($.parseJSON(e.responseText)); - return Metamaps.Maps.get(id); - } else { - return $.ajax({ - url: "/users/" + id + ".json", - success: function (data) { - Metamaps.Maps.add(data); - callback(Metamaps.Maps.get(id)); - } - }); - } - } else { - if (!callback) { - return Metamaps.Maps.get(id); - } else { - return callback(Metamaps.Maps.get(id)); - } + launch: function (id) { + var bb = Metamaps.Backbone; + var start = function (data) { + Metamaps.Active.Map = new bb.Map(data.map); + Metamaps.Mappers = new bb.MapperCollection(data.mappers); + Metamaps.Topics = new bb.TopicCollection(data.topics); + Metamaps.Synapses = new bb.SynapseCollection(data.synapses); + Metamaps.Mappings = new bb.MappingCollection(data.mappings); + + // build and render the visualization + Metamaps.JIT.prepareVizData(); + + // update filters + Metamaps.Filter.checkMappers(); + Metamaps.Filter.checkMetacodes(); + Metamaps.Filter.checkSynapses(); } + + $.ajax({ + url: "/maps/" + id + ".json", + success: start + }); }, fork: function () { Metamaps.GlobalUI.openLightbox('forkmap'); @@ -2853,13 +2807,13 @@ Metamaps.Map.InfoBox = { $('.yourMap .mapPermission').click(self.onPermissionClick); - $("div.index").hover(self.open, self.close); + $(".mapInfo").hover(self.open, self.close); }, open: function (event) { var self = Metamaps.GlobalUI.Account; clearTimeout(self.timeOut); - if (!self.isOpen && !self.changing && event.target.className != "openCheatsheet openLightbox") { + if (!self.isOpen && !self.changing && event.target.className.indexOf("openCheatsheet") === -1) { self.changing = true; $('.mapInfoBox').fadeIn(200, function () { self.changing = false; diff --git a/app/assets/javascripts/src/main.js b/app/assets/javascripts/src/main.js new file mode 100644 index 00000000..b3f7c6b8 --- /dev/null +++ b/app/assets/javascripts/src/main.js @@ -0,0 +1,155 @@ +define(function(require, exports, module) { + // import dependencies + var Engine = require('famous/core/Engine'); + var Modifier = require('famous/core/Modifier'); + var Transform = require('famous/core/Transform'); + var Surface = require('famous/core/Surface'); + var Timer = require('famous/utilities/Timer'); + + var templates = require('templates'); + + // create the main context + var famous = document.getElementById('famousOverlay'); + + Metamaps.Famous = {}; + var f = Metamaps.Famous; + + f.mainContext = Engine.createContext(famous); + + + // INFOVIS + f.viz = {}; + f.viz.surf = new Surface({ + size: [undefined, undefined], + classes: [], + properties: { + display: 'none' + } + }); + var prepare = function () { + f.viz.show(); + Metamaps.JIT.prepareVizData(); + f.viz.surf.removeListener('deploy',prepare); + }; + if (Metamaps.currentSection === "map") { + f.viz.surf.on('deploy', prepare); + } + f.viz.mod = new Modifier({ + origin: [0.5, 0.5], + opacity: 0 + }); + f.viz.show = function () { + f.viz.surf.setProperties({ "display":"block" }); + f.viz.mod.setOpacity( + 1, + { duration: 300 } + ); + }; + f.viz.hide = function () { + f.viz.mod.setOpacity( + 0, + { duration: 300 }, + function() { + f.viz.surf.setProperties({"display": "none"}); + } + ); + }; + f.mainContext.add(f.viz.mod).add(f.viz.surf); + + // EXPLORE MAPS BAR + f.explore = {}; + f.explore.surf = new Surface({ + size: [undefined, 94], + content: templates.mineContent, + classes: ['exploreMapsBar', 'exploreElement'] + }); + f.explore.mod = new Modifier({ + origin: [0.5, 0], + transform: Transform.translate(0, -94, 0) + }); + f.explore.show = function () { + f.explore.mod.setTransform( + Transform.translate(0, 0, 0), + { duration: 300, curve: 'easeOut' } + ); + }; + f.explore.hide = function () { + f.explore.mod.setTransform( + Transform.translate(0, -94, 0), + { duration: 300, curve: 'easeIn' } + ); + }; + f.explore.set = function (section) { + var loggedIn = Metamaps.Active.Mapper ? 'Auth' : ''; + f.explore.surf.setContent(templates[section + loggedIn + 'Content']); + }; + f.mainContext.add(f.explore.mod).add(f.explore.surf); + + // LOGO + f.logo = {}; + f.logo.surf = new Surface({ + size: [258, 56], + content: templates.logoContent, + classes: [] + }); + + f.logo.mod = new Modifier({ + origin: [0.5, 1], + transform: Transform.translate(0, 56, 0) + }); + f.logo.show = function () { + f.logo.mod.setTransform( + Transform.translate(0, 0, 0), + { duration: 300, curve: 'easeOut' } + ); + }; + f.logo.hide = function () { + f.logo.mod.setTransform( + Transform.translate(0, 56, 0), + { duration: 300, curve: 'easeIn' } + ); + }; + f.mainContext.add(f.logo.mod).add(f.logo.surf); + + + // TOAST + f.toast = {}; + f.toast.surf = new Surface({ + size: [true, 42], + content: '', + classes: ['toast'] + }); + f.toast.mod = new Modifier({ + origin: [0, 1], + opacity: 0, + transform: Transform.translate(24, -24, 0) + }); + f.toast.show = function () { + f.toast.mod.setOpacity( + 1, + { duration: 300 } + ); + }; + f.toast.hide = function () { + f.toast.mod.setOpacity( + 0, + { duration: 300 } + ); + }; + f.mainContext.add(f.toast.mod).add(f.toast.surf); + + f.logo.show(); + if (Metamaps.currentSection === "explore") { + Metamaps.Loading.loader.hide(); + f.explore.set(Metamaps.currentPage); + f.explore.show(); + } + else if (Metamaps.currentSection === "") { + Metamaps.Loading.loader.hide(); + if (Metamaps.Active.Mapper) { + f.explore.set('mine'); + f.explore.show(); + } + else f.explore.set('featured'); + } +}); \ No newline at end of file diff --git a/app/assets/javascripts/src/templates.js b/app/assets/javascripts/src/templates.js new file mode 100644 index 00000000..c3649711 --- /dev/null +++ b/app/assets/javascripts/src/templates.js @@ -0,0 +1,86 @@ +define(function(require, exports, module) { + +var t = {}; + +t.logoContent = ''; +t.logoContent += ''; + +/* logged out explore maps bars */ +t.activeContent = '
'; + t.activeContent += '
'; + t.activeContent += 'My Maps'; + t.activeContent += 'Recently Active'; + t.activeContent += 'Featured'; + t.activeContent += 'New'; + t.activeContent += '
'; + t.activeContent += ' - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : tyPoland Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/Lato-Bol-webfont.ttf b/app/assets/stylesheets/Fonts/Lato-Bol-webfont.ttf deleted file mode 100644 index a62d61ae..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Bol-webfont.ttf and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Bol-webfont.woff b/app/assets/stylesheets/Fonts/Lato-Bol-webfont.woff deleted file mode 100644 index 866d7867..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Bol-webfont.woff and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.eot b/app/assets/stylesheets/Fonts/Lato-Lig-webfont.eot deleted file mode 100644 index 42265967..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.eot and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.svg b/app/assets/stylesheets/Fonts/Lato-Lig-webfont.svg deleted file mode 100644 index e89a231a..00000000 --- a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.ttf b/app/assets/stylesheets/Fonts/Lato-Lig-webfont.ttf deleted file mode 100644 index 86b4e957..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.ttf and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.woff b/app/assets/stylesheets/Fonts/Lato-Lig-webfont.woff deleted file mode 100644 index 0c337a6a..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Lig-webfont.woff and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.eot b/app/assets/stylesheets/Fonts/Lato-Reg-webfont.eot deleted file mode 100644 index e648b1ad..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.eot and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.svg b/app/assets/stylesheets/Fonts/Lato-Reg-webfont.svg deleted file mode 100644 index d300fe48..00000000 --- a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : tyPoland Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.ttf b/app/assets/stylesheets/Fonts/Lato-Reg-webfont.ttf deleted file mode 100644 index 1d1e0865..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.ttf and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.woff b/app/assets/stylesheets/Fonts/Lato-Reg-webfont.woff deleted file mode 100644 index 95bba717..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-Reg-webfont.woff and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.eot b/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.eot deleted file mode 100644 index 6f7fd309..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.eot and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.svg b/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.svg deleted file mode 100644 index 28bd02ab..00000000 --- a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.svg +++ /dev/null @@ -1,147 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 20102011 by tyPoland Lukasz Dziedzic with Reserved Font Name Lato Licensed under the SIL Open Font License Version 11 -Designer : Lukasz Dziedzic -Foundry : tyPoland Lukasz Dziedzic -Foundry URL : httpwwwtypolandcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.ttf b/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.ttf deleted file mode 100644 index 60197266..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.ttf and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.woff b/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.woff deleted file mode 100644 index 4adbc518..00000000 Binary files a/app/assets/stylesheets/Fonts/Lato-RegIta-webfont.woff and /dev/null differ diff --git a/app/assets/stylesheets/Fonts/din.eot b/app/assets/stylesheets/Fonts/din.eot new file mode 100644 index 00000000..6864134c Binary files /dev/null and b/app/assets/stylesheets/Fonts/din.eot differ diff --git a/app/assets/stylesheets/Fonts/din.svg b/app/assets/stylesheets/Fonts/din.svg new file mode 100644 index 00000000..18575cbc --- /dev/null +++ b/app/assets/stylesheets/Fonts/din.svg @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/din.ttf b/app/assets/stylesheets/Fonts/din.ttf new file mode 100644 index 00000000..5600662b Binary files /dev/null and b/app/assets/stylesheets/Fonts/din.ttf differ diff --git a/app/assets/stylesheets/Fonts/din.woff b/app/assets/stylesheets/Fonts/din.woff new file mode 100644 index 00000000..ce391bec Binary files /dev/null and b/app/assets/stylesheets/Fonts/din.woff differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d7b824bb..649f2e2c 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -18,34 +18,6 @@ *= require animate */ -@font-face { - font-family: 'LatoLight'; - src: url('/assets/Fonts/Lato-Lig-webfont.eot'); - src: url('/assets/Fonts/Lato-Lig-webfont.eot?#iefix') format('embedded-opentype'), url('/assets/Fonts/Lato-Lig-webfont.woff') format('woff'), url('/assets/Fonts/Lato-Lig-webfont.ttf') format('truetype'), url('/assets/Fonts/Lato-Lig-webfont.svg#LatoLight') format('svg'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'LatoRegular'; - src: url('/assets/Fonts/Lato-Reg-webfont.eot'); - src: url('/assets/Fonts/Lato-Reg-webfont.eot?#iefix') format('embedded-opentype'), url('/assets/Fonts/Lato-Reg-webfont.woff') format('woff'), url('/assets/Fonts/Lato-Reg-webfont.ttf') format('truetype'), url('/assets/Fonts/Lato-Reg-webfont.svg#LatoRegular') format('svg'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'LatoItalic'; - src: url('/assets/Fonts/Lato-RegIta-webfont.eot'); - src: url('/assets/Fonts/Lato-RegIta-webfont.eot?#iefix') format('embedded-opentype'), url('/assets/Fonts/Lato-RegIta-webfont.woff') format('woff'), url('/assets/Fonts/Lato-RegIta-webfont.ttf') format('truetype'), url('/assets/Fonts/Lato-RegIta-webfont.svg#LatoItalic') format('svg'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'LatoBold'; - src: url('/assets/Fonts/Lato-Bol-webfont.eot'); - src: url('/assets/Fonts/Lato-Bol-webfont.eot?#iefix') format('embedded-opentype'), url('/assets/Fonts/Lato-Bol-webfont.woff') format('woff'), url('/assets/Fonts/Lato-Bol-webfont.ttf') format('truetype'), url('/assets/Fonts/Lato-Bol-webfont.svg#LatoBold') format('svg'); - font-weight: normal; - font-style: normal; -} /* clear styles */ html, @@ -85,22 +57,18 @@ img { html, body, .main, -.wrapper, -#container { +.wrapper { height: 100%; } -.unauthenticated .wrapper.homePage { - overflow: auto; -} .wrapper.homePage { - background: url('mm-homepage-bg-image.png') no-repeat center -249px; + /*background: url('mm-homepage-bg-image.png') no-repeat center -249px;*/ } -body.mapBody { +.wrapper.mapPage { overflow: hidden; } /* scrollbar override */ -.maps > div > div.mCS_no_scrollbar { +.mCS_no_scrollbar { padding-right: 0px !important; } .mCSB_container { @@ -112,12 +80,17 @@ body.mapBody { padding: 0 5px; width: auto; } -html {} body { - background: #E5E5E5; - font-family: 'LatoLight', helvetica, sans-serif; - color: #FFF; +html { + +} +body { + background: #d8d9da; + font-family: 'din-medium', helvetica, sans-serif; + color: #424242; } -body.mapBody {} h1, + + +h1, h2, h3, h4, @@ -139,7 +112,7 @@ h2 { line-height: 35px; } a { - color: #69a3a4; + color: #424242; text-decoration: none; } button.button, @@ -199,9 +172,6 @@ input[type="submit"]:hover { display: none; }*/ -#saveMapLayout { - display: none; -} #error_explanation { background: #612127; padding: 30px; @@ -289,7 +259,7 @@ input[type="submit"]:hover { top: 3px; right: 3px; } -.anypage .new_topic { +.new_topic { /* start it off screen while it initializes the spinner, then it will be hidden with jquery */ top: -1000px; left: -1000px; @@ -298,7 +268,7 @@ input[type="submit"]:hover { width: 300px; margin: -40px 0 0 -50px; } -.anypage .new_synapse { +.new_synapse { display: none; position: absolute; } @@ -311,8 +281,8 @@ input[type="submit"]:hover { height: 37px; font-family: ':atp'; } -.anypage #topic_name, -.anypage .tt-hint { +.new_topic #topic_name, +.new_topic .tt-hint { width: 190px; background: rgba(0, 0, 0, 0.8); height: 25px; @@ -340,7 +310,6 @@ input[type="submit"]:hover { height: 120px; } #metacodeImgTitle { - color: #FFF; float: left; width: 120px; text-align: center; @@ -440,15 +409,6 @@ label[for="user_remember_me"] { } /* --- top options --*/ -.notice.metamaps, -.alert.metamaps { - position: absolute; - margin: 5px 0 0 45px; - background: #0F1519; - padding: 10px 10px 9px 10px; - border-radius: 5px; - z-index: 1; -} .headertop { display: block; position: fixed; @@ -494,106 +454,50 @@ label[for="user_remember_me"] { height: 100%; margin: 0 0; } -/* bottom right corner stuffs */ -.wrapper div.index { - position: fixed; - bottom: 5px; - right: 0px; - z-index: 9999; - width: auto; - padding: 1px 10px 0px 10px; - font-family: "vinyl", sans-serif; - font-style: italic; - height: 35px; - font-size: 30px; - line-height: 38px; - border-right: none; - border-bottom-left-radius: 5px; - border-top-left-radius: 5px; -} -.wrapper div.index .openCheatsheet { - position: absolute; - top: 0; - left: -41px; - background: url('MMCCicon_help.png') no-repeat center center; - background-size: 27px 27px; - border-radius: 5px; - height: 36px; - width: 36px; - cursor: pointer; -} -.wrapper div.index .openCheatsheet:hover {} .wrapper div.index span { - float: left; -} -.wrapper div.index span.mapName { - text-transform: uppercase; - margin-right: 9px; -} -.wrapper div.index span.mapInfo { - width: 24px; - height: 24px; - line-height: 24px; - text-align: center; - margin-top: 5px; - font-size: 27px; - background: url('MMCCicon_info.png') no-repeat center center; - background-size: 19px 19px; -} -.wrapper h1.index { - position: fixed; - bottom: 5px; - right: 0; - z-index: 9999; - width: auto; - padding: 1px 10px 0px 20px; - text-transform: uppercase; - font-style: italic; - height: 35px; - font-size: 30px; - line-height: 38px; - border-right: none; - border-bottom-left-radius: 5px; - border-top-left-radius: 5px; - background: #0F1519; -} /* account */ .sidebarAccount { - position: fixed; - top: 10px; - right: 10px; - z-index: 200; - width: 35px; - height: 35px; + width: 32px; + height: 32px; +} +.unauthenticated .sidebarAccount { + width: 84px; + box-shadow: 0px 1px 1.5px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.24); + border-radius: 2px; } .sidebarAccountIcon { - position: absolute; - width: 35px; - height: 35px; - /*background: #0F1519 url('MMCCicon_mapper.png') no-repeat center center;*/ - background-size: 24px 24px; cursor: pointer; } +.authenticated .sidebarAccountIcon { + height: 32px; + width: 32px; +} +.unauthenticated .sidebarAccountIcon { + width: 66px; + height: 14px; + padding: 9px; + border-radius: 2px; + background-color: #E0E0E0; + color: #424242; + text-transform: uppercase; + text-align: center; + font-size: 14px; + line-height: 14px; +} .sidebarAccountIcon img { border-radius: 17px; } .sidebarAccountBox { - position: absolute; display: none; height: auto; - background: #000; - top: 45px; - right: 0; padding: 10px; - border: 1px solid black; min-width: 120px; - font-family: 'LatoLight', helvetica, sans-serif; } -.sidebarAccountBox.loggedin { +.authenticated .sidebarAccountBox { width: auto; } -.sidebarAccountBox.loggedout { +.unauthenticated .sidebarAccountBox { width: 200px; } .sidebarAccountBox h3 { @@ -639,7 +543,7 @@ li.accountInvite span { padding: 6px 0 6px 25px; } .sidebarAccountBox a { - color: white; + } .sidebarAccountBox input[type="email"], .sidebarAccountBox input[type="password"] { @@ -686,10 +590,6 @@ li.accountInvite span { /* Save To New Map */ .sidebarFork { - position: fixed; - top: 10px; - right: 120px; - z-index: 200; width: 35px; height: 35px; } @@ -733,108 +633,13 @@ li.accountInvite span { } /* end Save To New Map */ -/* Save Layout */ - -.sidebarSave { - position: absolute; - top: 5px; - right: 107px; - z-index: 200; - width: 35px; - height: 35px; -} -.sidebarSaveIcon { - position: absolute; - width: 35px; - height: 35px; - background: url('MMCCicon_save_layout.png') no-repeat center center; - background-size: 22px 22px; - cursor: pointer; -} -.sidebarSaveIcon:hover {} .sidebarSaveBox { - position: absolute; - display: none; - height: auto; - width: 182px; - background: #000; - top: 35px; - right: -36px; - padding: 10px; - border: 1px solid black; - font-family: 'LatoLight', helvetica, sans-serif; -} -.sidebarSave .hoverForTip:hover .tip { - display: block; -} -.sidebarSave .tip { - display: none; - position: absolute; - background: black; - text-align: center; - top: 36px; - right: 0; - color: white; - border-radius: 4px; - font-size: 15px !important; - font-family: 'LatoRegular'; - line-height: 17px; - padding: 3px 5px 2px; - z-index: 100; -} /* Filter */ .sidebarFilter { - position: absolute; - top: 10px; - right: 160px; - z-index: 200; width: 35px; height: 35px; } -.zoomIn { - position: absolute; - bottom: 100px; - right: 20px; - z-index: 200; - width: 35px; - height: 35px; - background: blue; -} - -.zoomOut { - position: absolute; - bottom: 60px; - right: 20px; - z-index: 200; - width: 35px; - height: 35px; - background: blue; -} - -.centerMap { - position: absolute; - bottom: 140px; - right: 20px; - z-index: 200; - width: 35px; - height: 35px; - background: blue; -} - -.zoomExtents { - position: absolute; - bottom: 180px; - right: 20px; - z-index: 200; - width: 35px; - height: 35px; - background: blue; -} - -.sidebarFilter.loggedout { - right: 35px; -} .sidebarFilterIcon { position: absolute; width: 35px; @@ -843,28 +648,17 @@ li.accountInvite span { background-size: 28px 28px; cursor: pointer; } -.sidebarFilterIcon:hover {} -/* we set a few of these params off screen to begin with, so that when we initialize the scroll bar it works, but then - we hide the element and position it correctly */ +.sidebarFilterIcon:hover { + +} .sidebarFilterBox { - position: fixed; - top: -1000px; - right: -1000px; - position:absolute; - top: 35px; - right:-150px; display:none; height: 400px; width: 320px; - background: #f5f5f5; padding: 10px; - border: 1px solid black; - font-family: 'LatoLight', helvetica, sans-serif; text-align: center; - color:#3e3e3e; - overflow: scroll; - + overflow-y: scroll; } h3.filterBox { text-align: left; @@ -925,10 +719,6 @@ h3.filterBox { /* collaborate */ .sidebarCollaborate { - position: fixed; - top: 10px; - right: 200px; - z-index: 200; width: 35px; height: 35px; } @@ -946,17 +736,11 @@ h3.filterBox { background-image: url('MMCCicon_realtime_blue.png'); } .sidebarCollaborateBox { - position: absolute; display: none; height: auto; width: auto; - background: #000; - top: 45px; - right: 0; padding: 10px; - border: 1px solid black; - min-width: 135px; - font-family: 'LatoLight', helvetica, sans-serif; + min-width: 180px; } h3.realtimeBoxTitle { margin-bottom: 10px; @@ -1003,332 +787,6 @@ h3.realtimeBoxTitle { } /* end collaborate */ -/* search */ - -.homeButton { - position: fixed; - top: 10px; - left: 10px; - width: 35px; - height: 35px; - z-index: 200; - background: white; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; -} - -.homeButton a { - display:block; - width: 35px; - height: 35px; -} - -.sidebarSearch { - position: fixed; - top: 10px; - left: 45px; - height: 35px; - z-index: 200; -} -.sidebarSearchIcon { - float: left; - width: 80px; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - height: 35px; - background: #00BCD4 url('search_icon_32x32.png') no-repeat center center; - background-size: 25px 25px; - cursor: pointer; -} -.sidebarSearch .twitter-typeahead { - float: left; -} -.sidebarSearchField, -.sidebarSearch .tt-hint { - height: 25px; - padding: 5px 0; - width: 0px; - margin: 0; - border: 0; - outline: none; - font-size: 18px; - line-height: 35px; - background: #0F1519; - color: rgba(255, 255, 255, 0.6); - font-family: 'LatoRegular'; -} -.sidebarSearch .tt-dropdown-menu { - left: -35px !important; - background: #0F1519; - min-width: 440px; - width: 440px; - overflow-y: scroll; - overflow-x: hidden; -} -.sidebarSearch .tt-dropdown-menu h3 { - font-family: 'vinyl', helvetica, sans-serif; - text-transform: uppercase; - font-style: italic; - font-size: 20px; - line-height: 20px; - margin: 10px 0 3px 10px; - float: left; -} -.sidebarSearch .tt-dropdown-menu .limitToMe { - float: left; - width: 15px; - height: 15px; - margin-top: 11px; - margin-left: 15px; -} -.sidebarSearch .tt-dropdown-menu .limitToMeLabel { - float: left; - margin-top: 11px; -} -.sidebarSearch .tt-dropdown-menu .minimizeResults { - float: right; - width: 35px; - height: 35px; - background: url('/assets/MMCCicon_minimize_arrow.png') no-repeat center center; - background-size: 25px 25px; - cursor: pointer; -} -.sidebarSearch .tt-dropdown-menu .maximizeResults { - float: right; - width: 35px; - height: 35px; - background: url('/assets/MMCCicon_maximize_arrow.png') no-repeat center center; - background-size: 25px 25px; - cursor: pointer; -} -.sidebarSearch .tt-suggestions { - font-family: 'LatoLight', helvetica, sans-serif; - overflow: visible; -} -.sidebarSearch .tt-suggestion { - background: #2A343C; -} -.sidebarSearch .tt-is-under-cursor, -.sidebarSearch .tt-is-under-mouse-cursor { - background: #0E161D; -} -.sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap, -.sidebarSearch .tt-dataset-maps .tt-is-under-mouse-cursor .resultmap, -.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .resulttopic, -.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .resulttopic { - min-height: 57px; -} -.sidebarSearch .tt-suggestion .icon { - float: left; - width: 36px; - height: 36px; - margin-right: 5px; -} -.sidebarSearch .topicMetacode { - float: left; - margin-right: 5px; - max-width: 70px; -} -.sidebarSearch .tt-dataset-topics .topicIcon { - width: 36px; - height: 36px; -} -.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .topicIcon, -.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .topicIcon { - margin: 0 auto; - padding-left: 2px -} -.sidebarSearch .tt-dataset-topics .metacodeTip { - display: none; -} -.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip, -.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .metacodeTip { - display: block; - font-family: 'vinyl'; - text-transform: uppercase; - font-style: italic; - font-size: 13px; - margin: 0 5px 0 2px; - text-align: center; -} -.sidebarSearch .tt-dataset-mappers .tt-suggestion .icon { - width: 28px; - height: 28px; - padding: 4px; -} -.sidebarSearch .resultText { - width: 225px; - display: block; - float: left; - word-wrap: break-word; -} -.sidebarSearch .resultTitle { - font-weight: normal; - font-family: 'LatoRegular'; - font-size: 18px; - line-height: 22px; - width: 100%; - padding-top: 8px; -} -.sidebarSearch .resultDesc { - font-family: 'LatoItalic'; - font-size: 14px; - line-height: 16px; - width: 100%; - padding: 3px 0 6px 0; -} -.sidebarSearch .tip { - display: none; -} -.sidebarSearch div.autoOptions { - width: 122px; - float: right; - position: relative; - display: none; -} -.sidebarSearch .tt-is-under-cursor .autoOptions, -.sidebarSearch .tt-is-under-mouse-cursor .autoOptions { - display: block; -} -.sidebarSearch .tt-suggestion .resultnoresult .autoOptions { - display: none; -} -.sidebarSearch .autoOptions button, -.sidebarSearch .autoOptions a, -.sidebarSearch .autoOptions div { - position: absolute; - padding: 0; - margin: 0; - border: none; - outline: none; -} -.sidebarSearch button.addToMap { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_add.png) no-repeat center center; - background-size: 18px 18px; - top: 30px; - left: 84px; - cursor: pointer; -} -.sidebarSearch div.goTo { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_pop-out.png) no-repeat center center; - background-size: 18px 18px; - top: 7px; - left: 84px; -} -.sidebarSearch div.mapCount { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_map.png) no-repeat 0px center; - background-size: 14px 14px; - top: 7px; - left: 38px; - padding-left: 18px; - font-size: 12px; - line-height: 20px; -} -.sidebarSearch div.topicCount { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_topic.png) no-repeat 0px center; - background-size: 14px 14px; - top: 7px; - left: 39px; - padding-left: 18px; - font-size: 12px; - line-height: 20px; -} -.sidebarSearch div.synapseCount { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_synapse.png) no-repeat 0px center; - background-size: 15px 15px; - top: 30px; - left: 38px; - padding-left: 19px; - font-size: 12px; - line-height: 20px; -} -.sidebarSearch div.topicOriginatorIcon { - width: 20px; - height: 20px; - background: url(/assets/MMCCicon_mapper.png) no-repeat center center; - background-size: 17px 17px; - top: 7px; - left: 13px; -} -.sidebarSearch .tip { - position: absolute; - background: white; - width: auto; - bottom: 0; - right: 25px; - color: black; - white-space: nowrap; - border-radius: 4px; - font-size: 15px !important; - font-family: 'LatoRegular'; - line-height: 17px; - padding: 3px 5px 2px; - z-index: 100; -} -.sidebarSearch .mapCount .tip, -.sidebarSearch .synapseCount .tip, -.sidebarSearch .topicCount .tip { - right: -3px; - bottom: 24px; -} -.sidebarSearch .hoverForTip:hover .tip { - display: block; -} -.sidebarSearch .mapContributorsIcon .mapContributors { - right: 0; - bottom: 21px; - white-space: normal; - width: 200px; -} -.sidebarSearch div.mapContributorsIcon { - height: 20px; - background: url(/assets/MMCCicon_mapper.png) no-repeat 0px center; - background-size: 17px 17px; - top: 7px; - right: 85px; - padding-left: 19px; - font-size: 12px; - line-height: 20px; - padding-right: 5px; -} -.sidebarSearch div.topicPermission, -.sidebarSearch div.mapPermission { - width: 20px; - height: 20px; - background-size: 19px 19px !important; - top: 30px; - left: 13px; -} -.sidebarSearch div.topicPermission.commons, -.sidebarSearch div.mapPermission.commons { - background: url(/assets/MMCCicon_commons.png) no-repeat center center; -} -.sidebarSearch div.topicPermission.public, -.sidebarSearch div.mapPermission.public { - background: url(/assets/MMCCicon_public.png) no-repeat center center; -} -.sidebarSearch div.topicPermission.private, -.sidebarSearch div.mapPermission.private { - background: url(/assets/MMCCicon_private.png) no-repeat center center; -} -.sidebarSearch .tt-dataset-mappers a.goTo { - top: 7px; -} -.sidebarSearch .tt-dataset-mappers div.mapCount { - top: 8px; -} -/* end search */ - .nodemargin { padding-top: 120px; } @@ -1342,14 +800,6 @@ h3.realtimeBoxTitle { #menus { margin: 0 7px; } -#cards { - height: 100%; - width: 90%; - margin: 0 auto; -} -#cards p.empty { - margin-left: 50px; -} /* right click menu */ .rightclickmenu { @@ -2313,16 +1763,13 @@ div.mapInfoStat { } .addMap { display: block; - position: fixed; - right: 55px; - top: 10px; - width: 55px; - height: 35px; - background: #00BCD4 url('MMCCicon_add_map.png') no-repeat 3px -4px; - background-size: 40px 40px; + width: 45px; + height: 32px; + background: #4fb5c0 url('MMCCicon_add_map.png') no-repeat center center; + background-size: 32px 32px; cursor: pointer; - z-index: 2; border-radius: 2px; + margin-right: 10px; } /* --- styling the logo button ---*/ @@ -2334,15 +1781,6 @@ div.mapInfoStat { margin-left: -55px; z-index: 15000; } -#logo { - color: #6B6B6B; - font-family: "vinyl", sans-serif; - font-style: italic; - text-transform: uppercase; - font-weight: 400; - font-size: 30px; - line-height: 30px; -} .home_bg { display: block; height: 100%; diff --git a/app/assets/stylesheets/base.css b/app/assets/stylesheets/base.css index 291e38ee..2f3e626c 100644 --- a/app/assets/stylesheets/base.css +++ b/app/assets/stylesheets/base.css @@ -32,11 +32,8 @@ } #infovis { - position:relative; width:100%; height:100%; - margin:0; - overflow:hidden; } .showcard .permission { @@ -174,8 +171,8 @@ font-family: 'LatoLight'; background-repeat: no-repeat; background-position: center center; background-size: 27px 27px; - z-index: 2; -position: relative; + z-index: 1; + position: relative; } .CardOnGraph .icon { @@ -186,7 +183,7 @@ position: relative; .linkItem.contributor { background-image: url(MMCCicon_mapper_black.png); margin-left:20px; - z-index:3; + z-index:1; } .linkItem.mapCount { background-image: url(MMCCicon_map_black.png); @@ -600,7 +597,6 @@ font-family: 'LatoLight'; width:100%; height:320px; color:#000; - z-index: 25; } .mapCard .metacodeImage { diff --git a/app/assets/stylesheets/clean.css b/app/assets/stylesheets/clean.css new file mode 100644 index 00000000..d46a1d4e --- /dev/null +++ b/app/assets/stylesheets/clean.css @@ -0,0 +1,637 @@ +@font-face { + font-family: 'din-medium'; + src: url('/assets/Fonts/din.eot'); + src: url('/assets/Fonts/din.eot?#iefix') format('embedded-opentype'), + url('/assets/Fonts/din.woff') format('woff'), + url('/assets/Fonts/din.ttf') format('truetype'), + url('/assets/Fonts/din.svg#din-medium') format('svg'); + font-weight: normal; + font-style: normal; +} + +.backface-visible { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + +#famousOverlay { + position:fixed; + top: 0; + width: 100%; + height: 100%; + margin:0; +} + +.yield { + display:none; +} + +/*.animations { + -webkit-transition-duration: .5s; + -moz-transition-duration: .5s; + -o-transition-duration: .5s; + -ms-transition-duration: .5s; + transition-duration: .5s; + + -webkit-transition-timing-function: ease-in-out; + -moz-transition-timing-function: ease-in-out; + -o-transition-timing-function: ease-in-out; + -ms-transition-timing-function: ease-in-out; + transition-timing-function: ease-in-out; +}*/ + +.mapElement { + display: none; +} +.mapPage .mapElement { + display: block; +} + +/* loading */ + +#loading { + width: 28px; + height: 28px; + position: fixed; + top: 50%; + margin-left: -14px; + left: 50%; + margin-top: -14px; +} + +/* end loading */ + + + +/* logo */ +.logo { + color: #6B6B6B; + font-family: "vinyl", sans-serif; + font-style: italic; + text-transform: uppercase; + font-weight: 400; + font-size: 30px; + line-height: 30px; + text-align: center; +} +.bottomLinks { + color: #9e9e9e; + font-size: 12px; + text-align: center; + list-style: none; +} +.bottomLinks li { + display: inline-block; +} +.bottomLinks li a { + color: #9e9e9e; +} + +/* end logo */ + + +/* upperLeftUI */ +.upperLeftUI { + position: fixed; + top: 10px; + left: 24px; + z-index:3; + box-shadow: 0px 1px 1.5px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.24); + border-radius: 2px; +} +.explorePage .upperLeftUI { + box-shadow: none; +} + +.unauthenticated .homePage .homeButton { + display:none; +} +.homeButton { + width: 40px; + height: 32px; + background: #757575; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; + float:left; +} +.homeButton a { + display:block; + width: 40px; + height: 32px; +} + +/* search */ + +.sidebarSearch { + float:left; + height: 32px; +} + +.unauthenticated .homePage .sidebarSearchIcon { + border-radius: 2px; +} +.sidebarSearchIcon { + float: left; + width: 72px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + height: 32px; + background: #4fb5c0 url('search_icon_32x32.png') no-repeat center center; + background-size: 25px 25px; + cursor: pointer; +} +.sidebarSearch .twitter-typeahead, .sidebarSearch .sidebarSearchField { + float: left; +} + +.unauthenticated .homePage .sidebarSearchField, +.unauthenticated .homePage .sidebarSearch .tt-hint { + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} +.explorePage .sidebarSearchField, +.explorePage .sidebarSearch .tt-hint { + width: 380px; + padding: 10px 10px 0 10px; +} + +.sidebarSearchField, +.sidebarSearch .tt-hint { + height: 20px; + border-top: 1px solid #BDBDBD; + border-bottom: 1px solid #BDBDBD; + border-left: none; + border-right: none; + padding: 10px 0 0 0; + width: 0px; + margin: 0; + outline: none; + font-size: 14px; + line-height: 14px; + background: #FFFFFF; + color: #BDBDBD; + font-family: 'LatoRegular'; +} +.sidebarSearch .tt-dropdown-menu { + left: -35px !important; + background: #0F1519; + min-width: 440px; + width: 440px; + overflow-y: scroll; + overflow-x: hidden; +} +.sidebarSearch .tt-dropdown-menu h3 { + font-family: 'vinyl', helvetica, sans-serif; + text-transform: uppercase; + font-style: italic; + font-size: 20px; + line-height: 20px; + margin: 10px 0 3px 10px; + float: left; +} +.sidebarSearch .tt-dropdown-menu .limitToMe { + float: left; + width: 15px; + height: 15px; + margin-top: 11px; + margin-left: 15px; +} +.sidebarSearch .tt-dropdown-menu .limitToMeLabel { + float: left; + margin-top: 11px; +} +.sidebarSearch .tt-dropdown-menu .minimizeResults { + float: right; + width: 35px; + height: 35px; + background: url('/assets/MMCCicon_minimize_arrow.png') no-repeat center center; + background-size: 25px 25px; + cursor: pointer; +} +.sidebarSearch .tt-dropdown-menu .maximizeResults { + float: right; + width: 35px; + height: 35px; + background: url('/assets/MMCCicon_maximize_arrow.png') no-repeat center center; + background-size: 25px 25px; + cursor: pointer; +} +.sidebarSearch .tt-suggestions { + font-family: 'LatoLight', helvetica, sans-serif; + overflow: visible; +} +.sidebarSearch .tt-suggestion { + background: #2A343C; +} +.sidebarSearch .tt-is-under-cursor, +.sidebarSearch .tt-is-under-mouse-cursor { + background: #0E161D; +} +.sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap, +.sidebarSearch .tt-dataset-maps .tt-is-under-mouse-cursor .resultmap, +.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .resulttopic, +.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .resulttopic { + min-height: 57px; +} +.sidebarSearch .tt-suggestion .icon { + float: left; + width: 36px; + height: 36px; + margin-right: 5px; +} +.sidebarSearch .topicMetacode { + float: left; + margin-right: 5px; + max-width: 70px; +} +.sidebarSearch .tt-dataset-topics .topicIcon { + width: 36px; + height: 36px; +} +.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .topicIcon, +.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .topicIcon { + margin: 0 auto; + padding-left: 2px +} +.sidebarSearch .tt-dataset-topics .metacodeTip { + display: none; +} +.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip, +.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .metacodeTip { + display: block; + font-family: 'vinyl'; + text-transform: uppercase; + font-style: italic; + font-size: 13px; + margin: 0 5px 0 2px; + text-align: center; +} +.sidebarSearch .tt-dataset-mappers .tt-suggestion .icon { + width: 28px; + height: 28px; + padding: 4px; +} +.sidebarSearch .resultText { + width: 225px; + display: block; + float: left; + word-wrap: break-word; +} +.sidebarSearch .resultTitle { + font-weight: normal; + font-family: 'LatoRegular'; + font-size: 18px; + line-height: 22px; + width: 100%; + padding-top: 8px; +} +.sidebarSearch .resultDesc { + font-family: 'LatoItalic'; + font-size: 14px; + line-height: 16px; + width: 100%; + padding: 3px 0 6px 0; +} +.sidebarSearch .tip { + display: none; +} +.sidebarSearch div.autoOptions { + width: 122px; + float: right; + position: relative; + display: none; +} +.sidebarSearch .tt-is-under-cursor .autoOptions, +.sidebarSearch .tt-is-under-mouse-cursor .autoOptions { + display: block; +} +.sidebarSearch .tt-suggestion .resultnoresult .autoOptions { + display: none; +} +.sidebarSearch .autoOptions button, +.sidebarSearch .autoOptions a, +.sidebarSearch .autoOptions div { + position: absolute; + padding: 0; + margin: 0; + border: none; + outline: none; +} +.sidebarSearch button.addToMap { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_add.png) no-repeat center center; + background-size: 18px 18px; + top: 30px; + left: 84px; + cursor: pointer; +} +.sidebarSearch div.goTo { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_pop-out.png) no-repeat center center; + background-size: 18px 18px; + top: 7px; + left: 84px; +} +.sidebarSearch div.mapCount { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_map.png) no-repeat 0px center; + background-size: 14px 14px; + top: 7px; + left: 38px; + padding-left: 18px; + font-size: 12px; + line-height: 20px; +} +.sidebarSearch div.topicCount { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_topic.png) no-repeat 0px center; + background-size: 14px 14px; + top: 7px; + left: 39px; + padding-left: 18px; + font-size: 12px; + line-height: 20px; +} +.sidebarSearch div.synapseCount { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_synapse.png) no-repeat 0px center; + background-size: 15px 15px; + top: 30px; + left: 38px; + padding-left: 19px; + font-size: 12px; + line-height: 20px; +} +.sidebarSearch div.topicOriginatorIcon { + width: 20px; + height: 20px; + background: url(/assets/MMCCicon_mapper.png) no-repeat center center; + background-size: 17px 17px; + top: 7px; + left: 13px; +} +.sidebarSearch .tip { + position: absolute; + background: white; + width: auto; + bottom: 0; + right: 25px; + color: black; + white-space: nowrap; + border-radius: 4px; + font-size: 15px !important; + font-family: 'LatoRegular'; + line-height: 17px; + padding: 3px 5px 2px; + z-index: 100; +} +.sidebarSearch .mapCount .tip, +.sidebarSearch .synapseCount .tip, +.sidebarSearch .topicCount .tip { + right: -3px; + bottom: 24px; +} +.sidebarSearch .hoverForTip:hover .tip { + display: block; +} +.sidebarSearch .mapContributorsIcon .mapContributors { + right: 0; + bottom: 21px; + white-space: normal; + width: 200px; +} +.sidebarSearch div.mapContributorsIcon { + height: 20px; + background: url(/assets/MMCCicon_mapper.png) no-repeat 0px center; + background-size: 17px 17px; + top: 7px; + right: 85px; + padding-left: 19px; + font-size: 12px; + line-height: 20px; + padding-right: 5px; +} +.sidebarSearch div.topicPermission, +.sidebarSearch div.mapPermission { + width: 20px; + height: 20px; + background-size: 19px 19px !important; + top: 30px; + left: 13px; +} +.sidebarSearch div.topicPermission.commons, +.sidebarSearch div.mapPermission.commons { + background: url(/assets/MMCCicon_commons.png) no-repeat center center; +} +.sidebarSearch div.topicPermission.public, +.sidebarSearch div.mapPermission.public { + background: url(/assets/MMCCicon_public.png) no-repeat center center; +} +.sidebarSearch div.topicPermission.private, +.sidebarSearch div.mapPermission.private { + background: url(/assets/MMCCicon_private.png) no-repeat center center; +} +.sidebarSearch .tt-dataset-mappers a.goTo { + top: 7px; +} +.sidebarSearch .tt-dataset-mappers div.mapCount { + top: 8px; +} +/* end search */ + +/* end upperLeftUI */ + +/* upperRightUI */ + +.upperRightUI { + position: fixed; + top: 10px; + right: 24px; + z-index:3; +} + +.upperRightUI .upperRightEl { + float: left; +} + +.upperRightBox { + position: fixed; + top:42px; + right:24px; + background-color: #E5E5E5; + border-radius: 4px; + box-shadow: 0 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16); +} + +.upperRightMapButtons { + position: relative; + top: -42px; /* puts it just offscreen */ +} +.mapPage .upperRightMapButtons { + top: 0; +} +/*.upperRightMapButtons.animations { + -webkit-transition-property: top; + -moz-transition-property: top; + -o-transition-property: top; + -ms-transition-property: top; + transition-property: top; +}*/ + +/* end upperRightUI */ + +/* infoAndHelp */ + +.infoAndHelp { + position: fixed; + bottom: 24px; + right: 66px; + z-index: 3; + width: auto; + padding: 1px 10px 0px 10px; + font-style: italic; + height: 32px; +} +.infoElement { + float:left; + width: 32px; + height:32px; + cursor: pointer; +} +.openCheatsheet { + background: url('MMCCicon_help.png') no-repeat center center; + background-size: 27px 27px; +} + +.mapInfo { + position: relative; + top: 56px; /* puts it just offscreen */ + background: url('MMCCicon_info.png') no-repeat center center; + background-size: 19px 19px; +} +.mapPage .mapInfo { + top: 0; +} +/*.mapInfo.animations { + -webkit-transition-property: top; + -moz-transition-property: top; + -o-transition-property: top; + -ms-transition-property: top; + transition-property: top; +}*/ + +/* end infoAndHelp */ + + +/* mapControls */ + +.mapControls { + position: fixed; + bottom: 24px; + right:-32px; /* puts it just offscreen */ + width:32px; + z-index: 3; +} +.mapPage .mapControls { + right: 24px; +} +/*.mapControls.animations { + -webkit-transition-property: right; + -moz-transition-property: right; + -o-transition-property: right; + -ms-transition-property: right; + transition-property: right; +}*/ + +.mapControl { + width:32px; + height:32px; + background-color: #424242; + cursor:pointer; +} +.centerMap, .zoomExtents { + margin-bottom:5px; + border-radius: 2px; +} +.zoomIn { + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} +.zoomOut { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; +} + +/* end mapControls */ + + + +/* explore maps */ + +.exploreMapsBar { + z-index:2; + background-color:#FAFAFA; +} + +.exploreMapsMenu { + display: block; + width: 100%; + margin-top:52px; + height:42px; + background-color:#EEEEEE; +} + +.exploreMapsCenter { + width: 700px; + margin: 0 auto; +} + +.exploreMapsCenter a { + color: #757575; + cursor: default; + font-weight: normal; + font-family: 'din-medium'; + font-size: 14px; + height: 14px; + padding-top: 16px; + display: inline-block; + padding-bottom: 12px; +} +.exploreMapsCenter a.active { + text-decoration: none; + color:#424242; +} +.exploreMapsCenter a:hover { + text-decoration: none; + color: #424242; +} + +.mapsWrapper { + margin: 100px 60px 0 60px; + display: none; +} +.explorePage .mapsWrapper { + display:block; +} + +/* end explore maps */ + + +/* toast */ + +.toast { + background-color: #323232; + color: #F5F5F5; + padding: 16px; + border-radius: 2px; + z-index: 1; + font-size: 14px; + line-height:14px; +} + +/* end toast */ \ No newline at end of file diff --git a/app/assets/stylesheets/in_metacode_sets.css.scss b/app/assets/stylesheets/in_metacode_sets.css.scss deleted file mode 100644 index 9bf15655..00000000 --- a/app/assets/stylesheets/in_metacode_sets.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the InMetacodeSets controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/main.css.scss b/app/assets/stylesheets/main.css.scss deleted file mode 100644 index a0d94c17..00000000 --- a/app/assets/stylesheets/main.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the main controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/mapping.css.scss b/app/assets/stylesheets/mapping.css.scss deleted file mode 100644 index afacf549..00000000 --- a/app/assets/stylesheets/mapping.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the mapping controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/maps.css.scss b/app/assets/stylesheets/maps.css.scss deleted file mode 100644 index 305e6f6f..00000000 --- a/app/assets/stylesheets/maps.css.scss +++ /dev/null @@ -1,38 +0,0 @@ -// Place all the styles related to the maps controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ -// explore maps page - - -.mapOrder { - display: block; - padding:5px 15px; - margin:5px auto 0; - font-weight: bold; - line-height: 24px; - position: relative; - width:770px; - height:25px; -} - -.mapOrder .displaying, .mapOrder .whichMaps { - float:left; -} - -.whichMaps a { - color: white; - text-decoration: underline; - padding: 0 10px; - cursor:default; - font-weight:normal; -} -.whichMaps a.active { - text-decoration: none; - font-weight:bold; -} -.whichMaps a:hover { - text-decoration: none; -} - - - diff --git a/app/assets/stylesheets/metacode_sets.css.scss b/app/assets/stylesheets/metacode_sets.css.scss deleted file mode 100644 index a23f1f68..00000000 --- a/app/assets/stylesheets/metacode_sets.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the MetacodeSets controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/sessions.css.scss b/app/assets/stylesheets/sessions.css.scss deleted file mode 100644 index 7bef9cf8..00000000 --- a/app/assets/stylesheets/sessions.css.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the sessions controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/topics.css.scss b/app/assets/stylesheets/topics.css.scss deleted file mode 100644 index 481ce8c2..00000000 --- a/app/assets/stylesheets/topics.css.scss +++ /dev/null @@ -1,4 +0,0 @@ -// Place all the styles related to the Topics controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 6860f24b..eac994fa 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -17,8 +17,10 @@ class MainController < ApplicationController #@maps = Map.order("updated_at DESC").where("permission != ?", "private").limit(3) @maps = Map.order("name ASC").find_all_by_user_id(@current.id) end - - respond_with(@maps, @current) + + respond_to do |format| + format.html { respond_with(@maps, @current) } + end end ### SEARCHING ### diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index ae6feadb..b8ab6f79 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -19,25 +19,32 @@ class MapsController < ApplicationController @current = current_user @user = nil - if request.path =="/explore/active" + if request.path.index("/explore/active") != nil @maps = Map.order("updated_at DESC").limit(20) @request = "active" - elsif request.path =="/explore/featured" + elsif request.path.index("/explore/featured") != nil @maps = Map.order("name ASC").find_all_by_featured(true) @request = "featured" - elsif request.path == "/explore/new" + elsif request.path.index("/explore/new") != nil @maps = Map.order("created_at DESC").limit(20) @request = "new" + elsif request.path.index('/explore/mine') != nil # looking for maps by me + if !authenticated? + redirect_to activemaps_url and return + end + @maps = Map.order("name ASC").find_all_by_user_id(@current.id) + @request = "you" + elsif request.path.index('/maps/mappers/') != nil # looking for maps by a mapper @user = User.find(params[:id]) @maps = Map.order("name ASC").find_all_by_user_id(@user.id) @request = "you" if authenticated? && @user == @current @request = "other" if authenticated? && @user != @current - elsif request.path.index('/maps/topics/') != nil # looking for maps by a certain topic they include + elsif request.path.index('/explore/topics/') != nil # looking for maps by a certain topic they include @topic = Topic.find(params[:id]).authorize_to_show(@current) if !@topic redirect_to featuredmaps_url, notice: "Access denied." and return @@ -47,10 +54,15 @@ class MapsController < ApplicationController end #read this next line as 'delete a map if its private and you're either 1. logged out or 2. logged in but not the map creator - @maps.delete_if {|m| m.permission == "private" && (!authenticated? || (authenticated? && @current.id != m.user_id)) } + if @maps + @maps.delete_if {|m| m.permission == "private" && (!authenticated? || (authenticated? && @current.id != m.user_id)) } + else + @maps = [] + end respond_to do |format| format.html { respond_with(@maps, @request, @user) } + format.json { render json: @maps } end end @@ -68,11 +80,17 @@ class MapsController < ApplicationController @alltopics = @map.topics # should limit to topics visible to user @allsynapses = @map.synapses # should also be limited @allmappings = @map.mappings - @allmetacodes = Metacode.all + + @json = Hash.new() + @json['map'] = @map + @json['topics'] = @alltopics + @json['synapses'] = @allsynapses + @json['mappings'] = @allmappings + @json['mappers'] = @allmappers respond_to do |format| - format.html { respond_with(@allmappers, @allmetacodes, @allmappings, @allsynapses, @alltopics, @map, @user) } - format.json { render json: @map } + format.html { respond_with(@allmappers, @allmappings, @allsynapses, @alltopics, @map, @user) } + format.json { render json: @json } end end diff --git a/app/views/layouts/_account.html.erb b/app/views/layouts/_account.html.erb index ee63252c..d4912682 100644 --- a/app/views/layouts/_account.html.erb +++ b/app/views/layouts/_account.html.erb @@ -7,12 +7,15 @@ <% account = current_user %>

Hello <%= account.name.split[0...1][0] %>!

    -
  • <%= link_to "Account", edit_user_url(account) %>
  • +
  • <%= link_to "Account", edit_user_url(account), + :data => { :bypass => 'true'} %>
  • <% if account.admin %> -
  • <%= link_to "Admin", metacodes_path %>
  • +
  • <%= link_to "Admin", metacodes_path, + :data => { :bypass => 'true'} %>
  • <% end %>
  • Share Invite
  • -
  • <%= link_to "Logout", "/sign_out", id: "Logout" %>
  • +
  • <%= link_to "Logout", "/sign_out", id: "Logout", + :data => { :bypass => 'true'} %>
<% else %>

Sign In

diff --git a/app/views/layouts/_exploremaps.html.erb b/app/views/layouts/_exploremaps.html.erb new file mode 100644 index 00000000..7a6c8a4f --- /dev/null +++ b/app/views/layouts/_exploremaps.html.erb @@ -0,0 +1,22 @@ + + +
+ <% if @maps %> + <% @maps.each do |map| %> + <%= render map %> + <% end %> + <% end %> +
+
\ No newline at end of file diff --git a/app/views/layouts/_lightboxes.html.erb b/app/views/layouts/_lightboxes.html.erb index 1d6d2d3e..9cf5b9eb 100644 --- a/app/views/layouts/_lightboxes.html.erb +++ b/app/views/layouts/_lightboxes.html.erb @@ -54,7 +54,6 @@ <%= render :partial => 'layouts/newmap' %>
- <% if (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %>
<%= render :partial => 'shared/forkmap' %>
@@ -62,7 +61,6 @@
<%= render :partial => 'shared/switchmetacodes' %>
- <% end %> <% end %>
diff --git a/app/views/layouts/_lowermapelements.html.erb b/app/views/layouts/_lowermapelements.html.erb new file mode 100644 index 00000000..9d902958 --- /dev/null +++ b/app/views/layouts/_lowermapelements.html.erb @@ -0,0 +1,14 @@ +
+
E
+
C
+
+
+
-
+
+ +
+
+ <%= render :partial => 'maps/mapinfobox' %> +
+
+
+
\ No newline at end of file diff --git a/app/views/layouts/_templates.html.erb b/app/views/layouts/_templates.html.erb index 85392e8c..98769ad4 100644 --- a/app/views/layouts/_templates.html.erb +++ b/app/views/layouts/_templates.html.erb @@ -7,7 +7,6 @@ - - - -<%= csrf_meta_tags %> - + + + <%=h yield(:title) %> + <%= csrf_meta_tags %> + + + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= javascript_include_tag "compileMapPages" %> + + + + + + + + + + + + + + + + + + + -" > + + <% if notice %>

<%= notice %>

@@ -33,37 +50,37 @@ <%= content_tag :div, class: authenticated? ? "main authenticated" : "main unauthenticated" do %> -
" id="wrapper"> - -
- -
- -
-
- -
-
+ <% classes = action_name == "home" ? "homePage" : "" + classes += action_name == "home" && authenticated? ? " explorePage" : "" + classes += controller_name == "maps" && action_name == "index" ? " explorePage" : "" + classes += controller_name == "maps" && action_name == "show" ? " mapPage" : "" + %> -
-
- <% if user && user.image %><%= image_tag user.image.url(:thumb), :size => "35x35" %><% end %> -
-
- <%= render :partial => 'layouts/account' %> -
-
+
+ + <%= render :partial => 'layouts/upperelements' %> + <%= render :partial => 'layouts/exploremaps' %> +
<%= yield %>
+ + +
<% if authenticated? %> -
+ <% # for creating and pulling in topics and synapses %> + <%= render :partial => 'maps/newtopic' %> + <%= render :partial => 'maps/newsynapse' %> + <% # for populating the change metacode list on the topic card %> + <%= render :partial => 'shared/metacodeoptions' %> <% end %> + <%= render :partial => 'layouts/lowermapelements' %> - <%= yield %> +
+
-
- - -
<% elsif authenticated? %> -
- Displaying: - -
-
+ <% content_for :title, "My Maps | Metamaps" %> -
-
- <% @maps.each do |map| %> - <%= render map %> - <% end %> -
-
-
- - -<% end %> - \ No newline at end of file + +<% end %> \ No newline at end of file diff --git a/app/views/maps/_mapinfobox.html (copy).erb b/app/views/maps/_mapinfobox.html (copy).erb new file mode 100644 index 00000000..1c808a4e --- /dev/null +++ b/app/views/maps/_mapinfobox.html (copy).erb @@ -0,0 +1,52 @@ +<%# + # Partial rendering form for a new topic on a map + # This code is called when viewing a metamap in show.html.erb in the views/maps folder + #%> +
<%= @map.authorize_to_edit(user) ? " canEdit" : "" %>"> + +
<%= best_in_place @map, :name, :type => :input, :classes => 'best_in_place_name' %>
+ +
+
+ <%= @map.contributors.count %> + <% contributorList = '' + @map.contributors.each_with_index do |c, index| + comma = (index+1) == @map.contributors.count ? '' : ', ' + contributorList += c.name + comma + end + if @map.contributors.count == 0 + contributorList = 'No one has added anything yet.' + end %> +
<%= contributorList %>
+
+
+ <%= @map.topics.count %> +
+
+ <%= @map.synapses.count %> +
+
+ <% if @map.user == user %> +
As the creator, you can change the permission of this map, but the permissions of the topics and synapses on it must be changed independently.
+ <% end %> +
+
+
+ + <% if (authenticated? && @map.authorize_to_edit(user)) || (!authenticated? && @map.desc != "" && @map.desc != nil )%> +
+ <%= best_in_place @map, :desc, :type => :textarea, :nil => "Click to add description.", :classes => 'best_in_place_desc' %> +
+ <% end %> + +
+

Created by <%= @map.user == user ? "you" : @map.user.name %> on <%= @map.created_at.strftime("%m/%d/%Y") %>

+

Last edited <%= @map.updated_at.strftime("%m/%d/%Y") %>

+
+ +
+ <% if @map.user == user %> + <%= link_to 'Delete', map_path(@map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete %> + <% end %> +
+
diff --git a/app/views/maps/_mapinfobox.html.erb b/app/views/maps/_mapinfobox.html.erb index 1c808a4e..0d7da05a 100644 --- a/app/views/maps/_mapinfobox.html.erb +++ b/app/views/maps/_mapinfobox.html.erb @@ -2,7 +2,8 @@ # Partial rendering form for a new topic on a map # This code is called when viewing a metamap in show.html.erb in the views/maps folder #%> -
<%= @map.authorize_to_edit(user) ? " canEdit" : "" %>"> +<% if @map %> +
<%= @map.authorize_to_edit(user) ? " canEdit" : "" %>">
<%= best_in_place @map, :name, :type => :input, :classes => 'best_in_place_name' %>
@@ -50,3 +51,39 @@ <% end %>
+ +<% else %> +
+ +
{{name}}
+ +
+
+ {{contributor_count}} +
{{contributor_list}}
+
+
+ {{topic_count}} +
+
+ {{synapse_count}} +
+
+ {{map_creator_tip}} +
+
+
+
+ {{desc}} +
+ +
+

Created by {{user_name}} on {{created_at}}

+

Last edited {{updated_at}}

+
+ +
+ {{delete}} +
+
+<% end %> \ No newline at end of file diff --git a/app/views/maps/_newsynapse.html.erb b/app/views/maps/_newsynapse.html.erb index 10f77fd3..1c190324 100644 --- a/app/views/maps/_newsynapse.html.erb +++ b/app/views/maps/_newsynapse.html.erb @@ -1,10 +1,3 @@ -<%# - # @file - # partial generating a new synapse - # TODO: Where is this code used? - #%> -
- <%= form_for Synapse.new, url: synapses_url, remote: true do |form| %> - <%= form.text_field :desc, :placeholder => "describe the connection..." %> - <% end %> -
+<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %> +<%= form.text_field :desc, :placeholder => "describe the connection..." %> +<% end %> diff --git a/app/views/maps/_newtopic.html.erb b/app/views/maps/_newtopic.html.erb index de307a22..048f453f 100644 --- a/app/views/maps/_newtopic.html.erb +++ b/app/views/maps/_newtopic.html.erb @@ -1,8 +1,3 @@ -<%# - # Partial rendering form for a new topic on a map - # This code is called when viewing a metamap in show.html.erb in the views/maps folder - #%> -
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
@@ -35,4 +30,3 @@ <% end %> <% end %> -
diff --git a/app/views/maps/index.html.erb b/app/views/maps/index.html.erb index 3c9adeea..92f17142 100644 --- a/app/views/maps/index.html.erb +++ b/app/views/maps/index.html.erb @@ -6,55 +6,21 @@ <% content_for :title, "Explore Maps | Metamaps" %> -
- Displaying: -
- <% if @request == "other" %> - By <%= @user.name %> / - <% end %> - <% if @request == "topic" %> - Maps Containing Topic <%= @topic.id.to_s %>: "<%= @topic.name.truncate(30) %>" - <% end %> - - <% if @request != "topic" %> - <% if authenticated? %> - ">My Maps / - <% end %> - ">Recently Active / - ">Featured / - ">Newest First - <% end %> -
-
-
- -
-
- <% @maps.each do |map| %> - <%= render map %> - <% end %> -
-
-
- diff --git a/app/views/maps/show.html.erb b/app/views/maps/show.html.erb index 77cb06f9..8379f429 100644 --- a/app/views/maps/show.html.erb +++ b/app/views/maps/show.html.erb @@ -6,77 +6,9 @@ <% content_for :title, @map.name + " | Metamaps" %> -
- -
- - -<% if authenticated? %> -
-
-
-
-
-<% if @map.permission == "commons" || @map.user == user %> -
-
-
-

Realtime:

- ON -
-
-
    -
  • - <%= user.name %> (me) -
  • -
-
-
-
-<% end %> -<% end %> -
-
-
- <%= render :partial => 'shared/filterBox' %> -
-
- -
+
-
-
-
C
-
E
- -
-
- -
- <%= render :partial => 'maps/mapinfobox' %> -
- -
-
-
-
-
-
-
- -<% if authenticated? %> - -<% # add these if you have edit permissions on the map %> -<% if @map.permission == "commons" || @map.user == user %> -<% # for creating and pulling in topics and synapses %> -<%= render :partial => 'newtopic' %> -<%= render :partial => 'newsynapse' %> -<% end %> - -<% # for populating the change metacode list on the topic card %> -<%= render :partial => 'shared/metacodeoptions' %> -<% end %> - -