so long whitespace

This commit is contained in:
joshua stein 2013-02-13 18:50:51 -06:00
parent e4ec8939c2
commit d0459974cd
18 changed files with 34 additions and 33 deletions

View file

@ -251,7 +251,7 @@ $(document).ready(function() {
var box = $(this).parents("li.comment").first().find("div.comment_reply"). var box = $(this).parents("li.comment").first().find("div.comment_reply").
first(); first();
box.html($("#comment_form").clone()); box.html($("#comment_form").clone());
box.find("ol").remove(); box.find("ol").remove();
@ -277,7 +277,7 @@ $(document).ready(function() {
li.load("/comments/" + $(li).attr("data-shortid") + "/edit", li.load("/comments/" + $(li).attr("data-shortid") + "/edit",
{ "edit": 1 }); { "edit": 1 });
}); });
$("a.comment_deletor").live("click", function() { $("a.comment_deletor").live("click", function() {
if (confirm("Are you sure you want to delete this comment?")) { if (confirm("Are you sure you want to delete this comment?")) {
var li = $(this).parents("li.comment").first(); var li = $(this).parents("li.comment").first();
@ -287,7 +287,7 @@ $(document).ready(function() {
}); });
} }
}); });
$("a.comment_undeletor").live("click", function() { $("a.comment_undeletor").live("click", function() {
if (confirm("Are you sure you want to undelete this comment?")) { if (confirm("Are you sure you want to undelete this comment?")) {
var li = $(this).parents("li.comment").first(); var li = $(this).parents("li.comment").first();

View file

@ -3,7 +3,7 @@ class CommentsController < ApplicationController
before_filter :require_logged_in_user_or_400, before_filter :require_logged_in_user_or_400,
:only => [ :create, :preview, :preview_new, :upvote, :downvote, :unvote ] :only => [ :create, :preview, :preview_new, :upvote, :downvote, :unvote ]
# for rss feeds, load the user's tag filters if a token is passed # for rss feeds, load the user's tag filters if a token is passed
before_filter :find_user_from_rss_token, :only => [ :index ] before_filter :find_user_from_rss_token, :only => [ :index ]
@ -57,7 +57,7 @@ class CommentsController < ApplicationController
:content_type => "text/html", :locals => { :story => story, :content_type => "text/html", :locals => { :story => story,
:comment => Comment.new, :show_comment => comment } :comment => Comment.new, :show_comment => comment }
end end
Countinual.count!("lobsters.comments.submitted", "+1") Countinual.count!("lobsters.comments.submitted", "+1")
else else
comment.previewing = true comment.previewing = true
@ -69,7 +69,7 @@ class CommentsController < ApplicationController
:comment => comment, :show_comment => comment } :comment => comment, :show_comment => comment }
end end
end end
def preview_new def preview_new
params[:preview] = true params[:preview] = true
return create return create
@ -178,7 +178,7 @@ class CommentsController < ApplicationController
if !(comment = Comment.find_by_short_id(params[:comment_id])) if !(comment = Comment.find_by_short_id(params[:comment_id]))
return render :text => "can't find comment", :status => 400 return render :text => "can't find comment", :status => 400
end end
if !Vote::COMMENT_REASONS[params[:reason]] if !Vote::COMMENT_REASONS[params[:reason]]
return render :text => "invalid reason", :status => 400 return render :text => "invalid reason", :status => 400
end end
@ -270,7 +270,7 @@ if false
th th
} }
end end
@comments = @threads.flatten @comments = @threads.flatten
end end
end end

View file

@ -59,7 +59,7 @@ class HomeController < ApplicationController
@stories = find_stories_for_user_and_tag_and_newest_and_by_user(@user, @stories = find_stories_for_user_and_tag_and_newest_and_by_user(@user,
nil, false, for_user.id) nil, false, for_user.id)
@heading = @title = "Newest Stories by #{for_user.username}" @heading = @title = "Newest Stories by #{for_user.username}"
@cur_url = "/newest/#{for_user.username}" @cur_url = "/newest/#{for_user.username}"

View file

@ -71,7 +71,7 @@ class MessagesController < ApplicationController
if @message.author_user_id == @user.id if @message.author_user_id == @user.id
@message.deleted_by_author = true @message.deleted_by_author = true
end end
if @message.recipient_user_id == @user.id if @message.recipient_user_id == @user.id
@message.deleted_by_recipient = true @message.deleted_by_recipient = true
end end

View file

@ -56,13 +56,13 @@ class StoriesController < ApplicationController
redirect_to @story.comments_url redirect_to @story.comments_url
end end
def edit def edit
if !@story.is_editable_by_user?(@user) if !@story.is_editable_by_user?(@user)
flash[:error] = "You cannot edit that story." flash[:error] = "You cannot edit that story."
return redirect_to "/" return redirect_to "/"
end end
@title = "Edit Story" @title = "Edit Story"
end end
@ -158,7 +158,7 @@ class StoriesController < ApplicationController
end end
@comment = Comment.new @comment = Comment.new
load_user_votes load_user_votes
render :action => "show" render :action => "show"
@ -254,7 +254,7 @@ private
@story.id, nil) @story.id, nil)
@story.vote = v.vote @story.vote = v.vote
end end
@votes = Vote.comment_votes_by_user_for_story_hash(@user.id, @story.id) @votes = Vote.comment_votes_by_user_for_story_hash(@user.id, @story.id)
@comments.each do |c| @comments.each do |c|
if @votes[c.id] if @votes[c.id]

