stuff
This commit is contained in:
@@ -42,7 +42,7 @@ protected
|
||||
else
|
||||
CurrentUser.user = AnonymousUser.new
|
||||
end
|
||||
|
||||
|
||||
Time.zone = CurrentUser.user.time_zone
|
||||
end
|
||||
|
||||
@@ -57,6 +57,7 @@ protected
|
||||
true
|
||||
else
|
||||
access_denied()
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class PostModerationController < ApplicationController
|
||||
before_filter :janitor_only
|
||||
rescue_from Post::ApprovalError, :with => :approval_error
|
||||
rescue_from Post::DisapprovalError, :with => :disapproval_error
|
||||
# before_filter :janitor_only
|
||||
# rescue_from Post::ApprovalError, :with => :approval_error
|
||||
# rescue_from Post::DisapprovalError, :with => :disapproval_error
|
||||
|
||||
def moderate
|
||||
@search = Post.order("id asc").pending_or_flagged.available_for_moderation.search(:tag_match => params[:query])
|
||||
|
||||
@@ -10,8 +10,8 @@ class PostsController < ApplicationController
|
||||
|
||||
def show
|
||||
@post = Post.find(params[:id])
|
||||
@post_flag = PostFlag.new(:post_id => @post)
|
||||
@post_appeal = PostAppeal.new(:post_id => @post)
|
||||
@post_flag = PostFlag.new(:post_id => @post.id)
|
||||
@post_appeal = PostAppeal.new(:post_id => @post.id)
|
||||
respond_with(@post)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module PostAppealsHelper
|
||||
def post_appeal_reason(post)
|
||||
def post_appeal_reasons(post)
|
||||
post.appeals.map do |appeal|
|
||||
content_tag("span", :class => "flag-and-reason-count") do
|
||||
appeal.reason + " (" + link_to(appeal.creator.name, :controller => "user", :action => "show", :id => appeal.creator_id) + ")"
|
||||
(appeal.reason + " (" + link_to(appeal.creator.name, user_path(appeal.creator_id)) + ")").html_safe
|
||||
end
|
||||
end.join("; ")
|
||||
end.join("; ").html_safe
|
||||
end
|
||||
end
|
||||
@@ -1,9 +1,9 @@
|
||||
module PostFlagsHelper
|
||||
def post_flag_reason(post)
|
||||
def post_flag_reasons(post)
|
||||
post.flags.map do |flag|
|
||||
content_tag("span", :class => "flag-and-reason-count") do
|
||||
flag.reason + " (" + link_to(flag.creator.name, :controller => "user", :action => "show", :id => flag.creator_id) + ")"
|
||||
content_tag("span") do
|
||||
(flag.reason + " (" + link_to(flag.creator.name, user_path(flag.creator_id)) + ")").html_safe
|
||||
end
|
||||
end.join("; ")
|
||||
end.join("; ").html_safe
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class PostAppeal < ActiveRecord::Base
|
||||
belongs_to :post
|
||||
validates_presence_of :reason, :creator_id, :creator_ip_addr
|
||||
validate :validate_post_is_inactive
|
||||
validate :creator_is_not_limited
|
||||
validate :validate_creator_is_not_limited
|
||||
before_validation :initialize_creator, :on => :create
|
||||
validates_uniqueness_of :creator_id, :scope => :post_id
|
||||
scope :for_user, lambda {|user_id| where(["creator_id = ?", user_id])}
|
||||
|
||||
@@ -4,10 +4,15 @@ class PostFlag < ActiveRecord::Base
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :post
|
||||
validates_presence_of :reason, :creator_id, :creator_ip_addr
|
||||
validate :creator_is_not_limited
|
||||
validate :validate_creator_is_not_limited
|
||||
validate :validate_post_is_active
|
||||
before_validation :initialize_creator, :on => :create
|
||||
validates_uniqueness_of :creator_id, :scope => :post_id
|
||||
before_save :update_post
|
||||
|
||||
def update_post
|
||||
post.update_attribute(:is_flagged, true)
|
||||
end
|
||||
|
||||
def validate_creator_is_not_limited
|
||||
if PostAppeal.for_user(creator_id).recent.count >= 10
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||
<%= stylesheet_link_tag "compiled/default" %>
|
||||
<%= stylesheet_link_tag "smoothness/jquery-ui-1.8.5.custom.css" %>
|
||||
<%= javascript_include_tag "compiled/default" %>
|
||||
<%= javascript_include_tag :defaults, :cache => true %>
|
||||
<%= Danbooru.config.custom_html_header_content %>
|
||||
<%= yield :html_header %>
|
||||
</head>
|
||||
|
||||
6
app/views/post_appeals/create.js.erb
Normal file
6
app/views/post_appeals/create.js.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
var errors = <%= @post_appeal.errors.full_messages.to_json.html_safe %>;
|
||||
if (errors.length > 0) {
|
||||
Danbooru.j_error(errors.join("; "));
|
||||
} else {
|
||||
Danbooru.j_alert("Appeal", "Post appeal");
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
var errors = <%= @unapproval.errors.full_messages.to_json.html_safe %>;
|
||||
var errors = <%= @post_flag.errors.full_messages.to_json.html_safe %>;
|
||||
if (errors.length > 0) {
|
||||
Danbooru.j_error(errors.join("; "));
|
||||
} else {
|
||||
Danbooru.j_alert("Flag", "Post flagged");
|
||||
$("a#approve").show();
|
||||
$("a#disapprove").show();
|
||||
$("a#flag").hide();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
<p>Enter a reason:</p>
|
||||
|
||||
<%= simple_form_for(@post_flag, :remote => true, :format => :js) do |f| %>
|
||||
<%= hidden_field_tag "post_flag[post_id]", @post_flag.post_id %>
|
||||
<%= f.input :post_id, :as => :hidden %>
|
||||
<%= f.text_field :reason %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
$("a#delete").hide();
|
||||
$("a#undelete").show();
|
||||
$("img#delete-wait").hide();
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
<% if post.approver %>
|
||||
<li>Approver: <%= link_to(post.approver.name, user_path(post.approver_id)) %></li>
|
||||
<% end %>
|
||||
<% if post.is_flagged? %>
|
||||
<li>Flagged: <%= post_flag_reason(post) %></li>
|
||||
<% end %>
|
||||
<% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
|
||||
<li>Appealed: <%= post_appeal_reason(post) %></li>
|
||||
<% end %>
|
||||
<li>
|
||||
Size: <%= number_to_human_size(post.file_size) %>
|
||||
<% if post.is_image? %>
|
||||
@@ -27,7 +21,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if post.is_flagged? %>
|
||||
<abbr title="Unapproved">U</abbr>
|
||||
<abbr title="Flagged">F</abbr>
|
||||
<% end %>
|
||||
|
||||
<% if !post.is_pending? && !post.is_deleted? %>
|
||||
|
||||
13
app/views/posts/partials/show/_notices.html.erb
Normal file
13
app/views/posts/partials/show/_notices.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<% if post.is_flagged? %>
|
||||
<div class="ui-corner-all ui-state-error notice">
|
||||
<span class="ui-icon ui-icon-alert"></span>
|
||||
This post has been flagged for deletion: <%= post_flag_reasons(post) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if post.is_deleted? && post.appeals.any? %>
|
||||
<div class="ui-corner-all ui-state-highlight notice">
|
||||
<span class="ui-icon ui-icon-info"></span>
|
||||
This post has been appealed: <%= post_appeal_reasons(post) %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
<section id="content">
|
||||
<h1>Post</h1>
|
||||
|
||||
<%= render :partial => "posts/partials/show/notices", :locals => {:post => @post} %>
|
||||
|
||||
<section id="image">
|
||||
<h2>Image</h2>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="sessions">
|
||||
<div id="new">
|
||||
<section>
|
||||
<h2>Sign In</h2>
|
||||
<h3>Sign In</h3>
|
||||
<%= form_tag(session_path) do %>
|
||||
<%= hidden_field_tag "url", params[:url] %>
|
||||
<table width="100%">
|
||||
@@ -30,7 +30,7 @@
|
||||
</section>
|
||||
|
||||
<aside>
|
||||
<h2>Help</h2>
|
||||
<h3>Help</h3>
|
||||
<ul>
|
||||
<li><%= link_to "I don't have an account", new_user_path %></li>
|
||||
<li><%= link_to "I forgot my password", reset_password_path %></li>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="users">
|
||||
<div class="new">
|
||||
<h1>Registration</h1>
|
||||
<h3>Registration</h3>
|
||||
|
||||
<div id="p1">
|
||||
<p><%= Danbooru.config.app_name %> is ad-sponsored and does not require an account to view. But in order to start uploading, editing, or creating content on this site, you will need to register. <em>Make sure you read and agree to the <%= link_to "terms of service", terms_of_service_path %> before registering. <strong>This site is open to web crawlers, therefore any name you choose will be public!</strong></em></p>
|
||||
|
||||
@@ -10,6 +10,26 @@ module Danbooru
|
||||
config.encoding = "utf-8"
|
||||
config.active_record.schema_format = :sql
|
||||
config.filter_parameters << :password
|
||||
config.action_view.javascript_expansions[:defaults] = [
|
||||
"src/lib/jquery-1.5.1.min.js",
|
||||
"src/lib/jquery-ui-1.8.9.custom.min.js",
|
||||
"src/lib/rails.js",
|
||||
"src/app/common.js",
|
||||
"src/app/cookie.js",
|
||||
"src/app/utility.js",
|
||||
"src/app/posts.js",
|
||||
"src/app/comments.js",
|
||||
"src/app/uploads.js",
|
||||
"src/app/users.js",
|
||||
"src/app/favorites.js",
|
||||
"src/app/post_flags.js",
|
||||
"src/app/post_appeals.js",
|
||||
"src/app/post_moderation.js",
|
||||
"src/app/pools.js",
|
||||
"src/app/wiki_pages.js",
|
||||
"src/app/forum_posts.js"
|
||||
]
|
||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module Danbooru
|
||||
class CustomConfiguration < Configuration
|
||||
# Define your custom overloads here
|
||||
def app_name
|
||||
"Lorem"
|
||||
"."
|
||||
end
|
||||
|
||||
def posts_per_page
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,132 +1,159 @@
|
||||
jQuery(function ($) {
|
||||
var csrf_token = $('meta[name=csrf-token]').attr('content'),
|
||||
csrf_param = $('meta[name=csrf-param]').attr('content');
|
||||
/**
|
||||
* Unobtrusive scripting adapter for jQuery
|
||||
*
|
||||
* Requires jQuery 1.4.3 or later.
|
||||
* https://github.com/rails/jquery-ujs
|
||||
*/
|
||||
|
||||
$.fn.extend({
|
||||
/**
|
||||
* Triggers a custom event on an element and returns the event result
|
||||
* this is used to get around not being able to ensure callbacks are placed
|
||||
* at the end of the chain.
|
||||
*
|
||||
* TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our
|
||||
* own events and placing ourselves at the end of the chain.
|
||||
*/
|
||||
triggerAndReturn: function (name, data) {
|
||||
var event = new $.Event(name);
|
||||
this.trigger(event, data);
|
||||
(function($) {
|
||||
// Make sure that every Ajax request sends the CSRF token
|
||||
function CSRFProtection(xhr) {
|
||||
var token = $('meta[name="csrf-token"]').attr('content');
|
||||
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
||||
}
|
||||
if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) });
|
||||
else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) });
|
||||
|
||||
return event.result !== false;
|
||||
},
|
||||
// Triggers an event on an element and returns the event result
|
||||
function fire(obj, name, data) {
|
||||
var event = $.Event(name);
|
||||
obj.trigger(event, data);
|
||||
return event.result !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles execution of remote calls firing overridable events along the way
|
||||
*/
|
||||
callRemote: function () {
|
||||
var el = this,
|
||||
method = el.attr('method') || el.attr('data-method') || 'GET',
|
||||
url = el.attr('action') || el.attr('href'),
|
||||
dataType = el.attr('data-type') || 'script';
|
||||
// Submits "remote" forms and links with ajax
|
||||
function handleRemote(element) {
|
||||
var method, url, data,
|
||||
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
||||
|
||||
if (url === undefined) {
|
||||
throw "No URL specified for remote call (action or href must be present).";
|
||||
} else {
|
||||
if (el.triggerAndReturn('ajax:before')) {
|
||||
var data = el.is('form') ? el.serializeArray() : [];
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: dataType,
|
||||
type: method.toUpperCase(),
|
||||
beforeSend: function (xhr) {
|
||||
el.trigger('ajax:loading', xhr);
|
||||
},
|
||||
success: function (data, status, xhr) {
|
||||
el.trigger('ajax:success', [data, status, xhr]);
|
||||
},
|
||||
complete: function (xhr) {
|
||||
el.trigger('ajax:complete', xhr);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
el.trigger('ajax:failure', [xhr, status, error]);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (fire(element, 'ajax:before')) {
|
||||
if (element.is('form')) {
|
||||
method = element.attr('method');
|
||||
url = element.attr('action');
|
||||
data = element.serializeArray();
|
||||
// memoized value from clicked submit button
|
||||
var button = element.data('ujs:submit-button');
|
||||
if (button) {
|
||||
data.push(button);
|
||||
element.data('ujs:submit-button', null);
|
||||
}
|
||||
} else {
|
||||
method = element.data('method');
|
||||
url = element.attr('href');
|
||||
data = null;
|
||||
}
|
||||
$.ajax({
|
||||
url: url, type: method || 'GET', data: data, dataType: dataType,
|
||||
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
||||
beforeSend: function(xhr, settings) {
|
||||
if (settings.dataType === undefined) {
|
||||
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
||||
}
|
||||
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
||||
},
|
||||
success: function(data, status, xhr) {
|
||||
element.trigger('ajax:success', [data, status, xhr]);
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
element.trigger('ajax:complete', [xhr, status]);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
element.trigger('ajax:error', [xhr, status, error]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
el.trigger('ajax:after');
|
||||
}
|
||||
}
|
||||
});
|
||||
// Handles "data-method" on links such as:
|
||||
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
||||
function handleMethod(link) {
|
||||
var href = link.attr('href'),
|
||||
method = link.data('method'),
|
||||
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
||||
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
||||
form = $('<form method="post" action="' + href + '"></form>'),
|
||||
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
||||
|
||||
/**
|
||||
* confirmation handler
|
||||
*/
|
||||
$('a[data-confirm],input[data-confirm]').live('click', function () {
|
||||
var el = $(this);
|
||||
if (el.triggerAndReturn('confirm')) {
|
||||
if (!confirm(el.attr('data-confirm'))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (csrf_param !== undefined && csrf_token !== undefined) {
|
||||
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
||||
}
|
||||
|
||||
form.hide().append(metadata_input).appendTo('body');
|
||||
form.submit();
|
||||
}
|
||||
|
||||
/**
|
||||
* remote handlers
|
||||
*/
|
||||
$('form[data-remote]').live('submit', function (e) {
|
||||
$(this).callRemote();
|
||||
e.preventDefault();
|
||||
});
|
||||
function disableFormElements(form) {
|
||||
form.find('input[data-disable-with], button[data-disable-with]').each(function() {
|
||||
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
||||
element.data('ujs:enable-with', element[method]());
|
||||
element[method](element.data('disable-with'));
|
||||
element.attr('disabled', 'disabled');
|
||||
});
|
||||
}
|
||||
|
||||
$('a[data-remote],input[data-remote]').live('click', function (e) {
|
||||
$(this).callRemote();
|
||||
e.preventDefault();
|
||||
});
|
||||
function enableFormElements(form) {
|
||||
form.find('input[data-disable-with]:disabled, button[data-disable-with]:disabled').each(function() {
|
||||
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
||||
if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
|
||||
element.removeAttr('disabled');
|
||||
});
|
||||
}
|
||||
|
||||
$('a[data-method]:not([data-remote])').live('click', function (e){
|
||||
var link = $(this),
|
||||
href = link.attr('href'),
|
||||
method = link.attr('data-method'),
|
||||
form = $('<form method="post" action="'+href+'"></form>'),
|
||||
metadata_input = '<input name="_method" value="'+method+'" type="hidden" />';
|
||||
function allowAction(element) {
|
||||
var message = element.data('confirm');
|
||||
return !message || (fire(element, 'confirm') && confirm(message));
|
||||
}
|
||||
|
||||
if (csrf_param != null && csrf_token != null) {
|
||||
metadata_input += '<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />';
|
||||
}
|
||||
function requiredValuesMissing(form) {
|
||||
var missing = false;
|
||||
form.find('input[name][required]').each(function() {
|
||||
if (!$(this).val()) missing = true;
|
||||
});
|
||||
return missing;
|
||||
}
|
||||
|
||||
form.hide()
|
||||
.append(metadata_input)
|
||||
.appendTo('body');
|
||||
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
||||
var link = $(this);
|
||||
if (!allowAction(link)) return false;
|
||||
|
||||
e.preventDefault();
|
||||
form.submit();
|
||||
});
|
||||
if (link.data('remote') != undefined) {
|
||||
handleRemote(link);
|
||||
return false;
|
||||
} else if (link.data('method')) {
|
||||
handleMethod(link);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* disable-with handlers
|
||||
*/
|
||||
var disable_with_input_selector = 'input[data-disable-with]';
|
||||
var disable_with_form_remote_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')';
|
||||
var disable_with_form_not_remote_selector = 'form:not([data-remote]):has(' + disable_with_input_selector + ')';
|
||||
$('form').live('submit.rails', function(e) {
|
||||
var form = $(this), remote = form.data('remote') != undefined;
|
||||
if (!allowAction(form)) return false;
|
||||
|
||||
var disable_with_input_function = function () {
|
||||
$(this).find(disable_with_input_selector).each(function () {
|
||||
var input = $(this);
|
||||
input.data('enable-with', input.val())
|
||||
.attr('value', input.attr('data-disable-with'))
|
||||
.attr('disabled', 'disabled');
|
||||
});
|
||||
};
|
||||
// skip other logic when required values are missing
|
||||
if (requiredValuesMissing(form)) return !remote;
|
||||
|
||||
$(disable_with_form_remote_selector).live('ajax:before', disable_with_input_function);
|
||||
$(disable_with_form_not_remote_selector).live('submit', disable_with_input_function);
|
||||
if (remote) {
|
||||
handleRemote(form);
|
||||
return false;
|
||||
} else {
|
||||
// slight timeout so that the submit button gets properly serialized
|
||||
setTimeout(function(){ disableFormElements(form) }, 13);
|
||||
}
|
||||
});
|
||||
|
||||
$(disable_with_form_remote_selector).live('ajax:complete', function () {
|
||||
$(this).find(disable_with_input_selector).each(function () {
|
||||
var input = $(this);
|
||||
input.removeAttr('disabled')
|
||||
.val(input.data('enable-with'));
|
||||
});
|
||||
});
|
||||
$('form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
||||
var button = $(this);
|
||||
if (!allowAction(button)) return false;
|
||||
// register the pressed submit button
|
||||
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
||||
button.closest('form').data('ujs:submit-button', data);
|
||||
});
|
||||
|
||||
});
|
||||
$('form').live('ajax:beforeSend.rails', function(event) {
|
||||
if (this == event.target) disableFormElements($(this));
|
||||
});
|
||||
|
||||
$('form').live('ajax:complete.rails', function(event) {
|
||||
if (this == event.target) enableFormElements($(this));
|
||||
});
|
||||
})( jQuery );
|
||||
|
||||
@@ -136,6 +136,10 @@ span.link {
|
||||
span.wait {
|
||||
color: #CCC; }
|
||||
|
||||
span.ui-icon {
|
||||
float: left;
|
||||
margin-right: 0.25em; }
|
||||
|
||||
table tfoot {
|
||||
margin-top: 2em; }
|
||||
|
||||
@@ -329,9 +333,13 @@ article.post-preview {
|
||||
margin-bottom: 4em;
|
||||
float: left; }
|
||||
|
||||
div#c-posts div.notice {
|
||||
font-size: 80%;
|
||||
padding: 1em;
|
||||
margin-bottom: 1em; }
|
||||
div#c-posts div.notice ul {
|
||||
margin-left: 1em; }
|
||||
div#c-posts aside#sidebar > section#pool-sidebar span.ui-icon {
|
||||
float: left;
|
||||
margin-right: 0.25em;
|
||||
color: #666; }
|
||||
div#c-posts aside#sidebar > section > ul li {
|
||||
list-style-type: none; }
|
||||
|
||||
@@ -176,6 +176,11 @@ span.wait {
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
span.ui-icon {
|
||||
float: left;
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
|
||||
table tfoot {
|
||||
margin-top: 2em;
|
||||
}
|
||||
@@ -515,10 +520,18 @@ article.post-preview {
|
||||
}
|
||||
|
||||
div#c-posts {
|
||||
div.notice {
|
||||
font-size: 80%;
|
||||
padding: 1em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
ul {
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
aside#sidebar > section#pool-sidebar {
|
||||
span.ui-icon {
|
||||
float: left;
|
||||
margin-right: 0.25em;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
while true ; do
|
||||
script/custom/compile_javascripts ;
|
||||
sass public/stylesheets/src/default.scss public/stylesheets/compiled/default.css ;
|
||||
sleep 2 ;
|
||||
done
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
script/custom/compile_javascripts
|
||||
script/custom/compile_stylesheets
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
mkdir -p public/javascripts/compiled/posts
|
||||
|
||||
cat public/javascripts/src/lib/jquery-1.5.1.min.js > public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/lib/jquery-ui-1.8.9.custom.min.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/lib/jrails.min.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/lib/rails.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/application.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/cookie.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/utility.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/posts.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/comments.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/uploads.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/users.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/favorites.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/post_flags.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/post_appeals.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/post_moderation.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/pools.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/wiki_pages.js >> public/javascripts/compiled/default.js
|
||||
cat public/javascripts/src/app/forum_posts.js >> public/javascripts/compiled/default.js
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
mkdir -p public/stylesheets/compiled
|
||||
sass public/stylesheets/src/default.scss public/stylesheets/compiled/default.css
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* jRails ajax extras
|
||||
* version 0.1
|
||||
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.extend( $.ajaxSettings, { accepts: { _default: "text/javascript, text/html, application/xml, text/xml, */*" }} );
|
||||
})(jQuery);
|
||||
|
||||
/*
|
||||
*
|
||||
* jRails form extras
|
||||
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function($) {
|
||||
// reset a form
|
||||
$.fn.reset = function() {
|
||||
return this.each(function() {
|
||||
// guard against an input with the name of 'reset'
|
||||
// note that IE reports the reset function as an 'object'
|
||||
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
|
||||
this.reset();
|
||||
});
|
||||
};
|
||||
// enable a form element
|
||||
$.fn.enable = function() {
|
||||
return this.each(function() {
|
||||
this.disabled = false;
|
||||
});
|
||||
};
|
||||
// disable a form element
|
||||
$.fn.disable = function() {
|
||||
return this.each(function() {
|
||||
this.disabled = true;
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
/*
|
||||
*
|
||||
* jRails form observer plugin
|
||||
* version 0.2
|
||||
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.extend({ // Translate field to event
|
||||
fieldEvent: function(el, obs) {
|
||||
var field = el[0] || el, e = 'change';
|
||||
if (field.type == 'radio' || field.type == 'checkbox') e = 'click';
|
||||
else if (obs && (field.type == 'text' || field.type == 'textarea' || field.type == 'password')) e = 'keyup';
|
||||
return e;
|
||||
}
|
||||
});
|
||||
$.fn.extend({ // Delayed observer for fields and forms
|
||||
delayedObserver: function(delay, callback){
|
||||
var el = $(this);
|
||||
if (typeof window.delayedObserverStack == 'undefined') window.delayedObserverStack = [];
|
||||
if (typeof window.delayedObserverCallback == 'undefined') {
|
||||
window.delayedObserverCallback = function(stackPos) {
|
||||
var observed = window.delayedObserverStack[stackPos];
|
||||
if (observed.timer) clearTimeout(observed.timer);
|
||||
observed.timer = setTimeout(function(){
|
||||
observed.timer = null;
|
||||
observed.callback(observed.obj, observed.obj.formVal());
|
||||
}, observed.delay * 1000);
|
||||
observed.oldVal = observed.obj.formVal();
|
||||
};
|
||||
}
|
||||
window.delayedObserverStack.push({
|
||||
obj: el, timer: null, delay: delay,
|
||||
oldVal: el.formVal(), callback: callback
|
||||
});
|
||||
var stackPos = window.delayedObserverStack.length-1;
|
||||
if (el[0].tagName == 'FORM') {
|
||||
$(':input', el).each(function(){
|
||||
var field = $(this);
|
||||
field.bind($.fieldEvent(field, delay), function(){
|
||||
var observed = window.delayedObserverStack[stackPos];
|
||||
if (observed.obj.formVal() == observed.oldVal) return;
|
||||
else window.delayedObserverCallback(stackPos);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
el.bind($.fieldEvent(el, delay), function(){
|
||||
var observed = window.delayedObserverStack[stackPos];
|
||||
if (observed.obj.formVal() == observed.oldVal) return;
|
||||
else window.delayedObserverCallback(stackPos);
|
||||
});
|
||||
};
|
||||
},
|
||||
formVal: function() { // Gets form values
|
||||
var el = this[0];
|
||||
if(el.tagName == 'FORM') return this.serialize();
|
||||
if(el.type == 'checkbox' || el.type == 'radio') return this.filter('input:checked').val() || '';
|
||||
else return this.val();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
/*
|
||||
*
|
||||
* jRails visual effects stubs
|
||||
* version 0.2
|
||||
* <aaron@ennerchi.com> | http://www.ennerchi.com
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.extend({
|
||||
visualEffect : function(o, options) {
|
||||
if (options) {
|
||||
speed = options.duration * 1000;
|
||||
} else {
|
||||
speed = null;
|
||||
}
|
||||
e = o.replace(/\_(.)/g, function(m, l){return l.toUpperCase()});
|
||||
return eval('$(this).'+e+'('+ speed + ')');
|
||||
},
|
||||
appear : function(speed, callback) {
|
||||
return this.fadeIn(speed, callback);
|
||||
},
|
||||
blindDown : function(speed, callback) {
|
||||
return this.show('blind', { direction: 'vertical' }, speed, callback);
|
||||
},
|
||||
blindUp : function(speed, callback) {
|
||||
return this.hide('blind', { direction: 'vertical' }, speed, callback);
|
||||
},
|
||||
blindRight : function(speed, callback) {
|
||||
return this.show('blind', { direction: 'horizontal' }, speed, callback);
|
||||
},
|
||||
blindLeft : function(speed, callback) {
|
||||
this.hide('blind', { direction: 'horizontal' }, speed, callback);
|
||||
return this;
|
||||
},
|
||||
dropOut : function(speed, callback) {
|
||||
return this.hide('drop', {direction: 'down' }, speed, callback);
|
||||
},
|
||||
dropIn : function(speed, callback) {
|
||||
return this.show('drop', { direction: 'up' }, speed, callback);
|
||||
},
|
||||
fade : function(speed, callback) {
|
||||
return this.fadeOut(speed, callback);
|
||||
},
|
||||
fadeToggle : function(speed, callback) {
|
||||
return this.animate({opacity: 'toggle'}, speed, callback);
|
||||
},
|
||||
fold : function(speed, callback) {
|
||||
return this.hide('fold', {}, speed, callback);
|
||||
},
|
||||
foldOut : function(speed, callback) {
|
||||
return this.show('fold', {}, speed, callback);
|
||||
},
|
||||
grow : function(speed, callback) {
|
||||
return this.show('scale', {}, speed, callback);
|
||||
},
|
||||
highlight : function(speed, callback) {
|
||||
return this.show('highlight', {}, speed, callback);
|
||||
},
|
||||
puff : function(speed, callback) {
|
||||
return this.hide('puff', {}, speed, callback);
|
||||
},
|
||||
pulsate : function(speed, callback) {
|
||||
return this.show('pulsate', {}, speed, callback);
|
||||
},
|
||||
shake : function(speed, callback) {
|
||||
return this.show('shake', {}, speed, callback);
|
||||
},
|
||||
shrink : function(speed, callback) {
|
||||
return this.hide('scale', {}, speed, callback);
|
||||
},
|
||||
squish : function(speed, callback) {
|
||||
return this.hide('scale', { origin: ['top', 'left'] }, speed, callback);
|
||||
},
|
||||
slideUp : function(speed, callback) {
|
||||
return this.hide('slide', { direction: 'up'}, speed, callback);
|
||||
},
|
||||
slideDown : function(speed, callback) {
|
||||
return this.show('slide', { direction: 'up'}, speed, callback);
|
||||
},
|
||||
switchOff : function(speed, callback) {
|
||||
return this.hide('clip', {}, speed, callback);
|
||||
},
|
||||
switchOn : function(speed, callback) {
|
||||
return this.show('clip', {}, speed, callback);
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -1 +0,0 @@
|
||||
(function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&(field.type=="text"||field.type=="textarea"||field.type=="password")){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){var observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||el.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
|
||||
Reference in New Issue
Block a user