diff --git a/app/assets/javascripts/Jit/ForceDirected/metamapFD.js b/app/assets/javascripts/Jit/ForceDirected/metamapFD.js index d3b4bcb0..f944a5e2 100644 --- a/app/assets/javascripts/Jit/ForceDirected/metamapFD.js +++ b/app/assets/javascripts/Jit/ForceDirected/metamapFD.js @@ -222,7 +222,7 @@ function initFD(){ node.eachAdjacency(function(adj) { adj.setDataset('end', { lineWidth: 3, - color: '#36acfb' + color: '#FFF' }); }); } else { diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 48d26acf..8a410406 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -43,21 +43,83 @@ } }); - var sliding = false; - $(".legend").hover( + + // controls the sliding hover of the filters + var sliding1 = false; + $(".accountWrap").hover( function () { - if (! sliding) { - sliding = true; - $("#iconLegend ul").slideDown('slow', function() { - sliding = false; + if (! sliding1) { + sliding1 = true; + $(".account").slideDown('slow', function() { + sliding1 = false; }); } }, function () { - if (! sliding) { - sliding = true; + if (! sliding1) { + sliding1 = true; + $(".account").slideUp('slow', function() { + sliding1 = false; + }); + } + } + ); + + var sliding2 = false; + $(".createWrap").hover( + function () { + if (! sliding2) { + sliding2 = true; + $(".create").slideDown('slow', function() { + sliding2 = false; + }); + } + }, + function () { + if (! sliding2) { + sliding2 = true; + $(".create").slideUp('slow', function() { + sliding2 = false; + }); + } + } + ); + + var sliding3 = false; + $(".exploreWrap").hover( + function () { + if (! sliding3) { + sliding3 = true; + $(".explore").slideDown('slow', function() { + sliding3 = false; + }); + } + }, + function () { + if (! sliding3) { + sliding3 = true; + $(".explore").slideUp('slow', function() { + sliding3 = false; + }); + } + } + ); + + var sliding4 = false; + $(".legend").hover( + function () { + if (! sliding4) { + sliding4 = true; + $("#iconLegend ul").slideDown('slow', function() { + sliding4 = false; + }); + } + }, + function () { + if (! sliding4) { + sliding4 = true; $("#iconLegend ul").slideUp('slow', function() { - sliding = false; + sliding4 = false; }); } } diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index cda002d1..f27cb8f4 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -61,7 +61,7 @@ input[type="submit"] { margin-top:5px; } .nodemargin { padding-top:120px; } -.focus { position:fixed; top:0; left:0; width:90%; z-index:10; display: block; min-width:533px; margin: 50px 50px 25px 50px; background: url('bg.png'); border-radius: 20px; color:#000; border:1px solid #000; } +.focus { position:fixed; top:0; left:0; width:90%; z-index:2; display: block; min-width:533px; margin: 50px 50px 25px 50px; background: url('bg.png'); border-radius: 20px; color:#000; border:1px solid #000; } .focus h1 { margin-top:0; } .focusleft, .focusmiddle, .focusright { display:block; float:left; } .focusleft { width:20%; min-width:70px; text-align:center; } @@ -79,6 +79,34 @@ input[type="submit"] { margin-top:5px; } .divider { margin: 20px 50px 20px 50px; border-bottom:2px solid #FFF; } .empty { margin-left:50px; } +#menus { margin-right:15px; } +.accountWrap, .createWrap, .exploreWrap { display:block; position:relative; cursor: pointer;} + +#menus .account, #menus .create, #menus .explore { display:none; position:absolute; right:0; z-index:12; width:auto; color: #67AF9F; +white-space: nowrap; +text-align: center; +font-size: 16px; +overflow: hidden; +padding: 3px 8px; +margin: 0; +border: 2px solid #AAA; +background: white; +border-radius: 6px; +-webkit-border-radius: 6px; +-moz-border-radius: 6px; +box-shadow: 0 2px rgba(0, 0, 0, 0.05), 0 -2px rgba(0, 0, 0, 0.05) inset; +-webkit-box-shadow: 0 2px rgba(0, 0, 0, 0.05), 0 -2px rgba(0, 0, 0, 0.05) inset; +-moz-box-shadow: 0 2px rgba(0, 0, 0, 0.05), 0 -2px rgba(0, 0, 0, 0.05) inset; +background: -moz-linear-gradient( center top, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.03) 0% ) repeat scroll 0 0 white; +background: -webkit-gradient( linear, 0% 0%, 0% 100%, from(white), to(rgba(0, 0, 0, 0.03)), color-stop(0.5, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(0, 0, 0, 0.03)) ) repeat scroll 0 0 white; +border: 1px solid rgba(0, 0, 0, 0.2); +} + +#menus ul li { margin:0; clear:both; float:none; list-style-type:none; display:block; padding:3px; text-align:center; border-top:1px solid #999; } +#menus ul li.first { border:none; } +#menus ul li a:hover { color:#2d6a5d; } +#menus ul li a { color: #67AF9F; display:block; } + /* --- styling the filter ---*/ .legend { position:fixed; bottom:10px; right:15px; z-index:12; display:block; width:auto; color: #67AF9F; diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 682b8e5e..a333b8f3 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -3,7 +3,21 @@ class MainController < ApplicationController respond_to :html, :js, :json - def home + #homepage pick a random map and show it + def samplemap + @current = current_user + @maps = Map.visibleToUser(@current, nil) + @map = @maps.sample + + @mapjson = @map.self_as_json(@current).html_safe + + respond_to do |format| + format.html { respond_with(@map, @user) } + format.json { respond_with(@mapjson) } + end + end + + def metamap @current = current_user @item = Item.visibleToUser(@current, nil).first @@ -23,5 +37,6 @@ class MainController < ApplicationController format.html { respond_with(@maps) } end end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 67baa140..a431a13f 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -21,9 +21,11 @@ class SessionsController < ApplicationController @session = Session.create(params[:session]) @user = User.new + + @connor = User.find(555629996) + @map = Map.find(5) - respond_with(@user, @session, location: root_url) do |format| - + respond_with(@user, @session, location: user_map_url(@connor,@map)) do |format| end end @@ -33,7 +35,7 @@ class SessionsController < ApplicationController @session.destroy respond_to do |format| - format.html { respond_with(@session, location: root_url) } + format.html { respond_with(@session, location: maps_url) } end end diff --git a/app/views/items/_item.html.erb b/app/views/items/_item.html.erb index 22035d19..169f4213 100644 --- a/app/views/items/_item.html.erb +++ b/app/views/items/_item.html.erb @@ -1,5 +1,5 @@ <%= div_for item, class: item.item_category.name do %> - <% if @user %><%= link_to 'Delete', user_item_path(@user,item), :class => 'delete', :confirm => 'Delete this topic and all synapses linking to it?', :method => :delete, :remote => true%><% end %> + <% if item.user == user %><%= link_to 'Delete', user_item_path(@user,item), :class => 'delete', :confirm => 'Delete this topic and all synapses linking to it?', :method => :delete, :remote => true%><% end %>
<%= item.item_category.name %>
<%= image_tag item.item_category.icon, :class => 'icon', :size => '50x50' %> <%= link_to item.name, user_item_path(@user, item), :class => 'title' %> diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb index eb13810b..e4e6eba1 100644 --- a/app/views/items/show.html.erb +++ b/app/views/items/show.html.erb @@ -4,7 +4,7 @@ <%= image_tag @item.item_category.icon, :class => 'icon', :size => '50x50' %><%= @item.desc %>
Shucks, there is nothing in metamaps.
+<% end %> + +<% if authenticated? %> + <%= render :partial => 'items/new' %> + <%= render :partial => 'synapses/new' %> +<% end %> + diff --git a/app/views/main/samplemap.html.erb b/app/views/main/samplemap.html.erb new file mode 100644 index 00000000..d808b248 --- /dev/null +++ b/app/views/main/samplemap.html.erb @@ -0,0 +1,34 @@ +
# of Topics: <%= @map.items.count %>
+# of Synapses: <%= @map.synapses.count %>
+<%= @map.desc %>
+Permissions:<%= @map.permission %>
<%= map.desc %>
# of Topics: <%= map.items.count %>
# of Synapses: <%= map.synapses.count %>
Permissions:<%= map.permission %>
# of Synapses: <%= @map.synapses.count %>
<%= @map.desc %>