Skip to content
Permalink
Browse files
Clean trailing whitespace from all files.
  • Loading branch information
csnover committed Dec 30, 2010
1 parent 429b078 commit 3e0cc815043c2425819743e907a0ce263a7ce164
Show file tree
Hide file tree
Showing 26 changed files with 688 additions and 688 deletions.
@@ -85,7 +85,7 @@ ${JQ}: ${MODULES} ${DIST_DIR}
@@cat ${MODULES} | \
sed 's/.function..jQuery...{//' | \
sed 's/}...jQuery..;//' | \
sed 's/Date:./&'"${DATE}"'/' | \
sed 's/@DATE/'"${DATE}"'/' | \
Copy link
@ajpiano

ajpiano Dec 30, 2010

Member

Whitespace change?

${VER} > ${JQ};

${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
@@ -31,7 +31,7 @@ rhino = "java -jar #{build_dir}/js.jar"
minfier = "java -jar #{build_dir}/google-compiler-20100917.jar"

# Turn off output other than needed from `sh` and file commands
verbose(false)
verbose(false)

# Tasks
task :default => "all"
@@ -51,7 +51,7 @@ task :min => jq_min
task :init => [sizzle, qunit] do
sizzle_git = File.join(sizzle_dir, '.git')
qunit_git = File.join(qunit_dir, '.git')

puts "Updating SizzleJS with latest..."
sh "git --git-dir=#{sizzle_git} pull -q origin master"

@@ -61,7 +61,7 @@ end

desc "Removes dist folder, selector.js, and Sizzle/QUnit"
task :clean do
puts "Removing Distribution directory: #{dist_dir}..."
puts "Removing Distribution directory: #{dist_dir}..."
rm_rf dist_dir

puts "Removing built copy of Sizzle..."
@@ -87,32 +87,32 @@ directory dist_dir

file jq => [dist_dir, base_files].flatten do
puts "Building jquery.js..."

File.open(jq, 'w') do |f|
f.write cat(base_files).gsub(/(Date:.)/, "\\1#{date}" ).gsub(/@VERSION/, version)
f.write cat(base_files).gsub(/@DATE/, date).gsub(/@VERSION/, version)
end
end

file jq_min => jq do
puts "Building jquery.min.js..."

sh "#{minfier} --js #{jq} --warning_level QUIET --js_output_file #{jq_min}"

min = File.read( jq_min )

# Equivilent of "head"
File.open(jq_min, 'w') do |f|
f.write File.readlines(jq)[0..14].join()
f.write min
end
end

file selector => [sizzle, :init] do
file selector => [sizzle, :init] do
puts "Building selector code from Sizzle..."

File.open(selector, 'w') do |f|
f.write File.read(sizzle).gsub(
/^.+EXPOSE$\n/,
f.write File.read(sizzle).gsub(
/^.+EXPOSE$\n/,
'\0' + File.read( File.join( src_dir, 'sizzle-jquery.js' ))
).gsub(
/^window.Sizzle.+$\n/, ''
@@ -77,7 +77,7 @@
<arg line="log -1 --pretty=format:%ad" />
</exec>
<replaceregexp match="(\(\s*function\s*\(\s*jQuery\s*\)\s*\{)|(\}\s*\)\s*\(\s*jQuery\s*\)\s*;)" flags="g" replace="" file="${JQ}" />
<replaceregexp match="Date: " replace="Date: ${date}" file="${JQ}" />
<replaceregexp match="@DATE" replace="${date}" file="${JQ}" />
<echo message="${JQ} built." />
</target>

@@ -1,5 +1,5 @@
(function( jQuery ) {

var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
rselectTextarea = /^(?:select|textarea)/i,
rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
@@ -43,9 +43,9 @@ jQuery.fn.extend({
type = "POST";
}
}

var self = this;

// Request the remote document
jQuery.ajax({
url: url,
@@ -171,49 +171,49 @@ jQuery.extend({
text: "Text",
json: "JSON"
},

accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": "*/*"
},

autoDataType: {
xml: /xml/,
html: /html/,
json: /json/
},

// Prefilters
// 1) They are useful to introduce custom dataTypes (see transport/jsonp for an example)
// 2) These are called:
// * BEFORE asking for a transport
// * AFTER param serialization (s.data is a string if s.processData is true)
// 3) They MUST be order agnostic
prefilters: [],

// Transports bindings
// 1) key is the dataType
// 2) the catchall symbol "*" can be used
// 3) selection will start with transport dataType and THEN go to "*" if needed
transports: {
},

// Checkers
// 1) key is dataType
// 2) they are called to control successful response
// 3) error throws is used as error data
dataCheckers: {

// Check if data is a string
"text": function(data) {
if ( typeof data != "string" ) {
jQuery.error("typeerror");
}
},

// Check if xml has been properly parsed
"xml": function(data) {
var documentElement = data ? data.documentElement : data;
@@ -225,25 +225,25 @@ jQuery.extend({
}
}
},

// List of data converters
// 1) key format is "source_type => destination_type" (spaces required)
// 2) the catchall symbol "*" can be used for source_type
dataConverters: {

// Convert anything to text
"* => text": function(data) {
return "" + data;
},

// Text to html (no transformation)
"text => html": function(data) {
return data;
},

// Evaluate text as a json expression
"text => json": jQuery.parseJSON,

// Parse text as xml
"text => xml": function(data) {
var xml, parser;
@@ -262,14 +262,14 @@ jQuery.extend({

// Main method
ajax: function( url , s ) {

if ( arguments.length === 1 ) {
s = url;
url = s ? s.url : undefined;
}

return jQuery.xhr().open( s ? s.type : undefined , url ).send( undefined , s );

},

// Serialize an array of form elements or a set of
@@ -281,19 +281,19 @@ jQuery.extend({
value = jQuery.isFunction(value) ? value() : value;
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};

// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}

// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray(a) || a.jquery ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});

} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
@@ -326,7 +326,7 @@ function buildParams( prefix, obj, traditional, add ) {
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
}
});

} else if ( !traditional && obj != null && typeof obj === "object" ) {
// If we see an array here, it is empty and should be treated as an empty
// object
@@ -339,7 +339,7 @@ function buildParams( prefix, obj, traditional, add ) {
buildParams( prefix + "[" + k + "]", v, traditional, add );
});
}

} else {
// Serialize scalar item.
add( prefix, obj );
@@ -373,7 +373,7 @@ if ( window.ActiveXObject ) {
return new window.XMLHttpRequest();
} catch( xhrError ) {}
}

try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch( activeError ) {}
@@ -182,7 +182,7 @@ jQuery.fn.extend({
var option = options[ i ];

// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {

// Get the specific value for the option

3 comments on commit 3e0cc81

@ajpiano
Copy link
Member

@ajpiano ajpiano commented on 3e0cc81 Dec 30, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of changes in here that don't seem to be specifically cleaning up whitespace, but I might be really naive or tired....

@ohaibbq
Copy link

@ohaibbq ohaibbq commented on 3e0cc81 Dec 30, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.xml, Rakefile and Makefile have changes that aren't cleaning up whitespace, other than that it's fine

@csnover
Copy link
Member Author

@csnover csnover commented on 3e0cc81 Dec 30, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date line used to be “Date: ”; the whitespace on the end of the line was important for it to work properly, which is wrong in the context of “no whitespace at the end of lines”, so I had to change it to use a substitution like the version number so that there’s not whitespace sitting at the end of the line.

Please sign in to comment.