From 5f349305a19860dc0b4acb1ef7c5462266d802c0 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Tue, 20 May 2014 20:07:22 -0400 Subject: [PATCH 1/4] Walkthrough for ubuntu added, as well as our lost default database file readded --- Walkthrough For Ubuntu Install | 99 ++++++++++++++++++++++++++ app/assets/stylesheets/application.css | 2 +- app/assets/stylesheets/users.css.scss | 3 +- app/views/users/edit.html.erb | 3 +- config/database.default.yml | 21 ++++++ 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 Walkthrough For Ubuntu Install create mode 100644 config/database.default.yml diff --git a/Walkthrough For Ubuntu Install b/Walkthrough For Ubuntu Install new file mode 100644 index 00000000..a4a4ddf2 --- /dev/null +++ b/Walkthrough For Ubuntu Install @@ -0,0 +1,99 @@ +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 *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 + +"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" + +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 :) + + + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 36e380f4..169ac95e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -354,7 +354,7 @@ font-family: 'LatoRegular'; label, select, input, textarea { display:block; -} + } label { margin-top:10px; diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss index ff75b57e..829f76f8 100644 --- a/app/assets/stylesheets/users.css.scss +++ b/app/assets/stylesheets/users.css.scss @@ -2,6 +2,7 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + .allMetacodes { float:left; } @@ -62,4 +63,4 @@ .editMetacodes li.toggledOff { opacity: 0.4; -} \ No newline at end of file +} diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 1e21f9ff..30ed5dcd 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -7,13 +7,12 @@ <% content_for :title, @user.name + "'s Settings | Metamaps" %> <%= formula_form_for @user, url: user_url do |form| %>

Your Settings

-

Edit Account

