Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hotsh/rstat.us
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Mar 28, 2011
2 parents f5fec48 + face850 commit 7286e93
Show file tree
Hide file tree
Showing 37 changed files with 65 additions and 74 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ gem "whatlanguage"
gem "tzinfo"

group :development, :test do
gem "minitest", :platforms => :ruby_18
gem "minitest", :platforms => :ruby_18
gem 'coffee-script'
gem 'rack-test'
gem "database_cleaner"
gem "factory_girl"
gem "capybara"
gem "minitest", :platforms => :ruby_18
gem "rocco"
gem "pygmentize"
gem "mocha"
gem "minitest", :platforms => :ruby_18
gem "jammit"
end
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GEM
celerity (0.8.8)
childprocess (0.1.8)
ffi (~> 1.0.6)
closure-compiler (1.1.1)
coffee-script (2.2.0)
coffee-script-source
execjs
Expand All @@ -46,6 +47,9 @@ GEM
haml (3.0.25)
hashie (1.0.0)
i18n (0.5.0)
jammit (0.6.0)
closure-compiler (>= 0.1.0)
yui-compressor (>= 0.9.1)
jnunemaker-validatable (1.8.4)
activesupport (>= 2.3.4)
json_pure (1.5.1)
Expand Down Expand Up @@ -184,6 +188,7 @@ GEM
whatlanguage (1.0.0)
xpath (0.1.3)
nokogiri (~> 1.3)
yui-compressor (0.9.4)

PLATFORMS
ruby
Expand All @@ -198,6 +203,7 @@ DEPENDENCIES
factory_girl
haml
i18n
jammit
minitest
mocha
mongo_mapper
Expand Down
15 changes: 15 additions & 0 deletions config/assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
embed_assets: on
gzip_assets: off

stylesheets:
screen:
- public/assets/s/screen.css

javascripts:
app:
- public/js/jquery.equalHeights.js
- public/js/home.js
- public/js/app.js
- public/js/update.js
- public/js/updates.show.js
- public/js/users.js
15 changes: 10 additions & 5 deletions models/author.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ def display_name
def valid_gravatar?
return unless email

ret = nil
Net::HTTP.start(GRAVATAR_HOST, 80) do |http|
# Use HEAD instead of GET for SPEED!
ret = http.head(gravatar_path).is_a?(Net::HTTPOK)
begin
ret = nil
Net::HTTP.start(GRAVATAR_HOST, 80) do |http|
# Use HEAD instead of GET for SPEED!
ret = http.head(gravatar_path).is_a?(Net::HTTPOK)
end
return ret
rescue
# No internet connection
false
end
return ret
end

def gravatar_url
Expand Down
1 change: 1 addition & 0 deletions public/assets/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/assets/s/screen.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/assets/screen-datauri.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/assets/screen.css

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed public/images/share.png
Binary file not shown.
9 changes: 0 additions & 9 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@
return $("#flash").delay(2000).slideUp('slow');
});
}).call(this);

function focusOnDiv( divId )
{
divElement = document.getElementById( divId );
if(divElement!= null && typeof(divElement) != 'undefined')
{
divElement.focus();
}
}
Empty file removed public/js/jquery.selectionRange.js
Empty file.
1 change: 0 additions & 1 deletion public/s/screen.css

This file was deleted.

5 changes: 0 additions & 5 deletions src/app.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
$(document).ready ->
$("#flash").delay(2000).slideUp('slow')

function focusOnDiv(divId)
divElement: document.getElementById(divId)
if divElement != null and typeofdivElement != "undefined"
divElement.focus()
11 changes: 8 additions & 3 deletions tasks/coffee.rake
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# coffee-script tasks
begin
require 'coffee-script'
require 'jammit'

namespace :js do
namespace :assets do
desc "compile coffee-scripts from ./src to ./public/js"
task :compile do
source = "#{File.dirname(__FILE__)}/../src/"
javascripts = "#{File.dirname(__FILE__)}/../public/js/"

sh "compass compile views/screen.scss --output-style compressed --css-dir public/assets"

