Skip to content

Commit

Permalink
Merge branch 'fixes' into i18n-pt_BR
Browse files Browse the repository at this point in the history
  • Loading branch information
brodock committed Mar 21, 2011
2 parents 7100e23 + bbae095 commit 71557be
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def search_path(atom = false)
end

def for_moderators_of(record, &block)
moderator_of?(record) && concat(capture(&block))
capture(&block) if moderator_of?(record)
end

end
19 changes: 9 additions & 10 deletions app/views/topics/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<p>
<label for="topic_title"><%= I18n.t('txt.views_topics.topic', :default => 'Name') %></label><br />
<%= form.text_field :title, :onchange => "/*TopicForm.editNewTitle(this);*/", :class => "primary", :tabindex => 10 %>
<%= form.text_field :title, :onchange => "TopicForm.editNewTitle(this);", :class => "primary", :tabindex => 10 %>
<% for_moderators_of @forum do -%>
<label style="margin-left:1em;">
<%= form.check_box :sticky %> <%= I18n.t('txt.sticky', :default => 'sticky') %>
</label>

<label style="margin-left:1em;">
<%= form.check_box :locked %> <%= I18n.t('txt.locked', :default => 'locked') %>
</label>
<% end -%>
<%= for_moderators_of @forum do %>
<label style="margin-left:1em;">
<%= form.check_box :sticky %> <%= I18n.t('txt.sticky', :default => 'sticky') %>
</label>
<label style="margin-left:1em;">
<%= form.check_box :locked %> <%= I18n.t('txt.locked', :default => 'locked') %>
</label>
<% end %>

</p>
<% if @topic.new_record? -%>
Expand Down
53 changes: 27 additions & 26 deletions public/javascripts/lowpro.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DOM = {};

// DOMBuilder for prototype
DOM.Builder = {
tagFunc : function(tag) {
tagFunc : function(tag) {
return function() {
var attrs, children;
if (arguments.length>0) {
Expand All @@ -29,29 +29,29 @@ DOM.Builder = {
return DOM.Builder.create(tag, attrs, children);
};
},
create : function(tag, attrs, children) {
attrs = attrs || {}; children = children || []; tag = tag.toLowerCase();
var el = new Element(tag, attrs);
for (var i=0; i<children.length; i++) {
if (typeof children[i] == 'string')
children[i] = document.createTextNode(children[i]);
el.appendChild(children[i]);
}
return $(el);
}
create : function(tag, attrs, children) {
attrs = attrs || {}; children = children || []; tag = tag.toLowerCase();
var el = new Element(tag, attrs);
for (var i=0; i<children.length; i++) {
if (typeof children[i] == 'string')
children[i] = document.createTextNode(children[i]);
el.appendChild(children[i]);
}
return $(el);
}
};

// Automatically create node builders as $tagName.
(function() {
var els = ("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|" +
"h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|" +
"select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|" +
"script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|" +
"label|dfn|kbd|samp|var").split("|");
var els = ("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|" +
"h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|" +
"select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|" +
"script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|" +
"label|dfn|kbd|samp|var").split("|");
var el, i=0;
while (el = els[i++])
window['$' + el] = DOM.Builder.tagFunc(el);
while (el = els[i++])
window['$' + el] = DOM.Builder.tagFunc(el);
})();

DOM.Builder.fromHTML = function(html) {
Expand Down Expand Up @@ -111,10 +111,12 @@ Event.addBehavior = function(rules) {

Event.delegate = function(rules) {
return function(e) {
var element = $(e.element());
for (var selector in rules)
if (element.match(selector)) return rules[selector].apply(this, $A(arguments));
}
for ( var selector in rules ){
if ( e.findElement(selector) ) {
return rules[selector].apply(this, $A(arguments));
}
}
}
}

Object.extend(Event.addBehavior, {
Expand Down Expand Up @@ -304,7 +306,7 @@ Remote.Form = Behavior.create(Remote.Base, {
var sourceElement = e.element();

if (['input', 'button'].include(sourceElement.nodeName.toLowerCase()) &&
sourceElement.type == 'submit')
['submit', 'image'].include(sourceElement.type))
this._submitButton = sourceElement;
},
onsubmit : function() {
Expand Down Expand Up @@ -335,5 +337,4 @@ Observed = Behavior.create({
return (this.options.frequency) ? new Form.Element.Observer(this.element, this.options.frequency, this.callback) :
new Form.Element.EventObserver(this.element, this.callback);
}
});

});

0 comments on commit 71557be

Please sign in to comment.