Initial commit

This commit is contained in:
Ben Goldsworthy 2017-01-12 23:10:07 +00:00
commit 28e6ddf404
1083 changed files with 191734 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/*
--------------------------------
Infinite Scroll Behavior
Cufon Refresh
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function ($, undefined) {
$.extend($.infinitescroll.prototype,{
_callback_cufon: function infscr_callback_cufon(newElements) {
Cufon.refresh(newElements);
}
});
})(jQuery);

View file

@ -0,0 +1,26 @@
// Calculate internal height (used for local scroll)
// this function is from the old localMode I think?
function infsrc_local_hiddenHeight(element) {
var height = 0;
jQuery(element).children().each(function() {
height = height + jQuery(this).outerHeight(false);
});
return height;
}
jQuery.extend(jQuery.infinitescroll.prototype,{
_nearbottom_local: function infscr_nearbottom_local() {
var opts = this.options, instance = this,
pixelsFromWindowBottomToBottom = infsrc_local_hiddenHeight(opts.binder)
- jQuery(opts.binder).scrollTop() - jQuery(opts.binder).height();
if (opts.local_pixelsFromNavToBottom == undefined){
opts.local_pixelsFromNavToBottom = infsrc_local_hiddenHeight(opts.binder) +
jQuery(opts.binder).offset().top - jQuery(opts.navSelector).offset().top;
}
instance._debug('local math:', pixelsFromWindowBottomToBottom,
opts.local_pixelsFromNavToBottom);
return (pixelsFromWindowBottomToBottom - opts.bufferPx < opts.local_pixelsFromNavToBottom);
}
});

View file

@ -0,0 +1,61 @@
/*
--------------------------------
Infinite Scroll Behavior
Manual / Twitter-style
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function($, undefined) {
$.extend($.infinitescroll.prototype,{
_setup_twitter: function infscr_setup_twitter () {
var opts = this.options,
instance = this;
// Bind nextSelector link to retrieve
$(opts.nextSelector).click(function(e) {
if (e.which == 1 && !e.metaKey && !e.shiftKey) {
e.preventDefault();
instance.retrieve();
}
});
// Define loadingStart to never hide pager
instance.options.loading.start = function (opts) {
opts.loading.msg
.appendTo(opts.loading.selector)
.show(opts.loading.speed, function () {
instance.beginAjax(opts);
});
}
},
_showdonemsg_twitter: function infscr_showdonemsg_twitter () {
var opts = this.options,
instance = this;
//Do all the usual stuff
opts.loading.msg
.find('img')
.hide()
.parent()
.find('div').html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
$(this).parent().fadeOut('normal');
});
//And also hide the navSelector
$(opts.navSelector).fadeOut('normal');
// user provided callback when done
opts.errorCallback.call($(opts.contentSelector)[0],'done');
}
});
})(jQuery);

View file

@ -0,0 +1,21 @@
/*
--------------------------------
Infinite Scroll Behavior
Masonry Integration
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function($, undefined) {
$.extend($.infinitescroll.prototype,{
_callback_masonry: function infscr_callback_masonry (newElements) {
$(this).masonry('appended',$(newElements));
}
});
})(jQuery);

View file

@ -0,0 +1,19 @@
/*
--------------------------------
Infinite Scroll Behavior
Sausage.js Integration
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function($, undefined) {
$.extend($.infinitescroll.prototype,{
// TODO: Implement
});
})(jQuery);

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,126 @@
<?php
/**
* Infinite Scroll Administrative Backend
* @subpackage Admin
* @package Infinite_Scroll
*/
class Infinite_Scroll_Admin {
private $parent;
/**
* Register hooks with WordPress API
* @param class $parent (reference) the Parent Class
*/
function __construct( &$parent ) {
$this->parent = &$parent;
add_action( 'admin_menu', array( &$this, 'options_menu_init' ) );
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue' ) );
//upload helers
add_filter( 'get_media_item_args', array( &$this, 'send_to_editor'), 10, 1);
}
/**
* Register our menu with WordPress
*/
function options_menu_init() {
add_options_page( __( 'Infinite Scroll Options', 'infinite-scroll' ), __( 'Infinite Scroll', 'infinite-scroll' ), 'manage_options', 'infinite_scroll_options', array( &$this, 'options' ) );
}
/**
* Callback to load options template
*/
function options() {
//toggle presets page
$file = isset( $_GET['manage-presets'] ) ? 'manage-presets' : 'options';
$file = isset( $_GET['submit'] ) ? 'submit' : $file;
require dirname( $this->parent->file ) . '/templates/' . $file . '.php';
}
/**
* Enqueue admin JS on options page
*/
function admin_enqueue() {
if ( get_current_screen()->id != 'settings_page_infinite_scroll_options' && !defined( 'IFRAME_REQUEST' ) )
return;
$suffix = ( WP_DEBUG || SCRIPT_DEBUG ) ? '.dev' : '';
$file = "/js/admin/infinite-scroll{$suffix}.js";
wp_enqueue_script( $this->parent->slug, plugins_url( $file, $this->parent->file ), array( 'jquery', 'media-upload', 'thickbox' ), $this->parent->version, true );
wp_enqueue_style('thickbox');
wp_localize_script( $this->parent->slug, $this->parent->slug_, array( 'confirm' => __( 'Are you sure you want to delete the preset "%s"?', 'infinite-scroll' ) ) );
}
/**
* If image is sucessfully uploaded, automatically close the editor
* and store the image URL in the image input
* @param array $args the default args
* @return array the original args, unmodified
* @uses media_send_to_editor()
& @uses send_to_editor() (javascript)
*/
function send_to_editor( $args ) {
global $wpdb;
if ( $args['errors'] !== null )
return $args;
if ( isset( $_GET['attachment_id'] ) ) {
$id = $_GET['attachment_id'];
//workaround for WP 3.2 non-flash upload
//not ideal, but works for an edge case
} else {
//because we can't get the attachment ID at this point, try to pull it from the database
//look for the most recent parent-less attachment with same title and mime-type
$upload = $GLOBALS['HTTP_POST_FILES']['async-upload'];
$title = substr( $upload['name'], 0, strrpos( $upload['name'], '.' ) );
$id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type = '" . $upload['type'] . "' AND post_parent = '0' AND post_title = '$title' ORDER BY ID DESC LIMIT 1" );
//if for some reason we couldn't pull the ID, simply kick
//the user will just have to click insert to close the dialog
if ( !$id )
return $args;
}
//rely on WordPress's internal function to output script tags and call send_to_editor()
media_send_to_editor( wp_get_attachment_url( $id ) );
return $args;
}
/**
* Wrapper function to load the tinyMCE Editor
* Used to allow fallback to pre-3.3 function
* @param string $field the field to load the editor for
*/
function editor( $field ) {
//3.3
if ( function_exists( 'wp_editor' ) )
wp_editor( $this->parent->options->loading[ $field ], "infinite_scroll[loading][{$field}]", array( 'media_buttons' => false, 'textarea_rows' => 5, 'teeny' => true ) );
//3.2
else
the_editor( $this->parent->options->loading[ $field ], "infinite_scroll[loading][{$field}]", null, false );
}
}

View file

@ -0,0 +1,191 @@
<?php
/**
* Provides interface to store and retrieve plugin and user options
* @subpackage Infinite_Scroll_Options
* @package Infinite_Scroll
*/
class Infinite_Scroll_Options {
//default scope for options when called directly,
//choices: site, user, or global (user option across sites)
public $defaults = array();
private $parent;
/**
* Stores parent class as static
* @param class $parent (reference) the parent class
*/
function __construct( &$parent ) {
$this->parent = &$parent;
add_action( 'admin_init', array( &$this, 'options_init' ) );
add_filter( $this->parent->prefix . 'options', array( &$this, 'default_options_filter' ), 20 );
add_filter( $this->parent->prefix . 'js_options', array( &$this, 'db_version_filter' ) );
}
/**
* Tells WP that we're using a custom settings field
*/
function options_init() {
register_setting( $this->parent->slug_, $this->parent->slug_, array( &$this, 'validate' ) );
}
/**
* Runs options through filter prior to saving
* @param array $options the options array
* @return array sanitized options array
*/
function validate( $options ) {
//add slashes to JS selectors
$js = array ( 'nextSelector', 'navSelector', 'itemSelector', 'contentSelector' );
foreach ( $js as $field ) {
if ( !isset( $options[$field] ) )
continue;
$options[$field] = addslashes( $options[ $field ] );
}
//force post-style kses on messages
foreach ( array( 'finishedMsg', 'msgText' ) as $field ) {
if ( !isset( $options['loading'][$field] ) )
continue;
// wp_filter_post_kses will add slashes to something like "you've" -> "you\'ve" but not added slashes to other slashes
// Escaping the slashes and then stripping them, gets past this problem and allows preservation of intentionally inserted slashes
$options['loading'][$field] = stripslashes(wp_filter_post_kses( addslashes($options['loading'][$field] )));
}
//handle image resets
if ( isset( $_POST[ 'reset_default_image'] ) )
$options["loading"]['img'] = $this->defaults["loading"]['img'];
//pull existing image if none is given
if ( empty( $options["loading"]['img'] ) )
$options["loading"]['img'] = $this->loading["img"];
// force `debug` to be a bool
$options["debug"] = (bool)$options["debug"];
return apply_filters( $this->parent->prefix . 'options_validate', $options );
}
/**
* Allows overloading to get option value
* Usage: $value = $object->{option name}
* @param string $name the option name
* @return mixed the option value
*/
function __get( $name ) {
return $this->get_option( $name );
}
/**
* Allows overloading to set option value
* Usage: $object->{option name} = $value
* @param string $name unique option key
* @param mixed $value the value to store
* @return bool success/fail
*/
function __set( $name, $value ) {
return $this->set_option( $name, $value );
}
/**
* Retreive the options array
* @return array the options
*/
function get_options( ) {
if ( !$options = wp_cache_get( 'options', $this->parent->slug ) ) {
$options = get_option( $this->parent->slug_ );
wp_cache_set( 'options', $options, $this->parent->slug );
}
return apply_filters( $this->parent->prefix . 'options', $options );
}
/**
* If any options are not set, merge with defaults
* @param array $options the saved options
* @return array the merged options with defaults
*/
function default_options_filter( $options ) {
$options = wp_parse_args( $options, $this->defaults );
wp_cache_set( 'options', $options, $this->parent->slug );
return $options;
}
/**
* Retreives a specific option
* @param string $option the unique option key
* @return mixed the value
*/
function get_option( $option ) {
$options = $this->get_options( );
$value = ( isset( $options[ $option ] ) ) ? $options[ $option ] : false;
return apply_filters( $this->parent->prefix . $option, $value );
}
/**
* Sets a specific option
* @return bool success/fail
* @param string $key the unique option key
* @param mixed $value the value
*/
function set_option( $key, $value ) {
$options = array( $key => $value );
$this->set_options( $options );
}
/**
* Sets all plugin options
* @param array $options the options array
* @param bool $merge (optional) whether or not to merge options arrays or overwrite
* @return bool success/fail
*/
function set_options( $options, $merge = true ) {
if ( $merge ) {
$defaults = $this->get_options();
$options = wp_parse_args( $options, $defaults );
}
wp_cache_set( 'options', $options, $this->parent->slug );
return update_option( $this->parent->slug_, $options );
}
/**
* Don't output db_version to front end when passing args to javascript function
*/
function db_version_filter( $options ) {
unset( $options['db_version'] );
return $options;
}
}