View file

@ -2,7 +2,7 @@ class EmailReply < ActionMailer::Base
default :from => "nobody@lobste.rs" default :from => "nobody@lobste.rs"
def reply(comment, user) def reply(comment, user)
@comment = comment @comment = comment
@user = user @user = user
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>",
@ -11,7 +11,7 @@ class EmailReply < ActionMailer::Base
end end
def mention(comment, user) def mention(comment, user)
@comment = comment @comment = comment
@user = user @user = user
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>",

View file

@ -46,7 +46,7 @@ class Keystore < ActiveRecord::Base
return new_value return new_value
end end
def self.decrement_value_for(key, amount = -1) def self.decrement_value_for(key, amount = -1)
self.increment_value_for(key, amount) self.increment_value_for(key, amount)
end end

View file

@ -183,8 +183,9 @@ class Story < ActiveRecord::Base
if !self.taggings.reject{|t| t.marked_for_destruction? || t.tag.is_media? if !self.taggings.reject{|t| t.marked_for_destruction? || t.tag.is_media?
}.any? }.any?
errors.add(:base, "Must have at least one non-media (PDF, video) tag. " << errors.add(:base, "Must have at least one non-media (PDF, video) " <<
"If no tags apply to your content, it probably doesn't belong here.") "tag. If no tags apply to your content, it probably doesn't " <<
"belong here.")
end end
end end

View file

@ -95,7 +95,7 @@ class User < ActiveRecord::Base
def stories_submitted_count def stories_submitted_count
Keystore.value_for("user:#{self.id}:stories_submitted").to_i Keystore.value_for("user:#{self.id}:stories_submitted").to_i
end end
def comments_posted_count def comments_posted_count
Keystore.value_for("user:#{self.id}:comments_posted").to_i Keystore.value_for("user:#{self.id}:comments_posted").to_i
end end
@ -103,7 +103,7 @@ class User < ActiveRecord::Base
def undeleted_received_messages def undeleted_received_messages
received_messages.where(:deleted_by_recipient => false) received_messages.where(:deleted_by_recipient => false)
end end
def undeleted_sent_messages def undeleted_sent_messages
sent_messages.where(:deleted_by_author => 0) sent_messages.where(:deleted_by_author => 0)
end end

View file

@ -43,7 +43,7 @@ class Vote < ActiveRecord::Base
votes votes
end end
def self.story_votes_by_user_for_story_ids_hash(user_id, story_ids) def self.story_votes_by_user_for_story_ids_hash(user_id, story_ids)
if !story_ids.any? if !story_ids.any?
return {} return {}

