Permalink
Browse files

cleaned up whitespace at the end of lines

  • Loading branch information...
1 parent 02a27cb commit 81a31c94aa26058d20c6b56dd46741c7d7809108 @sferik committed Oct 7, 2009
@@ -1,4 +1,4 @@
-class MerbAdmin::Application < Merb::Controller
+class MerbAdmin::Application < Merb::Controller
include Merb::MerbAdmin::MainHelper
controller_for_slice
View
@@ -80,7 +80,7 @@ def update
end
has_one_associations = @abstract_model.has_one_associations.map{|association| [association, (params[:associations] || {}).delete(association[:name])]}
has_many_associations = @abstract_model.has_many_associations.map{|association| [association, (params[:associations] || {}).delete(association[:name])]}
- if @object.update_attributes(object) && has_one_associations.each{|association, id| update_has_one_association(association, id)} && has_many_associations.each{|association, ids| update_has_many_association(association, ids)}
+ if @object.update_attributes(object) && has_one_associations.each{|association, id| update_has_one_association(association, id)} && has_many_associations.each{|association, ids| update_has_many_association(association, ids)}
if params[:_continue]
redirect(url(:merb_admin_edit, :model_name => @abstract_model.singular_name, :id => @object.id), :message => {:notice => "#{@abstract_model.pretty_name} was successfully updated"})
elsif params[:_add_another]
@@ -4,56 +4,56 @@ module ApplicationHelper
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path relative to the public directory, with added segments.
def image_path(*segments)
public_path_for(:image, *segments)
end
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path relative to the public directory, with added segments.
def javascript_path(*segments)
public_path_for(:javascript, *segments)
end
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path relative to the public directory, with added segments.
def stylesheet_path(*segments)
public_path_for(:stylesheet, *segments)
end
# Construct a path relative to the public directory
- #
+ #
# @param <Symbol> The type of component.
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path relative to the public directory, with added segments.
def public_path_for(type, *segments)
::MerbAdmin.public_path_for(type, *segments)
end
# Construct an app-level path.
- #
+ #
# @param <Symbol> The type of component.
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path within the host application, with added segments.
def app_path_for(type, *segments)
::MerbAdmin.app_path_for(type, *segments)
end
# Construct a slice-level path.
- #
+ #
# @param <Symbol> The type of component.
# @param *segments<Array[#to_s]> Path segments to append.
#
- # @return <String>
+ # @return <String>
# A path within the slice source (Gem), with added segments.
def slice_path_for(type, *segments)
::MerbAdmin.slice_path_for(type, *segments)
@@ -21,7 +21,7 @@
</h1>
</div>
</div>
-<%= partial('layout/message', :message => message) unless message.blank? -%>
+<%= partial('layout/message', :message => message) unless message.blank? -%>
<div id="content" class="colMS">
<h1>
<%= page_name %>
@@ -1,4 +1,4 @@
-<%
+<%
association_name = association[:name]
collection = MerbAdmin::AbstractModel.new(association[:child_model]).all.map{|o| [o.id, object_title(o)]}.sort_by{|o| o[1]}
selected = @object.send(association_name)
@@ -16,4 +16,4 @@
<%= partial(property_type.to_s, :property => property) -%>
</div>
<% end %>
- </fieldset>
+ </fieldset>
View
@@ -1,19 +1,19 @@
#
# ==== Standalone MerbAdmin configuration
-#
-# This configuration/environment file is only loaded by bin/slice, which can be
+#
+# This configuration/environment file is only loaded by bin/slice, which can be
# used during development of the slice. It has no effect on this slice being
# loaded in a host application. To run your slice in standalone mode, just
# run 'slice' from its directory. The 'slice' command is very similar to
-# the 'merb' command, and takes all the same options, including -i to drop
+# the 'merb' command, and takes all the same options, including -i to drop
# into an irb session for example.
#
# The usual Merb configuration directives and init.rb setup methods apply,
# including use_orm and before_app_loads/after_app_loads.
#
-# If you need need different configurations for different environments you can
+# If you need need different configurations for different environments you can
# even create the specific environment file in config/environments/ just like
-# in a regular Merb application.
+# in a regular Merb application.
#
# In fact, a slice is no different from a normal # Merb application - it only
# differs by the fact that seamlessly integrates into a so called 'host'
View
@@ -9,7 +9,7 @@
Merb::Slices::register(__FILE__)
# Slice configuration - set this in a before_app_loads callback.
- # By default a Slice uses its own layout, so you can swicht to
+ # By default a Slice uses its own layout, so you can swicht to
# the main application layout or no layout at all if needed.
#
# Configuration options:
@@ -47,7 +47,7 @@
task :migrate do # see slicetasks.rb
end
- desc "Freeze MerbAdmin into your app (only merb-admin/app)"
+ desc "Freeze MerbAdmin into your app (only merb-admin/app)"
task :freeze => [ "freeze:app" ]
namespace :freeze do
@@ -67,7 +67,7 @@
preserved.each { |f| puts "! preserved override as #{f}" }
end
- desc "Freeze all views into your application for easy modification"
+ desc "Freeze all views into your application for easy modification"
task :views do
puts "Copying all view templates to your application - resolves any collisions"
copied, preserved = MerbAdmin.mirror_files_for :view
@@ -76,7 +76,7 @@
preserved.each { |f| puts "! preserved override as #{f}" }
end
- desc "Freeze all models into your application for easy modification"
+ desc "Freeze all models into your application for easy modification"
task :models do
puts "Copying all models to your application - resolves any collisions"
copied, preserved = MerbAdmin.mirror_files_for :model
@@ -35,7 +35,7 @@
t.spec_opts = ["--format", "specdoc", "--colour"]
if(ENV['REQUEST'])
t.spec_files = Dir["#{slice_root}/spec/requests/**/#{ENV['REQUEST']}_spec.rb"].sort
- else
+ else
t.spec_files = Dir["#{slice_root}/spec/requests/**/*_spec.rb"].sort
end
end
@@ -92,7 +92,7 @@ var DateTimeShortcuts = {
openClock: function(num) {
var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num)
var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num)
-
+
// Recalculate the clockbox position
// is it left-to-right or right-to-left layout ?
if (getStyle(document.body,'direction')!='rtl') {
@@ -106,7 +106,7 @@ var DateTimeShortcuts = {
clock_box.style.left = findPosX(clock_link) - 110 + 'px';
}
clock_box.style.top = findPosY(clock_link) - 30 + 'px';
-
+
// Show the clock box
clock_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; });
@@ -208,7 +208,7 @@ var DateTimeShortcuts = {
}
}
-
+
// Recalculate the clockbox position
// is it left-to-right or right-to-left layout ?
if (getStyle(document.body,'direction')!='rtl') {
@@ -222,7 +222,7 @@ var DateTimeShortcuts = {
cal_box.style.left = findPosX(cal_link) - 180 + 'px';
}
cal_box.style.top = findPosY(cal_link) - 75 + 'px';
-
+
cal_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
},
@@ -13,7 +13,7 @@ function html_unescape(text) {
// IE doesn't accept periods or dashes in the window name, but the element IDs
// we use to generate popup window names may contain them, therefore we map them
-// to allowed characters in a reversible way so that we can locate the correct
+// to allowed characters in a reversible way so that we can locate the correct
// element when the popup window is dismissed.
function id_to_windowname(text) {
text = text.replace(/\./g, '__dot__');
@@ -25,7 +25,7 @@ var Actions = {
tr.className += ' selected';
} else if (!checked) {
tr.className = tr.className.replace(' selected', '');
- }
+ }
},
checker: function(checked) {
var actionCheckboxes = document.getElementsBySelector('tr input.action-select');
@@ -78,7 +78,7 @@ function findPosX(obj) {
curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
obj = obj.offsetParent;
}
- // IE offsetParent does not include the top-level
+ // IE offsetParent does not include the top-level
if (isIE && obj.parentElement){
curleft += obj.offsetLeft - obj.scrollLeft;
}
@@ -95,7 +95,7 @@ function findPosY(obj) {
curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
obj = obj.offsetParent;
}
- // IE offsetParent does not include the top-level
+ // IE offsetParent does not include the top-level
if (isIE && obj.parentElement){
curtop += obj.offsetTop - obj.scrollTop;
}
@@ -36,7 +36,7 @@ var weekdayNames = gettext("Sunday Monday Tuesday Wednesday Thursday Friday Satu
an error if 0 or more than 1 matches
*/
function parseMonth(month) {
- var matches = monthNames.filter(function(item) {
+ var matches = monthNames.filter(function(item) {
return new RegExp("^" + month, "i").test(item);
});
if (matches.length == 0) {
@@ -61,22 +61,22 @@ function parseWeekday(weekday) {
return weekdayNames.indexOf(matches[0]);
}
-/* Array of objects, each has 're', a regular expression and 'handler', a
- function for creating a date from something that matches the regular
- expression. Handlers may throw errors if string is unparseable.
+/* Array of objects, each has 're', a regular expression and 'handler', a
+ function for creating a date from something that matches the regular
+ expression. Handlers may throw errors if string is unparseable.
*/
var dateParsePatterns = [
// Today
{ re: /^tod/i,
- handler: function() {
+ handler: function() {
return new Date();
- }
+ }
},
// Tomorrow
{ re: /^tom/i,
handler: function() {
- var d = new Date();
- d.setDate(d.getDate() + 1);
+ var d = new Date();
+ d.setDate(d.getDate() + 1);
return d;
}
},
@@ -89,15 +89,15 @@ var dateParsePatterns = [
}
},
// 4th
- { re: /^(\d{1,2})(st|nd|rd|th)?$/i,
+ { re: /^(\d{1,2})(st|nd|rd|th)?$/i,
handler: function(bits) {
var d = new Date();
d.setDate(parseInt(bits[1], 10));
return d;
}
},
// 4th Jan
- { re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,
+ { re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,
handler: function(bits) {
var d = new Date();
d.setDate(parseInt(bits[1], 10));
@@ -116,7 +116,7 @@ var dateParsePatterns = [
}
},
// Jan 4th
- { re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i,
+ { re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i,
handler: function(bits) {
var d = new Date();
d.setDate(parseInt(bits[2], 10));
@@ -209,7 +209,7 @@ function magicDate(input) {
var messagespan = input.id + 'Msg';
try {
var d = parseDateString(input.value);
- input.value = d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' +
+ input.value = d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' +
fmt00(d.getDate());
input.className = '';
// Human readable date
@@ -1,20 +1,20 @@
/* document.getElementsBySelector(selector)
- returns an array of element objects from the current document
- matching the CSS selector. Selectors can contain element names,
+ matching the CSS selector. Selectors can contain element names,
class names and ids and can be nested. For example:
-
+
elements = document.getElementsBySelect('div#main p a.external')
-
- Will return an array of all 'a' elements with 'external' in their
- class attribute that are contained inside 'p' elements that are
+
+ Will return an array of all 'a' elements with 'external' in their
+ class attribute that are contained inside 'p' elements that are
contained inside the 'div' element which has id="main"
New in version 0.4: Support for CSS2 and CSS3 attribute selectors:
See http://www.w3.org/TR/css3-selectors/#attribute-selectors
Version 0.4 - Simon Willison, March 25th 2003
-- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows
- -- Opera 7 fails
+ -- Opera 7 fails
*/
function getAllChildren(e) {
@@ -112,7 +112,7 @@ document.getElementsBySelector = function(selector) {
case '=': // Equality
checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
break;
- case '~': // Match one of space seperated words
+ case '~': // Match one of space seperated words
checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
break;
case '|': // Match start with value followed by optional hyphen
@@ -156,12 +156,12 @@ document.getElementsBySelector = function(selector) {
return currentContext;
}
-/* That revolting regular expression explained
+/* That revolting regular expression explained
/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
\---/ \---/\-------------/ \-------/
| | | |
| | | The value
| | ~,|,^,$,* or =
- | Attribute
+ | Attribute
Tag
*/
@@ -57,10 +57,10 @@ p img, h1 img, h2 img, h3 img, h4 img, td img { vertical-align:middle; }
table { border-collapse:collapse; border-color:#ccc; }
td, th { font-size:11px; line-height:13px; border-bottom:1px solid #eee; vertical-align:top; padding:5px; font-family:"Lucida Grande", Verdana, Arial, sans-serif; }
th { text-align:left; font-size:12px; font-weight:bold; }
-thead th,
+thead th,
tfoot td { color:#666; padding:2px 5px; font-size:11px; background:#e1e1e1 url(../images/nav-bg.gif) top left repeat-x; border-left:1px solid #ddd; border-bottom:1px solid #ddd; }
tfoot td { border-bottom:none; border-top:1px solid #ddd; }
-thead th:first-child,
+thead th:first-child,
tfoot td:first-child { border-left:none !important; }
thead th.optional { font-weight:normal !important; }
fieldset table { border-right:1px solid #eee; }
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe MerbAdmin::Main do
+describe MerbAdmin::Main do
before(:each) do
mount_slice
@@ -1,6 +1,6 @@
class Draft
include DataMapper::Resource
-
+
property :id, Serial
property :created_at, DateTime
property :updated_at, DateTime
Oops, something went wrong.

0 comments on commit 81a31c9

Please sign in to comment.