Initial commit
This commit is contained in:
commit
28e6ddf404
1083 changed files with 191734 additions and 0 deletions
12
plugins/infinite-scroll/templates/footer.php
Normal file
12
plugins/infinite-scroll/templates/footer.php
Normal 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>
|
21
plugins/infinite-scroll/templates/manage-presets.php
Normal file
21
plugins/infinite-scroll/templates/manage-presets.php
Normal 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>
|
174
plugins/infinite-scroll/templates/options.php
Normal file
174
plugins/infinite-scroll/templates/options.php
Normal 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>
|
||||
|
7
plugins/infinite-scroll/templates/preset-prompt.php
Normal file
7
plugins/infinite-scroll/templates/preset-prompt.php
Normal 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>
|
23
plugins/infinite-scroll/templates/submit-prompt.php
Normal file
23
plugins/infinite-scroll/templates/submit-prompt.php
Normal 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> </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>
|
31
plugins/infinite-scroll/templates/submit.php
Normal file
31
plugins/infinite-scroll/templates/submit.php
Normal 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">
|
||||
<blockquote>
|
||||
<?php echo $this->parent->presets->export( isset( $_GET['all'] ) ); ?>
|
||||
</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>
|
Reference in a new issue