diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js b/app/assets/javascripts/src/Metamaps.GlobalUI.js index 92dfa6e5..479fe654 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js @@ -484,6 +484,9 @@ Metamaps.GlobalUI.Search = { } }, close: function (closeAfter, bypass) { + // for now + return + var self = Metamaps.GlobalUI.Search; self.timeOut = setTimeout(function () { diff --git a/app/assets/javascripts/src/Metamaps.Map.js b/app/assets/javascripts/src/Metamaps.Map.js index fc06ed68..6dd63aa1 100644 --- a/app/assets/javascripts/src/Metamaps.Map.js +++ b/app/assets/javascripts/src/Metamaps.Map.js @@ -436,11 +436,25 @@ Metamaps.Map.InfoBox = { }) $('body').click(self.close) - self.attachEventListeners() - - + self.attachEventListeners() self.generateBoxHTML = Hogan.compile($('#mapInfoBoxTemplate').html()) + + var querystring = window.location.search.replace(/^\?/, '') + if (querystring == 'new') { + self.open() + window.setTimeout(self.requestMapTitle, 3000) + } + }, + requestMapTitle: function () { + var t = prompt('Please enter a name for your map. You can also set it any time using the map info panel.') + + if (t) { + Metamaps.Active.Map.set('name', t) + Metamaps.Active.Map.save() + $('#mapInfoName span').text(t) + document.title = t + ' | Metamaps' + } }, toggleBox: function (event) { var self = Metamaps.Map.InfoBox diff --git a/app/assets/javascripts/src/Metamaps.Realtime.js b/app/assets/javascripts/src/Metamaps.Realtime.js index b43a9b96..d7c7038c 100644 --- a/app/assets/javascripts/src/Metamaps.Realtime.js +++ b/app/assets/javascripts/src/Metamaps.Realtime.js @@ -93,7 +93,9 @@ Metamaps.Realtime = { }) self.room.videoAdded(self.handleVideoAdded) - self.room.chat.$container.hide() + if (!Metamaps.Active.Map) { + self.room.chat.$container.hide() + } $('body').prepend(self.room.chat.$container) } // if Metamaps.Active.Mapper }, diff --git a/app/assets/javascripts/src/Metamaps.Router.js b/app/assets/javascripts/src/Metamaps.Router.js index e80da42b..145210ba 100644 --- a/app/assets/javascripts/src/Metamaps.Router.js +++ b/app/assets/javascripts/src/Metamaps.Router.js @@ -66,7 +66,7 @@ Metamaps.GlobalUI.hideDiv('#exploreMaps') Metamaps.GlobalUI.showDiv('#yield') Metamaps.GlobalUI.Search.unlock() - Metamaps.GlobalUI.Search.close(0, true) + //Metamaps.GlobalUI.Search.close(0, true) Metamaps.Router.timeoutId = setTimeout(navigate, 500) } @@ -187,8 +187,8 @@ Metamaps.Topic.end() Metamaps.Active.Topic = null - Metamaps.GlobalUI.Search.unlock() - Metamaps.GlobalUI.Search.close(0, true) + //Metamaps.GlobalUI.Search.unlock() + //Metamaps.GlobalUI.Search.close(0, true) Metamaps.Loading.show() Metamaps.Map.end() @@ -219,8 +219,8 @@ Metamaps.Map.end() Metamaps.Active.Map = null - Metamaps.GlobalUI.Search.unlock() - Metamaps.GlobalUI.Search.close(0, true) + //Metamaps.GlobalUI.Search.unlock() + //Metamaps.GlobalUI.Search.close(0, true) Metamaps.Topic.end() Metamaps.Topic.launch(id) diff --git a/app/assets/stylesheets/clean.css.erb b/app/assets/stylesheets/clean.css.erb index 4fc87f06..947a7a18 100644 --- a/app/assets/stylesheets/clean.css.erb +++ b/app/assets/stylesheets/clean.css.erb @@ -110,8 +110,6 @@ top: 10px; left: 24px; z-index:3; - box-shadow: 0px 1px 1.5px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.24); - border-radius: 2px; } .explorePage .upperLeftUI { box-shadow: none; @@ -121,23 +119,21 @@ display:none; } .homeButton { - width: 40px; - height: 32px; - background-color: #757575; - background-image: url(<%= asset_data_uri('home_light.png') %>); - background-repeat: no-repeat; - background-position: center center; - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; float:left; + margin-right: 16px; } .homeButton:hover { - background-image: url(<%= asset_data_uri('home_light.png') %>); + } .homeButton a { display:block; - width: 40px; - height: 32px; + color: #9E9E9E; + font-family: "vinyl", sans-serif; + font-style: italic; + text-transform: uppercase; + font-weight: 400; + font-size: 30px; + line-height: 38px; } /* end upperLeftUI */ diff --git a/app/assets/stylesheets/search.scss.erb b/app/assets/stylesheets/search.scss.erb index 1d7ec7c4..8958fd05 100644 --- a/app/assets/stylesheets/search.scss.erb +++ b/app/assets/stylesheets/search.scss.erb @@ -8,20 +8,14 @@ } .unauthenticated { - .homePage .sidebarSearchIcon { - border-radius: 2px; - } - - .homePage .sidebarSearchField, - .homePage .sidebarSearch .tt-hint { - border-top-left-radius: 2px; - border-bottom-left-radius: 2px; + .homePage .sidebarSearch { + display: none; } } .sidebarSearchIcon { float: left; - width: 72px; + width: 50px; border-top-right-radius: 2px; border-bottom-right-radius: 2px; height: 32px; @@ -99,13 +93,15 @@ .sidebarSearchField { float: left; + width: 380px; + padding: 7px 10px 3px 10px; height: 20px; border-top: 1px solid #BDBDBD; border-bottom: 1px solid #BDBDBD; - border-left: none; + border-left: 1px solid #BDBDBD; border-right: none; - padding: 5px 0 5px 0; - width: 0px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; margin: 0; outline: none; font-size: 14px; @@ -117,13 +113,13 @@ .tt-hint { color: transparent; + width: 380px; + padding: 7px 10px 3px 10px; height: 20px; border-top: 1px solid #BDBDBD; border-bottom: 1px solid #BDBDBD; border-left: none; border-right: none; - padding: 5px 0 5px 0; - width: 0px; margin: 0; outline: none; font-size: 14px; diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 90d2c320..3a12cd3b 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -86,6 +86,20 @@ class MapsController < ApplicationController end end + # GET maps/new + def new + @map = Map.new(name: "Untitled Map", permission: "public", arranged: true) + authorize @map + + respond_to do |format| + format.html do + @map.user = current_user + @map.save + redirect_to(map_path(@map) + '?new') + end + end + end + # GET maps/:id def show @map = Map.find(params[:id]) diff --git a/app/views/layouts/_lightboxes.html.erb b/app/views/layouts/_lightboxes.html.erb index 8bef0921..55ca9eb6 100644 --- a/app/views/layouts/_lightboxes.html.erb +++ b/app/views/layouts/_lightboxes.html.erb @@ -100,11 +100,6 @@ - <% # this is the create new map form %> -
- <%= render :partial => 'layouts/newmap' %> -
-
<%= render :partial => 'shared/forkmap' %>
diff --git a/app/views/layouts/_lowermapelements.html.erb b/app/views/layouts/_lowermapelements.html.erb index 50e4296e..df9c76ce 100644 --- a/app/views/layouts/_lowermapelements.html.erb +++ b/app/views/layouts/_lowermapelements.html.erb @@ -8,6 +8,6 @@
<%= render :partial => 'maps/mapinfobox' %>
Map Info
-
Help
+
Help
-
\ No newline at end of file + diff --git a/app/views/layouts/_newmap.html.erb b/app/views/layouts/_newmap.html.erb deleted file mode 100644 index 5ebce204..00000000 --- a/app/views/layouts/_newmap.html.erb +++ /dev/null @@ -1,61 +0,0 @@ -<%# - # @file - # Partial view, renders a form that creates a new map. - #%> -
-<%= form_for Map.new, url: maps_url, remote: true, html: { class: "new_map", id: "new_map" } do |form|%> -

Create New Map

- -
- - <%= form.text_field :name, :maxlength => 140 %> -
-
- -
- - <%= form.text_area :desc, class: "description", :rows => 5, :cols => 43 %> -
-
- -
- -

*new topics and synapses take on the same permission as the map they are created on

-
-
-
-
- Anyone with an account can edit this map. Anyone without an account can only view it. -
-
-

COMMONS

-
-
-
-
- Only people you allow can edit this map. Anyone can view it. -
-
-

PUBLIC

-
-
-
-
- Only people you allow can edit this map. No one else can view it. -
-
-

PRIVATE

-
-
-
-

Anyone with an account can edit this map. Anyone without an account can only view it.

-
-
- -
- - -
-
-<% end %> -
diff --git a/app/views/layouts/_upperelements.html.erb b/app/views/layouts/_upperelements.html.erb index afef6415..6756522c 100644 --- a/app/views/layouts/_upperelements.html.erb +++ b/app/views/layouts/_upperelements.html.erb @@ -4,7 +4,7 @@
- <%= 'data-bypass=true' %><% end %>> + <%= 'data-bypass=true' %><% end %>>METAMAPS
@@ -39,8 +39,11 @@ <% if current_user %> -
Create New Map
-
+ +
+ Create New Map +
+
<% end %> diff --git a/config/routes.rb b/config/routes.rb index 81ef8dfe..a850459b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -34,7 +34,7 @@ Metamaps::Application.routes.draw do get 'topics/:id/relative_numbers', to: 'topics#relative_numbers', as: :relative_numbers get 'topics/:id/relatives', to: 'topics#relatives', as: :relatives - resources :maps, except: [:index, :new, :edit] + resources :maps, except: [:index, :edit] get 'maps/:id/export', to: 'maps#export' post 'maps/:id/events/:event', to: 'maps#events' get 'maps/:id/contains', to: 'maps#contains', as: :contains