Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuing merge from upstream #117

Merged
merged 3 commits into from
Jan 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 127 additions & 97 deletions _inc/genericons/rtl/genericons-rtl.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions modules/infinite-scroll/infinity.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Scroller = function( settings ) {
this.disabled = false;
this.page = 1;
this.offset = settings.offset;
this.currentday = settings.currentday;
this.order = settings.order;
this.throttle = false;
this.handle = '<div id="infinite-handle"><span>' + text.replace( '\\', '' ) + '</span></div>';
Expand Down Expand Up @@ -108,6 +109,7 @@ Scroller.prototype.render = function( response ) {
Scroller.prototype.query = function() {
return {
page : this.page,
currentday : this.currentday,
order : this.order,
scripts : window.infiniteScroll.settings.scripts,
styles : window.infiniteScroll.settings.styles,
Expand Down Expand Up @@ -285,6 +287,10 @@ Scroller.prototype.refresh = function() {
if ( type == 'click' && !response.lastbatch )
self.element.append( self.handle );

// Update currentday to the latest value returned from the server
if (response.currentday)
self.currentday = response.currentday;

// Fire Google Analytics pageview
if ( self.google_analytics && 'object' == typeof _gaq )
_gaq.push(['_trackPageview', self.history.path.replace( /%d/, self.page ) ]);
Expand Down
12 changes: 11 additions & 1 deletion modules/infinite-scroll/infinity.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ function action_wp_head() {
*/
function action_wp_footer_settings() {
global $wp_rewrite;
global $currentday;

// Base JS settings
$js_settings = array(
Expand All @@ -525,6 +526,7 @@ function action_wp_footer_settings() {
'footer' => is_string( self::get_settings()->footer ) ? esc_js( self::get_settings()->footer ) : self::get_settings()->footer,
'text' => esc_js( __( 'Older posts', 'jetpack' ) ),
'totop' => esc_js( __( 'Scroll back to top', 'jetpack' ) ),
'currentday' => $currentday,
'order' => 'DESC',
'scripts' => array(),
'styles' => array(),
Expand Down Expand Up @@ -815,6 +817,12 @@ function query() {

$page = (int) $_GET['page'];

// Sanitize and set $previousday. Expected format: dd.mm.yy
if ( preg_match( '/^\d{2}\.\d{2}\.\d{2}$/', $_GET['currentday'] ) ) {
global $previousday;
$previousday = $_GET['currentday'];
}

$sticky = get_option( 'sticky_posts' );
$post__not_in = self::wp_query()->get( 'post__not_in' );
if ( ! empty( $post__not_in ) )
Expand Down Expand Up @@ -892,7 +900,9 @@ function query() {
ob_end_clean();

if ( 'success' == $results['type'] ) {
global $currentday;
$results['lastbatch'] = self::is_last_batch();
$results['currentday'] = $currentday;
}

// Loop through posts to capture sharing data for new posts loaded via Infinite Scroll
Expand Down Expand Up @@ -1116,4 +1126,4 @@ function the_neverending_home_page_theme_support() {
*/
if ( The_Neverending_Home_Page::got_infinity() ) {
show_admin_bar( false );
}
}
2 changes: 1 addition & 1 deletion modules/widget-visibility/widget-conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public static function sidebars_widgets( $widget_areas ) {
}

// Old single widget
else if ( false === self::filter_widget( $settings[$id_base] ) ) {
else if ( ! empty( $settings[ $id_base ] ) && false === self::filter_widget( $settings[$id_base] ) ) {
unset( $widget_areas[$widget_area][$position] );
}
}
Expand Down