Dir.foreach(source) do |cf|
unless cf == '.' || cf == '..'
js = CoffeeScript.compile File.read("#{source}#{cf}")
open "#{javascripts}#{cf.gsub('.coffee', '.js')}", 'w' do |f|
f.puts js
end
end
end
end

Jammit.package!
end
end
rescue LoadError
warn "#$! -- coffee-script tasks not loaded."
warn "#$! -- error compiling assets."
end
5 changes: 0 additions & 5 deletions tasks/scss.rake

This file was deleted.

12 changes: 9 additions & 3 deletions views/_head.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
%meta{:charset => "utf-8"}
%title= locals[:title].nil? ? "rstat.us": "rstat.us - #{locals[:title]}"
%script{:src=>"https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"}
%script{:src => "/js/app.js"}
%link{:href => "/s/screen.css", :media => "screen", :rel => "stylesheet"}

%script{:src => "/assets/app.js"}

<!--[if (!IE)|(gte IE 8)]><!-->
%link{:href => "/assets/screen-datauri.css", :media => "screen", :rel => "stylesheet"}
<!--<![endif]-->
<!--[if lte IE 7]>
<link href="assets/screen.css" media="screen" rel="stylesheet" type="text/css" />
<![endif]-->

!= yield_content :css

- if production?
Expand Down
3 changes: 0 additions & 3 deletions views/_updates.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@
- if updates.empty?
.empty
There's no updates here yet

- content_for :javascript do
%script{:src=>"/js/updates.show.js"}
3 changes: 0 additions & 3 deletions views/dashboard.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- content_for :top do
!= haml :_update_form

- content_for :javascript do
%script{:src => "/js/update.js"}

!= haml :_navigation
#timeline.updates
!= haml :_updates, :locals => {:updates => @updates}
Expand Down
3 changes: 0 additions & 3 deletions views/hashtags.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- content_for :top do
!= haml :_update_form

- content_for :javascript do
%script{:src => "/js/update.js"}

!= haml :_navigation
#timeline.updates
!= haml :_updates, :locals => {:updates => current_user.timeline}
Expand Down
4 changes: 0 additions & 4 deletions views/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,3 @@
Join the conversation

!= haml :footer

- content_for :javascript do
%script{:src => "/js/jquery.equalHeights.js"}
%script{:src => "/js/home.js"}
3 changes: 0 additions & 3 deletions views/replies.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
- content_for :top do
!= haml :_update_form

- content_for :javascript do
%script{:src => "/js/update.js"}

!= haml :_navigation
#replies.updates
!= haml :_updates, :locals => {:updates => @replies}
Expand Down
2 changes: 1 addition & 1 deletion views/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Use the following command:
rake css:compile
rake assets:compile
Do not edit screen.css manually!
Expand Down
4 changes: 2 additions & 2 deletions views/stylesheets/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#left {
#logo {
h2 {
@include image-replaced("../images/logo-sm.png", 159px, 45px)
@include image-replaced("/images/embed/logo-sm.png", 159px, 45px)
}
}

Expand Down Expand Up @@ -497,7 +497,7 @@ form#update-form {
cursor: pointer;
float: right;
border: none;
@include image-replaced('../images/trash.png', 13px, 16px)
@include image-replaced('/images/embed/trash.png', 13px, 16px)
}

.end-links {
Expand Down
8 changes: 4 additions & 4 deletions views/stylesheets/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body#home {
a {
margin-left: 1em;
display: block;
@include image-replaced("../images/logo.png", 348px, 100px);
@include image-replaced("/images/embed/logo.png", 348px, 100px);
}
}
#login {
Expand Down Expand Up @@ -47,16 +47,16 @@ body#home {
}