View file

@ -93,7 +93,7 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div id="inside"> <div id="inside">
<% if flash[:error] %> <% if flash[:error] %>
<div class="flash-error"><%= flash[:error] %></div> <div class="flash-error"><%= flash[:error] %></div>

View file

@ -56,7 +56,7 @@
<%= f.text_field :recipient_username, :size => 20, <%= f.text_field :recipient_username, :size => 20,
:autocomplete => "off" %> :autocomplete => "off" %>
</div> </div>
<div class="boxline"> <div class="boxline">
<%= f.label :subject, "Subject:", :class => "required" %> <%= f.label :subject, "Subject:", :class => "required" %>
<%= f.text_field :subject, :style => "width: 500px;", <%= f.text_field :subject, :style => "width: 500px;",

View file

@ -32,7 +32,7 @@
<%= submit_tag "Delete Message" %> <%= submit_tag "Delete Message" %>
<% end %> <% end %>
</div> </div>
<div style="float: left; padding-left: 1em;"> <div style="float: left; padding-left: 1em;">
<%= form_tag message_url(@message.short_id) + "/keep_as_new", <%= form_tag message_url(@message.short_id) + "/keep_as_new",
:method => :post do %> :method => :post do %>
@ -42,7 +42,7 @@
</div> </div>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<br> <br>
<div class="legend"> <div class="legend">

View file

@ -20,7 +20,7 @@
<%= radio_button_tag "what", "stories", @search.what == "stories" %> <%= radio_button_tag "what", "stories", @search.what == "stories" %>
<label for="search_what_stories" class="normal">Stories</label> <label for="search_what_stories" class="normal">Stories</label>
&nbsp; &nbsp;
<%= radio_button_tag "what", "comments", @search.what == "comments" %> <%= radio_button_tag "what", "comments", @search.what == "comments" %>

View file

@ -19,7 +19,7 @@
<% end %> <% end %>
<p></p> <p></p>
<div class="box"> <div class="box">
<div class="boxline markdown_help_toggler"> <div class="boxline markdown_help_toggler">
<div class="markdown_help_label"> <div class="markdown_help_label">

View file

@ -24,7 +24,7 @@
Lobsters</a> Lobsters</a>
</div> </div>
<ul> <ul>
<li> <li>
<p> <p>
To be able to easily submit a page you're viewing in your browser To be able to easily submit a page you're viewing in your browser
@ -52,7 +52,7 @@
are it does not belong here. Do not overreach with tags if they are it does not belong here. Do not overreach with tags if they
are not the primary focus of the story. are not the primary focus of the story.
</p></li> </p></li>
<li><p> <li><p>
When the story being submitted is more than a year or so old, When the story being submitted is more than a year or so old,
please add the year the story was written to the post title in please add the year the story was written to the post title in

View file

@ -29,7 +29,7 @@
<% end %> <% end %>
</span> </span>
<br> <br>
<label class="required">Karma:</label> <label class="required">Karma:</label>
<span class="d"> <span class="d">
<%= @showing_user.karma %> <%= @showing_user.karma %>
@ -44,7 +44,7 @@
@showing_user.stories_submitted_count %></a> @showing_user.stories_submitted_count %></a>
</span> </span>
<br> <br>
<label class="required">Comments Posted:</label> <label class="required">Comments Posted:</label>
<span class="d"> <span class="d">
<a href="/threads/<%= @showing_user.username %>"><%= <a href="/threads/<%= @showing_user.username %>"><%=

View file

@ -195,7 +195,7 @@ class Sponge
newuri.scheme = uri.scheme newuri.scheme = uri.scheme
newuri.port = uri.port newuri.port = uri.port
newuri.path = "/#{newuri.path}" newuri.path = "/#{newuri.path}"
dputs "following relative redirection to " + newuri.to_s dputs "following relative redirection to " + newuri.to_s
end end