<%= form.input :name, label: "Name", class: "name" %> <%= form.input :email, label: "Email", class: "email" %> <%= form.input :password, label: "Password", class: "password" %> - <%= form.submit "Update", class: "update" %> + <%= form.submit "Update", class: "update" %> <% end %> diff --git a/config/database.default.yml b/config/database.default.yml new file mode 100644 index 00000000..6705ca8f --- /dev/null +++ b/config/database.default.yml @@ -0,0 +1,21 @@ +development: + min_messages: WARNING + adapter: postgresql + host: 127.0.0.1 + port: 5432 + encoding: unicode + database: metamap002_development + pool: 5 + username: postgres + password: "3112" + +production: + min_messages: WARNING + adapter: postgresql + host: ec2-107-21-107-194.compute-1.amazonaws.com + port: 5432 + encoding: unicode + database: ddcrn2lgphjk9k + pool: 5 + username: qqpckkahytovwv + password: "njeP6cMA8EjM9ukHk9s3ReOdy7" From 6f2d19c5703fc6b38fbf87fa38f16f9766d4aad3 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Tue, 10 Jun 2014 17:41:34 -0400 Subject: [PATCH 2/4] Addition of scrollbar to search results --- Ubuntu README.rdoc | 101 +++++++++++++++++++++++++ app/assets/javascripts/application.js | 30 +++++++- app/assets/javascripts/typeahead.js | 2 +- app/assets/stylesheets/application.css | 13 ++-- app/controllers/main_controller.rb | 4 +- 5 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 Ubuntu README.rdoc diff --git a/Ubuntu README.rdoc b/Ubuntu README.rdoc new file mode 100644 index 00000000..b468eb4c --- /dev/null +++ b/Ubuntu README.rdoc @@ -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 :) + + + + diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 53af30e3..eed55362 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -28,6 +28,7 @@ var viewMode = "list"; var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false, goRealtime = false, mapid = null, mapperm = false, touchPos, touchDragNode, mouseIsDown = false; $(document).ready(function() { + function bindMainMenuHover() { @@ -59,6 +60,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, },500); } + var openMenu = function() { clearTimeout(lT); if (! sliding1) { @@ -95,6 +97,8 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, var searchIsOpen = false + + // controls the sliding hover of the search var sliding1 = false; var lT; @@ -114,6 +118,8 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, }); } } + + var closeSearch = function(closeAfter) { lT = setTimeout(function() { if (!sliding1 && searchIsOpen && $('.sidebarSearchField').val() == '') { @@ -161,6 +167,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, $('.sidebarSearchField').typeahead([ { name: 'topics', + limit: 9999, dupChecker: function (datum1,datum2) { return false; }, @@ -403,6 +410,8 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, } }); + + // initialize the autocomplete results for the metacode spinner $('#synapse_desc').typeahead([ { @@ -461,8 +470,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, top: '35px', right: '-36px' }); - - // initialize metacode spinner and then hide it + // initialize metacode spinner and then hide it $("#metacodeImg").CloudCarousel( { titleBox: $('#metacodeImgTitle'), yRadius:40, @@ -783,6 +791,24 @@ function openLightbox(which) { $('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px' ); } +//Set max height of the search results box to prevent it from covering bottom left footer + +$(function(){ + + $(window).ready(function(){ + var h = $(window).height(); + $(".tt-dropdown-menu").css('max-height', h - 100); + }); +}); + +$(function(){ + + $(window).resize(function(){ + var h = $(window).height(); + $(".tt-dropdown-menu").css('max-height', h - 100); + }); +}); + function cancelMapCreate(id) { $('#lightbox_overlay').hide(); diff --git a/app/assets/javascripts/typeahead.js b/app/assets/javascripts/typeahead.js index 1fb987d5..e0bda832 100644 --- a/app/assets/javascripts/typeahead.js +++ b/app/assets/javascripts/typeahead.js @@ -1137,4 +1137,4 @@ } }; })(); -})(window.jQuery); \ No newline at end of file +})(window.jQuery); diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 169ac95e..079ad62f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -260,7 +260,7 @@ button.button:hover, a.button:hover, input[type="submit"]:hover { padding: 20px; border-radius: 15px; color: #000; - border:2px solid #000; + border:2px solid #000; } @@ -979,6 +979,9 @@ cursor:pointer; left:-35px !important; background: #0F1519; min-width: 440px; +width: 440px; +overflow-y: scroll; +overflow-x: hidden; } .sidebarSearch .tt-dropdown-menu h3 { @@ -1077,7 +1080,7 @@ min-width: 440px; } .sidebarSearch .resultText { - width: 250px; + width: 125px; display: block; float: left; } @@ -1104,7 +1107,7 @@ min-width: 440px; .sidebarSearch div.autoOptions { width: 122px; - float: right; + float: left; position:relative; display:none; } @@ -1148,7 +1151,7 @@ height: 20px; background: url(/assets/MMCCicon_map.png) no-repeat 0px center; background-size: 14px 14px; top: 7px; -left: 39px; +left: 38px; padding-left: 18px; font-size: 12px; line-height: 20px; @@ -1191,7 +1194,7 @@ line-height: 20px; background: white; width: auto; bottom: 0; - left: 23px; + left: 35px; color: black; white-space: nowrap; border-radius: 4px; diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index c450bdfc..a3ba3b43 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -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? @maps = Map.where(query, search).limit(5).order('"name"') 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 else @maps = [] @@ -182,7 +182,7 @@ class MainController < ApplicationController #remove "mapper:" if appended at beginning 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 @mappers = [] end From 51180056999587b4290b52fe28668722349a33e8 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Tue, 10 Jun 2014 17:43:25 -0400 Subject: [PATCH 3/4] Addition of scrollbar to search results. --- Walkthrough For Ubuntu Install | 99 ---------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 Walkthrough For Ubuntu Install diff --git a/Walkthrough For Ubuntu Install b/Walkthrough For Ubuntu Install deleted file mode 100644 index a4a4ddf2..00000000 --- a/Walkthrough For Ubuntu Install +++ /dev/null @@ -1,99 +0,0 @@ -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 *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 - -"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" - -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 :) - - - - From 3d8332056a35c328bcc7bb7469c2c84dfe4400e9 Mon Sep 17 00:00:00 2001 From: Raymon Johnstone Date: Tue, 10 Jun 2014 20:13:15 -0400 Subject: [PATCH 4/4] Addition of scrollbar to search results. --- .../javascripts/Jit/graphsettings-event-handlers.js | 4 ++-- app/assets/javascripts/application.js | 2 +- app/assets/stylesheets/application.css | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/Jit/graphsettings-event-handlers.js b/app/assets/javascripts/Jit/graphsettings-event-handlers.js index ee49e522..1d6d940b 100644 --- a/app/assets/javascripts/Jit/graphsettings-event-handlers.js +++ b/app/assets/javascripts/Jit/graphsettings-event-handlers.js @@ -1,6 +1,7 @@ function selectEdgeOnClickHandler(adj, e) { if (Mconsole.busy) return; - + + // catch right click on mac, which is often like ctrl+click if (navigator.platform.indexOf("Mac")!=-1 && e.ctrlKey) { selectEdgeOnRightClickHandler(adj, e) @@ -204,7 +205,6 @@ function selectNodeOnClickHandler(node, e) { selectNodeOnRightClickHandler(node, e) return; } - var check = nodeWasDoubleClicked(); if (check) { nodeDoubleClickHandler(node, e); diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index eed55362..1fc5456d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -160,7 +160,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, default: break; //console.log(e.which); } }); - + // initialize the search box autocomplete results var mapheader = userid ? '

Maps

' : '

Maps

'; var topicheader = userid ? '

Topics

' : '

Topics

'; diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 079ad62f..e4366d0f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1080,7 +1080,7 @@ overflow-x: hidden; } .sidebarSearch .resultText { - width: 125px; + width: 250px; display: block; float: left; } @@ -1194,7 +1194,7 @@ line-height: 20px; background: white; width: auto; bottom: 0; - left: 35px; + right: 20px; color: black; white-space: nowrap; border-radius: 4px; @@ -1205,14 +1205,14 @@ line-height: 20px; z-index:100; } .sidebarSearch .mapCount .tip,.sidebarSearch .synapseCount .tip, .sidebarSearch .topicCount .tip { - left:-3px; + right:-3px; bottom:24px; } .sidebarSearch .hoverForTip:hover .tip { display:block; } .sidebarSearch .mapContributorsIcon .mapContributors { - left:0; + right:0; bottom:21px; white-space:normal; width:200px;