updated the 404 page. fixed merge conflicts. removed generation code

This commit is contained in:
Connor Turland 2014-11-23 22:58:30 -05:00
commit 54bb3d2c3d
35 changed files with 894 additions and 439 deletions

View file

@ -1,2 +1 @@
https://github.com/heroku/heroku-buildpack-ruby.git
https://github.com/stomita/heroku-buildpack-phantomjs.git
https://github.com/heroku/heroku-buildpack-ruby.git

View file

@ -6,8 +6,6 @@ gem 'rails', '3.2.17'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'phantomjs'
gem 'devise'
gem 'redis'
gem 'pg'
@ -19,9 +17,6 @@ gem 'rails3-jquery-autocomplete'
gem 'best_in_place' #in-place editing
gem 'kaminari' # pagination
gem 'uservoice-ruby'
gem 'sidekiq' # worker processes
gem 'sinatra', require: false
gem 'slim'
gem 'paperclip'
gem 'aws-sdk'

View file

@ -41,8 +41,6 @@ GEM
rails (~> 3.1)
builder (3.0.4)
cancan (1.6.10)
celluloid (0.15.2)
timers (~> 1.1.0)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.4)
@ -54,7 +52,6 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.8.0)
connection_pool (2.0.0)
devise (3.4.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -100,13 +97,10 @@ GEM
mime-types
pg (0.17.1)
pg (0.17.1-x86-mingw32)
phantomjs (1.9.7.1)
polyglot (0.3.5)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-protection (1.5.3)
rack
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
@ -132,8 +126,6 @@ GEM
rdoc (3.12.2)
json (~> 1.4)
redis (3.1.0)
redis-namespace (1.5.1)
redis (~> 3.0, >= 3.0.4)
responders (1.1.1)
railties (>= 3.2, < 4.2)
sass (3.4.5)
@ -141,29 +133,14 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sidekiq (3.2.5)
celluloid (= 0.15.2)
connection_pool (>= 2.0.0)
json
redis (>= 3.0.6)
redis-namespace (>= 1.3.1)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
slim (2.0.3)
temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
temple (0.6.8)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
timers (1.1.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
@ -196,13 +173,9 @@ DEPENDENCIES
kaminari
paperclip
pg
phantomjs
rails (= 3.2.17)
rails3-jquery-autocomplete
redis
sass-rails
sidekiq
sinatra
slim
uglifier (>= 1.0.3)
uservoice-ruby

6
LiveSiteUpdatesNotes.txt Normal file
View file

@ -0,0 +1,6 @@
make sure that root individuals have same 'joinedwithcode' as 'code'
User.all.each do |u|
u.generation = u.get_generation
u.save
end

View file

@ -1,2 +1 @@
web: bundle exec rails server -p $PORT
worker: bundle exec sidekiq -c 5 -v
web: bundle exec rails server -p $PORT

Binary file not shown.

View file

@ -2495,7 +2495,7 @@ Extras.Classes.Navigation = new Class({
//START METAMAPS CODE
var rightClick = e.button == 2 || (navigator.platform.indexOf("Mac") != -1 && e.ctrlKey);
// TODO make sure this works across browsers
if (!Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || (rightClick && e.ctrlKey))) {
if (!Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || rightClick)) {
Metamaps.Mouse.boxStartCoordinates = eventInfo.getPos();
//console.log('mouse down');
}
@ -2525,13 +2525,13 @@ Extras.Classes.Navigation = new Class({
// START METAMAPS CODE
var rightClick = e.button == 2 || (navigator.platform.indexOf("Mac") != -1 && e.ctrlKey);
if (!Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || (rightClick && e.ctrlKey))) {
if (!Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || rightClick)) {
Metamaps.Visualize.mGraph.busy = true;
Metamaps.boxStartCoordinates = eventInfo.getPos();
//console.log('mouse move');
return;
}
if (Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || (rightClick && e.ctrlKey))) {
if (Metamaps.Mouse.boxStartCoordinates && ((e.button == 0 && e.shiftKey) || (e.button == 0 && e.ctrlKey) || rightClick)) {
Metamaps.Visualize.mGraph.busy = true;
Metamaps.JIT.drawSelectBox(eventInfo,e);
//console.log('mouse move');
@ -7493,7 +7493,7 @@ Graph.Label.Native = new Class({
// START METAMAPS CODE
var index;
for (index = 0; index < customLabel.length; ++index) {
ctx.fillText(customLabel[index], pos.x, pos.y + node.getData("height") + 9 + (25*index));
ctx.fillText(customLabel[index], pos.x, pos.y + node.getData("height") + 23 + (25*index));
}
// END METAMAPS CODE
},

View file

@ -167,6 +167,9 @@ Metamaps.GlobalUI = {
clearTimeout(self.notifyTimeOut);
Metamaps.Famous.toast.hide();
},
shareInvite: function(inviteLink) {
window.prompt("To copy the invite link, press: Ctrl+C, Enter", inviteLink);
}
};
@ -326,6 +329,8 @@ Metamaps.GlobalUI.Account = {
Metamaps.Realtime.close();
Metamaps.Filter.close();
$('.sidebarAccountIcon .tooltipsUnder').addClass('hide');
if (!self.isOpen && !self.changing) {
self.changing = true;
@ -339,6 +344,7 @@ Metamaps.GlobalUI.Account = {
close: function () {
var self = Metamaps.GlobalUI.Account;
$('.sidebarAccountIcon .tooltipsUnder').removeClass('hide');
if (!self.changing) {
self.changing = true;
$('.sidebarAccountBox #user_email').blur();

View file

@ -175,7 +175,8 @@ Metamaps.JIT = {
context.fillStyle = '#424242';
context.textAlign = 'center';
context.font = '14px din-medium';
context.fillText(count, x, y - 6);
context.fillText(count, x, y + 5);
};
if (!canvas.denySelected && desc != "" && showDesc) {
@ -186,7 +187,7 @@ Metamaps.JIT = {
var ctx = canvas.getCtx();
ctx.font = 'bold 14px arial';
ctx.fillStyle = '#FFF';
ctx.textBaseline = 'hanging';
ctx.textBaseline = 'alphabetic';
var arrayOfLabelLines = Metamaps.Util.splitLine(desc, 30).split('\n');
var index, lineWidths = [];
@ -222,7 +223,7 @@ Metamaps.JIT = {
ctx.fillStyle = '#424242';
ctx.textAlign = 'center';
for (index = 0; index < arrayOfLabelLines.length; ++index) {
ctx.fillText(arrayOfLabelLines[index], x + (width / 2), y + 7 + (16 * index));
ctx.fillText(arrayOfLabelLines[index], x + (width / 2), y + 18 + (16 * index));
}
if (synapseNum > 1) {
@ -306,7 +307,7 @@ Metamaps.JIT = {
type: 'Native', //Native or HTML
size: 20,
family: 'arial',
textBaseline: 'hanging',
textBaseline: 'alphabetic',
color: Metamaps.Settings.colors.labels.text
},
//Add Tips
@ -374,14 +375,14 @@ Metamaps.JIT = {
$('.rightclickmenu').remove();
if (Metamaps.Mouse.boxStartCoordinates) {
if(e.ctrlKey && e.shiftKey){
if(e.ctrlKey){
Metamaps.Visualize.mGraph.busy = false;
Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos();
Metamaps.JIT.zoomToBox(e);
//console.log('called zoom to box');
return;
}
else if (e.ctrlKey || e.shiftKey) {
else if (e.shiftKey) {
Metamaps.Visualize.mGraph.busy = false;
Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos();
Metamaps.JIT.selectWithBox(e);
@ -410,10 +411,10 @@ Metamaps.JIT = {
// remove the rightclickmenu
$('.rightclickmenu').remove();
if (Metamaps.Mouse.boxStartCoordinates && e.ctrlKey) {
if (Metamaps.Mouse.boxStartCoordinates) {
Metamaps.Visualize.mGraph.busy = false;
Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos();
Metamaps.JIT.zoomToBox(e);
Metamaps.JIT.selectWithBox(e);
return;
}
@ -1097,7 +1098,7 @@ Metamaps.JIT = {
eX = Metamaps.Mouse.boxEndCoordinates.x,
eY = Metamaps.Mouse.boxEndCoordinates.y;
if(!(e.shiftKey) && !(e.ctrlKey)){
if(!e.shiftKey){
Metamaps.Control.deselectAllNodes();
Metamaps.Control.deselectAllEdges();
}
@ -1108,7 +1109,7 @@ Metamaps.JIT = {
y = n.pos.y;
if ((sX < x && x < eX && sY < y && y < eY) || (sX > x && x > eX && sY > y && y > eY) || (sX > x && x > eX && sY < y && y < eY) || (sX < x && x < eX && sY > y && y > eY)) {
if(e.ctrlKey){
if(e.shiftKey){
if(n.selected){
Metamaps.Control.deselectNode(n);
}
@ -1211,7 +1212,7 @@ Metamaps.JIT = {
var node2id = synapse.get('edge').nodeTo.id;
var edge = Metamaps.Visualize.mGraph.graph.getAdjacence(node1id, node2id);
if(selectTest){
if(e.ctrlKey){
if(e.shiftKey){
if(Metamaps.Selected.Edges.indexOf(synapse.get('edge')) != -1 ){
Metamaps.Control.deselectEdge(synapse.get('edge'));
}
@ -1273,23 +1274,19 @@ Metamaps.JIT = {
// wait a certain length of time, then check again, then run this code
setTimeout(function () {
if (!Metamaps.JIT.nodeWasDoubleClicked()) {
if (!e.shiftKey && !e.ctrlKey) {
var nodeAlreadySelected = node.selected;
if (!e.shiftKey) {
Metamaps.Control.deselectAllNodes();
Metamaps.Control.deselectAllEdges();
}
if (nodeAlreadySelected) {
Metamaps.Control.deselectNode(node);
} else {
Metamaps.Control.selectNode(node,e);
}
else if(e.shiftKey && e.ctrlKey){
//no result
}
else if(e.ctrlKey){
if (node.selected) {
Metamaps.Control.deselectNode(node);
} else {
Metamaps.Control.selectNode(node,e);
}
}else if(e.shiftKey){
Metamaps.Control.selectNode(node,e);
}
//trigger animation to final styles
Metamaps.Visualize.mGraph.fx.animate({
@ -1531,22 +1528,17 @@ Metamaps.JIT = {
// wait a certain length of time, then check again, then run this code
setTimeout(function () {
if (!Metamaps.JIT.nodeWasDoubleClicked()) {
if (!e.shiftKey && !e.ctrlKey) {
var edgeAlreadySelected = Metamaps.Selected.Edges.indexOf(adj) !== -1;
if (!e.shiftKey) {
Metamaps.Control.deselectAllNodes();
Metamaps.Control.deselectAllEdges();
Metamaps.Control.selectEdge(adj);
}
else if (e.shiftKey && e.ctrlKey){
//no result
}
else if (e.ctrlKey){
if (Metamaps.Selected.Edges.indexOf(adj) !== -1) {
Metamaps.Control.deselectEdge(adj);
} else {
Metamaps.Control.selectEdge(adj);
}
}
else if (e.shiftKey){
if (edgeAlreadySelected) {
Metamaps.Control.deselectEdge(adj);
} else {
Metamaps.Control.selectEdge(adj);
}
@ -1861,7 +1853,7 @@ Metamaps.JIT = {
var x = n.pos.x,
y = n.pos.y;
if (counter == 0){
if (counter == 0 && n.getData('alpha') == 1){
maxX = x;
minX = x;
maxY = y;
@ -1880,12 +1872,15 @@ Metamaps.JIT = {
}
var width = Math.max.apply(null, lineWidths) + 8;
maxX = Math.max(x + width /2,maxX);
maxY = Math.max(y + n.getData("height") + 5 + height,maxY);
minX = Math.min(x - width /2,minX);
minY = Math.min(y - dim,minY);
// only adjust these values if the node is not filtered
if (n.getData('alpha') == 1) {
maxX = Math.max(x + width /2,maxX);
maxY = Math.max(y + n.getData("height") + 5 + height,maxY);
minX = Math.min(x - width /2,minX);
minY = Math.min(y - dim,minY);
counter++;
counter++;
}
});
var spanX = maxX - minX;

View file

@ -741,7 +741,7 @@ Metamaps.Create = {
}
},
engine: Hogan,
header: "<h3>Existing Synapses</h3>"
header: "<h3>Existing synapses</h3>"
}
]);
@ -1043,8 +1043,8 @@ Metamaps.TopicCard = {
});
$(showCard).find('.best_in_place_desc').bind("ajax:success", function () {
this.innerHTML = this.innerHTML.replace(/\r/g, '')
var desc = $(this).html();
this.innerHTML = this.innerHTML.replace(/\r/g, '');
var desc = $(this).html() === $(this).data('nil') ? "" : $(this).html();
topic.set("desc", desc);
topic.trigger('saved');
});
@ -1289,7 +1289,7 @@ Metamaps.SynapseCard = {
});
},
add_drop_down: function (edge, synapse) {
var list, i, synapses, l;
var list, i, synapses, l, desc;
synapses = edge.getData("synapses");
l = synapses.length;
@ -1311,7 +1311,9 @@ Metamaps.SynapseCard = {
list = '<ul id="switchSynapseList">';
for (i = 0; i < l; i++) {
if (synapses[i] !== synapse) { // don't add the current one to the list
list += '<li data-synapse-index="' + i + '">' + synapses[i].get('desc') + '</li>';
desc = synapses[i].get('desc');
desc = desc === "" || desc === null ? "(no description)" : desc;
list += '<li data-synapse-index="' + i + '">' + desc + '</li>';
}
}
list += '</ul>'
@ -1333,7 +1335,7 @@ Metamaps.SynapseCard = {
add_user_info: function (synapse) {
var u = '<div id="edgeUser" class="hoverForTip">';
u += '<img src="" width="24" height="24" />'
u += '<div class="tip">Created by ' + synapse.get("user_name") + '</div></div>';
u += '<div class="tip">' + synapse.get("user_name") + '</div></div>';
$('#editSynLowerBar').append(u);
// get mapper image
@ -1826,6 +1828,7 @@ Metamaps.Realtime = {
Metamaps.GlobalUI.Account.close();
Metamaps.Filter.close();
$('.sidebarCollaborateIcon div').addClass('hide');
if (!self.isOpen && !self.changing) {
self.changing = true;
@ -1837,7 +1840,7 @@ Metamaps.Realtime = {
},
close: function () {
var self = Metamaps.Realtime;
$(".sidebarCollaborateIcon div").removeClass('hide');
if (!self.changing) {
self.changing = true;
$('.sidebarCollaborateBox').fadeOut(200, function () {
@ -1884,13 +1887,13 @@ Metamaps.Realtime = {
turnOn: function (notify) {
var self = Metamaps.Realtime;
if (!self.status) {
if (notify) self.sendRealtimeOn();
$(".rtMapperSelf").removeClass('littleRtOff').addClass('littleRtOn');
self.status = true;
$(".sidebarCollaborateIcon").addClass("blue");
$(".collabCompass").show();
}
if (notify) self.sendRealtimeOn();
$(".rtMapperSelf").removeClass('littleRtOff').addClass('littleRtOn');
$('.rtOn').addClass('active');
$('.rtOff').removeClass('active');
self.status = true;
$(".sidebarCollaborateIcon").addClass("blue");
$(".collabCompass").show();
},
turnOff: function (silent) {
var self = Metamaps.Realtime;
@ -1898,6 +1901,8 @@ Metamaps.Realtime = {
if (self.status) {
if (!silent) self.sendRealtimeOff();
$(".rtMapperSelf").removeClass('littleRtOn').addClass('littleRtOff');
$('.rtOn').removeClass('active');
$('.rtOff').addClass('active');
self.status = false;
$(".sidebarCollaborateIcon").removeClass("blue");
$(".collabCompass").hide();
@ -3067,6 +3072,8 @@ Metamaps.Filter = {
Metamaps.GlobalUI.Account.close();
Metamaps.Realtime.close();
$('.sidebarFilterIcon div').addClass('hide');
if (!self.isOpen && !self.changing) {
self.changing = true;
@ -3080,6 +3087,8 @@ Metamaps.Filter = {
},
close: function () {
var self = Metamaps.Filter;
$('.sidebarFilterIcon div').removeClass('hide');
if (!self.changing) {
self.changing = true;
@ -3103,6 +3112,8 @@ Metamaps.Filter = {
$('#filter_by_metacode ul').empty();
$('#filter_by_mapper ul').empty();
$('#filter_by_synapse ul').empty();
$('.filterBox .showAll').addClass('active');
},
/*
Most of this data essentially depends on the ruby function which are happening for filter inside view filterBox
@ -3231,36 +3242,48 @@ Metamaps.Filter = {
filterAllMetacodes: function (e) {
var self = Metamaps.Filter;
$('#filter_by_metacode ul li').addClass('toggledOff');
$('.showAllMetacodes').removeClass('active');
$('.hideAllMetacodes').addClass('active');
self.visible.metacodes = [];
self.passFilters();
},
filterNoMetacodes: function (e) {
var self = Metamaps.Filter;
$('#filter_by_metacode ul li').removeClass('toggledOff');
$('.showAllMetacodes').addClass('active');
$('.hideAllMetacodes').removeClass('active');
self.visible.metacodes = self.filters.metacodes.slice();
self.passFilters();
},
filterAllMappers: function (e) {
var self = Metamaps.Filter;
$('#filter_by_mapper ul li').addClass('toggledOff');
$('.showAllMappers').removeClass('active');
$('.hideAllMappers').addClass('active');
self.visible.mappers = [];
self.passFilters();
},
filterNoMappers: function (e) {
var self = Metamaps.Filter;
$('#filter_by_mapper ul li').removeClass('toggledOff');
$('.showAllMappers').addClass('active');
$('.hideAllMappers').removeClass('active');
self.visible.mappers = self.filters.mappers.slice();
self.passFilters();
},
filterAllSynapses: function (e) {
var self = Metamaps.Filter;
$('#filter_by_synapse ul li').addClass('toggledOff');
$('.showAllSynapses').removeClass('active');
$('.hideAllSynapses').addClass('active');
self.visible.synapses = [];
self.passFilters();
},
filterNoSynapses: function (e) {
var self = Metamaps.Filter;
$('#filter_by_synapse ul li').removeClass('toggledOff');
$('.showAllSynapses').addClass('active');
$('.hideAllSynapses').removeClass('active');
self.visible.synapses = self.filters.synapses.slice();
self.passFilters();
},
@ -3284,14 +3307,53 @@ Metamaps.Filter = {
toggleMetacode: function () {
var self = Metamaps.Filter;
self.toggleLi.call(this, 'metacodes');
if (self.visible.metacodes.length === self.filters.metacodes.length) {
$('.showAllMetacodes').addClass('active');
$('.hideAllMetacodes').removeClass('active');
}
else if (self.visible.metacodes.length === 0) {
$('.showAllMetacodes').removeClass('active');
$('.hideAllMetacodes').addClass('active');
}
else {
$('.showAllMetacodes').removeClass('active');
$('.hideAllMetacodes').removeClass('active');
}
},
toggleMapper: function () {
var self = Metamaps.Filter;
self.toggleLi.call(this, 'mappers');
if (self.visible.mappers.length === self.filters.mappers.length) {
$('.showAllMappers').addClass('active');
$('.hideAllMappers').removeClass('active');
}
else if (self.visible.mappers.length === 0) {
$('.showAllMappers').removeClass('active');
$('.hideAllMappers').addClass('active');
}
else {
$('.showAllMappers').removeClass('active');
$('.hideAllMappers').removeClass('active');
}
},
toggleSynapse: function () {
var self = Metamaps.Filter;
self.toggleLi.call(this, 'synapses');
if (self.visible.synapses.length === self.filters.synapses.length) {
$('.showAllSynapses').addClass('active');
$('.hideAllSynapses').removeClass('active');
}
else if (self.visible.synapses.length === 0) {
$('.showAllSynapses').removeClass('active');
$('.hideAllSynapses').addClass('active');
}
else {
$('.showAllSynapses').removeClass('active');
$('.hideAllSynapses').removeClass('active');
}
},
passFilters: function () {
var self = Metamaps.Filter;
@ -4196,6 +4258,7 @@ Metamaps.Map = {
Metamaps.Create.newTopic.hide();
Metamaps.Create.newSynapse.hide();
Metamaps.Filter.close();
Metamaps.Map.InfoBox.close();
Metamaps.Realtime.endActiveMap();
}
},
@ -4242,6 +4305,7 @@ Metamaps.Map = {
Metamaps.GlobalUI.CreateMap.topicsToMap = nodes_data;
Metamaps.GlobalUI.CreateMap.synapsesToMap = synapses_data;
},
leavePrivateMap: function(){
var map = Metamaps.Active.Map;
@ -4495,7 +4559,7 @@ Metamaps.Map.InfoBox = {
isOpen: false,
changing: false,
selectingPermission: false,
changePermissionText: "<div class='tip'>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.</div>",
changePermissionText: "<div class='tooltips'>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.</div>",
nameHTML: '<span class="best_in_place best_in_place_name" id="best_in_place_map_{{id}}_name" data-url="/maps/{{id}}" data-object="map" data-attribute="name" data-type="textarea" data-activator="#mapInfoName">{{name}}</span>',
descHTML: '<span class="best_in_place best_in_place_desc" id="best_in_place_map_{{id}}_desc" data-url="/maps/{{id}}" data-object="map" data-attribute="desc" data-nil="Click to add description..." data-type="textarea" data-activator="#mapInfoDesc">{{desc}}</span>',
init: function () {
@ -4521,7 +4585,7 @@ Metamaps.Map.InfoBox = {
},
open: function () {
var self = Metamaps.Map.InfoBox;
$('.mapInfoIcon div').addClass('hide');
if (!self.isOpen && !self.changing) {
self.changing = true;
$('.mapInfoBox').fadeIn(200, function () {
@ -4533,12 +4597,14 @@ Metamaps.Map.InfoBox = {
close: function () {
var self = Metamaps.Map.InfoBox;
$('.mapInfoIcon div').removeClass('hide');
if (!self.changing) {
self.changing = true;
$('.mapInfoBox').fadeOut(200, function () {
self.changing = false;
self.isOpen = false;
self.hidePermissionSelect();
$('.mapContributors .tip').hide();
});
}
},
@ -4613,6 +4679,17 @@ Metamaps.Map.InfoBox = {
$('.mapInfoBox.yourMap').unbind('.yourMap').bind('click.yourMap', self.hidePermissionSelect);
$('.yourMap .mapInfoDelete').unbind().click(self.deleteActiveMap);
$('.mapContributors span, #mapContribs').unbind().click(function(event){
$('.mapContributors .tip').toggle();
event.stopPropagation();
});
$('.mapContributors .tip').unbind().click(function(event){
event.stopPropagation();
});
$('.mapInfoBox').unbind('.hideTip').bind('click.hideTip', function(){
$('.mapContributors .tip').hide();
});
},
updateNameDescPerm: function(name, desc, perm) {
$('.mapInfoName .best_in_place_name').html(name);
@ -4622,9 +4699,17 @@ Metamaps.Map.InfoBox = {
createContributorList: function () {
var self = Metamaps.Map.InfoBox;
var mapperNames = Metamaps.Mappers.pluck("name");
var string = "";
return mapperNames.length > 0 ? mapperNames.join(", ") : "No one has added anything yet.";
string += "<ul>";
Metamaps.Mappers.each(function(m){
string += '<li><img class="rtUserImage" width="25" height="25" src="' + m.get("image") + '" />' + m.get("name") + '</li>';
});
string += "</ul>";
return string;
},
updateNumbers: function () {
var self = Metamaps.Map.InfoBox;
@ -4641,7 +4726,7 @@ Metamaps.Map.InfoBox = {
}
$('.mapContributors img').attr('src', contributors_image).removeClass('multiple mTwo').addClass(contributors_class);
$('.mapContributors span').text(Metamaps.Mappers.length)
$('.mapContributors .tip').text(self.createContributorList());
$('.mapContributors .tip').html(self.createContributorList());
$('.mapTopics').text(Metamaps.Topics.length);
$('.mapSynapses').text(Metamaps.Synapses.length);

View file

@ -141,7 +141,7 @@ input[type="submit"]:active {
}
.leaveSpace {
display: block;
height: 50px;
height: 25px;
}
.hidden {
display: none;
@ -531,7 +531,7 @@ input[type="submit"]:active {
background: #FFFFFF;
height: 14px;
margin: 0;
padding: 10px 6px;
padding: 14px 6px;
border: none;
border-radius: 2px;
outline: none;
@ -581,7 +581,7 @@ input[type="submit"]:active {
}
.new_synapse #synapse_desc,
.new_synapse .tt-hint {
width: 244px;
width: 258px;
background: #FFFFFF;
height: 14px;
margin: 0;
@ -1007,7 +1007,7 @@ h3.filterBox {
cursor: pointer;
font-size:12px;
}
.sidebarFilterBox span:hover {
.sidebarFilterBox span:hover, .sidebarFilterBox span.active {
color: #00BCD4;
}
.sidebarFilterBox ul {
@ -1104,7 +1104,7 @@ h3.realtimeBoxTitle {
text-align: center;
font-size:12px;
}
.sidebarCollaborateBox .realtimeOnOff:hover {
.sidebarCollaborateBox .realtimeOnOff:hover, .sidebarCollaborateBox .realtimeOnOff.active {
color: #00bcd4;
}
.sidebarCollaborateBox .rtOff {
@ -1137,6 +1137,7 @@ h3.realtimeBoxTitle {
left: 0;
border-radius: 14px;
}
.littleJuntoIcon {
width: 24px;
height:24px;
@ -1359,9 +1360,14 @@ float: left;
#new_topic .tt-suggestion,
#new_synapse .tt-suggestion {
background: #F5F5F5;
width: 256px;
position: relative;
}
#new_topic .tt-suggestion {
width: 256px;
}
#new_synapse .tt-suggestion {
width: 270px;
}
#new_topic .autocompleteSection {
float: left;
}
@ -1380,9 +1386,9 @@ float: left;
line-height: 14px;
font-size: 14px;
padding: 9px 0 9px 8px;
display: inline-block;
}
#new_topic .expandTopicMetadata,
#new_synapse .expandSynapseMetadata {
#new_topic .expandTopicMetadata {
display:none;
width: 16px;
height: 16px;
@ -1394,19 +1400,14 @@ float: left;
background-position: 0 -32px;
}
#new_topic .tt-suggestion.tt-is-under-cursor .expandTopicMetadata,
#new_topic .tt-suggestion.tt-is-under-mouse-cursor .expandTopicMetadata,
#new_synapse .tt-suggestion.tt-is-under-cursor .expandSynapseMetadata,
#new_synapse .tt-suggestion.tt-is-under-mouse-cursor .expandSynapseMetadata {
#new_topic .tt-suggestion.tt-is-under-mouse-cursor .expandTopicMetadata {
display: block;
}
#new_topic .tt-suggestion.tt-is-under-cursor .topicMetadata,
#new_topic .tt-suggestion.tt-is-under-mouse-cursor .topicMetadata,
#new_synapse .tt-suggestion.tt-is-under-cursor .synapseMetadata,
#new_synapse .tt-suggestion.tt-is-under-mouse-cursor .synapseMetadata {
#new_topic .tt-suggestion.tt-is-under-mouse-cursor .topicMetadata {
display: block;
}
#new_topic .topicMetadata,
#new_synapse .synapseMetadata {
#new_topic .topicMetadata {
position: absolute;
display: none;
top: -18px;
@ -1417,8 +1418,7 @@ float: left;
font-family: 'din-regular', helvetica, sans-serif;
font-size: 14px;
}
#new_topic .topicPermission,
#new_synapse .synapsePermission {
#new_topic .topicPermission {
width: 32px;
height: 32px;
background-repeat: no-repeat;
@ -1439,8 +1439,7 @@ float: left;
#new_synapse .synapsePermission.private {
background-position: -32px 0;
}
#new_topic .topicNumMaps,
#new_synapse .synapseNumMaps {
#new_topic .topicNumMaps {
height: 14px;
padding: 1px 0 1px 32px;
background-image: url(metamap16.png);
@ -1458,52 +1457,92 @@ float: left;
position: absolute;
bottom: 10px;
}
#new_topic .topicOriginatorIcon,
#new_synapse .synapseOriginatorIcon {
#new_topic .topicOriginatorIcon {
position: absolute;
top: 8px;
right: 8px;
}
#new_topic .topicOriginatorIcon img,
#new_synapse .synapseOriginatorIcon img {
#new_topic .topicOriginatorIcon img {
border-radius: 12px;
}
#new_topic .topicOriginatorIcon:hover .tip,
#new_synapse .synapseOriginatorIcon:hover .tip {
display: block;
#new_topic .topicOriginatorIcon .tooltips {
left: 32px;
top: -2px;
right: auto;
}
#new_topic .tip,
#new_synapse .tip {
display: none;
#new_topic .topicOriginatorIcon .tooltips:after {
content: '';
position: absolute;
background: white;
width: auto;
top: 0;
left: 23px;
color: black;
white-space: nowrap;
border-radius: 4px;
font-size: 15px !important;
line-height: 15px;
padding: 2px 5px 2px;
z-index: 100;
top: 57%;
left: -4px;
margin-top: -6px;
width: 0;
height: 0;
border-right: 4px solid #000000;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
#new_topic .topicOriginatorIcon:hover .tooltips {
display:block;
}
#new_synapse .tt-dropdown-menu {
background: #F5F5F5;
}
#new_synapse .tt-dropdown-menu h3 {
font-family: 'vinyl', helvetica, sans-serif;
text-transform: uppercase;
font-style: italic;
font-size: 14pxpx;
font-size: 14px;
line-height: 16px;
margin: 3px;
padding: 8px;
border-top: 1px solid #BFBFBF;
color: #808080;
}
#new_synapse .tt-suggestion .resultnoresult .synapsePermission,
#new_synapse .tt-suggestion .resultnoresult .synapseOriginatorIcon {
display: none;
}
#new_synapse .synapseMetadata {
width: 64px;
padding-left: 4px;
height: 32px;
position: absolute;
left: 202px;
top: 0;
}
#new_synapse .synapseOriginatorIcon {
position: absolute;
top: 4px;
}
#new_synapse .synapseOriginatorIcon .tooltips {
right: 32px;
top: -2px;
}
#new_synapse .synapseOriginatorIcon .tooltips:after {
content: '';
position: absolute;
top: 57%;
left: 100%;
margin-top: -6px;
width: 0;
height: 0;
border-left: 4px solid #000000;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
#new_synapse .synapseOriginatorIcon:hover .tooltips {
display:block;
}
#new_synapse .synapseOriginatorIcon img {
border-radius: 12px;
}
#new_synapse .synapsePermission {
position: absolute;
left: 32px;
width: 32px;
height: 32px;
background-repeat: no-repeat;
background-image: url(permissions32_sprite.png);
}
/* map info box */
/* map info box */
@ -1575,7 +1614,6 @@ float: left;
margin: 9px 0px 9px 56px;
padding: 0;
width: 64px;
cursor: pointer;
}
#mapContribs {
float: left;
@ -1584,6 +1622,7 @@ float: left;
width: 25px;
height: 25px;
border-radius: 15px;
cursor: pointer;
}
#mapContribs.multiple.mTwo {
box-shadow: 1px 1px 0 0 #B5B5B5,3px 2px 0 0 #424242;
@ -1596,12 +1635,22 @@ float: left;
padding-top: 5px;
padding-left: 8px;
float: left;
cursor: pointer;
}
#mapContribsTip {
border: 2px solid #424242;
background-color: #fff;
width: 25px;
height: 25px;
border-radius: 15px;
}
.infoStatIcon .tip {
display: none;
position: absolute;
background: white;
background: #202020;
min-width: 180px;
max-width: 250px;
text-align: center;
@ -1609,20 +1658,78 @@ float: left;
border-radius: 4px;
font-size: 15px !important;
line-height: 17px;
padding: 3px 5px 2px;
padding: 6px 8px 6px 8px;
z-index: 100;
}
.mapContributors .tip {
top: 38px;
left: 6px;
top: 45px;
left: -10px;
}
.mapInfoBox .mapPermission .tip {
top: 0;
right: 32px;
.mapContributors .tip ul {
max-height: 188px;
overflow-y: auto;
}
.mapInfoBox .hoverForTip:hover .tip {
display: none;
.mapContributors .tip li {
list-style-type: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 12px 40px;
display: block;
height: 14px;
font-family: 'din-regular', helvetica, sans-serif;
font-size: 14px;
line-height: 14px;
position: relative;
text-align: left;
color: white;
}
.mapContributors div:after {
content: '';
position: absolute;
top: -4px;
left: 21px;
width: 0;
height: 0;
border-bottom: 4px solid #202020;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.mapContributors .tip img {
border: 2px solid #bdbdbd;
position: absolute;
top: 4px;
left: 4px;
border-radius: 14px;
}
.mapInfoBox .mapPermission .tooltips {
top: -20px;
right: 36px;
width: 155px;
white-space: normal;
text-align: center;
}
.mapInfoBox .mapPermission .tooltips:after {
content: '';
position: absolute;
right: -4px;
top: 24px;
width: 0;
height: 0;
border-left: 4px solid black;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
.mapInfoBox.yourMap .mapPermission.hoverForTip:hover .tooltips {
display: block;
}
.mapTopics {
background-image: url(topic32.png);
background-position: 13px center;
@ -1902,6 +2009,9 @@ and it won't be important on password protected instances */
color: #424242;
text-align: left;
}
.lightboxContent li {
list-style: none;
}
.openLightbox {
cursor: pointer;
}
@ -2101,10 +2211,20 @@ and it won't be important on password protected instances */
float: left;
}
#about > p, #getInvolved > p, #invite > p, #colophon p {
/* color: #000;
font-size: 16px;*/
margin: 0px 0px 20px 0px;
#colophon {
overflow-y: scroll;
height:434px;
}
#colophonLinks {
padding-left:20px;
}
#colophoneHeader {
padding-bottom:12px;
}
#about > p, #colophon p {
margin: 0px 0px 10px 0px;
line-height: 20px;
}
#about ul {
@ -2232,6 +2352,9 @@ and it won't be important on password protected instances */
#joinCodesBox {
margin-top: 30px;
}
#joinCodesBox button {
margin: 16px 198px 0;
}
/* new map */
.new_map {

View file

@ -19,11 +19,12 @@
#center-container {
position:relative;
position:relative;
height:100%;
width:100%;
/* background-color:#031924; */
color:#444;
/* background-color:#031924; */
color:#444;
}
.showcard {
@ -121,18 +122,18 @@
.CardOnGraph .best_in_place_desc textarea {
font-size: 13px;
line-height:15px;
font-family: helvetica, sans-serif;
color: #424242;
padding: 0;
width: 100%;
margin: 0;
border: 0;
outline: none;
font-size: 12px;
line-height: 15px;
background: none;
resize: none;
line-height:15px;
font-family: helvetica, sans-serif;
color: #424242;
padding: 0;
width: 100%;
margin: 0;
border: 0;
outline: none;
font-size: 12px;
line-height: 15px;
background: none;
resize: none;
}
.CardOnGraph .desc h3 {
@ -198,9 +199,40 @@ resize: none;
left: 0;
border-radius: 16px;
}
.contributorName {
display:none;
.contributor:hover .contributorName {
display: block;
}
.contributorName {
display: none;
position: absolute;
background: black;
text-align: center;
color: white;
border-radius: 2px;
font-family: din-regular;
line-height: 15px;
font-size: 12px;
padding: 3px 5px 2px;
white-space: nowrap;
margin-top: 36px;
margin-left: -32px;
}
.contributor div:before {
content: '';
position: absolute;
top: 128%;
left: 13px;
margin-top: -30px;
width: 0;
height: 0;
border-bottom: 4px solid #000000;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.linkItem.mapCount {
margin-left: 12px;
width: 24px;
@ -425,7 +457,21 @@ background-color: #E0E0E0;
bottom: 0;
}
.CardOnGraph .hoverForTip:hover .tip, .mapCard .hoverForTip:hover .tip {
.tip li {
list-style-type: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 10px 34px;
display: block;
height: 14px;
font-family: 'din-regular', helvetica, sans-serif;
font-size: 14px;
line-height: 14px;
position: relative;
}
.CardOnGraph .hoverForTip:hover .tip, .mapCard .hoverForTip:hover .tip, #mapContribs:hover .tip {
display:block;
}
.CardOnGraph .tip, .mapCard .tip {
@ -626,6 +672,7 @@ font-family: 'din-regular', helvetica, sans-serif;
#editSynUpperBar {
background: #FFFFFF url(synapse32.png) no-repeat 8px center;
min-height: 48px;
height: 48px;
border-bottom: 1px solid #222222;
display: table;
width: 100%;
@ -701,14 +748,14 @@ font-family: 'din-regular', helvetica, sans-serif;
border-bottom: 1px solid #BBBBBB;
}
#switchSynapseList li {
padding: 8px;
padding: 8px 8px 8px 68px;
cursor: pointer;
font-family: 'din-regular';
font-size: 14px;
line-height: 16px;
}
#switchSynapseList li:hover {
background: #E0E0E0;
background: #DAB539;
}
#edgeUser {
@ -723,18 +770,32 @@ font-family: 'din-regular', helvetica, sans-serif;
display:block;
}
#edgeUser .tip {
background: none repeat scroll 0 0 #000000;
border-radius: 4px;
color: #FFFFFF;
display: none;
font-size: 15px !important;
line-height: 17px;
padding: 3px 5px 2px;
position: absolute;
left: 0;
text-align: center;
top: 23px;
z-index: 100;
display: none;
position: absolute;
background: black;
text-align: center;
text-transform: none;
color: white;
border-radius: 2px;
font-family: din-regular;
line-height: 15px;
font-size: 12px;
padding: 3px 5px 2px;
white-space: nowrap;
margin-top: 9px;
font-style: normal;
}
#edgeUser:hover div:before{
content: '';
position: absolute;
margin-top: -7px;
margin-left: 2px;
width: 0;
height: 0;
border-bottom: 4px solid #000000;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
#edit_synapse .mapPerm {

View file

@ -214,10 +214,28 @@
top: 40px !important;
background: #F5F5F5;
width: 472px;
overflow-y: auto;
overflow-x: hidden;
overflow-y: visible;
overflow-x: visible;
box-shadow: 0 1px 1.5px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.24);
}
.autoOptions #mapContribs {
width: 15px;
height: 15px;
border: 1px solid #424242;
margin-top: 4px;
margin-left: 4px;
}
.mapContributorsIcon span {
margin-left: 5px;
}
.mapContributorsIcon li span {
margin-left: 10px;
}
.searchHeader {
height: 42px;
width: 100%;
@ -462,6 +480,12 @@
.sidebarSearch .topicOriginatorIcon img {
border-radius: 9px;
}
.sidebarSearch .topicOriginatorIcon .tip {
left: 30px;
right: auto;
top: 1px;
}
.sidebarSearch .tip {
position: absolute;
background: #424242;
@ -480,6 +504,58 @@
.sidebarSearch .hoverForTip:hover .tip {
display: block;
}
.sidebarSearch .mapContributorsIcon .tip {
left: 40px;
right: auto;
top: -5px;
padding-top: 5px;
padding-bottom: 5px;
}
.sidebarSearch .hoverForTip .tip li {
padding-left: 28px;
padding-top: 4px;
}
.tipUserImage {
position: absolute;
top: 0px;
left: 7px;
border-radius: 14px;
}
.sidebarSearch .hoverForTip .tip:before {
content: '';
position: absolute;
width: 0;
height: 0;
border-right: 4px solid #424242;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
.sidebarSearch .hoverForTip.addToMap .tip {
right: 30px;
}
.sidebarSearch .hoverForTip.addToMap .tip:before {
right: -4px;
border-left: 4px solid #424242;
border-right: none;
}
.sidebarSearch .mapContributorsIcon .tip:before {
top: 65px;
left: -4px;
margin-top: -53px;
}
.sidebarSearch .topicOriginatorIcon .tip:before {
top: 58px;
left: -4px;
margin-top: -53px;
}
.sidebarSearch .mapContributorsIcon .mapContributors {
top: auto;
right: 0;
@ -736,9 +812,13 @@
/* infoAndHelp */
.mapPage .infoAndHelp, .topicPage .infoAndHelp{
.mapPage .infoAndHelp, .topicPage .infoAndHelp {
right: 70px;
}
.mapPage .openCheatsheet .tooltipsAbove, .topicPage .openCheatsheet .tooltipsAbove {
left: 29px;
}
.infoAndHelp {
position: fixed;
bottom: 20px;
@ -790,6 +870,10 @@
right: 24px;
}
.topicPage .zoomExtents {
display: none;
}
.mapControl {
width:32px;
height:32px;
@ -798,6 +882,11 @@
background-position: 0 0;
cursor:pointer;
}
.mapControls:hover, .infoAndHelp:hover {
z-index: 4;
}
.takeScreenshot {
margin-bottom: 5px;
border-radius: 2px;
@ -810,17 +899,157 @@
.canEditMap .takeScreenshot {
display: block;
}
.zoomExtents {
margin-bottom:5px;
border-radius: 2px;
background-image: url(extents_sprite.png);
}
.zoomExtents:hover {
background-position: -32px 0;
}
.zoomExtents:hover .tooltips, .zoomIn:hover .tooltips, .zoomOut:hover .tooltips, .takeScreenshot:hover .tooltips, .sidebarCollaborateIcon:hover .tooltipsUnder,
.sidebarFilterIcon:hover .tooltipsUnder, .sidebarForkIcon:hover .tooltipsUnder, .addMap:hover .tooltipsUnder, .authenticated .sidebarAccountIcon:hover .tooltipsUnder,
.mapInfoIcon:hover .tooltipsAbove, .openCheatsheet:hover .tooltipsAbove {
display: block;
}
.hide {
display: none !important;
}
.tooltips {
display: none;
position: absolute;
background: black;
text-align: center;
right: 45px;
color: white;
border-radius: 2px;
font-family: din-regular;
line-height: 15px;
font-size: 12px;
padding: 3px 5px 2px;
white-space: nowrap;
margin-top: 5px;
}
.tooltipsUnder {
display: none;
position: absolute;
background: black;
text-align: center;
color: white;
border-radius: 2px;
font-family: din-regular;
line-height: 15px;
font-size: 12px;
padding: 3px 5px 2px;
white-space: nowrap;
margin-top: 36px;
}
.tooltipsAbove {
display: none;
position: absolute;
background: black;
text-align: center;
text-transform: none;
color: white;
border-radius: 2px;
font-family: din-regular;
line-height: 15px;
font-size: 12px;
padding: 3px 5px 2px;
white-space: nowrap;
margin-top: -23px;
font-style: normal;
}
.sidebarCollaborateIcon .tooltipsUnder {
margin-left: -3px;
}
.sidebarFilterIcon .tooltipsUnder {
margin-left: -4px;
}
.sidebarForkIcon .tooltipsUnder {
margin-left: -34px;
}
.sidebarForkIcon div:after{
left: 45%;
}
.addMap .tooltipsUnder {
margin-left: -36px;
}
.addMap div:after {
left: 45%;
}
.mapInfoIcon .tooltipsAbove {
left: -11px;
}
.openCheatsheet .tooltipsAbove {
left: -4px;
}
.sidebarAccountIcon .tooltipsUnder {
margin-left: -8px;
margin-top: 40px;
}
.zoomExtents div::after, .zoomIn div::after, .zoomOut div::after, .takeScreenshot div:after {
content: '';
position: absolute;
top: 57%;
left: 100%;
margin-top: -6px;
width: 0;
height: 0;
border-left: 4px solid #000000;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
}
.sidebarCollaborateIcon div:after, .sidebarFilterIcon div:after, .sidebarAccountIcon .tooltipsUnder:after {
left: 38%;
}
.sidebarCollaborateIcon div:after, .sidebarFilterIcon div:after, .sidebarForkIcon div:after, .addMap div:after, .sidebarAccountIcon .tooltipsUnder:after {
content: '';
position: absolute;
top: 128%;
margin-top: -30px;
width: 0;
height: 0;
border-bottom: 4px solid #000000;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.mapInfoIcon div:after, .openCheatsheet div:after {
content: '';
position: absolute;
top: 77%;
left: 41%;
margin-top: 5px;
width: 0;
height: 0;
border-top: 4px solid #000000;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.zoomIn {
background-image: url(zoom_sprite.png);
background-position: 0 0;
background-position: 0 /0;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}

View file

@ -194,9 +194,24 @@ class MainController < ApplicationController
topic2id = params[:topic2id]
if term && !term.empty?
@synapses = Synapse.select('DISTINCT "desc"').
where('LOWER("desc") like ?', '%' + term.downcase + '%').limit(5).order('"desc"')
@synapses = Synapse.select('DISTINCT "desc"').where('LOWER("desc") like ?', '%' + term.downcase + '%').order('"desc"')
# remove any duplicate synapse types that just differ by
# leading or trailing whitespaces
collectedDesc = []
@synapses.delete_if {|s|
desc = s.desc == nil || s.desc == "" ? "" : s.desc.strip
if collectedDesc.index(desc) == nil
collectedDesc.push(desc)
boolean = false
else
boolean = true
end
}
#limit to 5 results
@synapses = @synapses.slice(0,5)
render json: autocomplete_synapse_generic_json(@synapses)
elsif topic1id && !topic1id.empty?

View file

@ -15,19 +15,19 @@ module MapsHelper
map['contributorCount'] = m.contributors.count
map['rtype'] = "map"
contributorList = m.user.name + ' created this map. '
contributorTip = ''
firstContributorImage = '/assets/user.png'
if m.contributors.count > 0
m.contributors.each_with_index do |c, index|
comma = (index+1) == m.contributors.count ? '' : ', '
contributorList += c.name + comma
end
contributorList += ' has edited it.' if m.contributors.count == 1
contributorList += ' have edited it.' if m.contributors.count > 1
else
contributorList += 'No one has added anything yet.'
firstContributorImage = m.contributors[0].image.url(:square)
m.contributors.each_with_index do |c, index|
userImage = c.image.url(:square)
name = c.name
contributorTip += '<li> <img class="tipUserImage" width="25" height="25" src=' + userImage + ' />' + '<span>' + name + '</span> </li>'
end
end
map['contributorList'] = contributorList
map['contributorTip'] = contributorTip
map['mapContributorImage'] = firstContributorImage
temp.push map
end
return temp

View file

@ -20,12 +20,12 @@ module SynapsesHelper
synapses.each do |s|
synapse = {}
synapse['id'] = s.id
synapse['label'] = s.desc
synapse['label'] = s.desc == nil || s.desc == "" ? "(no description)" : s.desc
synapse['value'] = s.desc
synapse['permission'] = s.permission
synapse['mapCount'] = s.maps.count
synapse['originator'] = s.user.name
synapse['originatorImage'] = s.user.image
synapse['originatorImage'] = s.user.image.url(:square)
synapse['rtype'] = "synapse"
temp.push synapse

View file

@ -15,7 +15,7 @@ module TopicsHelper
topic['mapCount'] = t.maps.count
topic['synapseCount'] = t.synapses.count
topic['originator'] = t.user.name
topic['originatorImage'] = t.user.image
topic['originatorImage'] = t.user.image.url(:square)
topic['rtype'] = "topic"
temp.push topic

View file

@ -8,8 +8,6 @@ class Map < ActiveRecord::Base
has_many :topics, :through => :topicmappings
has_many :synapses, :through => :synapsemappings
#after_touch :save_screenshot
# This method associates the attribute ":image" with a file attachment
has_attached_file :screenshot, :styles => {
:thumb => ['188x126#', :png]
@ -121,17 +119,6 @@ class Map < ActiveRecord::Base
return true
end
def save_screenshot
# TODO - this will grab a map every single frickin' time a map is touched
# we need a system to throttle the amount to 1/hour or something like that
# maybe have a flag - last time this map was screenshotted
# don't update if it was less than an hour ago
# except this has the issue of a user updating map 7x, and it only screenshotting after
# the first time. We only want it to screenhsot the 7th time.
# We need to store a timestamp somewhere and do processing every hour, I think.
GrabMapScreenshotWorker.perform_async(self.id)
end
def decode_base64(imgBase64)
decoded_data = Base64.decode64(imgBase64)

View file

@ -28,12 +28,7 @@ class User < ActiveRecord::Base
validates_uniqueness_of :name # done by devise
validates_uniqueness_of :email # done by devise
if ActiveRecord::Base.connection.table_exists? 'users'
codes = ActiveRecord::Base.connection.execute("SELECT code FROM users").map {|user| user["code"] }
else
codes = []
end
validates :joinedwithcode, :presence => true, :inclusion => { :in => codes, :message => "%{value} is not valid" }, :on => :create
validates :joinedwithcode, :presence => true, :inclusion => { :in => $codes, :message => "%{value} is not valid" }, :on => :create
# This method associates the attribute ":image" with a file attachment
has_attached_file :image, :styles => {
@ -54,6 +49,8 @@ class User < ActiveRecord::Base
def generate_code
#generate a random 8 letter/digit code that they can use to invite people
self.code = rand(36**8).to_s(36)
$codes.push(self.code)
end
def settings

View file

@ -19,7 +19,7 @@
<div id="rightAboutParms">
<p>PRIVATE BETA</p>
<p>2.6 (Catalpa)</p>
<p>Nov 11, 2014</p>
<p>Nov 23, 2014</p>
</div>
<div class="clearfloat">
</div>

View file

@ -1,13 +1,13 @@
<div class="mapControls mapElement">
<div class="takeScreenshot mapControl"></div>
<div class="zoomExtents mapControl"></div>
<div class="zoomIn mapControl"></div>
<div class="zoomOut mapControl"></div>
<div class="takeScreenshot mapControl"><div class="tooltips">Capture Screenshot</div></div>
<div class="zoomExtents mapControl"><div class="tooltips">Center View</div></div>
<div class="zoomIn mapControl"><div class="tooltips">Zoom In</div></div>
<div class="zoomOut mapControl"><div class="tooltips">Zoom Out</div></div>
</div>
<div class="infoAndHelp">
<%= render :partial => 'maps/mapinfobox' %>
<div class="mapInfoIcon infoElement mapElement"></div>
<div class="openCheatsheet openLightbox infoElement" data-open="cheatsheet"></div>
<div class="mapInfoIcon infoElement mapElement"><div class="tooltipsAbove">Map Info</div></div>
<div class="openCheatsheet openLightbox infoElement" data-open="cheatsheet"><div class="tooltipsAbove">Help</div></div>
<div class="clearfloat"></div>
</div>

View file

@ -13,7 +13,7 @@
<img id="mapContribs" class="{{contributors_class}}"
width="25" height="25" src="{{contributor_image}}" />
<span>{{contributor_count}}</span>
<div class="tip">{{contributor_list}}</div>
<div class="tip">{{{contributor_list}}}</div>
</div>
<div class="infoStatIcon mapTopics">
{{topic_count}}
@ -121,8 +121,13 @@
{{synapseCount}}
</div>
<div class="mapContributorsIcon hoverForTip">
<span class="tip mapContributors">{{contributorList}}</span>
{{contributorCount}}
<img id="mapContribs" width="25" height="25" src="{{mapContributorImage}}" />
<div class="tip">
<ul>
{{{contributorTip}}}
</ul>
</div>
<span>{{contributorCount}}</span>
</div>
<div class="mapPermission {{permission}}">
</div>
@ -143,9 +148,6 @@
<div class="mapperCreated">
<p>Mapping since: {{created_at}}</p>
</div>
<div class="mapperGeneration">
<p>Generation: 1</p>
</div>
<div class="mapCount">
{{mapCount}}
</div>
@ -156,13 +158,11 @@
<script type="text/template" id="synapseAutocompleteTemplate">
<div class="result{{rtype}}">
<p class="autocompleteSection synapseDesc">{{label}}</p>
<div class="expandSynapseMetadata"></div>
<p class="autocompleteSection synapseDesc">{{label}}</p>
<div class="synapseMetadata">
<div class="synapseNumMaps">{{mapCount}}</div>
<div class="synapseOriginatorIcon hoverForTip">
<img width="24" height="24" src="{{originatorImage}}" />
<span class="tip synapseOriginator">{{originator}}</span>
<span class="tooltips synapseOriginator">{{originator}}</span>
</div>
<div class="synapsePermission {{permission}}"></div>
</div>
@ -179,7 +179,7 @@
<div class="topicNumSynapses">{{synapseCount}}</div>
<div class="topicOriginatorIcon hoverForTip">
<img width="24" height="24" src="{{originatorImage}}" />
<span class="tip topicOriginator">{{originator}}</span>
<span class="tooltips topicOriginator">{{originator}}</span>
</div>
<div class="topicPermission {{permission}}"></div>
</div>

View file

@ -21,7 +21,7 @@
<div class="mapElement upperRightEl upperRightMapButtons">
<!-- Realtime -->
<div class="sidebarCollaborate upperRightEl">
<div class="sidebarCollaborateIcon upperRightIcon blue"></div>
<div class="sidebarCollaborateIcon upperRightIcon blue"><div class="tooltipsUnder">Junto</div></div>
<div class="sidebarCollaborateBox upperRightBox">
<h3 class="realtimeBoxTitle">REALTIME</h3>
<span class="realtimeOnOff rtOff">OFF</span>
@ -41,7 +41,7 @@
<!-- filtering -->
<div class="sidebarFilter upperRightEl">
<div class="sidebarFilterIcon upperRightIcon"></div>
<div class="sidebarFilterIcon upperRightIcon"><div class="tooltipsUnder">Filter</div></div>
<div class="sidebarFilterBox upperRightBox">
<%= render :partial => 'shared/filterBox' %>
</div>
@ -49,19 +49,20 @@
<!-- fork map -->
<div class="sidebarFork upperRightEl">
<div class="sidebarForkIcon upperRightIcon"></div>
<div class="sidebarForkIcon upperRightIcon"><div class="tooltipsUnder">Save To New Map</div></div>
</div> <!-- end sidebarFork -->
<div class="clearfloat"></div>
</div> <!-- end mapElement -->
<!-- create new map -->
<div class="addMap openLightbox upperRightEl upperRightIcon" data-open="newmap">
<div class="addMap openLightbox upperRightEl upperRightIcon" data-open="newmap"><div class="tooltipsUnder">Create New Map</div>
</div><!-- end addMap -->
<!-- Account / Sign in -->
<div class="sidebarAccount upperRightEl">
<div class="sidebarAccountIcon">
<div class="tooltipsUnder">Account</div>
<%= image_tag user.image.url(:square), :size => "32x32" %>
</div>
<div class="sidebarAccountBox upperRightBox">

View file

@ -149,6 +149,10 @@
<% end %>
</script>
<% if !authenticated? %>
<iframe width="1" height="1" src="http://support.metamaps.cc/logout.json"; style="visibility:hidden;"></iframe>
<% end %>
<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %>
</body>
</html>

View file

@ -22,15 +22,11 @@
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" class="multiple" />
<% end %>
<span><%= @map.contributors.count %></span>
<% 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 %>
<div class="tip"><%= contributorList %></div>
<div class="tip"> <ul><% @map.contributors.each_with_index do |c, index| %>
<li > <img class="rtUserImage" width="25" height="25" src="<%= c.image.url(:square) %>" />
<%= c.name %>
</li>
<% end %></ul></div>
</div>
<div class="infoStatIcon mapTopics">
<%= @map.topics.count %>
@ -39,9 +35,7 @@
<%= @map.synapses.count %>
</div>
<div class="infoStatIcon mapPermission <%= @map.permission %> hoverForTip">
<% if @map.user == user %>
<div class="tip">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.</div>
<% end %>
<div class="tooltips">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.</div>
</div>
<div class="clearfloat"></div>
</div>

View file

@ -91,7 +91,7 @@
<div id="filter_by_mapper" class="filterBySection">
<h3><%= @map ? "MAPPERS" : @topic ? "CREATORS" : "" %></h3>
<span class="hideAll hideAllMappers">NONE</span>
<span class="showAll showAllMappers">ALL</span>
<span class="active showAll showAllMappers">ALL</span>
<div class="clearfloat"></div>
<ul>
<%= @mapperlist.html_safe %>
@ -102,7 +102,7 @@
<div id="filter_by_metacode" class="filterBySection">
<h3>METACODES</h3>
<span class="hideAll hideAllMetacodes">NONE</span>
<span class="showAll showAllMetacodes">ALL</span>
<span class="active showAll showAllMetacodes">ALL</span>
<div class="clearfloat"></div>
<ul>
<%= @metacodelist.html_safe %>
@ -113,7 +113,7 @@
<div id="filter_by_synapse" class="filterBySection">
<h3>SYNAPSES</h3>
<span class="hideAll hideAllSynapses">NONE</span>
<span class="showAll showAllSynapses">ALL</span>
<span class="active showAll showAllSynapses">ALL</span>
<div class="clearfloat"></div>
<ul>
<%= @synapselist.html_safe %>

View file

@ -18,7 +18,7 @@
<%= f.password_field :password_confirmation %></div>
<div><%= f.label "Access Code:", :class => "fieldText" %>
<%= f.text_field :joinedwithcode %></div>
<%= f.text_field :joinedwithcode, :value => params[:code] %></div>
<div><%= f.submit "Sign up!" %></div>
<% end %>

View file

@ -1,10 +0,0 @@
# app/workers/grab_map_screenshot_worker.rb
class GrabMapScreenshotWorker
include Sidekiq::Worker
def perform(map_id)
imgBase64 = `phantomjs ./script/phantomjs-save-screenshot.js #{map_id} #{Rails.env}`
map = Map.find(map_id)
map.decode_base64(imgBase64)
end
end

View file

@ -0,0 +1,2 @@
https://github.com/heroku/heroku-buildpack-ruby.git
https://github.com/stomita/heroku-buildpack-phantomjs.git

View file

@ -0,0 +1,4 @@
$codes = []
if ActiveRecord::Base.connection.table_exists? 'users'
$codes = ActiveRecord::Base.connection.execute("SELECT code FROM users").map {|user| user["code"] }
end

View file

@ -1,9 +0,0 @@
redis_url = Rails.env.development? ? 'redis://localhost:6379/0' : ENV['REDISTOGO_URL']
Sidekiq.configure_server do |config|
config.redis = { :url => redis_url, :namespace => 'metamaps' }
end
Sidekiq.configure_client do |config|
config.redis = { :url => redis_url, :namespace => 'metamaps' }
end

View file

@ -1,12 +1,7 @@
require 'sidekiq/web'
Metamaps::Application.routes.draw do
root to: 'main#home', via: :get
root to: 'main#home', via: :get
#To debug sidekiq and monitor processes, enable this route
#mount Sidekiq::Web, at: '/sidekiq'
match 'search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
match 'search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
match 'search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers

View file

@ -1,134 +1,134 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140930013020) do
create_table "in_metacode_sets", :force => true do |t|
t.integer "metacode_id"
t.integer "metacode_set_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
create_table "mappings", :force => true do |t|
t.text "category"
t.integer "xloc"
t.integer "yloc"
t.integer "topic_id"
t.integer "synapse_id"
t.integer "map_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "maps", :force => true do |t|
t.text "name"
t.boolean "arranged"
t.text "desc"
t.text "permission"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "featured"
t.string "screenshot_file_name"
t.string "screenshot_content_type"
t.integer "screenshot_file_size"
t.datetime "screenshot_updated_at"
end
create_table "metacode_sets", :force => true do |t|
t.string "name"
t.text "desc"
t.integer "user_id"
t.boolean "mapperContributed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
create_table "metacodes", :force => true do |t|
t.text "name"
t.string "icon"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "color"
end
create_table "synapses", :force => true do |t|
t.text "desc"
t.text "category"
t.text "weight"
t.text "permission"
t.integer "node1_id"
t.integer "node2_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "topics", :force => true do |t|
t.text "name"
t.text "desc"
t.text "link"
t.text "permission"
t.integer "user_id"
t.integer "metacode_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "audio_file_name"
t.string "audio_content_type"
t.integer "audio_file_size"
t.datetime "audio_updated_at"
end
create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.text "settings"
t.string "code", :limit => 8
t.string "joinedwithcode", :limit => 8
t.string "crypted_password"
t.string "password_salt"
t.string "persistence_token"
t.string "perishable_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "encrypted_password", :limit => 128, :default => ""
t.string "remember_token"
t.datetime "remember_created_at"
t.string "reset_password_token"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.string "current_sign_in_ip"
t.datetime "reset_password_sent_at"
t.boolean "admin"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
end
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20141121204712) do
create_table "in_metacode_sets", :force => true do |t|
t.integer "metacode_id"
t.integer "metacode_set_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
create_table "mappings", :force => true do |t|
t.text "category"
t.integer "xloc"
t.integer "yloc"
t.integer "topic_id"
t.integer "synapse_id"
t.integer "map_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "maps", :force => true do |t|
t.text "name"
t.boolean "arranged"
t.text "desc"
t.text "permission"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "featured"
t.string "screenshot_file_name"
t.string "screenshot_content_type"
t.integer "screenshot_file_size"
t.datetime "screenshot_updated_at"
end
create_table "metacode_sets", :force => true do |t|
t.string "name"
t.text "desc"
t.integer "user_id"
t.boolean "mapperContributed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
create_table "metacodes", :force => true do |t|
t.text "name"
t.string "icon"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "color"
end
create_table "synapses", :force => true do |t|
t.text "desc"
t.text "category"
t.text "weight"
t.text "permission"
t.integer "node1_id"
t.integer "node2_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "topics", :force => true do |t|
t.text "name"
t.text "desc"
t.text "link"
t.text "permission"
t.integer "user_id"
t.integer "metacode_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "audio_file_name"
t.string "audio_content_type"
t.integer "audio_file_size"
t.datetime "audio_updated_at"
end
create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.text "settings"
t.string "code", :limit => 8
t.string "joinedwithcode", :limit => 8
t.string "crypted_password"
t.string "password_salt"
t.string "persistence_token"
t.string "perishable_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "encrypted_password", :limit => 128, :default => ""
t.string "remember_token"
t.datetime "remember_created_at"
t.string "reset_password_token"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.string "current_sign_in_ip"
t.datetime "reset_password_sent_at"
t.boolean "admin"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
end
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end

View file

@ -26,14 +26,14 @@
}
body {
background: #d8d9da url(shattered_@2X.png);
background: #d8d9da url(/assets/shattered_@2X.png);
font-family: 'din-regular', helvetica, sans-serif;
color: #424242;
text-align: justify;
font-size: 18px;
line-height: 18px;
}
.title a {
.dialog a {
color:#c04f4f;
}
.title{
@ -85,7 +85,7 @@
box-shadow: 0px 1px 1.5px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.24);
margin: 0 auto;
text-decoration: none;
color: #FFFFFF;
color: #FFFFFF !important;
cursor: pointer;
}
@ -116,11 +116,13 @@
<div class="dialog">
<h1 class="title">404 - You've Found Nothing</h1>
<p>Nothing is here!</p>
<p>There are nothings that inspire and nothings that motivate, but there are no nothings that cannot stir your experience of nothing.</p>
<p>Therefore there is nothing to see here, nothing to behold here, nothing to be here, maybe there is but definitely not here.</p>
<p>Therefore, move along! Nothing is ending here<a href="http://spacecollective.org/Wildcat/8942/Some-nothings-are-like-elephants-really-big-elephants" target="_blank">...</a></p>
<a href="/explore/featured" class="button exploreFeaturedCTA">EXPLORE FEATURED MAPS</a>
<a href="http://blog.metamaps.cc" class="button blogCTA">GO TO OUR BLOG</a>
<p>
It seems the page you are looking for could not be found, doesn't exist anymore, or maybe just moved.
</p>
<p>
Try checking the URL for errors, then hit the refresh button on your browser. If that doesn't work, the best thing to do is go back to the home page using the button below.
</p>
<a href="/" class="button exploreFeaturedCTA">GO BACK HOME!</a>
</div>
<div class="picture">

View file

@ -5,6 +5,7 @@ user:
email: user@user.com
encrypted_password: $2a$10$psR68SWYNy5ZKQPs9FrFM.HuRMrTXO/YFzv.HaUmdCsQZsQrG1XAW
code: qwertyui
joinedwithcode: qwertyui
admin: false
admin:
@ -12,4 +13,5 @@ admin:
email: admin@admin.com
encrypted_password: $2a$10$psR68SWYNy5ZKQPs9FrFM.HuRMrTXO/YFzv.HaUmdCsQZsQrG1XAW
code: iuytrewq
joinedwithcode: iuytrewq
admin: true