Merge branch 'Tadasu85-master'

This commit is contained in:
Connor Turland 2014-06-11 08:43:15 -04:00
commit e5cc8b8078
8 changed files with 183 additions and 41 deletions

101
Ubuntu README.rdoc Normal file
View file

@ -0,0 +1,101 @@
Firstly this walkthrough is done with a 14.04 32bit install of Ubuntu.
All Commands are quoted with "" which are not to be included in the command.
All commands that I could are terminal based.
Lets check if all updates for the system are installed first
in terminal type
"sudo apt-get update"
now we need to install git
"sudo apt-get install git"
lets get our RVM installed (Ruby Version Manager) now this is fun because the package you will get from apt-get is outdated.
so we are going to use CURL to get RVM
"sudo apt-get install curl"
then lets install RVM with curl like this
"curl -L get.rvm.io | bash -s stable"
"PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting"
"[[ -s "$HOME/.profile" ]] && source "$HOME/.profile""
"[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm""
"source ~/.rvm/scripts/rvm"
now we can actually install RVM
"rvm requirements"
running this will check your system for requirements as well so you will need to put your system password in.
alright now we can download metamaps from the master using git
"git clone https://github.com/Connoropolous/metamaps_gen002.git"
now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server
"sudo apt-get install nodejs"
"sudo apt-get install postgresql"
"sudo apt-get install libpq-dev"
"sudo apt-get install redis-server"
Install the specific version of ruby needed this will take some time *Note you will get a warning about this being an outdated version*
"rvm install ruby-1.9.3-p125"
Now we also need to rename your database file which is in ./config/database.default.yml to database.yml
now run inside your metamaps_gen002 folder
"bundle install"
in your top lvl directory for metamaps this is a lengthy process so you might want to go and make a coffee or something :)
alright now we need to make sure your postgres password is the same as it is listed in the DB file so we are going to set it by
"sudo -u postgres psql"
Select postgres like this
"\password postgres"
set the password to 3112
Then to quit
"\q"
now we can run the rake install and db creation
"rake db:create"
"rake db:schema:load"
"rake db:fixtures:load"
Execute the server : "rails s"
and dont forget to run realtime too open a new terminal
navigate to ./realtime and run
"nodejs realtime-server.js"
Now your all set enjoy your personal server of metamaps :)

View file

@ -31,6 +31,25 @@ function selectEdgeOnClickHandler(adj, e) {
selectEdge(adj); selectEdge(adj);
} }
var edgeIsSelected = MetamapsModel.selectedEdges.indexOf(adj);
if (edgeIsSelected == -1) edgeIsSelected = false;
else if (edgeIsSelected != -1) edgeIsSelected = true;
if (edgeIsSelected && e.shiftKey) {
//deselecting an edge with shift
deselectEdge(adj);
} else if (!edgeIsSelected && e.shiftKey) {
//selecting an edge with shift
selectEdge(adj);
} else if (edgeIsSelected && !e.shiftKey) {
//deselecting an edge without shift - unselect all
deselectAllEdges();
} else if (!edgeIsSelected && !e.shiftKey) {
//selecting an edge without shift - unselect all but new one
deselectAllEdges();
selectEdge(adj);
}
Mconsole.plot(); Mconsole.plot();
} //selectEdgeOnClickHandler } //selectEdgeOnClickHandler

View file

