-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
129 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script type="text/javascript"> | ||
;( function( $ ) { | ||
$( '.swipebox' ).swipebox({ | ||
hideCloseButtonOnMobile: true | ||
}); | ||
} )( jQuery ); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<% if (is_home()) { %> | ||
<%- partial('_partial/header', { | ||
title: config.title, | ||
hdClass: 'index-header' | ||
}) %> | ||
<div class="container body-wrap"> | ||
<ul class="post-list"> | ||
<% | ||
if (theme.articleSort) { | ||
site.posts.data = site.posts.data.sort(function(a, b) { | ||
return Number(a.updated.format('x')) < Number(b.updated.format('x')) ? 1 : -1; | ||
}); | ||
} | ||
var perPage = config.per_page || config.index_generator.per_page || config.topindex_generator.per_page || 10; | ||
var startIndex = (page.current - 1) * perPage; | ||
var endIndex = startIndex + perPage; | ||
site.posts.slice(startIndex, endIndex).forEach(function (post, index) { %> | ||
<li class="post-list-item fade"> | ||
<%- partial('_partial/index-item', { | ||
post: post, | ||
index: index, | ||
total: page.posts.length | ||
}) %> | ||
</li> | ||
<% }) %> | ||
</ul> | ||
<%- partial('_partial/paginator') %> | ||
</div> | ||
<% if (is_home()) { %> | ||
<%- partial('_partial/header', { | ||
title: config.title, | ||
hdClass: 'index-header' | ||
}) %> | ||
<div class="container body-wrap"> | ||
<ul class="post-list"> | ||
<% | ||
if (theme.articleSort) { | ||
site.posts.data = site.posts.data.sort(function(a, b) { | ||
return Number(a.updated.format('x')) < Number(b.updated.format('x')) ? 1 : -1; | ||
}); | ||
} | ||
var perPage = config.per_page || config.index_generator.per_page || config.topindex_generator.per_page || 10; | ||
var startIndex = (page.current - 1) * perPage; | ||
var endIndex = startIndex + perPage; | ||
site.posts.slice(startIndex, endIndex).forEach(function (post, index) { %> | ||
<li class="post-list-item fade"> | ||
<%- partial('_partial/index-item', { | ||
post: post, | ||
index: index, | ||
total: page.posts.length | ||
}) %> | ||
</li> | ||
<% }) %> | ||
</ul> | ||
<%- partial('_partial/paginator') %> | ||
</div> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/*! A fix for the iOS orientationchange zoom bug. | ||
Script by @scottjehl, rebound by @wilto. | ||
MIT / GPLv2 License. | ||
*/ | ||
(function(w){ | ||
|
||
// This fix addresses an iOS bug, so return early if the UA claims it's something else. | ||
var ua = navigator.userAgent; | ||
if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){ | ||
return; | ||
} | ||
|
||
var doc = w.document; | ||
|
||
if( !doc.querySelector ){ return; } | ||
|
||
var meta = doc.querySelector( "meta[name=viewport]" ), | ||
initialContent = meta && meta.getAttribute( "content" ), | ||
disabledZoom = initialContent + ",maximum-scale=1", | ||
enabledZoom = initialContent + ",maximum-scale=10", | ||
enabled = true, | ||
x, y, z, aig; | ||
|
||
if( !meta ){ return; } | ||
|
||
function restoreZoom(){ | ||
meta.setAttribute( "content", enabledZoom ); | ||
enabled = true; | ||
} | ||
|
||
function disableZoom(){ | ||
meta.setAttribute( "content", disabledZoom ); | ||
enabled = false; | ||
} | ||
|
||
function checkTilt( e ){ | ||
aig = e.accelerationIncludingGravity; | ||
x = Math.abs( aig.x ); | ||
y = Math.abs( aig.y ); | ||
z = Math.abs( aig.z ); | ||
|
||
// If portrait orientation and in one of the danger zones | ||
if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ | ||
if( enabled ){ | ||
disableZoom(); | ||
} | ||
} | ||
else if( !enabled ){ | ||
restoreZoom(); | ||
} | ||
} | ||
|
||
w.addEventListener( "orientationchange", restoreZoom, false ); | ||
w.addEventListener( "devicemotion", checkTilt, false ); | ||
|
||
})( this ); |
Oops, something went wrong.