#col-1 {
background: url('../images/slide1.png') center bottom no-repeat;
background: url('/images/slide1.png') center bottom no-repeat;
&:hover {
text-decoration: none;
}
}
#col-2 {
background: url('../images/slide2.png') center bottom no-repeat;
background: url('/images/slide2.png') center bottom no-repeat;
}
#col-3 {
background: url('../images/slide3.png') center bottom no-repeat;
background: url('/images/slide3.png') center bottom no-repeat;
}
.last-col {
border: none;
Expand Down
2 changes: 1 addition & 1 deletion views/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ body#home {
#logo {
float: left;
a {
@include image-replaced("../images/logo-xs.png", 71px, 20px)
@include image-replaced("/images/embed/logo-xs.png", 71px, 20px)
}
}
ul {
Expand Down
4 changes: 2 additions & 2 deletions views/stylesheets/lib/css3buttons.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.button { display: inline-block; padding: 7px 9px; font-size: 12px; line-height:1; color: #3C3C3D; text-shadow: 1px 1px 0 #FFFFFF; background: #ECECEC url('/images/css3buttons_backgrounds.png') 0 0 no-repeat; white-space: nowrap; overflow: visible; cursor: pointer; text-decoration: none; border: 1px solid #CACACA; -webkit-border-radius: 2px; -moz-border-radius: 2px; -webkit-background-clip: padding-box; border-radius: 2px; outline: none; position: relative; zoom: 1; *display: inline; }
.button { display: inline-block; padding: 7px 9px; font-size: 12px; line-height:1; color: #3C3C3D; text-shadow: 1px 1px 0 #FFFFFF; background: #ECECEC url('/images/embed/css3buttons_backgrounds.png') 0 0 no-repeat; white-space: nowrap; overflow: visible; cursor: pointer; text-decoration: none; border: 1px solid #CACACA; -webkit-border-radius: 2px; -moz-border-radius: 2px; -webkit-background-clip: padding-box; border-radius: 2px; outline: none; position: relative; zoom: 1; *display: inline; }
.button.primary { font-weight: bold }
.button:hover { color: #FFFFFF; border-color: #4c9092; text-decoration: none; text-shadow: -1px -1px 0 rgba(0,0,0,0.3); background-position: 0 -40px; background-color: #378284; }
.button:active,
Expand All @@ -15,7 +15,7 @@
.button.middle:active,
.button.right:active { top: 0px }
.button.big { font-size: 16px; padding: 7px 16px; }
.button span.icon { display: inline-block; width: 12px; height: 12px; margin: auto 4px auto auto; position: relative; top: 1px; background-image: url('/images/css3buttons_icons.png'); background-repeat: no-repeat; }
.button span.icon { display: inline-block; width: 12px; height: 12px; margin: auto 4px auto auto; position: relative; top: 1px; background-image: url('/images/embed/css3buttons_icons.png'); background-repeat: no-repeat; }
a.big.button span.icon { top: 0px }
.button span.icon.book { background-position: 0 0 }
.button:hover span.icon.book { background-position: 0 -15px }
Expand Down
3 changes: 0 additions & 3 deletions views/updates/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@
%form{:method => "post", :action => "/updates/#{@update.id}"}
%input{:type => "hidden", :name => "_method", :value => "delete"}
%input.remove-update{:type => "submit", :value => "I Regret This"}

- content_for :javascript do
%script{:src=>"/js/updates.show.js"}
3 changes: 0 additions & 3 deletions views/users/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@
- unless @next_page.nil?
%a.button{:href => @next_page, :id => "next_button"}
Next &raquo;

- content_for :javascript do
%script{:src=>"/js/users.js"}
3 changes: 0 additions & 3 deletions views/users/list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@
- unless @next_page.nil?
%a.button{:href => @next_page, :id => "next_button"}
Next &raquo;

- content_for :javascript do
%script{:src=>"/js/users.js"}
3 changes: 0 additions & 3 deletions views/users/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@
- unless @next_page.nil?
%a.button{:href => @next_page, :id => "next_button"}
Next &raquo;

- content_for :javascript do
%script{:src=>"/js/users.js"}
3 changes: 0 additions & 3 deletions views/world.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- content_for :top do
!= haml :_update_form

- content_for :javascript do
%script{:src => "/js/update.js"}

!= haml :_navigation
#world.updates
!= haml :_updates, :locals => {:updates => @updates}
Expand Down

0 comments on commit 7286e93

Please sign in to comment.