@ -144,6 +144,7 @@ $(document).ready(function () {
$('.sidebarSearchField').typeahead([ $('.sidebarSearchField').typeahead([
{ {
name: 'topics', name: 'topics',
limit: 9999,
dupChecker: function (datum1, datum2) { dupChecker: function (datum1, datum2) {
return false; return false;
}, },
@ -174,6 +175,7 @@ $(document).ready(function () {
}, },
{ {
name: 'maps', name: 'maps',
limit: 9999,
dupChecker: function (datum1, datum2) { dupChecker: function (datum1, datum2) {
return false; return false;
}, },
@ -203,6 +205,7 @@ $(document).ready(function () {
}, },
{ {
name: 'mappers', name: 'mappers',
limit: 9999,
dupChecker: function (datum1, datum2) { dupChecker: function (datum1, datum2) {
return false; return false;
}, },
@ -224,6 +227,18 @@ $(document).ready(function () {
header: '<h3 class="search-header">Mappers</h3><div class="minimizeResults minimizeMapperResults"></div><div class="clearfloat"></div>' header: '<h3 class="search-header">Mappers</h3><div class="minimizeResults minimizeMapperResults"></div><div class="clearfloat"></div>'
} }
]); ]);
//Set max height of the search results box to prevent it from covering bottom left footer
$('.sidebarSearchField').bind('typeahead:opened', function (event) {
var h = $(window).height();
$(".tt-dropdown-menu").css('max-height', h - 100);
});
$(window).resize(function () {
var h = $(window).height();
$(".tt-dropdown-menu").css('max-height', h - 100);
});
// tell the autocomplete to launch a new tab with the topic, map, or mapper you clicked on // tell the autocomplete to launch a new tab with the topic, map, or mapper you clicked on
$('.sidebarSearchField').bind('typeahead:selected', function (event, datum, dataset) { $('.sidebarSearchField').bind('typeahead:selected', function (event, datum, dataset) {
console.log(event); console.log(event);

View file

@ -967,6 +967,9 @@ h3.filterByMetacode {
left:-35px !important; left:-35px !important;
background: #0F1519; background: #0F1519;
min-width: 440px; min-width: 440px;
width: 440px;
overflow-y: scroll;
overflow-x: hidden;
} }
.sidebarSearch .tt-dropdown-menu h3 { .sidebarSearch .tt-dropdown-menu h3 {
font-family: 'vinyl', helvetica, sans-serif; font-family: 'vinyl', helvetica, sans-serif;
@ -1011,11 +1014,13 @@ h3.filterByMetacode {
.sidebarSearch .tt-suggestion { .sidebarSearch .tt-suggestion {
background: #2A343C; background: #2A343C;
} }
.sidebarSearch .tt-is-under-cursor { .sidebarSearch .tt-is-under-cursor, .sidebarSearch .tt-is-under-mouse-cursor {
background: #0E161D; background: #0E161D;
} }
.sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap, .sidebarSearch .tt-dataset-maps .tt-is-under-cursor .resultmap,
.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .resulttopic { .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; min-height: 57px;
} }
.sidebarSearch .tt-suggestion .icon { .sidebarSearch .tt-suggestion .icon {
@ -1033,14 +1038,16 @@ h3.filterByMetacode {
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .topicIcon { .sidebarSearch .tt-dataset-topics .tt-is-under-cursor .topicIcon,
.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .topicIcon {
margin: 0 auto; margin: 0 auto;
padding-left: 2px padding-left: 2px
} }
.sidebarSearch .tt-dataset-topics .metacodeTip { .sidebarSearch .tt-dataset-topics .metacodeTip {
display: none; display: none;
} }
.sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip { .sidebarSearch .tt-dataset-topics .tt-is-under-cursor .metacodeTip,
.sidebarSearch .tt-dataset-topics .tt-is-under-mouse-cursor .metacodeTip {
display: block; display: block;
font-family: 'vinyl'; font-family: 'vinyl';
text-transform: uppercase; text-transform: uppercase;
@ -1055,9 +1062,10 @@ h3.filterByMetacode {
padding: 4px; padding: 4px;
} }
.sidebarSearch .resultText { .sidebarSearch .resultText {
width: 250px; width: 225px;
display: block; display: block;
float: left; float: left;
word-wrap: break-word;
} }
.sidebarSearch .resultTitle { .sidebarSearch .resultTitle {
font-weight: normal; font-weight: normal;
@ -1083,7 +1091,8 @@ h3.filterByMetacode {
position: relative; position: relative;
display: none; display: none;
} }
.sidebarSearch .tt-is-under-cursor .autoOptions { .sidebarSearch .tt-is-under-cursor .autoOptions,
.sidebarSearch .tt-is-under-mouse-cursor .autoOptions {
display: block; display: block;
} }
.sidebarSearch .tt-suggestion .resultnoresult .autoOptions { .sidebarSearch .tt-suggestion .resultnoresult .autoOptions {
@ -1121,7 +1130,7 @@ h3.filterByMetacode {
background: url(/assets/MMCCicon_map.png) no-repeat 0px center; background: url(/assets/MMCCicon_map.png) no-repeat 0px center;
background-size: 14px 14px; background-size: 14px 14px;
top: 7px; top: 7px;
left: 39px; left: 38px;
padding-left: 18px; padding-left: 18px;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
@ -1161,7 +1170,7 @@ h3.filterByMetacode {
background: white; background: white;
width: auto; width: auto;
bottom: 0; bottom: 0;
left: 23px; right: 25px;
color: black; color: black;
white-space: nowrap; white-space: nowrap;
border-radius: 4px; border-radius: 4px;
@ -1171,17 +1180,15 @@ h3.filterByMetacode {
padding: 3px 5px 2px; padding: 3px 5px 2px;
z-index:100; z-index:100;
} }
.sidebarSearch .mapCount .tip, .sidebarSearch .mapCount .tip,.sidebarSearch .synapseCount .tip, .sidebarSearch .topicCount .tip {
.sidebarSearch .synapseCount .tip, right:-3px;
.sidebarSearch .topicCount .tip {
left: -3px;
bottom:24px; bottom:24px;
} }
.sidebarSearch .hoverForTip:hover .tip { .sidebarSearch .hoverForTip:hover .tip {
display: block; display: block;
} }
.sidebarSearch .mapContributorsIcon .mapContributors { .sidebarSearch .mapContributorsIcon .mapContributors {
left: 0; right:0;
bottom:21px; bottom:21px;
white-space:normal; white-space:normal;
width:200px; width:200px;

View file

@ -2,6 +2,7 @@
// They will automatically be included in application.css. // They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/ // You can use Sass (SCSS) here: http://sass-lang.com/
.allMetacodes { .allMetacodes {
float:left; float:left;
} }

View file

@ -161,7 +161,7 @@ class MainController < ApplicationController
# !connor why is the limit 5 done here and not above? also, why not limit after sorting alphabetically? # !connor why is the limit 5 done here and not above? also, why not limit after sorting alphabetically?
@maps = Map.where(query, search).limit(5).order('"name"') @maps = Map.where(query, search).limit(5).order('"name"')
elsif user elsif user
@maps = Map.where(query, search).where('user_id = ?', user).limit(5).order('"name"') @maps = Map.where(query, search).where('user_id = ?', user).order('"name"')
end end
else else
@maps = [] @maps = []
@ -182,7 +182,7 @@ class MainController < ApplicationController
#remove "mapper:" if appended at beginning #remove "mapper:" if appended at beginning
term = term[7..-1] if term.downcase[0..6] == "mapper:" term = term[7..-1] if term.downcase[0..6] == "mapper:"
@mappers = User.where('LOWER("name") like ?', term.downcase + '%').limit(5).order('"name"') @mappers = User.where('LOWER("name") like ?', term.downcase + '%').order('"name"')
else else
@mappers = [] @mappers = []
end end

View file

@ -12,6 +12,5 @@
<%= form.input :email, label: "Email", class: "email" %> <%= form.input :email, label: "Email", class: "email" %>
<%= form.input :password, label: "Password", class: "password", :autocomplete => :off %> <%= form.input :password, label: "Password", class: "password", :autocomplete => :off %>
<%= form.submit "Update", class: "update" %> <%= form.submit "Update", class: "update" %>
<% end %> <% end %>