Permalink
Browse files

Removed trailing white space (end of lines) throughout.

  • Loading branch information...
1 parent c2f1de9 commit 7918f5307498f26fb5312aeea1d26c43ac887320 @BorisMoore committed Mar 22, 2011
View
@@ -1,4 +1,4 @@
-# jQuery Templates plugin v1.0.0pre.
+# jQuery Templates plugin v1.0.0pre.
_Note: This plugin is currently in beta form and may change significantly before version 1.0 is released. See tagged versions for stable Beta releases. Requires jquery version 1.4.2._
@@ -143,7 +143,7 @@
case "2":
compare = compareDate;
break;
- }
+ }
for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
@@ -153,7 +153,7 @@
for ( var i = 0, l = data.length; i < l; i++ ) {
$( bookingTmplItems[data[i].movie.Id].nodes ).appendTo( "#bookingsList" );
}
-
+
function compareName( a, b ) {
return a == b ? 0 : (((a.movie.Name > b.movie.Name) !== reverse) ? 1 : -1);
}
@@ -192,7 +192,7 @@
$( "#movieTmpl" )
// Render movies using the movieTemplate
- .tmpl( movies )
+ .tmpl( movies )
// Display rendered movies in the movieList container
.appendTo( "#movieList" )
@@ -228,7 +228,7 @@
return;
}
// Collapse previously selected booking, and switch to non-edit view
- var oldSelected = selectedBooking;
+ var oldSelected = selectedBooking;
$( "div", bookingTmplItems[oldSelected.movie.Id].nodes ).animate( { height: 0 }, 500, function() {
switchView( oldSelected );
});
@@ -245,7 +245,7 @@
var bookingNode = $( "#bookingEditTmpl" )
// Render the booking for the chosen movie using the bookingEditTemplate
- .tmpl( booking, { animate: true } )
+ .tmpl( booking, { animate: true } )
// Append the rendered booking to the bookings list
.appendTo( "#bookingsList" )
@@ -258,7 +258,7 @@
bookingTmplItems[booking.movie.Id] = newItem;
// Attach handlers etc. on the rendered template.
- bookingEditRendered( newItem );
+ bookingEditRendered( newItem );
}
}
@@ -293,7 +293,7 @@
}
function bookingRendered( item ) {
- $( item.nodes ).click( function() {
+ $( item.nodes ).click( function() {
selectBooking( item.data );
});
$( ".close", item.nodes ).click( removeBooking );
@@ -329,7 +329,7 @@
cartTmplItem.update();
$( bookingTmplItems[booking.movie.Id].nodes ).remove();
delete bookingTmplItems[booking.movie.Id];
- return false;
+ return false;
}
function removeBookings() {
@@ -12,9 +12,9 @@
Notice that in the example there are no global variables:
Code is wrapped in a function closure: (function($) {...})(jQuery);
The formatDate function within the closure is called from within the
- template by passing it in with options:
- $( "#bookingEditTmpl" ).tmpl( booking, { formatDate: formatDate } )
- and accessing it on the template item, $item:
+ template by passing it in with options:
+ $( "#bookingEditTmpl" ).tmpl( booking, { formatDate: formatDate } )
+ and accessing it on the template item, $item:
${$item.formatDate()}.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -152,7 +152,7 @@
case "2":
compare = compareDate;
break;
- }
+ }
for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
@@ -162,7 +162,7 @@
for ( var i = 0, l = data.length; i < l; i++ ) {
$( bookingTmplItems[data[i].movie.Id].nodes ).appendTo( "#bookingsList" );
}
-
+
function compareName( a, b ) {
return a == b ? 0 : (((a.movie.Name > b.movie.Name) !== reverse) ? 1 : -1);
}
@@ -201,7 +201,7 @@
$( "#movieTmpl" )
// Render movies using the movieTemplate
- .tmpl( movies )
+ .tmpl( movies )
// Display rendered movies in the movieList container
.appendTo( "#movieList" )
@@ -237,7 +237,7 @@
return;
}
// Collapse previously selected booking, and switch to non-edit view
- var oldSelected = selectedBooking;
+ var oldSelected = selectedBooking;
$( "div", bookingTmplItems[oldSelected.movie.Id].nodes ).animate( { height: 0 }, 500, function() {
switchView( oldSelected );
});
@@ -254,7 +254,7 @@
var bookingNode = $( "#bookingEditTmpl" )
// Render the booking for the chosen movie using the bookingEditTemplate
- .tmpl( booking, { animate: true, formatDate: formatDate } )
+ .tmpl( booking, { animate: true, formatDate: formatDate } )
// Append the rendered booking to the bookings list
.appendTo( "#bookingsList" )
@@ -267,7 +267,7 @@
bookingTmplItems[booking.movie.Id] = newItem;
// Attach handlers etc. on the rendered template.
- bookingEditRendered( newItem );
+ bookingEditRendered( newItem );
}
}
@@ -302,7 +302,7 @@
}
function bookingRendered( item ) {
- $( item.nodes ).click( function() {
+ $( item.nodes ).click( function() {
selectBooking( item.data );
});
$( ".close", item.nodes ).click( removeBooking );
@@ -338,7 +338,7 @@
cartTmplItem.update();
$( bookingTmplItems[booking.movie.Id].nodes ).remove();
delete bookingTmplItems[booking.movie.Id];
- return false;
+ return false;
}
function removeBookings() {
@@ -142,7 +142,7 @@
case "2":
compare = compareDate;
break;
- }
+ }
for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
@@ -158,7 +158,7 @@
return a.date - b.date;
}
}
-
+
function getMovies( index ) {
var query = "http://odata.netflix.com/Catalog/Genres('" + genre + "')/Titles" +
"?$format=json" +
@@ -182,15 +182,15 @@
function showMovies( data ) {
pageCount = Math.ceil( data.d.__count/pageSize ),
movies = data.d.results;
-
+
$( "#pager" ).pager({ pagenumber: pageIndex, pagecount: pageCount, buttonClickCallback: getMovies });
// show movies in template
$( "#movieList" ).empty();
$( "#movieTmpl" )
// Render movies using the movieTemplate
- .tmpl( movies )
+ .tmpl( movies )
// Display rendered movies in the movieList container
.appendTo( "#movieList" )
@@ -226,7 +226,7 @@
return;
}
// Collapse previously selected booking, and switch to non-edit view
- var oldSelected = selectedBooking;
+ var oldSelected = selectedBooking;
$( "div", bookingItem( oldSelected ).nodes ).animate( { height: 0 }, 500, function() {
switchView( oldSelected );
});
@@ -239,11 +239,11 @@
switchView( booking, true );
} else {
cart.bookings[booking.movie.Id] = booking;
-
+
var bookingNode = $( "#bookingEditTmpl" )
-
+
// Render the booking for the chosen movie using the bookingEditTemplate
- .tmpl( booking, { animate: true } )
+ .tmpl( booking, { animate: true } )
// Append the rendered booking to the bookings list
.appendTo( "#bookingsList" )
@@ -289,7 +289,7 @@
$( "div", nodes ).css( "height", 0 ).animate( { height: 116 }, 500 );
}
}
-
+
function bookingRendered( item ) {
$( item.nodes ).click( function() {
selectBooking( item.data );
@@ -304,7 +304,7 @@
var item = bookingItem( booking ),
tmpl = $( edit ? "#bookingEditTmpl" : "#bookingTitleTmpl" ).template();
if ( item.tmpl !== tmpl) {
- item.tmpl = tmpl;
+ item.tmpl = tmpl;
item.update();
(edit ? bookingEditRendered : bookingRendered)( item );
}
@@ -326,7 +326,7 @@
cart.count--;
cartTmplItem.update();
$.tmplCmd( "remove", booking, bookingTmplItems );
- return false;
+ return false;
}
function removeBookings() {
@@ -100,7 +100,7 @@
<script type="text/javascript">
var genre="Cartoons", pageIndex = 1, pageSize = 3, pageCount = 0,
cart = { bookings: {}, count: 0, sortBy:0 }, bookingTmplItems = [], selectedBooking;
-
+
getMovies( pageIndex );
$( "#genres li" ).click( selectGenre );
@@ -141,23 +141,23 @@
case "2":
compare = compareDate;
break;
- }
+ }
for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
}
data = data.sort( compare );
bookingTmplItems = $.tmplCmd( "replace", data, bookingTmplItems );
-
+
function compareName( a, b ) {
return a == b ? 0 : (((a.movie.Name > b.movie.Name) !== reverse) ? 1 : -1);
}
function compareDate( a, b ) {
return a.date - b.date;
}
}
-
+
function getMovies( index ) {
var query = "http://odata.netflix.com/Catalog/Genres('" + genre + "')/Titles" +
"?$format=json" +
@@ -177,7 +177,7 @@
});
});
}
-
+
function showMovies( data ) {
pageCount = Math.ceil( data.d.__count/pageSize ),
movies = data.d.results;
@@ -217,7 +217,7 @@
return;
}
// Collapse previously selected booking, and switch to non-edit view
- var oldSelected = selectedBooking;
+ var oldSelected = selectedBooking;
$( "div", bookingItem( oldSelected ).nodes ).animate( { height: 0 }, 500, function() {
switchView( oldSelected );
});
@@ -234,8 +234,8 @@
$( "#bookingEditTmpl" )
// Render the booking for the chosen movie using the bookingEditTemplate
- .tmpl( booking, {
- animate: true,
+ .tmpl( booking, {
+ animate: true,
rendered: onBookingEditRendered,
addedTmplItems: bookingTmplItems
})
@@ -280,7 +280,7 @@
});
$( ".close", nodes ).click( removeBooking );
-
+
$( ".date", nodes ).change( function() {
data.date = $(this).datepicker( "getDate" );
updateBooking( item );
@@ -317,7 +317,7 @@
cart.count--;
cartTmplItem.update();
$.tmplCmd( "remove", booking, bookingTmplItems );
- return false;
+ return false;
}
function removeBookings() {
Oops, something went wrong.

0 comments on commit 7918f53

Please sign in to comment.