From fa753d92e79afa753b90f01f6d4230ee893fb428 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sat, 19 Mar 2011 23:40:45 -0400 Subject: [PATCH 1/5] docs : add Sites using Isotope from Ember --- css/style.css | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) diff --git a/css/style.css b/css/style.css index 7bd952d..ad2b894 100644 --- a/css/style.css +++ b/css/style.css @@ -607,6 +607,57 @@ code .nd { color: #9FAD7E; } /* CSS pseudo selector */ width: 436px; } +/**** Sites using Isotope ****/ + +#sites h2 { + padding: 0.4em; + line-height: 32px; + margin-bottom: 0.4em; +} + +#sites h2 img { + display: inline-block; + margin-right: 0.4em; + vertical-align: bottom; +} + +#sites h2.loading { + background: white; + color: #222; +} + +#sites ul { + margin: 0; +} + +#sites li { + list-style: none; + float: left; + width: 290px; +} + +#sites li a, +#sites li b, +#sites li img { + display: block; +} + +#sites li a { + width: 270px; + padding: 10px; +} + +#sites li a:hover { + background: #333; +} + +#sites li b { + font-weight: bold; + line-height: 1.3em; + margin-bottom: 0.6em; +} + + /************************** ** Infinite Scroll **************************/ diff --git a/index.html b/index.html index ea7a4a6..19f1df6 100644 --- a/index.html +++ b/index.html @@ -91,6 +91,8 @@ layout: nil +
+ {% include footer.html %} @@ -142,6 +144,53 @@ layout: nil } }); + // Sites using Isotope markup + var $sites = $('#sites'), + $sitesTitle = $('

Loading sites using Isotope

'), + $sitesList = $(''); + + $sites.append( $sitesTitle ).append( $sitesList ); + + $sitesList.isotope({ + layoutMode: 'cellsByRow', + cellsByRow: { + columnWidth: 290, + rowHeight: 400 + } + }); + + // dynamically load sites using Isotope from Ember app + $.getJSON('http://api.emberapp.com/users/view/' + + 'desandro/collections/view/isotope.json?callback=?', + function( data ){ + + // proceed only if we have images + if ( !data.response || !data.response.images ) { + return; + } + var images = data.response.images, + items = [], + item, image; + + for ( var i=0, len = images.length; i < len; i++ ) { + image = images[i]; + item = '
  • ' + + '' + image.name + '' + + '' + + '
  • '; + items.push( item ); + } + + var $items = $( items.join('') ); + + $items.imagesLoaded(function(){ + $sitesTitle.removeClass('loading').text('Sites using Isotope'); + $sitesList.isotope( 'insert', $items ); + }); + + }); + + }); From 9626ba8889caa88376235ed19d5ae89d592e832d Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sun, 20 Mar 2011 12:21:25 -0400 Subject: [PATCH 2/5] docs : add {{ site.jquery_js }} --- _layouts/elements.html | 2 +- _layouts/inf-scroll-page.html | 2 +- _posts/demos/2010-12-12-basic.html | 2 +- _posts/demos/2010-12-29-layout-modes.html | 2 +- _posts/demos/2010-12-30-filtering.html | 2 +- _posts/demos/2010-12-30-sorting.html | 2 +- _posts/demos/2010-12-31-relayout.html | 2 +- _posts/demos/2011-01-02-adding-items.html | 2 +- _posts/demos/2011-01-02-infinite-scroll.html | 2 +- _posts/demos/2011-01-11-images.html | 2 +- index.html | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/_layouts/elements.html b/_layouts/elements.html index 759f7a5..c009a63 100644 --- a/_layouts/elements.html +++ b/_layouts/elements.html @@ -50,7 +50,7 @@ {% include footer.html %} - + + + + + + + + + + +