View file

@ -0,0 +1,759 @@
<?php
/**
* Infinite Scroll Presets Interface
*
* Stores theme-specific presets for CSS Selectors to aid with setup. Pulls community presets from CSV
* stored in the plugin's SVN repo.
*
* The csv from the repo is cached for 24 hours as a site-transient (available to all sites on a network install)
*
* Custom presets (beyond the SVN CSV) are stored as a site option (also available to all sites on network)
*
* On a single site install, settings available to all admins.
* On a network install, settings available only to super-admins (but site-admins can load those presets)
*
* If a user hasn't chosen CSS selectors for there theme and a preset exists, the plugin will
* default to the preset (thus in many cases, no need to adjust any settings or know this exists).
*
* Hierarchy of presets: 1) User specified, 2) (admin specified) custom preset, 3) community specified preset
*
* @subpackage Presets
* @package Infinite_Scroll
*/
require_once(ABSPATH . "/wp-admin/includes/theme.php");
class Infinite_Scroll_Presets {
private $parent;
// public $preset_url = 'http://plugins.svn.wordpress.org/infinite-scroll/branches/PresetDB/presets.csv';
public $preset_url = 'https://raw.github.com/benbalter/Infinite-Scroll/presetDB/presets.csv';
public $custom_preset_key = 'infinite_scroll_presets';
public $ttl = 86000; //TTL of transient cache in seconds, 1 day = 86400 = 60*60*24
public $keys = array( 'theme', 'contentSelector', 'navSelector', 'itemSelector', 'nextSelector' );
/**
* Register hooks with WordPress API
*
* @param object $parent (reference) the parent class
*/
function __construct( &$parent ) {
$this->parent = &$parent;
add_action( 'admin_init', array( &$this, 'set_presets' ) );
add_action( 'wp_ajax_infinite-scroll-edit-preset', array( &$this, 'process_ajax_edit' ) );
add_action( 'wp_ajax_infinite-scroll-delete-preset', array( &$this, 'process_ajax_delete' ) );
add_filter( $this->parent->prefix . 'presets', array( &$this, 'merge_custom_presets' ) );
add_filter( $this->parent->prefix . 'options', array( &$this, 'default_to_presets'), 9 );
add_action( $this->parent->prefix . 'refresh_cache', array( &$this, 'get_presets' ) );
}
/**
* Allow for class overloading
* @param string $preset the theme slug to retrieve
* @return array|bool the presets or false on failure
*/
function __get( $preset ) {
return $this->get_preset( $preset );
}
function getThemes($args) {
if (function_exists("wp_get_themes")) {
return wp_get_themes($args);
} else {
return get_themes();
}
}
function getTheme($theme) {
if (function_exists("wp_get_theme")) {
return wp_get_theme($theme);
} else {
return get_theme($theme);
}
}
/**
* Pulls preset array from cache, or retrieves and parses
* @return array an array of preset objects
* @todo Consider using TLC Transients in case cron isn't working
*/
function get_presets() {
//check cache
if ( $cache = get_transient( $this->parent->prefix . 'presets' ) )
return apply_filters( $this->parent->prefix . 'presets', $cache );
$data = wp_remote_get( $this->preset_url );
if ( is_wp_error( $data ) )
return array();
$data = wp_remote_retrieve_body( $data );
//parse CSV string into array
$presets = $this->parse_csv( $data );
//sort by key alpha ascending
asort( $presets );
set_transient( $this->parent->prefix . 'presets', $presets, $this->ttl );
return apply_filters( $this->parent->prefix . 'presets', $presets );
}
/**
* Return a theme's preset object
* @param string $theme the slug of theme to retrieve
* @return object the preset object
*/
function get_preset( $theme = null ) {
if ( $theme == null )
$theme = get_stylesheet();
$presets = $this->get_presets();
//direct match found, return
if ( array_key_exists( $theme, $presets ) )
return $presets[ $theme ];
//no direct match found, permahps this is a child theme?
//theme isn't installed, no way to know if it's a child, so skip
if ( !$this->theme_installed( $theme ) )
return false;
//WP version 3.4+, use the new wp_get_themes function
if ( function_exists( 'wp_get_theme' ) ) {
$theme = $this->getTheme($theme);
//not a theme or not a child
if ( is_wp_error( $theme ) || !is_object( $theme->parent() ) )
return false;
return $this->get_preset( $theme->parent()->stylesheet );
}
//pre 3.4 back compat..
//get theme by slug
$name = $this->get_name( $theme );
$themes = $this->getThemes(array());
$child = $themes[ $name ];
//not a child theme
if ( !isset( $child['Template'] ) || empty( $child['Template'] ) || $child['Template'] == $child['Stylesheet'] )
return false;
//pull up parent data to get its name
$parent = $themes[$name]['Template'];
$parent = get_theme_data( get_theme_root( $child['Template'] ) . '/' . $child['Template'] . '/style.css' );
$preset = $this->get_preset( $parent['Stylesheet'] );
//no parent preset
if ( !$preset )
return false;
//rename the theme of the parent preset object for consistent return
$preset->theme = $theme;
$preset->parentPreset = $parent['Stylesheet'];
return $preset;
}
/**
* On plugin activation register with WP_Cron API to asynchronously refresh cache every 24 hours
* This will also asynchronously prime the cache on activation
*/
function schedule() {
wp_schedule_event( time(), 'daily', $this->parent->prefix . 'refresh_cache' );
}
/**
* Clear chron schedule on deactivation
*/
function unschedule() {
wp_clear_scheduled_hook( $this->parent->prefix . 'refresh_cache' );
}
/**
* Conditionally prompts users on options page to use the default selectors
* @uses get_preset
*/
function preset_prompt() {
$preset = $this->get_preset( );
if ( !$preset )
return;
unset( $preset->theme );
unset( $preset->parentPreset );
//if they are already using the preset, don't prompt
$using_default = true;
foreach ( $preset as $key => $value ) {
if ( $this->parent->options->$key != $value )
$using_default = false;
}
if ( $using_default )
return;
require dirname( $this->parent->file ) . '/templates/preset-prompt.php';
}
/**
* Reset selectors to default
*/
function set_presets() {
if ( !isset( $_GET['set_presets'] ) )
return;
if ( !current_user_can( 'manage_options' ) )
return;
check_admin_referer( 'infinite-scroll-presets', 'nonce' );
//don't delete options if we don't have a preset
$preset = $this->get_preset( );
if ( !$preset )
return;
foreach ( $this->keys as $key )
$this->parent->options->$key = null;
wp_redirect( admin_url( 'options-general.php?page=infinite_scroll_options&settings-updated=true' ) );
exit();
}
/**
* Handles AJAX edits from the manage presets form
*/
function process_ajax_edit() {
if ( !current_user_can( 'manage_options' ) )
wp_die( -1 );
if ( is_multisite() && !is_super_admin() )
wp_die( -1 );
$data = new stdClass;
foreach ( $this->keys as $key )
$data->$key = addslashes( trim( $_POST[ $key . '_column-' . $key ] ) );
$this->set_custom_preset( $data->theme, $data );
wp_die( 1 );
}
/**
* Handles AJAX requests to delete presets from the manage presets form
*/
function process_ajax_delete() {
if ( !current_user_can( 'manage_options' ) )
wp_die( -1 );
if ( is_multisite() && !is_super_admin() )
wp_die( -1 );
if ( !isset( $_GET['theme'] ) )
wp_die( -1 );
$this->delete_custom_preset( $_GET['theme'] );
}
/**
* Retreive global custom presets
* @return array the custom preset array
*/
function get_custom_presets( ) {
$presets = get_site_option( $this->custom_preset_key, array(), true );
return apply_filters( $this->parent->prefix . 'custom_presets', $presets );
}
/**
* Update global custom presets
* @param array $presets the presets (all)
* @return bool success/fail
*/
function set_custom_presets( $presets ) {
return update_site_option( $this->custom_preset_key, $presets );
}
/**
* Store a theme's global presets
* @param string $theme the theme name
* @param array $preset the presets
* @return bool success/fail
*/
function set_custom_preset( $theme, $preset ) {
$presets = $this->get_custom_presets();
$presets[ $theme ] = $preset;
return $this->set_custom_presets( $presets );
}
/**
* Removes a custom preset from the database
* @param string $theme the theme to remove
* @return bool success/fail
*/
function delete_custom_preset( $theme ) {
$presets = $this->get_custom_presets();
unset( $presets[ $theme ] );
return $this->set_custom_presets( $presets );
}
/**
* Allow custom presets to merge/override community presets
* @param unknown $presets
* @return unknown
*/
function merge_custom_presets( $presets ) {
// 2nd array overrides keys that overlap with first array
$presets = array_merge( $presets, $this->get_custom_presets() );
//sort by key alpha ascending
asort( $presets );
return $presets;
}
/**
* If a selector is not set, try to grab a preset to save the user trouble
* @param array $options the options array
* @return array the defaulted options array
*/
function default_to_presets( $options ) {
//we don't have a preset, no need to go any further
if ( !( $preset = $this->get_preset( ) ) )
return $options;
foreach ( $this->keys as $key ) {
if ( empty( $options[$key] ) )
$options[$key] = $preset->$key;
}
return $options;
}
/**
* Converts legacy csv.php format
* Removes first two lines and last line
* @param string $data the contents of the CSV (usually via wp_remote_get)
* @param string the equivalent standard CSV
*/
function parse_legacy_csv( $data ) {
if ( is_string( $data ) )
$data = explode( "\n", $data );
//remove first two lines
$data = array_slice( $data, 2 );
//remove the last line
array_pop( $data );
$presets = $this->parse_csv( $data );
$output = array();
//convert Theme Name to stylesheet and stuff into output array
foreach( $presets as $theme ) {
$theme->theme = $this->get_stylesheet( $theme->theme );
$output[ $theme->theme ] = $theme;
}
return $output;
}
/**
* Parse CSV into array of preset objects
* @param string|array the CSV data, either as a string or as an array of lines
* @return array array of preset objects
*/
function parse_csv( $data ) {
if ( is_string( $data ) )
$data = explode( "\n", $data );
//php 5.3+
if ( function_exists( 'str_getcsv' ) ) {
foreach ( $data as &$line )
$line = str_getcsv( $line );
//php 5.2
// fgetcsv needs a file handle,
// so write the string to a temp file before parsing
} else {
$fh = tmpfile();
fwrite( $fh, implode( "\n", $data ) );
fseek( $fh, 0 );
$data = array();
while( $line = fgetcsv( $fh ) )
$data[] = $line;
fclose( $fh );
}
$presets = array();
//build preset objects and stuff into keyed array
foreach ( $data as &$line ) {
$lineObj = new stdClass;
foreach ( $this->keys as $id => $key )
$lineObj->$key = $line[ $id ];
$presets[ $lineObj->theme ] = $lineObj;
}
return $presets;
}
/**
* Return object representing current theme's selectors
* @return object the same as would be returned from get_preset()
*/
function current_selectors() {
$theme = new stdClass();
foreach ( $this->keys as $key )
$theme->$key = $this->parent->options->$key;
$theme->theme = get_stylesheet();
return $theme;
}
/**
* Export CSS Selectors as CSV
* @param bool $all (optional) whether to include community selectors in output
* @return string CSV of selectors
*/
function export( $all = false ) {
$presets = array();
//if the current theme is not a known preset or they want all
if ( !$this->get_preset( ) || $all )
$presets[ get_stylesheet() ] = $this->current_selectors();
//user has access to global custom presets
if ( is_multisite() && is_super_admin() ) {
if ( $custom = $this->get_custom_presets() );
$presets = array_merge( $presets, $custom );
}
//include community presets, if asked
if ( $all )
$presets = array_merge( $this->get_presets(), $presets );
asort( $presets );
//workaround because fputcsv needs a file handle by default
$fh = tmpfile();
$length = 0;
foreach ( $presets as &$preset )
$length += fputcsv( $fh, (array) $preset );
if ( $length == 0 )
return false;
fseek( $fh, 0 );
$csv = fread( $fh, $length );
fclose( $fh );
return $csv;
}
/**
* Migrates legacy csv.php files to 2.5's custom presets format
* @uses parse_legacy_csv
*/
function migrate() {
//no preset file to migrate
if ( !file_exists( dirname( $this->parent->file ) . '/PresetDB.csv.php' ) )
return;
$data = file_get_contents( dirname( $this->parent->file ) . '/PresetDB.csv.php' );
$presets = $this->parse_legacy_csv( $data );
//this wiill override any existing presets,
// but is okay as is only being fired when no presets exist
$this->set_custom_presets( $presets );
return $presets;
}
/**
* Determines whether a given theme is installed
* @param string|object $theme either the theme slug or the preset object
* @return bool true if insalled, otherwise false
*/
function theme_installed( $theme ) {
// get theme name if $theme is an preset object
if ( is_object( $theme ) ) {
$theme = $theme->theme;
}
//3.4+
if ( function_exists( 'wp_get_theme' ) ) {
return wp_get_theme( $theme )->exists();
} else {
//pre 3.4
$themes = get_themes();
$name = $this->get_name( $theme );
return array_key_exists( $name, $themes );
}
}
/**
* Given a theme name, returns the coresponding theme stylesheet
*
* Used for converting legacy CSVs which were name based to new CSVs which are stylesheet based
* since 3.4 returns themes keyed to stylesheets, not names as it did pre-3.4
*
* @param string $theme the theme name
* @return string the stylesheet
*/
function get_stylesheet( $name ) {
//pre 3.4
if ( !function_exists( 'wp_get_themes' ) ) {
if ( $theme = get_theme( $name ) )
return $theme->stylesheet;
//3.4+
} else {
//we can't use wp_filter_list_object with WP_Theme objects, so filter manually
foreach ( $this->getThemes(null) as $theme )
if ( $theme->name = $name )
return $theme->stylesheet;
}
return false;
}
/**
* Given a theme stylesheet, return the coresponding theme name
*
* Used to normalize data between 3.3 and 3.4 where keying of themes switched from name to stylesheet
*
* @param string $stylesheet the theme stylesheet (slug)
* @return string the theme name
*/
function get_name( $stylesheet ) {
//3.4+
if ( function_exists( 'wp_get_theme' ) ) {
if ( $theme = wp_get_theme( $stylesheet ) )
return $theme->name;
//pre 3.4
} else {
foreach ( get_themes() as $theme )
if ( $theme->stylesheet == $stylesheet )
return $theme->name;
}
//theme isn't installed, use the WP.org API to grab the name rather than risk losing data on upgrade
$api = themes_api( 'theme_information', array( 'slug' => $stylesheet, 'fields' => array( 'sections' => false, 'tags' => false ) ) );
if ( is_wp_error( $api ) )
return false;
return $api->name;
}
}
if (!class_exists('WP_List_Table')) {
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
/**
* List table for manage custom presets page
*/
class Infinite_Scroll_Presets_Table extends WP_List_Table {
/**
* Register with Parent
*/
function __construct( $args = array() ) {
parent::__construct( array(
'singular' => 'preset',
'plural' => 'presets',
'ajax' => true,
) );
}
/**
* Default column callback
* @param object $item the item to display
* @param string $column_name the column name
* @return string the HTML to display
*/
function column_default( $item, $column_name ) {
return $item->$column_name;
}
/**
* Callback to display the theme column
* @param object $item the preset object
* @return string the HTML to display
*/
function column_theme( $item ) {
global $infinite_scroll;
$s = '<strong><a href="#" class="theme-name">' . $item->theme . '</a></strong>';
$s .= '<div class="edit edit-link" style="visibility:hidden;"><a href="#">' . __( 'Edit', 'infinite-scroll' ) . '</a> | <span class="delete"><a href="#">' . __( 'Delete', 'infinite-scroll' ) . '</a></span></div>';
$s .= '<div class="save save-link" style="display:none; padding-top:5px;"><a href="#" class="button-primary">' . __( 'Save', 'infinite-scroll' ) . '</a> <a href="#" class="cancel">' . __( 'Cancel', 'infinite-scroll' ) . '</a> <img class="loader" style="display:none;" src="'. admin_url( '/images/loading.gif' ) .'" /></div>';
return $s;
}
/**
* Callaback to return list of columns to display
* @return array the columns to display
*/
function get_columns() {
return array(
'theme' => 'Theme',
'contentSelector' => 'Content Selector',
'navSelector' => 'Navigation Selector',
'nextSelector' => 'Next Selector',
'itemSelector' => 'Item Selector',
);
}
/**
* Grab data and filter prior to passing to table class
*/
function prepare_items() {
global $infinite_scroll;
$per_page = 25;
$columns = $this->get_columns();
$hidden = array();
$sortable = array();
$this->_column_headers = array($columns, $hidden, $sortable);
$data = $infinite_scroll->presets->get_presets();
//only display installed themes
$data = array_filter( $data, array( &$infinite_scroll->presets, 'theme_installed' ) );
//merge in themes
$themes = $infinite_scroll->presets->getThemes(null);
foreach ( $themes as $theme => $theme_data ) {
if ( array_key_exists( $theme, $data) )
continue;
//check for parent theme's preset, if any
if ( $preset = $infinite_scroll->presets->get_preset( $theme ) ) {
$data[ $theme ] = $preset;
continue;
}
$themeObj = new stdClass;
foreach ( $infinite_scroll->presets->keys as $key )
$themeObj->$key = null;
$themeObj->theme = $theme;
$data[ $theme ] = $themeObj;
}
asort( $data );
$current_page = $this->get_pagenum();
$total_items = count($data);
$data = array_slice($data, (($current_page-1)*$per_page), $per_page);
$this->items = $data;
$this->set_pagination_args( array(
'total_items' => $total_items, //WE have to calculate the total number of items
'per_page' => $per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages
) );
}
}

View file

@ -0,0 +1,67 @@
<?php
/**
* Prompts users to submit CSS Selectors to WP Forums when appropriate
* @subpackage Infinite_Scroll_Submit
* @package Infinite_Scroll
*/
class Infinite_Scroll_Submit {
// public $url = 'http://wordpress.org/support/topic/plugin-infinite-scroll-FOO#postform';
public $url = 'https://github.com/benbalter/Infinite-Scroll/issues/7#issue_comment_form';
private $parent;
/**
* Stores parent class as static
* @param class $parent (reference) the parent class
*/
function __construct( &$parent ) {
$this->parent = &$parent;
add_action( 'wp_ajax_' . $this->parent->slug_ . '_hide_submit', array( &$this, 'hide') );
}
/**
* Conditionally prompts users to submit selectors to community DB when appropriate
*/
function prompt() {
//user has globally opted out
if ( get_user_option( 'infinite-scroll-hide-submit', get_current_user_ID() ) )
return;
//their current theme's preset selectors, false if none found (good)
$preset = $this->parent->presets->get_preset( get_stylesheet() );
//their network-wide custom presets, false if none found (bad)
$custom = $this->parent->presets->get_custom_presets( );
//the site's current theme is a preset
// and there are no custom presets, kick
if ( $preset && !$custom )
return;
//we already have their current theme,
// and they can't submit custom presets b/c multisite and not superadmin
if ( $preset && is_multisite() && !is_super_admin() )
return;
require dirname( $this->parent->file ) . '/templates/submit-prompt.php';
}
/**
* Stores user's preference to hide the submit message via AJAX
*/
function hide() {
check_ajax_referer( $this->parent->slug_ . '_hide_submit' , '_ajax_nonce-' . $this->parent->slug . '-hide-submit' );
//note: option will be global
update_user_option( get_current_user_ID(), 'infinite-scroll-hide-submit', true, true );
die( 1 );
}
}

View file

@ -0,0 +1,316 @@
<?php
/*
Plugin Name: Infinite Scroll
Description: Automatically loads the next page of posts into the bottom of the initial page.
Version: 2.6.2
Author: Beaver6813, dirkhaim, Paul Irish, benbalter, Glenn Nelson
Author URI:
License: GPL3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: infinite-scroll
Domain Path: /languages/
*/
/* Copyright 2008-2012 Beaver6813, dirkhaim, Paul Irish, Benjamin J. Balter, Glenn Nelson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright 2008-2012
* @license GPL v3
* @version 2.6.2
* @package Infinite Scroll
* @author Beaver6813, dirkhaim, Paul Irish, Benjamin J. Balter, Glenn Nelson
*/
require_once dirname( __FILE__ ) . '/includes/options.php';
require_once dirname( __FILE__ ) . '/includes/admin.php';
require_once dirname( __FILE__ ) . '/includes/presets.php';
require_once dirname( __FILE__ ) . '/includes/submit.php';
class Infinite_Scroll {
static $instance;
public $options;
public $admin;
public $submit;
public $name = 'Infinite Scroll'; //Human-readable name of plugin
public $slug = 'infinite-scroll'; //plugin slug, generally base filename and in url on wordpress.org
public $slug_ = 'infinite_scroll'; //slug with underscores (PHP/JS safe)
public $prefix = 'infinite_scroll_'; //prefix to append to all options, API calls, etc. w/ trailing underscore
public $file = null;
public $version = '2.6.1';
public $behaviors = array( //array of behaviors as key => array( label => js file ) (without extension)
'twitter' => array( 'label' => 'Manual Trigger', 'src' => 'manual-trigger' ),
'local' => array( 'label' => 'Local', 'src' => 'local' ),
'cufon' => array( 'label' => 'Cufon', 'src' => 'cufon' ),
'masonry' => array( 'label' => 'Masonry/Isotope', 'src' => 'masonry-isotope')
);
/**
* Construct the primary class and auto-load all child classes
*/
function __construct() {
self::$instance = &$this;
$this->file = __FILE__;
$this->admin = new Infinite_Scroll_Admin( $this );
$this->options = new Infinite_Scroll_Options( $this );
$this->presets = new Infinite_Scroll_Presets( $this );
$this->submit = new Infinite_Scroll_Submit( $this );
//upgrade db
add_action( 'admin_init', array( &$this, 'upgrade_check' ) );
//i18n
add_action( 'init', array( &$this, 'i18n' ) );
//default options
add_action( 'init', array( &$this, 'init_defaults' ) );
//js
add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_js' ) );
add_action( 'wp_footer', array( &$this, 'footer' ), 100 ); //low priority will load after i18n and script loads
//preset cron
register_activation_hook( __FILE__, array( &$this->presets, 'schedule' ) );
register_deactivation_hook( __FILE__, array( &$this->presets, 'unschedule' ) );
//404 fix
add_action( 'wp', array( &$this, 'paged_404_fix' ) );
}
/**
* Init default options
*/
function init_defaults() {
//option keys map to javascript options and are passed directly via wp_localize_script
$this->options->defaults = array(
'loading' => array(
'msgText' => '<em>' . __( 'Loading...', 'infinite-scroll' ) . '</em>',
'finishedMsg' => '<em>' . __( 'No additional posts.', 'infinite-scroll' ) . '</em>',
'img' => plugins_url( 'img/ajax-loader.gif', __FILE__ )
),
'nextSelector' => '#nav-below a:first',
'navSelector' => '#nav-below',
'itemSelector' => '.post',
'contentSelector' => '#content',
'debug' => WP_DEBUG,
'behavior' => ''
);
}
/**
* Enqueue front-end JS and pass options to json_encoded array
*/
function enqueue_js() {
if (!$this->shouldLoadJavascript()) {
return;
}
$suffix = ( WP_DEBUG ) ? '.dev' : '';
$file = "/js/front-end/jquery.infinitescroll{$suffix}.js";
wp_enqueue_script( $this->slug, plugins_url( $file, __FILE__ ), array( 'jquery' ), $this->version, true );
$options = apply_filters( $this->prefix . 'js_options', $this->options->get_options() );
wp_localize_script($this->slug, $this->slug_, json_encode($options));
// If no behavior, we're done, kick
if ( !$options['behavior'] )
return;
//sanity check
if ( !array_key_exists( $options['behavior'], $this->behaviors ) )
return _doing_it_wrong( 'Infinite Scroll behavior', "Behavior {$options['behavior']} not found", $this->version );
$src = 'behaviors/' . $this->behaviors[ $options['behavior'] ]['src'] . '.js';
wp_enqueue_script( $this->slug . "-behavior", plugins_url( $src, __FILE__ ), array( "jquery", $this->slug ), $this->version, true );
}
/**
* Load footer template to pass options array to JS
*/
function footer() {
if (!$this->shouldLoadJavascript()) {
return;
}
require dirname( __FILE__ ) . '/templates/footer.php';
}
/**
* Init i18n files
*/
function i18n() {
load_plugin_textdomain( $this->slug, false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' );
}
/**
* Upgrades DB
* Fires on admin init to support SVN
*/
function upgrade_check() {
if ($this->options->db_version == $this->version) {
return;
}
$this->upgrade( $this->options->db_version, $this->version );
do_action( $this->prefix . 'upgrade', $this->version, $this->options->db_version );
$this->options->db_version = $this->version;
}
/**
* Upgrade DB to latest version
* @param int $from version coming from
* @param int $to version going to
*/
function upgrade( $from , $to ) {
if ($from < "2.5") {
//array of option conversions in the form of from => to
$map = array(
'js_calls' => 'callback',
'image' => 'img',
'text' => 'msgText',
'donetext' => 'finishedMsg',
'content_selector' => 'contentSelector',
'post_selector' => 'itemSelector',
'nav_selector' => 'navSelector',
'next_selector' => 'nextSelector',
'behavior' => 'behavior',
'debug' => 'debug',
);
$old = get_option( 'infscr_options' );
$new = array();
//really old legacy options storage
//each option is stored as its own option in the options table
if ( !$old ) {
//loop through options and attempt to find
foreach ( array_keys( $map ) as $option ) {
$legacy = get_option( 'infscr_' . $option );
if ( !$legacy )
continue;
//move to new option array and delete old
$new[ $map[ $option ] ] = $legacy;
delete_option( 'infscr_' . $option );
}
}
//pre 2.5 options storage
//all stuffed in a single array, but not properly keyed
foreach ( $map as $from => $to ) {
if ( !$old || !isset( $old[ 'infscr_' . $from ] ) )
continue;
$new[ $to ] = $old[ 'infscr_' . $from ];
}
//pre 2.5 we html encoded selectors, we don't do this anymore
foreach ( array( 'contentSelector', 'itemSelector', 'navSelector', 'nextSelector' ) as $field ) {
if ( isset( $new[$field] ) ) {
$new[$field] = html_entity_decode($new[$field]);
}
}
//regardless of which upgrade we did, move loading string to array
$new['loading'] = array( );
foreach ( array( 'finishedMsg', 'msgText', "img" ) as $field ) {
if ( isset( $new[$field] ) ) {
$new['loading'][$field] = $new[$field];
unset( $new[$field] );
}
}
//if the user is still using the default ajax-loader.gif then update the location
if( isset($new["loading"]['img']) && !strstr($new["loading"]["img"], "/img/ajax-loader.gif") )
$new["loading"]['img'] = str_replace("/ajax-loader.gif",
"/img/ajax-loader.gif",
$new["loading"]['img']);
//regardless of which upgrade, ensure that debug is now set to boolean string rather than int
//if it wasn't originally on then just set it to the plugin default
if( isset($new['debug']) && $new['debug'] == 1 )
$new['debug'] = "true";
else
unset( $new['debug'] );
//don't pass an empty array so the default filter can properly set defaults
if ( empty( $new['loading'] ) )
unset( $new['loading'] );
$this->options->set_options( $new );
delete_option( 'infscr_options' );
$this->presets->migrate();
}
//migrate loading image
if ($from < '2.6') {
$old = get_option("infinite_scroll");
$new = $old;
$new["loading"]["img"] = $old["img"];
unset($new["img"]);
$this->options->set_options($new);
}
}
/**
* If we go beyond the last page and request a page that doesn't exist,
* force WordPress to return a 404.
* See http://core.trac.wordpress.org/ticket/15770
*/
function paged_404_fix( ) {
global $wp_query;
if ( is_404() || !is_paged() || 0 != count( $wp_query->posts ) )
return;
$wp_query->set_404();
status_header( 404 );
nocache_headers();
}
/**
* Determines if the jQuery plugin and corresponding options should
* be output onto the page.
*
* @return bool
*/
function shouldLoadJavascript() {
// Don't need to load the plugin on single pages
if (is_singular()) {
return false;
}
return true;
}
}
$infinite_scroll = new Infinite_Scroll();

View file

@ -0,0 +1,5 @@
jQuery(document).ready(function(a){a("#upload_image_button").click(function(){formfield=a("#upload_image").attr("name");tb_show("","media-upload.php?type=image&infinite_scroll=true&TB_iframe=true");return!1});window.send_to_editor=function(b){a("#upload_image").val(b);tb_remove()};a("#the-list td").hover(function(){a(this).children(".edit-link").css("visibility","visible")},function(){a(this).children(".edit-link").css("visibility","hidden")});a('#the-list tr:not(".editing")').live("click",function(b){b.preventDefault();
a(this).addClass("editing");a(this).find(".edit-link").hide();a(this).find(".save-link").show();a(this).css("height","50px");a(this).children("td:not(:first)").each(function(){a(this).html('<input type="text" name="'+a(this).attr("class")+'" value="'+a(this).html()+'" />')});b=a(this).children(".theme");a(b).html(a(b).html()+'<input type="hidden" name="theme_column-theme" value="'+a(b).find(".theme-name").text()+'" />');return!1});a("#the-list .save-link a").live("click",function(b){b.preventDefault();
var c=a(this).siblings(".loader");a(c).show();a.ajax({url:ajaxurl+"?action=infinite-scroll-edit-preset",type:"POST",data:a("#ajax-form").serialize(),success:function(){a(c).hide();tr=a(c).parent().parent().parent();a(tr).removeClass("editing");a(tr).find(".edit-link").show();a(tr).find(".save-link").hide();a(tr).css("height","auto");a(tr).children("td:not(:first)").each(function(){a(this).html(a(this).children("input").val())})}});return!1});a("#the-list .save-link a.cancel").live("click",function(b){b.preventDefault();
tr=a(this).parent().parent().parent();a(tr).removeClass("editing");a(tr).find(".edit-link").show();a(tr).find(".save-link").hide();a(tr).css("height","auto");a(tr).children("td:not(:first)").each(function(){a(this).html(a(this).children("input").val())});return!1});a(".delete").live("click",function(b){b.preventDefault();b=a(this).parent().siblings("strong").children("a").text();if(!confirm(infinite_scroll.confirm.replace("%s",b)))return!1;var c=a(this).parent().parent().parent();a.ajax({url:ajaxurl+
"?action=infinite-scroll-delete-preset&theme="+b,type:"POST",data:a("#ajax-form").serialize(),success:function(){a(c).children("td:not(:first)").each(function(){a(this).html("")})}});return!1});a("#use_default").click(function(b){b.preventDefault();a("#infinite_scroll_form").append('<input type="hidden" name="reset_default_image" value="1" />').submit();return!1})});

View file

@ -0,0 +1,128 @@
jQuery(document).ready(function( $) {
//open upload dialog
$('#upload_image_button').click(function() {
formfield = $('#upload_image').attr('name');
tb_show('', 'media-upload.php?type=image&infinite_scroll=true&TB_iframe=true');
return false;
});
//close upload dialog CB
//overrides native WP function
window.send_to_editor = function(html) {
$('#upload_image').val( html );
tb_remove();
}
//list table hover
$('#the-list td').hover(
function() { $(this).children('.edit-link').css('visibility', 'visible'); },
function() { $(this).children('.edit-link').css('visibility', 'hidden'); }
);
//list table edit link click
$( '#the-list tr:not(".editing")' ).live( 'click', function(event) {
event.preventDefault();
$(this).addClass( 'editing' );
$(this).find('.edit-link').hide();
$(this).find('.save-link').show();
$(this).css('height', '50px' );
$(this).children('td:not(:first)').each( function() {
$(this).html( '<input type="text" name="' + $(this).attr('class') + '" value="' + $(this).html() + '" />' );
});
var theme = $(this).children('.theme');
$(theme).html( $(theme).html() + '<input type="hidden" name="theme_column-theme" value="' + $(theme).find('.theme-name').text() + '" />' );
return false;
});
//save-link
$( '#the-list .save-link a' ).live( 'click', function(event){
event.preventDefault();
var loader = $(this).siblings( '.loader' );
$(loader).show();
$.ajax( {
url: ajaxurl + '?action=infinite-scroll-edit-preset',
type: 'POST',
data: $('#ajax-form').serialize(),
success: function() {
$(loader).hide();
tr = $(loader).parent().parent().parent();
$(tr).removeClass( 'editing' );
$(tr).find('.edit-link').show();
$(tr).find('.save-link').hide();
$(tr).css('height', 'auto' );
$(tr).children('td:not(:first)').each( function() {
$(this).html( $(this).children('input').val() );
});
}
});
return false;
});
//cancel button
$( '#the-list .save-link a.cancel' ).live( 'click', function(event){
event.preventDefault();
tr = $(this).parent().parent().parent();
$(tr).removeClass( 'editing' );
$(tr).find('.edit-link').show();
$(tr).find('.save-link').hide();
$(tr).css('height', 'auto' );
$(tr).children('td:not(:first)').each( function() {
$(this).html( $(this).children('input').val() );
});
return false;
});
//delete button
$( '.delete' ).live( 'click', function( event ) {
event.preventDefault();
var theme = $(this).parent().siblings('strong').children('a').text();
if ( !confirm( infinite_scroll.confirm.replace( '%s', theme ) ) )
return false;
var tr = $(this).parent().parent().parent();
$.ajax( {
url: ajaxurl + '?action=infinite-scroll-delete-preset&theme=' + theme,
type: 'POST',
data: $('#ajax-form').serialize(), //serialize nonce
success: function() {
$(tr).children('td:not(:first)').each( function() {
$(this).html( '' );
});
}
});
return false;
});
//reset to default image
$('#use_default').click( function(event) {
event.preventDefault();
$('#infinite_scroll_form').append( '<input type="hidden" name="reset_default_image" value="1" />' ).submit();
return false;
});
//hide submit button
$('#hide-submit').click( function(event){
event.preventDefault();
$.ajax({
url: ajaxurl + '?action=' + submit.action + '&' + submit.nonce + '=' + $('#'+submit.nonce).val(),
success: function() { $('tr#submit').fadeOut(); }
});
return false;
});
//submit textarea select
$('textarea#submit').select();
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,173 @@
# Copyright (C) 2012 Infinite Scroll
# This file is distributed under the same license as the Infinite Scroll project.
msgid ""
msgstr ""
"Project-Id-Version: Infinite Scroll 2.5\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/infinite-scroll\n"
"POT-Creation-Date: 2012-02-12 14:02-0500\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2012-02-12 14:02-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: infinite-scroll.php:91
msgid "<em>Loading...</em>"
msgstr ""
#: infinite-scroll.php:92
msgid "<em>No additional posts.</em>"
msgstr ""
#: includes/admin.php:33
#: HD/Applications/MAMP/htdocs/trunk/wp-content/plugins/infinite-scroll/templates/options.php:8
msgid "Infinite Scroll Options"
msgstr ""
#: includes/admin.php:33
msgid "Infinite Scroll"
msgstr ""
#: includes/admin.php:62
#, php-format
msgid "Are you sure you want to delete the preset \"%s\"?"
msgstr ""
#: includes/presets.php:467
msgid "Edit"
msgstr ""
#: includes/presets.php:467
msgid "Delete"
msgstr ""
#: includes/presets.php:468
msgid "Save"
msgstr ""
#: includes/presets.php:468
msgid "Cancel"
msgstr ""
#: templates/manage-presets.php:15
msgid "Mange Infinite Scroll Presets"
msgstr ""
#: templates/manage-presets.php:16
msgid "Many theme's CSS selector's are stored in a community contributed database maintained by the plugin. If the current theme's CSS selectors are known, the plugin will automatically use them if the site administrator has not set any. This list will update automatically as additional theme's are added. You can add to and/or override those community defaults below. Changes entered here will affect only your site on a single-site install, and only your network's site on a multisite install."
msgstr ""
#: templates/manage-presets.php:19
msgid "Back to General Options"
msgstr ""
#: templates/options.php:12
msgid "Infinite scroll uses <a href=\"http://www.w3.org/TR/CSS2/selector.html\">CSS selectors</a> to identify various parts of your site's unique theme. In most cases, identifying each of your theme's elements below simply requires entering either the element's ID indicated with a hashmark, (<em>e.g.,</em><code>#content</code>), or the element's class indicated by a period, (<em>e.g.,</em><code>.post</code>). For more information, please see <a href=\"http://docs.jquery.com/Selectors\">jQuery's CSS Selector documentation</a>."
msgstr ""
#: templates/options.php:17
msgid "Content Selector"
msgstr ""
#: templates/options.php:21
msgid "Div containing your theme's content"
msgstr ""
#: templates/options.php:26
msgid "Navigation Selector"
msgstr ""
#: templates/options.php:30
msgid "Div containing your theme's navigation"
msgstr ""
#: templates/options.php:35
msgid "Next Selector"
msgstr ""
#: templates/options.php:39
msgid "Link to next page of content"
msgstr ""
#: templates/options.php:44
msgid "Item Selector"
msgstr ""
#: templates/options.php:48
msgid "Div containing an individual post"
msgstr ""
#: templates/options.php
msgid "Callback"
msgstr ""
#: templates/options.php
msgid "Code that is called after each new page is loaded"
msgstr "
#: templates/options.php:53
msgid "Loading Message"
msgstr ""
#: templates/options.php:58
msgid "Text to display as new posts are retrieved"
msgstr ""
#: templates/options.php:64
msgid "Finished Message"
msgstr ""
#: templates/options.php:69
msgid "Text to display when no additional posts are available"
msgstr ""
#: templates/options.php:75
msgid "Loading Image"
msgstr ""
#: templates/options.php:78
msgid "Current Image:"
msgstr ""
#: templates/options.php:78
msgid "Current Loading Image"
msgstr ""
#: templates/options.php:79
msgid "New Image:"
msgstr ""
#: templates/options.php:81
msgid "Upload New Image"
msgstr ""
#: templates/options.php:82
msgid "Use Default"
msgstr ""
#: templates/options.php:85
msgid "URL of existing or uploaded image to display as new posts are retrieved"
msgstr ""
#: templates/options.php
mgsid "Behavior"
msgstr ""
#: templates/options.php
mgsid "Debug"
msgstr ""
#: templates/options.php:90
msgid "Save Options"
msgstr ""
#: templates/options.php:93
msgid "Manage Defaults"
msgstr ""
#: templates/preset-prompt.php:7
#, php-format
msgid "Other users have submitted default CSS selectors for your theme. Would you like to <strong><a href=\"%s\">use your theme's default selectors</a></strong>?"
msgstr ""

View file

@ -0,0 +1,694 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GNU General Public License v3.0 - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml"
href="http://www.gnu.org/licenses/gpl-3.0.rdf" />
</head>
<body>
<h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>
<p>Copyright &copy; 2007 Free Software Foundation, Inc.
&lt;<a href="http://fsf.org/">http://fsf.org/</a>&gt;</p><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<h3><a name="preamble"></a>Preamble</h3>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.</p>
<p>The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.</p>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
<p>To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.</p>
<p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.</p>
<p>Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.</p>
<p>For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.</p>
<p>Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.</p>
<p>Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
<h4><a name="section0"></a>0. Definitions.</h4>
<p>&ldquo;This License&rdquo; refers to version 3 of the GNU General Public License.</p>
<p>&ldquo;Copyright&rdquo; also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.</p>
<p>&ldquo;The Program&rdquo; refers to any copyrightable work licensed under this
License. Each licensee is addressed as &ldquo;you&rdquo;. &ldquo;Licensees&rdquo; and
&ldquo;recipients&rdquo; may be individuals or organizations.</p>
<p>To &ldquo;modify&rdquo; a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a &ldquo;modified version&rdquo; of the
earlier work or a work &ldquo;based on&rdquo; the earlier work.</p>
<p>A &ldquo;covered work&rdquo; means either the unmodified Program or a work based
on the Program.</p>
<p>To &ldquo;propagate&rdquo; a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
<p>To &ldquo;convey&rdquo; a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
<p>An interactive user interface displays &ldquo;Appropriate Legal Notices&rdquo;
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
<h4><a name="section1"></a>1. Source Code.</h4>
<p>The &ldquo;source code&rdquo; for a work means the preferred form of the work
for making modifications to it. &ldquo;Object code&rdquo; means any non-source
form of a work.</p>
<p>A &ldquo;Standard Interface&rdquo; means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
<p>The &ldquo;System Libraries&rdquo; of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
&ldquo;Major Component&rdquo;, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
<p>The &ldquo;Corresponding Source&rdquo; for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<h4><a name="section2"></a>2. Basic Permissions.</h4>
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
<p>You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
<h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
<p>You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
<h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
&ldquo;keep intact all notices&rdquo;.</li>
<li>c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.</li>
<li>d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.</li>
</ul>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
&ldquo;aggregate&rdquo; if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
<h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
<p>You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
<ul>
<li>a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.</li>
<li>b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.</li>
<li>c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.</li>
<li>d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.</li>
<li>e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.</li>
</ul>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
<p>A &ldquo;User Product&rdquo; is either (1) a &ldquo;consumer product&rdquo;, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, &ldquo;normally used&rdquo; refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
<p>&ldquo;Installation Information&rdquo; for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
<h4><a name="section7"></a>7. Additional Terms.</h4>
<p>&ldquo;Additional permissions&rdquo; are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or</li>
<li>c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
<li>f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.</li>
</ul>
<p>All other non-permissive additional terms are considered &ldquo;further
restrictions&rdquo; within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.</p>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
<h4><a name="section8"></a>8. Termination.</h4>
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
<p>However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
<h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
<p>You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
<h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
<p>An &ldquo;entity transaction&rdquo; is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
<h4><a name="section11"></a>11. Patents.</h4>
<p>A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's &ldquo;contributor version&rdquo;.</p>
<p>A contributor's &ldquo;essential patent claims&rdquo; are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, &ldquo;control&rdquo; includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
<p>In the following three paragraphs, a &ldquo;patent license&rdquo; is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To &ldquo;grant&rdquo; such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. &ldquo;Knowingly relying&rdquo; means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
<p>A patent license is &ldquo;discriminatory&rdquo; if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
<h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
<h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
<p>Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.</p>
<h4><a name="section14"></a>14. Revised Versions of this License.</h4>
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License &ldquo;or any later version&rdquo; applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.</p>
<p>If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
<h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM &ldquo;AS IS&rdquo; WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<h4><a name="section16"></a>16. Limitation of Liability.</h4>
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
<h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
<p>END OF TERMS AND CONDITIONS</p>
<h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
<p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</p>
<p>To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the &ldquo;copyright&rdquo; line and a pointer to where the full notice is found.</p>
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</pre>
<p>Also add information on how to contact you by electronic and paper mail.</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:</p>
<pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</pre>
<p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an &ldquo;about box&rdquo;.</p>
<p>You should also get your employer (if you work as a programmer) or school,
if any, to sign a &ldquo;copyright disclaimer&rdquo; for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</p>
<p>The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
&lt;<a href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</a>&gt;.</p>
</body></html>

View file

@ -0,0 +1,246 @@
# Infinite-Scroll #
**Contributors:** beaver6813, dirkhaim, paul.irish, benbalter
**Donate link:** http://www.infinite-scroll.com
**Tags:** ajax, pagination, scrolling, scroll, endless, reading
**Requires at least:** 3.2
**Tested up to:** 3.5
**Stable tag:** 2.6.2
Automatically append the next page of posts (via AJAX) to your page when a user scrolls to the bottom.
## Description ##
Infinite scroll has been called autopagerize, unpaginate, endless pages. But essentially it is pre-fetching content from a subsequent page and adding it directly to the users current page.
When a user scrolls towards the bottom of the page, the next page of posts is automatically retrieved and appended. This means they never need to click "Next Page", which *dramatically increases stickiness*.
Features:
* Works out-of-the-box for many popular WordPress themes -- just activate the plugin and scroll
* Fully customizable to adapt to your site and theme
* Requires no (hopefully) template hacking, only a knowledge of CSS selectors.
* Relies on shared database of common themes to simplify installation process
* Maintain local database of theme presets for all installed themes (shared across network on multisite installs)
* Countless API endpoints to modify the behavior.
* Backwards compatible: Will not break RSS readers, mobile devices, or browsers with javascript
Full information on [infinite-scroll.com](http://www.infinite-scroll.com)
## Screenshots ##
### 1. CSS Selector (theme) configuration options ###
![CSS Selector (theme) configuration options](https://github.com/benbalter/Infinite-Scroll/raw/develop/screenshot-1.png)
### 2. Text and image options (to display as additional posts load) ###
![Text and image options (to display as additional posts load)](https://github.com/benbalter/Infinite-Scroll/raw/develop/screenshot-2.png)
### 3. Edit theme presets screen ###
![Edit theme presets screen](https://github.com/benbalter/Infinite-Scroll/raw/develop/screenshot-3.png)
## Changelog ##
### 2.5 ###
* Plugin completely rewritten from the bottom up
* **Note: you will need to manually reactivate this plugin after upgrading**
* Minimum WordPress version required now to **3.2**
* Added support for internationalization (see FAQ for information on translating)
* Added support for custom post types (now works on all pages but `is_singular()`)
* Options screens significantly simplified with additional help text
* Presets screen now uses standard WordPress administrative interface
* Ability to submit your theme's CSS Selectors to the community CSS selector database to aid others with installation
* Changes to presets are now made inline; saved via AJAX without page reload
* Added additional API endpoints for developers to modify and customize plugin behavior
* Loading image now uses native WordPress uploader and can accept arbitrary URL or image from media gallery
* Loading and finished text now uses native WordPress TinyMCE editor
* If site administrator has not entered CSS selectors and preset is known, plugin will default to preset
* Any preset entered by site (or network) administrator will now override community contributed presets by default
* Community contributed CSS selector presets are now stored in the database allowing for plugin directory to be unwritable (security enhancement)
* Prompts users to default to CSS selector preset when available
* Presets now support child themes
* Community contributed CSS selected asynchronously update daily (performance enhancement)
* Site (or network) specific CSS selector presets are now stored in the database (security enhancement)
* CSS Preset updater now uses WP_HTTP class (compatibility enhancement)
* Javascript file now served directly to user (rather than proxied via PHP) to allow for browser caching, minification, serving via CDN, and better integration with caching plugins (performance enhancement)
* Javascript options stored natively in database and passed directly to script via WordPress's `wp_localize_script` function (performance and customizability enhancement)
* No longer relies on deprecated user levels to determine permissions
* Default loading and fished messages changed
* Fixes for error and warnings when run with `WP_DEBUG` enabled
* Removed prompt for option to activate infinite scrolling for only certain users (defaults to all)
* Removed prompt for option to toggle debug mode (defaults to `WP_DEBUG` or `SCRIPT_DEBUG`)
* Removed prompt for option to toggle scrolling behavior (defaults to automatic)
* Removed prompt for additional callbacks
* Removed prompt to select image alignment (defaults to left, can override via CSS)
* Significant code clean up, file reorganization, and in-line documentation to conform to WordPress coding and style standards (whitespace, double v. single quotes, tab drift, trailing commas, closing PHP tags, etc.)
* Classes loaded as sub-classes (rather than extending parent class) to prevent classes from becoming out of sync
* Added phpdoc style documentation
* Plugin file name changed to conform to standard WordPress naming conventions
* License (GPL) included with distribution
* Version numbering simplified
### 2.0b2.120111 ###
* Added infinite_scroll_load_override filter to manually force infinite-scroll to load on a page.
* Thanks to https://github.com/samargulies for the above patch.
### 2.0b2.111218 ###
* Updated preset DB with basic themes
* Made a few fixes in options/presets to prep for main release.
* Changed hook used by 404 detection to template_redirect from wp.
### 2.0b2.110822 ###
* Removed registration/enqueuing script in favor of just enqueueing
* Fixed bug/typo in compressed init script
### 2.0b2.110821 ###
* Converted options pages to use Settings API
* Added behavior selection (Manual triggering)
### 2.0b2.110818 ###
* Completely revamped admin panel adding more modular management
* Added ability to center loading image
* Added WYSIWYG editor to HTML allowed fields in admin panel
* Updated Javascript callback to pass DOM for new elements added
* Added Preset manager
* Added ability to auto-fill selector fields from theme preset
* Overhaul of underlying code, separating out into classes to cut down
on code processed (and hence load time) for the end-user.
### 2.0b2.110723 ###
* Improved escaping on settings to allow greater flexibility.
* Fixed issue with jQuery not loading if WP version is up to date.
* Fixed issue with plugin showing twice on plugin list.
### 2.0b2.110716 ###
* Moved init script from direct page insertion to separate script.
* Cleaned up unneeded declared constants.
* Combined init script and library into one minified script.
* This fixes an incompatibility with HeadJS plugin.
### 2.0b2.110713 ###
* Fixed multiple jQuery loaded conflicts.
* Now uses standard WordPress javascript insertion.
* Loads locally stored jQuery 1.6.2 if current version is < 1.6
this can only be detected through WordPress now, hence the fix
for multiple versions conflicting (some naughty themes don't
use WordPress's javascript loading).
### 2.0b2.110709 ###
* FIX: Default options not being recursively copied.
* Updated to new options layout.
* Callback fix.
### 2.0b2.110706 ###
* HTTPS loading image fix.
* Better debug support (switches between minified and non).
### 2.0b2.110629 ###
* Callback (custom javascript) fix.
* IE9 binding bug fix.
### 2.0b2.110628 ###
* Modified the method used to determine the link paths (bug fix)
### 2.0b2.110617 ###
* Updated core javascript to version 2.0b2.110617 (full revamp).
* General cleanup/tidy of plugin itself.
* Fixed bugs with numerical sub-domains (now uses site_url to determine path).
* Supports archives, tags, searches.
* Wider theme support.
* Simplified plugin options page, added loading image upload ability, added option for debug mode.
* Removed annoying reminder that showed on all admin pages.
* Forces 404 header when no more posts are available.
### 1.5.100504 ###
* New appending technique using document fragments.
* Callback receives the contentSelector elem as its first argument,
and an array of the new elements as the second argument
### 1.4.100210 ###
Fixed small bug that jQuery 1.4 introduced.
### 1.4 ###
Proper WordPress method (enqueue_script) removed because it just breaks too often
JS updated with some custom method action.
### 1.3 ###
Use proper WordPress function to register the javascript
Use plugins_url to determine plugin url
### 1.2 ###
* 2009 August 4th
* `get_option('siteurl')` fix made.
* jQuery plugin version updated. many more options available.
* Release backwards compatible
### 1.1 ###
* 2008 September 25
* JavaScript rewritten as a proper jQuery plugin.
* Added animation
### 1.0 ###
* June 29 - 1.0 release.
## Frequently Asked Questions ##
### What exactly is infinite scrolling? ###
Essentially it is pre-fetching content from a subsequent page and adding it directly to the users current page. [More Information](http://www.infinite-scroll.com/the-interaction-design-pattern/)
### Can I change the number of posts loaded? ###
Yes. Go to Settings -> Reading in your WordPress administrative dashboard.
### How do I change the alignment of the loading image? ###
Add the following to your theme's css: `#infscr-loading img { text-align: ALIGNMENT; }` where "ALIGNMENT" is either `left`, `right`, or `center`.
### How can I pass additional arguments such as behavior or callbacks to the script? ###
Add a filter to `infinite_scroll_options` and adds additional options to the options array.
### Is the plugin available in my language? ###
If you enjoy the plugin and are interested in contributing a translation (it's super easy), please take a look at the [Translating WordPress](http://codex.wordpress.org/Translating_WordPress) page.
### Is it SEO-Friendly? ###
Yes all enhancements are made via javascript only, so search spiders see no difference.
### Is it accessible? ###
Things wont change for screen-readers. This technique degrades gracefully.
### Does it still keep going, even at the end of the blog? ###
Infinite scroll is configured to die when it hits a 404 Not Found status code, so when it goes through all your archives it should hit a /page/43/ (or something) that doesnt exist, then show a message "Congrats, youve reached the end of the internet." Some WordPress themes dont report not found pages with a 404. Try a different theme or contacting the theme author.
### Do I need to edit my theme to make this work? ###
Probably not, nope.
### How do I pass additional arguments such as callbacks to the Infinite Scroll script? ###
To pass additional arguments to the Infinite Scroll script, add the following code to either your theme's `functions.php` or to a stand-alone plugin file.
```
function my_infinite_scroll_options_filter( $options ) {
$options['callback'] = 'my_callback';
$options['another_parameter'] = 'another_value';
return $options;
}
add_filter( 'infinite_scroll_js_options', 'my_infinite_scroll_options_filter' );
```
## Installation ##
### Automatic Install ###
1. Login to your WordPress site as an Administrator
2. Navigate to Plugins->Add New from the menu on the left
3. Search for "Infinite Scroll"
4. Click "Install"
5. Click "Activate Now"
### Manual Install ###
1. Download the plugin from the link in the top left corner
2. Unzip the file, and upload the resulting "infinite-scroll" folder to your "/wp-content/plugins directory" as "/wp-content/plugins/infinite-scroll"
3. Log into your WordPress install as an administrator, and navigate to the plugins screen from the left-hand menu
4. Activate Infinite Scroll

View file

@ -0,0 +1,241 @@
=== Infinite-Scroll ===
Contributors: beaver6813, dirkhaim, paul.irish, benbalter
Donate link: http://www.infinite-scroll.com
Tags: ajax, pagination, scrolling, scroll, endless, reading
Requires at least: 3.2
Tested up to: 3.5
Stable tag: 2.6.2
Automatically append the next page of posts (via AJAX) to your page when a user scrolls to the bottom.
== Description ==
Infinite scroll has been called autopagerize, unpaginate, endless pages. But essentially it is pre-fetching content from a subsequent page and adding it directly to the users current page.
When a user scrolls towards the bottom of the page, the next page of posts is automatically retrieved and appended. This means they never need to click "Next Page", which *dramatically increases stickiness*.
Features:
* Works out-of-the-box for many popular WordPress themes -- just activate the plugin and scroll
* Fully customizable to adapt to your site and theme
* Requires no (hopefully) template hacking, only a knowledge of CSS selectors.
* Relies on shared database of common themes to simplify installation process
* Maintain local database of theme presets for all installed themes (shared across network on multisite installs)
* Countless API endpoints to modify the behavior.
* Backwards compatible: Will not break RSS readers, mobile devices, or browsers with javascript
Full information on [infinite-scroll.com](http://www.infinite-scroll.com)
== Changelog ==
= 2.5 =
* Plugin completely rewritten from the bottom up
* **Note: you will need to manually reactivate this plugin after upgrading**
* Minimum WordPress version required now to **3.2**
* Added support for internationalization (see FAQ for information on translating)
* Added support for custom post types (now works on all pages but `is_singular()`)
* Options screens significantly simplified with additional help text
* Presets screen now uses standard WordPress administrative interface
* Ability to submit your theme's CSS Selectors to the community CSS selector database to aid others with installation
* Changes to presets are now made inline; saved via AJAX without page reload
* Added additional API endpoints for developers to modify and customize plugin behavior
* Loading image now uses native WordPress uploader and can accept arbitrary URL or image from media gallery
* Loading and finished text now uses native WordPress TinyMCE editor
* If site administrator has not entered CSS selectors and preset is known, plugin will default to preset
* Any preset entered by site (or network) administrator will now override community contributed presets by default
* Community contributed CSS selector presets are now stored in the database allowing for plugin directory to be unwritable (security enhancement)
* Prompts users to default to CSS selector preset when available
* Presets now support child themes
* Community contributed CSS selectors now stored as standard CSV and asynchronously update daily (performance and compatibility enhancement)
* Site (or network) specific CSS selector presets are now stored in the database (security enhancement)
* CSS Preset updater now uses WP_HTTP class (compatibility enhancement)
* Javascript file now served directly to user (rather than proxied via PHP) to allow for browser caching, minification, serving via CDN, and better integration with caching plugins (performance enhancement)
* Javascript options stored natively in database and passed directly to script via WordPress's `wp_localize_script` function (performance and customizability enhancement)
* No longer relies on deprecated user levels to determine permissions
* Default loading and fished messages changed
* Fixes for error and warnings when run with `WP_DEBUG` enabled
* Removed prompt for option to activate infinite scrolling for only certain users (defaults to all)
* Removed prompt for option to toggle debug mode (defaults to `WP_DEBUG` or `SCRIPT_DEBUG`)
* Removed prompt for option to toggle scrolling behavior (defaults to automatic)
* Removed prompt for additional callbacks
* Removed prompt to select image alignment (defaults to left, can override via CSS)
* Significant code clean up, file reorganization, and in-line documentation to conform to WordPress coding and style standards (whitespace, double v. single quotes, tab drift, trailing commas, closing PHP tags, etc.)
* Classes loaded as sub-classes (rather than extending parent class) to prevent classes from becoming out of sync
* Added phpdoc style documentation
* Plugin file name changed to conform to standard WordPress naming conventions
* License (GPL) included with distribution
* Version numbering simplified
= 2.0b2.120111 =
* Added infinite_scroll_load_override filter to manually force infinite-scroll to load on a page.
* Thanks to https://github.com/samargulies for the above patch.
= 2.0b2.111218 =
* Updated preset DB with basic themes
* Made a few fixes in options/presets to prep for main release.
* Changed hook used by 404 detection to template_redirect from wp.
= 2.0b2.110822 =
* Removed registration/enqueuing script in favor of just enqueueing
* Fixed bug/typo in compressed init script
= 2.0b2.110821 =
* Converted options pages to use Settings API
* Added behavior selection (Manual triggering)
= 2.0b2.110818 =
* Completely revamped admin panel adding more modular management
* Added ability to center loading image
* Added WYSIWYG editor to HTML allowed fields in admin panel
* Updated Javascript callback to pass DOM for new elements added
* Added Preset manager
* Added ability to auto-fill selector fields from theme preset
* Overhaul of underlying code, separating out into classes to cut down
on code processed (and hence load time) for the end-user.
= 2.0b2.110723 =
* Improved escaping on settings to allow greater flexibility.
* Fixed issue with jQuery not loading if WP version is up to date.
* Fixed issue with plugin showing twice on plugin list.
= 2.0b2.110716 =
* Moved init script from direct page insertion to separate script.
* Cleaned up unneeded declared constants.
* Combined init script and library into one minified script.
* This fixes an incompatibility with HeadJS plugin.
= 2.0b2.110713 =
* Fixed multiple jQuery loaded conflicts.
* Now uses standard WordPress javascript insertion.
* Loads locally stored jQuery 1.6.2 if current version is < 1.6
this can only be detected through WordPress now, hence the fix
for multiple versions conflicting (some naughty themes don't
use WordPress's javascript loading).
= 2.0b2.110709 =
* FIX: Default options not being recursively copied.
* Updated to new options layout.
* Callback fix.
= 2.0b2.110706 =
* HTTPS loading image fix.
* Better debug support (switches between minified and non).
= 2.0b2.110629 =
* Callback (custom javascript) fix.
* IE9 binding bug fix.
= 2.0b2.110628 =
* Modified the method used to determine the link paths (bug fix)
= 2.0b2.110617 =
* Updated core javascript to version 2.0b2.110617 (full revamp).
* General cleanup/tidy of plugin itself.
* Fixed bugs with numerical sub-domains (now uses site_url to determine path).
* Supports archives, tags, searches.
* Wider theme support.
* Simplified plugin options page, added loading image upload ability, added option for debug mode.
* Removed annoying reminder that showed on all admin pages.
* Forces 404 header when no more posts are available.
= 1.5.100504 =
* New appending technique using document fragments.
* Callback receives the contentSelector elem as its first argument,
and an array of the new elements as the second argument
= 1.4.100210 =
Fixed small bug that jQuery 1.4 introduced.
= 1.4 =
Proper WordPress method (enqueue_script) removed because it just breaks too often
JS updated with some custom method action.
= 1.3 =
Use proper WordPress function to register the javascript
Use plugins_url to determine plugin url
= 1.2 =
* 2009 August 4th
* `get_option('siteurl')` fix made.
* jQuery plugin version updated. many more options available.
* Release backwards compatible
= 1.1 =
* 2008 September 25
* JavaScript rewritten as a proper jQuery plugin.
* Added animation
= 1.0 =
* June 29 - 1.0 release.
== Screenshots ==
1. CSS Selector (theme) configuration options
2. Text and image options (to display as additional posts load)
3. Edit theme presets screen
== Frequently Asked Questions ==
= What exactly is infinite scrolling? =
Essentially it is pre-fetching content from a subsequent page and adding it directly to the users current page. [More Information](http://www.infinite-scroll.com/the-interaction-design-pattern/)
= Can I change the number of posts loaded? =
Yes. Go to Settings -> Reading in your WordPress administrative dashboard.
= How do I change the alignment of the loading image? =
Add the following to your theme's css: `#infscr-loading img { text-align: ALIGNMENT; }` where "ALIGNMENT" is either `left`, `right`, or `center`.
= How can I pass additional arguments such as behavior or callbacks to the script? =
Add a filter to `infinite_scroll_options` and adds additional options to the options array.
= Is the plugin available in my language? =
If you enjoy the plugin and are interested in contributing a translation (it's super easy), please take a look at the [Translating WordPress](http://codex.wordpress.org/Translating_WordPress) page.
= Is it SEO-Friendly? =
Yes all enhancements are made via javascript only, so search spiders see no difference.
= Is it accessible? =
Things wont change for screen-readers. This technique degrades gracefully.
= Does it still keep going, even at the end of the blog? =
Infinite scroll is configured to die when it hits a 404 Not Found status code, so when it goes through all your archives it should hit a /page/43/ (or something) that doesnt exist, then show a message "Congrats, youve reached the end of the internet." Some WordPress themes dont report not found pages with a 404. Try a different theme or contacting the theme author.
= Do I need to edit my theme to make this work? =
Probably not, nope.
= How do I pass additional arguments such as callbacks to the Infinite Scroll script? =
To pass additional arguments to the Infinite Scroll script, add the following code to either your theme's `functions.php` or to a stand-alone plugin file.
```
function my_infinite_scroll_options_filter( $options ) {
$options['callback'] = 'my_callback';
$options['another_parameter'] = 'another_value';
return $options;
}
add_filter( 'infinite_scroll_js_options', 'my_infinite_scroll_options_filter' );
```
== Installation ==
= Automatic Install =
1. Login to your WordPress site as an Administrator
2. Navigate to Plugins->Add New from the menu on the left
3. Search for "Infinite Scroll"
4. Click "Install"
5. Click "Activate Now"
= Manual Install =
1. Download the plugin from the link in the top left corner
2. Unzip the file, and upload the resulting "infinite-scroll" folder to your "/wp-content/plugins directory" as "/wp-content/plugins/infinite-scroll"
3. Log into your WordPress install as an administrator, and navigate to the plugins screen from the left-hand menu
4. Activate Infinite Scroll

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View file

@ -0,0 +1,12 @@
<?php
/**
* Template to include on wp_footer front-end; passes plugin options to javascript function
* @package Infinite_Scroll
*/
?>
<script type="text/javascript">
// Because the `wp_localize_script` method makes everything a string
infinite_scroll = jQuery.parseJSON(infinite_scroll);
jQuery( infinite_scroll.contentSelector ).infinitescroll( infinite_scroll, function(newElements, data, url) { eval(infinite_scroll.callback); });
</script>

View file

@ -0,0 +1,21 @@
<?php
/**
* Template for manage presets page
* @package Infinite_Scroll
* @uses Infinite_Scroll_Presets_Table
*/
if ( is_multisite() && !is_super_admin() )
wp_die( 'Not authorized', 'infinite-scroll' );
$table = new Infinite_Scroll_Presets_Table();
$table->prepare_items();
?>
<div class="wrap">
<h2><?php _e( 'Manage Infinite Scroll Presets', 'infinite-scroll' ); ?></h2>
<p class="description"><?php _e( 'Many theme\'s CSS selector\'s are stored in a community contributed database maintained by the plugin. If the current theme\'s CSS selectors are known, the plugin will automatically use them if the site administrator has not set any. This list will update automatically as additional theme\'s are added. You can add to and/or override those community defaults below. Changes entered here will affect only your site on a single-site install, and only your network\'s site on a multisite install.', 'infinite-scroll' ); ?></p>
<form id="ajax-form">
<?php $table->display(); ?>
<div style="margin-top: -2em;"><a href="<?php echo admin_url( 'options-general.php?page=infinite_scroll_options'); ?>"><?php _e( 'Back to General Options', 'infinite-scroll' ); ?></a> | <a href="<?php echo esc_url( add_query_arg( 'submit', true ) ); ?>"><?php _e( 'Export/Submit', 'infinite-scroll' ); ?></a></div>
</div>
</form>

View file

@ -0,0 +1,174 @@
<?php
/**
* Template to display options page
* @package Infinite_Scroll
*/
?>
<div class="wrap">
<h2><?php _e( 'Infinite Scroll Options', 'infinite-scroll' ); ?></h2>
<form method="post" action="options.php" id="infinite_scroll_form">
<?php settings_errors(); ?>
<?php settings_fields( $this->parent->slug_ ); ?>
<p class="description"><?php _e( 'Infinite scroll uses <a href="http://www.w3.org/TR/CSS2/selector.html">CSS selectors</a> to identify various parts of your site\'s unique theme. In most cases, identifying each of your theme\'s elements below simply requires entering either the element\'s ID indicated with a hashmark, (<em>e.g.,</em><code>#content</code>), or the element\'s class indicated by a period, (<em>e.g.,</em><code>.post</code>). For more information, please see <a href="http://docs.jquery.com/Selectors">jQuery\'s CSS Selector documentation</a>.', 'infinite-scroll' ); ?></p>
<?php $this->parent->presets->preset_prompt(); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php _e( 'Content Selector', 'infinite-scroll' ); ?>
</th>
<td>
<input type="text" name="infinite_scroll[contentSelector]" id="infinite_scroll[contentSelector]" value="<?php echo esc_attr( $this->parent->options->contentSelector ); ?>" class="regular-text" /><br />
<span class="description"><?php _e( 'Div containing your theme\'s content', 'infinite-scroll' ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Navigation Selector', 'infinite-scroll' ); ?>
</th>
<td>
<input type="text" name="infinite_scroll[navSelector]" id="infinite_scroll[navSelector]" value="<?php echo esc_attr( $this->parent->options->navSelector ); ?>" class="regular-text" /><br />
<span class="description"><?php _e( 'Div containing your theme\'s navigation', 'infinite-scroll' ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Next Selector', 'infinite-scroll' ); ?>
</th>
<td>
<input type="text" name="infinite_scroll[nextSelector]" id="infinite_scroll[nextSelector]" value="<?php echo esc_attr( $this->parent->options->nextSelector ); ?>" class="regular-text" /><br />
<span class="description"><?php _e( 'Link to next page of content', 'infinite-scroll' ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Item Selector', 'infinite-scroll' ); ?>
</th>
<td>
<input type="text" name="infinite_scroll[itemSelector]" id="infinite_scroll[itemSelector]" value="<?php echo esc_attr( $this->parent->options->itemSelector ); ?>" class="regular-text" /><br />
<span class="description"><?php _e( 'Div containing an individual post', 'infinite-scroll' ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e("Callback", "infinite-scroll"); ?>
</th>
<td>
<textarea name="infinite_scroll[callback]" id="infinite_scroll[callback]" rows="6" cols="80"><?php print($this->parent->options->callback); ?></textarea><br />
<span class="description"><?php _e("Code that is called after each new page is loaded", "infinite-scroll"); ?></span>
</td>
</tr>
<?php $this->parent->submit->prompt(); ?>
<tr valign="top">
<th scope="row">
<?php _e( 'Loading Message', 'infinite-scroll' ); ?>
</th>
<td>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<?php $this->parent->admin->editor( 'msgText' ); ?>
<span class="description"><?php _e( 'Text to display as new posts are retrieved', 'infinite-scroll' ); ?></span>
</div>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Finished Message', 'infinite-scroll' ); ?>
</th>
<td>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<?php $this->parent->admin->editor( 'finishedMsg' ); ?>
<span class="description"><?php _e( 'Text to display when no additional posts are available', 'infinite-scroll' ); ?></span>
</div>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Loading Image', 'infinite-scroll' ); ?>
</th>
<td>
<?php _e( 'Current Image:', 'infinite-scroll' ); ?> <img src="<?php echo esc_attr( $this->parent->options->loading["img"] ); ?>" alt="<?php _e( 'Current Loading Image', 'infinite-scroll' ); ?>" /><br />
<?php _e( 'New Image:', 'infinite-scroll' ); ?>
<input id="infinite-scroll-upload-image" type="text" size="36" name="infinite_scroll[loading][img]" value="" />
<input id="infinite-scroll-upload-image-button" type="button" value="<?php _e( 'Upload New Image', 'infinite-scroll' ); ?>" /> <?php if ( $this->parent->options->loading["img"]
!= $this->parent->options->defaults["loading"]['img'] ) { ?>
( <a href="#" id="use_default"><?php _e( 'Use Default', 'infinite-scroll' ); ?></a> )
<?php } ?>
<br />
<span class="description"><?php _e( 'URL of existing or uploaded image to display as new posts are retrieved', 'infinite-scroll' ); ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Behavior', 'infinite-scroll' ) ?>
</th>
<td>
<select id="infinite_scroll[behavior]" name="infinite_scroll[behavior]">
<option <?php selected("", $this->parent->options->behavior); ?> value="">Default</option>
<?php foreach ( $this->parent->behaviors as $key => $behavior ) { ?>
<option value="<?php echo $key; ?>" <?php selected( $key, $this->parent->options->behavior ); ?>><?php echo $behavior['label']; ?></option>
<?php } ?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">
<?php _e( 'Debug', 'infinite-scroll' ) ?>
</th>
<td>
<input type="checkbox" id="infinite_scroll[debug]" name="infinite_scroll[debug]" value="true" <?php checked($this->parent->options->debug) ?> />
</td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'infinite-scroll' ); ?>" />
</p>
<?php if ( !is_multisite() || is_super_admin() ) { ?>
<div style="float:right; margin-top: -50px; margin-right:20px;"><a href="<?php echo esc_url( add_query_arg( 'manage-presets', true ) ); ?>"><?php _e( 'Manage Defaults', 'infinite-scroll' ); ?></a></div>
<?php } ?>
</form>
</div>
<?php
// Allow the user to auto-magically insert the image URL into the text field
// Taken From: http://wordpress.stackexchange.com/a/11254/17267
?>
<script type="text/javascript">
(function($, undefined) {
$(function() {
var $uploadImageInput = $("#infinite-scroll-upload-image");
var $uploadImageButton = $("#infinite-scroll-upload-image-button");
var tb_show_temp = window.tb_show;
window.tb_show = function() {
tb_show_temp.apply(null, arguments);
var $iframe = $("#TB_iframeContent");
$iframe.load(function() {
var $document = $iframe.get(0).contentWindow.document;
var $jquery = $iframe.get(0).contentWindow.jQuery;
var $buttonContainer = $jquery("td.savesend");
if ($buttonContainer.get(0)) {
var $buttonSubmit = $buttonContainer.find("input:submit");
$buttonSubmit.click(function() {
var fileId = jQuery(this).attr("id").replace("send", "").replace("[", "").replace("]", "");
var imageUrl = $jquery("input[name=\"attachments\\[" + fileId + "\\]\\[url\\]\"]").val();
$uploadImageInput.val(imageUrl);
tb_remove();
});
}
});
}
$uploadImageButton.click(function() {
tb_show("Loading Image", "media-upload.php?type=image&tab=library&TB_iframe=1");
});
});
})(jQuery);
</script>

View file

@ -0,0 +1,7 @@
<?php
/**
* Prompt to display when plugin knows theme defaults but user has not chosen
* @package Infinite_Scroll
*/
?>
<p><?php echo sprintf( __( 'Other users have submitted default CSS selectors for your theme. Would you like to <strong><a href="%s">use your theme\'s default selectors</a></strong>?'), esc_url( add_query_arg( 'nonce', wp_create_nonce( 'infinite-scroll-presets' ), add_query_arg( 'set_presets', true ) ) ) ); ?></p>

View file

@ -0,0 +1,23 @@
<?php
/**
* Prompt to display when we want user to submit CSS Selectors to community database
* @package Infinite_Scroll
*/
?>
<tr id="submit" valign="top">
<th>&nbsp;</th>
<td>
<p class="description"><?php echo sprintf( __( 'Please consider <a href="%s">submitting your theme\'s CSS selectors</a> to the global CSS selector database to make installation and configuration easier for other users', 'infinite-scroll'), esc_url( add_query_arg( 'submit', true ) ) ); ?>
<span style="font-size: 10px;">
(<a href="#" id="hide-submit"><?php _e( 'hide this message', 'infinite-scroll' ); ?></a>)
</span>
</p>
<?php wp_nonce_field( $this->parent->slug_ . '_hide_submit' , '_ajax_nonce-' . $this->parent->slug . '-hide-submit' ); ?>
<?php $data = array( 'action' => $this->parent->slug_ . '_hide_submit', 'nonce' => '_ajax_nonce-' . $this->parent->slug . '-hide-submit' ); ?>
<script>var submit = <?php echo json_encode( $data ); ?>;</script>
</td>
</div>

View file

@ -0,0 +1,31 @@
<?php
/**
* Outputs CSV of custom selecors and provides instructions on how to submit
* @package Infinite_Scroll
*/
?>
<div class="wrap">
<h2><?php _e( 'Submit CSS Selectors', 'infinite-scroll' ); ?></h2>
<p class="description"><?php _e( 'Infinite Scroll maintains a global database of CSS selectors to help new users, and users without knowledge of CSS selectors adapt the plugin to fit their individual theme. If you have enjoyed this free plugin, please consider contributing back to the community by taking a moment to submit the below information.', 'infinite-scroll' ); ?></p>
<strong><?php _e( 'How to submit:', 'infinite-scroll' ); ?></strong>
<ol>
<li><?php _e( 'Press <code>CTRL-C</code> (PC) or <code>Command-C</code> (Mac) to copy the below CSS selectors to your computer\'s clipboard.', 'infinite-scroll' );?></li>
<li><?php echo sprintf( __( 'Navigate to the <a href="%s" target="_BLANK">Infinite Scroll Support Forum CSS Selectors Page</a>, and if you don\'t already have one, <a href="%s" target="_BLANK">create a WordPress.org account</a> (it takes 30 seconds!).', 'infinite-scroll'), $this->parent->submit->url, 'http://wordpress.org/support/register.php' );?></li>
<li><?php _e( 'Click the reply message box (the big input area)', 'infinite-scroll' ); ?></li>
<li><?php _e( 'Press <code>CTRL-V</code> (PC) or <code>Command-V</code> (Mac) to paste the selectors into the message box', 'infinite-scroll' ); ?></li>
<li><?php _e( 'Add a message, if you\'d like (optional)', 'infinit-scroll' ); ?></li>
<li><?php _e( 'Click "<code>Post</code>"', 'infinite-scroll' ); ?></li>
</ol>
<strong><?php echo ( isset( $_GET['all'] ) ) ? __( 'All CSS Selectors:', 'infinite-scroll' ) : __( 'Your CSS Selectors:', 'infinite-scroll' ); ?></strong>
<textarea style="width: 100%; height: 200px;" id="submit">
&lt;blockquote>
<?php echo $this->parent->presets->export( isset( $_GET['all'] ) ); ?>
&lt;/blockquote></textarea>
<span style="font-size: 10px;">
<?php if ( isset( $_GET['all'] ) ) { ?>
<a href="<?php echo esc_url( remove_query_arg( 'all' ) ); ?>"><?php _e( 'Export only custom selectors', 'infinite-scroll' ); ?></a>
<?php } else { ?>
<a href="<?php echo esc_url( add_query_arg( 'all', true ) ); ?>"><?php _e( 'Export all selectors', 'infinite-scroll' ); ?></a>
<?php } ?>
</span>
</div>