Merge branch 'develop' into feature/realtime.video

This commit is contained in:
Devin Howard 2016-02-06 12:56:23 +08:00
commit 786eeae72a
10 changed files with 219 additions and 52 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@
#assety stuff
realtime/node_modules
public/assets
vendor/
#secrets and config
.env

View file

@ -25,7 +25,7 @@ git clone git@github.com:metamaps/metamaps_gen002.git
Now ensure you have VirtualBox and Vagrant installed on your computer
```
cd metamaps_gen002
./configure.sh
./bin/configure.sh
```
This will do all the setup steps to make Metamaps work with a bit of behind the scenes ninja magick.

View file

@ -379,6 +379,8 @@ Metamaps.GlobalUI.Account = {
Metamaps.GlobalUI.Search = {
locked: false,
isOpen: false,
limitTopicsToMe: false,
limitMapsToMe: false,
timeOut: null,
changing: false,
optionsInitialized: false,
@ -462,7 +464,7 @@ Metamaps.GlobalUI.Search = {
var self = Metamaps.GlobalUI.Search;
self.timeOut = setTimeout(function () {
if (!self.locked && !self.changing && self.isOpen && (bypass || $('.sidebarSearchField').val() == '')) {
if (!self.locked && !self.changing && self.isOpen && (bypass || $('.sidebarSearchField.tt-input').val() == '')) {
self.changing = true;
$('.sidebarSearchField, .sidebarSearch .tt-hint').css({
padding: '7px 0 3px 0',
@ -493,7 +495,7 @@ Metamaps.GlobalUI.Search = {
display: function(s) { return s.label; },
templates: {
notFound: function(s) {
return Hogan.compile($('#topicSearchTemplate').html()).render({
return Hogan.compile(topicheader + $('#topicSearchTemplate').html()).render({
value: "No results",
label: "No results",
typeImageURL: "<%= asset_path('icons/wildcard.png') %>",
@ -512,7 +514,7 @@ Metamaps.GlobalUI.Search = {
url: '/search/topics',
prepare: function(query, settings) {
settings.url += '?term=' + query;
if (Metamaps.Active.Mapper && $("#limitTopicsToMe").is(':checked')) {
if (Metamaps.Active.Mapper && self.limitTopicsToMe) {
settings.url += "&user=" + Metamaps.Active.Mapper.id.toString();
}
return settings;
@ -527,7 +529,7 @@ Metamaps.GlobalUI.Search = {
display: function(s) { return s.label; },
templates: {
notFound: function(s) {
return Hogan.compile($('#mapSearchTemplate').html()).render({
return Hogan.compile(mapheader + $('#mapSearchTemplate').html()).render({
value: "No results",
label: "No results",
rtype: "noresult"
@ -545,7 +547,7 @@ Metamaps.GlobalUI.Search = {
url: '/search/maps',
prepare: function(query, settings) {
settings.url += '?term=' + query;
if (Metamaps.Active.Mapper && $("#limitMapsToMe").is(':checked')) {
if (Metamaps.Active.Mapper && self.limitMapsToMe) {
settings.url += "&user=" + Metamaps.Active.Mapper.id.toString();
}
return settings;
@ -560,7 +562,7 @@ Metamaps.GlobalUI.Search = {
display: function(s) { return s.label; },
templates: {
notFound: function(s) {
return Hogan.compile($('#mapperSearchTemplate').html()).render({
return Hogan.compile(mapperheader + $('#mapperSearchTemplate').html()).render({
value: "No results",
label: "No results",
rtype: "noresult",
@ -596,6 +598,12 @@ Metamaps.GlobalUI.Search = {
self.hideLoader();
var h = $(window).height();
$(".tt-dropdown-menu").css('max-height', h - 100);
if (self.limitTopicsToMe) {
$('#limitTopicsToMe').prop('checked', true);
}
if (self.limitMapsToMe) {
$('#limitMapsToMe').prop('checked', true);
}
});
$(window).resize(function () {
var h = $(window).height();
@ -611,11 +619,10 @@ Metamaps.GlobalUI.Search = {
});
// make sure that when you click on 'limit to me' or 'toggle section' it works
$('.sidebarSearchField').bind('typeahead:change', function(){
if ($(this).val() === "") {
$('.sidebarSearchField.tt-input').keyup(function(){
if ($('.sidebarSearchField.tt-input').val() === '') {
self.hideLoader();
}
else {
} else {
self.showLoader();
}
});
@ -642,29 +649,29 @@ Metamaps.GlobalUI.Search = {
var self = Metamaps.GlobalUI.Search;
function toggleResultSet(set) {
var s = $('.tt-dataset-' + set + ' .tt-dataset');
if (s.css('height') == '0px') {
s.css({
'height': 'auto',
'overflow': 'visible'
});
$(this).removeClass('maximizeResults').addClass('minimizeResults');
} else {
s.css({
'height': '0',
'overflow': 'hidden'
});
var s = $('.tt-dataset-' + set + ' .tt-suggestion, .tt-dataset-' + set + ' .resultnoresult');
if (s.is(':visible')) {
s.hide();
$(this).removeClass('minimizeResults').addClass('maximizeResults');
} else {
s.show();
$(this).removeClass('maximizeResults').addClass('minimizeResults');
}
}
$('.limitToMe').unbind().bind("change", function (e) {
// set the value of the search equal to itself to retrigger the autocomplete event
self.isOpen = false;
$('.sidebarSearchField').typeahead('val', $('.sidebarSearchField').val());
setTimeout(function () {
self.isOpen = true;
}, 2000);
if ($(this).attr('id') == 'limitTopicsToMe') {
self.limitTopicsToMe = !self.limitTopicsToMe;
}
if ($(this).attr('id') == 'limitMapsToMe') {
self.limitMapsToMe = !self.limitMapsToMe;
}
// set the value of the search equal to itself to retrigger the
// autocomplete event
var searchQuery = $('.sidebarSearchField.tt-input').val();
$(".sidebarSearchField").typeahead('val', '')
.typeahead('val', searchQuery);
});
// when the user clicks minimize section, hide the results for that section

View file

@ -67,6 +67,14 @@
width: 100%;
}
.resultnoresult {
padding: 8px 0;
> div {
display: table-cell;
vertical-align: middle;
}
}
.canEditMap button.addToMap {
display: block;
}
@ -128,6 +136,7 @@
top: 40px !important;
background: #F5F5F5;
width: 472px;
max-height: 25em;
overflow-y: auto;
overflow-x: visible;
box-shadow: 0 10px 10px rgba(0,0,0,0.19), 0 6px 3px rgba(0,0,0,0.23);
@ -219,15 +228,14 @@
font-style: italic;
font-family: helvetica, sans-serif;
}
.topicMetacode,
.searchResIconWrapper {
vertical-align: middle;
padding: 0 0 0 8px;
width: 70px;
}
}/* tt-suggestion */
.searchResIconWrapper {
vertical-align: middle;
width: 70px;
padding: 0 18px 0 28px;
}
.tt-dataset {
overflow: visible;
}
@ -242,8 +250,12 @@
.topicIcon {
width: 32px;
height: 32px;
margin: 0 auto;
}
.resulttopic .topicIcon {
margin: 0 auto
}
.metacodeTip {
display: none;
margin: 0 auto;
@ -313,7 +325,7 @@
.tt-suggestion:hover .autoOptions {
display: block;
}
.tt-suggestion .resultnoresult .autoOptions {
.resultnoresult .autoOptions {
display: none;
}

View file

@ -97,7 +97,7 @@
<script type="text/template" id="topicSearchTemplate">
<div class="result{{rtype}}">
<div class="topicMetacode">
<div class="topicMetacode searchResIconWrapper">
<img src="{{typeImageURL}}" class="topicIcon" />
<div class="metacodeTip">{{type}}</div>
</div>

View file

@ -14,4 +14,4 @@ vagrant ssh --command "cd /vagrant; bundle install";
vagrant ssh --command "cd /vagrant; cp .example-env .env";
# Rake all the things
vagrant ssh --command "cd /vagrant; rake db:create; rake db:schema:load; rake db:fixtures:load"
vagrant ssh --command "cd /vagrant; rake db:create; rake db:setup"

View file

@ -4,8 +4,11 @@
#sudo aptitude -q -y install libpq-dev
source "$HOME/.rvm/scripts/rvm"
rvm install $(cat .ruby-version)
rvm gemset use $(cat .ruby-gemset)
rvm use $(cat .ruby-version) || \
rvm install $(cat .ruby-version)
rvm gemset use $(cat .ruby-gemset) || \
rvm gemset create $(cat .ruby-gemset) && \
rvm gemset use $(cat .ruby-gemset)
gem install bundler
set -x

16
lib/tasks/perms.rake Normal file
View file

@ -0,0 +1,16 @@
require 'dotenv/tasks'
namespace :perms do
desc "Update the Unix permissions on the public directory"
task :fix => :environment do
# e.g. rake perms:fix user=mmstaging group=mmstaging
# e.g. rake perms:fix group=www-data #probably don't need this one
# e.g. rake perms:fix
user = ENV['user'] || 'metamaps'
group = ENV['group'] || 'metamaps'
public_dir = Rails.root.join('public').to_s
system "chown -R #{user}:#{group} #{public_dir}"
system "find #{public_dir} -type d -exec chmod 755 '{}' \\;"
system "find #{public_dir} -type f -exec chmod 644 '{}' \\;"
end
end

View file

@ -26,16 +26,16 @@
}
body {
background: #d8d9da url(https://s3.amazonaws.com/metamaps-assets/site/shattered_%402X.png);
font-family: 'din-regular', helvetica, sans-serif;
color: #424242;
text-align: justify;
font-size: 18px;
line-height: 18px;
}
.dialog a {
color:#c04f4f;
}
background: #d8d9da url(https://s3.amazonaws.com/metamaps-assets/site/shattered_%402X.png);
font-family: 'din-regular', helvetica, sans-serif;
color: #424242;
text-align: justify;
font-size: 18px;
line-height: 18px;
}
.dialog a {
color:#c04f4f;
}
.title{
font-size:50px;
line-height: 50px;

128
public/503.html Normal file
View file

@ -0,0 +1,128 @@
<!DOCTYPE html>
<html>
<head>
<title>Down for maintenance (503)</title>
<style type="text/css">
@font-face {
font-family: 'din-medium';
src: url('/assets/Fonts/din.eot');
src: url('/assets/Fonts/din.eot?#iefix') format('embedded-opentype'),
url('/assets/Fonts/din.woff') format('woff'),
url('/assets/Fonts/din.ttf') format('truetype'),
url('/assets/Fonts/din.svg#din-medium') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'din-regular';
src: url('/assets/Fonts/din-reg.eot');
src: url('/assets/Fonts/din-reg.eot?#iefix') format('embedded-opentype'),
url('/assets/Fonts/din-reg.woff') format('woff'),
url('/assets/Fonts/din-reg.ttf') format('truetype'),
url('/assets/Fonts/din-reg.svg#din-reg') format('svg');
font-weight: normal;
font-style: normal;
}
body {
background: #d8d9da url(https://s3.amazonaws.com/metamaps-assets/site/shattered_%402X.png);
font-family: 'din-regular', helvetica, sans-serif;
color: #424242;
text-align: justify;
font-size: 18px;
line-height: 18px;
}
.dialog a {
color:#c04f4f;
}
.title{
font-size:50px;
line-height: 50px;
text-align: left;
font-family: 'din-medium', helvetica, sans-serif;
text-transform: uppercase;
margin-bottom: 24px;
}
div.dialog {
width: 380px;
border: 0px;
border-right-color: #999;
border-bottom-color: #999;
float: left;
margin-right: 50px;
padding-top: 70px;
padding-bottom: 70px;
}
.picture {
width: 450px;
height: 450px;
border: 10px solid #424242;
border-radius: 225px;
-webkit-border-radius: 225px;
-moz-border-radius: 225px;
background: url(https://s3.amazonaws.com/metamaps-assets/site/monkeyselfie.jpg) no-repeat;
float: left;
background-position:50% 20%;
background-size: 100%;
margin-top: 110px;
}
.wrapper {
margin: 0 auto;
width: 900px;
}
.button {
display: block;
width: 220px;
height: 14px;
padding: 16px 0;
margin-bottom: 16px;
text-align: center;
border-radius: 2px;
font-size: 14px;
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 !important;
cursor: pointer;
}
.blogCTA {
background-color: #4fc059;
}
.blogCTA:hover {
background-color: #49ad4e;
}
.exploreFeaturedCTA {
background-color: #a354cd;
margin-bottom: 16px;
}
.exploreFeaturedCTA:hover {
background-color: #9150bc;
}
</style>
</head>
<body>
<!-- This file lives in public/503.html -->
<div class="wrapper">
<div class="dialog">
<h1 class="title">503 - Down for Maintenance</h1>
<p>Metamaps is offline!</p>
<p>Don't worry, this is intentional. We're probably just turning on some great new features.</p>
<p>In the meantime, you can visit our blog, or aimlessly search YouTube until we're back online.</p>
<a href="https://twitter.com/metamapps" class="button blogCTA">GO TO OUR TWITTER FEED</a>
<a href="http://blog.metamaps.cc" class="button blogCTA">GO TO OUR BLOG</a>
</div>
<div class="picture">
</div>
</div>
</body>
</html>