RS, merged publisher refactor
|
|
@ -37,4 +37,15 @@ module ApplicationHelper
|
|||
link_to person.real_name, person_url(person)
|
||||
end
|
||||
|
||||
def owner_picture
|
||||
default = "#{root_url}images/user/default.jpg"
|
||||
image = "#{root_url}images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg"
|
||||
|
||||
if File.exist?("public/images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg")
|
||||
image_tag image, :id => "user_picture"
|
||||
else
|
||||
image_tag default, :id => "user_picture"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
%h3 your friends
|
||||
%ul#friend_stream
|
||||
%ul#friend_stream.nav
|
||||
- for friend in @friends
|
||||
= link_to friend.real_name, friend_path(friend)
|
||||
%br
|
||||
%br
|
||||
%hr
|
||||
= link_to "add a new friend", new_friend_path
|
||||
%li= link_to friend.real_name, friend_path(friend)
|
||||
/= link_to "add a new friend", new_friend_path
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
:javascript
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-17207587-1']);
|
||||
_gaq.push(['_setDomainName', '#{root_url}']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
|
@ -5,14 +5,12 @@
|
|||
= "diaspora "
|
||||
= "- #{User.first.real_name}" if User.first
|
||||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
||||
%meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" }
|
||||
|
||||
= stylesheet_link_tag "blueprint/screen", :media => 'screen'
|
||||
= stylesheet_link_tag "application"
|
||||
/= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
|
||||
= javascript_include_tag 'jquery142', 'rails', 'view', 'publisher'
|
||||
= javascript_include_tag 'jquery142', 'rails', 'view', 'publisher', 'google_a'
|
||||
= javascript_include_tag 'tiny_mce/tiny_mce', 'jquery.infieldlabel'
|
||||
= render 'js/google_a_js'
|
||||
= render 'js/websocket_js'
|
||||
|
||||
= csrf_meta_tag
|
||||
|
|
@ -44,18 +42,16 @@
|
|||
= link_to User.first.real_name, root_url
|
||||
%span.description
|
||||
= my_latest_message
|
||||
|
||||
#content.span-24.last
|
||||
.span-5.append-1.last
|
||||
= link_to (image_tag "/images/user_picture.jpg", :id => "user_picture"), root_path
|
||||
|
||||
%ul#stream_filters
|
||||
%a{ :href => status_messages_path, :title => "Recent status messages."}
|
||||
%li status messages
|
||||
%a{ :href => bookmarks_path, :title => "Recently shared links."}
|
||||
%li bookmarks
|
||||
%a{ :href => blogs_path, :title => "Recent blog posts."}
|
||||
%li blogs
|
||||
= link_to owner_picture, root_path
|
||||
%ul#stream_filters.nav
|
||||
%li= link_to "status messages", status_messages_path
|
||||
%li= link_to "bookmarks", bookmarks_path
|
||||
%li= link_to "blogs", blogs_path
|
||||
= render 'friends/sidebar' if user_signed_in?
|
||||
|
||||
.span-18
|
||||
= yield
|
||||
= render "posts/debug"
|
||||
|
|
|
|||
|
|
@ -32,20 +32,19 @@
|
|||
|
||||
.selected {
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-top: 1px solid #333;
|
||||
-webkit-box-shadow: 0 2px 1px #fff;
|
||||
background-color: rgba( 255, 255, 255, 0.5);
|
||||
-webkit-box-shadow: 0 2px 1px #fff;
|
||||
-moz-box-shadow: 0 2px 1px #fff;
|
||||
}
|
||||
|
||||
#publisher
|
||||
%ul#publisher_content_pickers
|
||||
%a{ :class => "status_message", :href => '#', :title => "new status message."}
|
||||
%li{ :class => "selected" } status message
|
||||
%a{ :class => "bookmark", :href => '#', :title => "new bookmark."}
|
||||
%li bookmark
|
||||
%a{ :class => "blog", :href => '#', :title => "new blog post."}
|
||||
%li blog
|
||||
%li{ :class => "status_message selected" }= link_to "status message", "#"
|
||||
%li{ :class => "bookmark" }= link_to "bookmark", "#"
|
||||
%li{ :class => "blog" }= link_to "blog", "#"
|
||||
|
||||
#publisher_form
|
||||
= form_for StatusMessage.new, :remote => true do |f|
|
||||
|
|
|
|||
|
|
@ -2,4 +2,6 @@
|
|||
|
||||
require ::File.expand_path('../config/environment', __FILE__)
|
||||
#use Rack::FiberPool
|
||||
require 'lib/chrome_frame'
|
||||
use Rack::ChromeFrame
|
||||
run Diaspora::Application
|
||||
|
|
|
|||
|
|
@ -48,10 +48,46 @@ def create(backer_number, password)
|
|||
["Lyndon B.", "Johnson"],
|
||||
["Richard", "Nixon"]
|
||||
]
|
||||
pin =[5072,
|
||||
3742,
|
||||
7782,
|
||||
2691,
|
||||
6133,
|
||||
7558,
|
||||
8670,
|
||||
1559,
|
||||
5404,
|
||||
6431,
|
||||
1957,
|
||||
5323,
|
||||
8784,
|
||||
4267,
|
||||
8891,
|
||||
2324,
|
||||
6948,
|
||||
8176,
|
||||
6928,
|
||||
5677,
|
||||
7966,
|
||||
2893,
|
||||
6828,
|
||||
2982,
|
||||
6756,
|
||||
6658,
|
||||
3551,
|
||||
3088,
|
||||
8379,
|
||||
7493,
|
||||
2759,
|
||||
1029,
|
||||
4013,
|
||||
8507,
|
||||
1508,
|
||||
5258]
|
||||
|
||||
# Create seed user
|
||||
email = names[backer_number][1].gsub(/ /,'').downcase
|
||||
user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{password}", :profile => Profile.create( :first_name => names[backer_number][0], :last_name => names[backer_number][1] ))
|
||||
user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{email+pin[backer_number].to_s}", :profile => Profile.create( :first_name => names[backer_number][0], :last_name => names[backer_number][1] ))
|
||||
|
||||
# Make friends with Diaspora Tom
|
||||
Friend.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :profile => Profile.create(:first_name => "Diaspora", :last_name => "Tom"))
|
||||
|
|
|
|||
63
lib/chrome_frame.rb
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
module Rack
|
||||
class ChromeFrame
|
||||
|
||||
def initialize(app, options={})
|
||||
@app = app
|
||||
@options = options
|
||||
end
|
||||
|
||||
def call(env)
|
||||
|
||||
if env['HTTP_USER_AGENT'] =~ /MSIE/
|
||||
if env['HTTP_USER_AGENT'] =~ /chromeframe/
|
||||
status, headers, response = @app.call(env)
|
||||
new_body = insert_tag(build_response_body(response))
|
||||
new_headers = recalculate_body_length(headers, new_body)
|
||||
return [status, new_headers, new_body]
|
||||
elsif @options[:minimum].nil? or ie_version(env['HTTP_USER_AGENT']) < @options[:minimum]
|
||||
html = <<-HTML
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
<title>You need to use a real browser in order to use Diaspora!</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="cf-placeholder"></div>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
|
||||
<script>CFInstall.check({ node: "cf-placxeholder" #{', destination: "' + @options[:destination] + '" ' if @options[:destination]}});</script>
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
return [200, {'Content-Type' => 'text/html', 'Content-Length' => html.size.to_s}, Rack::Response.new([html])]
|
||||
end
|
||||
end
|
||||
@app.call(env)
|
||||
end
|
||||
|
||||
def build_response_body(response)
|
||||
response_body = ""
|
||||
response.each { |part| response_body += part }
|
||||
response_body
|
||||
end
|
||||
|
||||
def recalculate_body_length(headers, body)
|
||||
new_headers = headers
|
||||
new_headers["Content-Length"] = body.length.to_s
|
||||
new_headers
|
||||
end
|
||||
|
||||
def insert_tag(body)
|
||||
head = <<-HEAD
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
HEAD
|
||||
|
||||
body.gsub!('<head>', "<head>\n" + head )
|
||||
body
|
||||
end
|
||||
|
||||
def ie_version(ua_string)
|
||||
ua_string.match(/MSIE (\S+)/)[1].to_f
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Before Width: | Height: | Size: 304 KiB |
BIN
public/images/user/adams.jpeg
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
public/images/user/buchanan.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/images/user/buren.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/images/user/default.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/images/user/fillmore.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
public/images/user/harrison.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
public/images/user/jackson.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/images/user/jefferson.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/images/user/lincoln.jpg
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
public/images/user/madison.jpeg
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
public/images/user/monroe.jpg
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
public/images/user/pierce.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
public/images/user/polk.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/images/user/quincyadams.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/images/user/taylor.jpg
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
public/images/user/tyler.jpeg
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
public/images/user/washington.jpeg
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 114 KiB |
10
public/javascripts/google.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-17207587-1']);
|
||||
_gaq.push(['_setDomainName', '.joindiaspora.com']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
function selectPicker(event){
|
||||
event.preventDefault();
|
||||
if( $("#new_" + this.className).css("display") == "none" ) {
|
||||
if( $("#new_" + $(this)[0].classList[0]).css("display") == "none" ) {
|
||||
$("#publisher_content_pickers .selected").removeClass("selected");
|
||||
$("#publisher_form form").fadeOut(50);
|
||||
|
||||
$(this).children("a > li").toggleClass("selected");
|
||||
$("#new_" + this.className).delay(50).fadeIn(200);
|
||||
$(this).toggleClass("selected");
|
||||
$("#new_" + $(this)[0].classList[0]).delay(50).fadeIn(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,3 +229,6 @@ label {
|
|||
position: absolute;
|
||||
top: 3px;
|
||||
left: 0.48em; }
|
||||
|
||||
ul.nav li > a {
|
||||
display: block; }
|
||||
|
|
|
|||
|
|
@ -271,3 +271,6 @@ label
|
|||
:position absolute
|
||||
:top 3px
|
||||
:left 0.48em
|
||||
|
||||
ul.nav li > a
|
||||
:display block
|
||||
|
|
|
|||