Skip to content

Commit

Permalink
Removed trailing white space (end of lines) throughout.
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisMoore committed Mar 22, 2011
1 parent c2f1de9 commit 7918f53
Show file tree
Hide file tree
Showing 27 changed files with 239 additions and 240 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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._

Expand Down
16 changes: 8 additions & 8 deletions demos/movies/PagesCore/movies.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ <h1>Netflix: Book a Movie...</h1>
case "2":
compare = compareDate;
break;
}
}

for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
Expand All @@ -153,7 +153,7 @@ <h1>Netflix: Book a Movie...</h1>
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);
}
Expand Down Expand Up @@ -192,7 +192,7 @@ <h1>Netflix: Book a Movie...</h1>

$( "#movieTmpl" )
// Render movies using the movieTemplate
.tmpl( movies )
.tmpl( movies )

// Display rendered movies in the movieList container
.appendTo( "#movieList" )
Expand Down Expand Up @@ -228,7 +228,7 @@ <h1>Netflix: Book a Movie...</h1>
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 );
});
Expand All @@ -245,7 +245,7 @@ <h1>Netflix: Book a Movie...</h1>
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" )
Expand All @@ -258,7 +258,7 @@ <h1>Netflix: Book a Movie...</h1>
bookingTmplItems[booking.movie.Id] = newItem;

// Attach handlers etc. on the rendered template.
bookingEditRendered( newItem );
bookingEditRendered( newItem );
}
}

Expand Down Expand Up @@ -293,7 +293,7 @@ <h1>Netflix: Book a Movie...</h1>
}

function bookingRendered( item ) {
$( item.nodes ).click( function() {
$( item.nodes ).click( function() {
selectBooking( item.data );
});
$( ".close", item.nodes ).click( removeBooking );
Expand Down Expand Up @@ -329,7 +329,7 @@ <h1>Netflix: Book a Movie...</h1>
cartTmplItem.update();
$( bookingTmplItems[booking.movie.Id].nodes ).remove();
delete bookingTmplItems[booking.movie.Id];
return false;
return false;
}

function removeBookings() {
Expand Down
22 changes: 11 additions & 11 deletions demos/movies/PagesCore/moviesNoGlobals.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -152,7 +152,7 @@ <h1>Netflix: Book a Movie...</h1>
case "2":
compare = compareDate;
break;
}
}

for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
Expand All @@ -162,7 +162,7 @@ <h1>Netflix: Book a Movie...</h1>
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);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ <h1>Netflix: Book a Movie...</h1>

$( "#movieTmpl" )
// Render movies using the movieTemplate
.tmpl( movies )
.tmpl( movies )

// Display rendered movies in the movieList container
.appendTo( "#movieList" )
Expand Down Expand Up @@ -237,7 +237,7 @@ <h1>Netflix: Book a Movie...</h1>
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 );
});
Expand All @@ -254,7 +254,7 @@ <h1>Netflix: Book a Movie...</h1>
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" )
Expand All @@ -267,7 +267,7 @@ <h1>Netflix: Book a Movie...</h1>
bookingTmplItems[booking.movie.Id] = newItem;

// Attach handlers etc. on the rendered template.
bookingEditRendered( newItem );
bookingEditRendered( newItem );
}
}

Expand Down Expand Up @@ -302,7 +302,7 @@ <h1>Netflix: Book a Movie...</h1>
}

function bookingRendered( item ) {
$( item.nodes ).click( function() {
$( item.nodes ).click( function() {
selectBooking( item.data );
});
$( ".close", item.nodes ).click( removeBooking );
Expand Down Expand Up @@ -338,7 +338,7 @@ <h1>Netflix: Book a Movie...</h1>
cartTmplItem.update();
$( bookingTmplItems[booking.movie.Id].nodes ).remove();
delete bookingTmplItems[booking.movie.Id];
return false;
return false;
}

function removeBookings() {
Expand Down
22 changes: 11 additions & 11 deletions demos/movies/PagesTmplPlus/movies1.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h1>Netflix: Book a Movie...</h1>
case "2":
compare = compareDate;
break;
}
}

for ( var item in cart.bookings ) {
data.push( cart.bookings[item] );
Expand All @@ -158,7 +158,7 @@ <h1>Netflix: Book a Movie...</h1>
return a.date - b.date;
}
}

function getMovies( index ) {
var query = "http://odata.netflix.com/Catalog/Genres('" + genre + "')/Titles" +
"?$format=json" +
Expand All @@ -182,15 +182,15 @@ <h1>Netflix: Book a Movie...</h1>
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" )
Expand Down Expand Up @@ -226,7 +226,7 @@ <h1>Netflix: Book a Movie...</h1>
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 );
});
Expand All @@ -239,11 +239,11 @@ <h1>Netflix: Book a Movie...</h1>
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" )
Expand Down Expand Up @@ -289,7 +289,7 @@ <h1>Netflix: Book a Movie...</h1>
$( "div", nodes ).css( "height", 0 ).animate( { height: 116 }, 500 );
}
}

function bookingRendered( item ) {
$( item.nodes ).click( function() {
selectBooking( item.data );
Expand All @@ -304,7 +304,7 @@ <h1>Netflix: Book a Movie...</h1>
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 );
}
Expand All @@ -326,7 +326,7 @@ <h1>Netflix: Book a Movie...</h1>
cart.count--;
cartTmplItem.update();
$.tmplCmd( "remove", booking, bookingTmplItems );
return false;
return false;
}

function removeBookings() {
Expand Down
20 changes: 10 additions & 10 deletions demos/movies/PagesTmplPlus/movies2.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h1>Netflix: Book a Movie...</h1>
<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 );
Expand Down Expand Up @@ -141,23 +141,23 @@ <h1>Netflix: Book a Movie...</h1>
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" +
Expand All @@ -177,7 +177,7 @@ <h1>Netflix: Book a Movie...</h1>
});
});
}

function showMovies( data ) {
pageCount = Math.ceil( data.d.__count/pageSize ),
movies = data.d.results;
Expand Down Expand Up @@ -217,7 +217,7 @@ <h1>Netflix: Book a Movie...</h1>
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 );
});
Expand All @@ -234,8 +234,8 @@ <h1>Netflix: Book a Movie...</h1>
$( "#bookingEditTmpl" )

// Render the booking for the chosen movie using the bookingEditTemplate
.tmpl( booking, {
animate: true,
.tmpl( booking, {
animate: true,
rendered: onBookingEditRendered,
addedTmplItems: bookingTmplItems
})
Expand Down Expand Up @@ -280,7 +280,7 @@ <h1>Netflix: Book a Movie...</h1>
});

$( ".close", nodes ).click( removeBooking );

$( ".date", nodes ).change( function() {
data.date = $(this).datepicker( "getDate" );
updateBooking( item );
Expand Down Expand Up @@ -317,7 +317,7 @@ <h1>Netflix: Book a Movie...</h1>
cart.count--;
cartTmplItem.update();
$.tmplCmd( "remove", booking, bookingTmplItems );
return false;
return false;
}

function removeBookings() {
Expand Down
Loading

0 comments on commit 7918f53

Please sign in to comment.