WordPress Infinite Scroll – Ajax Load More - Version 2.5.1

Version Description

  • FIX - Dynamic population of category, tag and author content within Shortcode Builder - now this actually works as requested and no database queries happen if this setting is true.
  • FIX - Small issue with new destory_after parameter in core js.
  • UPDATE - Updated language .pot file.
  • UPDATE - Small admin interface tweaks.
Download this release

Release Info

Developer dcooney
Plugin Icon 128x128 WordPress Infinite Scroll – Ajax Load More
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.4.1 to 2.5.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://connekthq.com/donate/
4
  Tags: ajax, query, loop, paging, filter, infinite scroll, infinite, dynamic, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, meta_query, post format, wmpl, archives, date
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
- Stable tag: 2.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -19,10 +19,10 @@ Build complex WordPress queries using our shortcode builder then add the shortco
19
 
20
  = Features =
21
 
 
22
  * **Shortcode Builder** - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder.(see Shortcode Parameters).
23
  * **Query Parameters** - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
24
  * **Customizable Repeater Templates** - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots).
25
- * **Multiple Instances** - One, two, three or ten - you can now include multiple instances of Ajax Load More on a single page.
26
  * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
27
 
28
  Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for more information!
@@ -36,8 +36,10 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
36
  * **repeater** - Choose a repeater template (Add-on available). Default = ‘default’
37
  * **post_type** - Comma separated list of post types. Default = ‘post’
38
  * **post_format** - Query by post format. Default = null
39
- * **category** - Query by category slug. Default = null
40
- * **tag** - Query by tag name. Default = null
 
 
41
  * **taxonomy** - Query by custom taxonomy name. Default = null
42
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
43
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
@@ -47,10 +49,9 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
47
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
48
  * **meta_key** - Custom field key(name). Default = null
49
  * **meta_value** - Custom field value. Default = null
50
- * **meta_compare** - Operator to compare meta_key and meta_value against (=/!=/>/>=/</<= etc.). Default = ‘=’
51
  * **author** - Query by author id. Default = null
52
  * **search** - Query search term (‘s’). Default = null
53
- * **post_status** - Display posts by their current status (publish, future, draft, pending, private, trash). Default = ‘publish’
54
  * **order** - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’
55
  * **orderby** - Order posts by date, title, name, menu order, random, author, post ID or comment count. Default = ‘date’
56
  * **exclude** - Comma separated list of post ID’s to exclude from query. Default = null
@@ -59,15 +60,18 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
59
  * **scroll** - Load more posts as the user scrolls the page (true/false). Default = ‘true’
60
  * **max_pages** - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '5'
61
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
62
- * **transition** - Choose a posts reveal transition (slide/fade). Default = 'slide'
 
63
  * **button_label** - The label text for Load More button. Default = 'Older Posts'
64
- * **seo** - Enable address bar URL rewrites as users page through content - <a href="seo/">add-on only</a> (true/false). Default = ‘false’
 
 
65
 
66
  ***
67
 
68
  = Example Shortcode =
69
- `[ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"]`
70
-
71
 
72
  ***
73
 
@@ -77,6 +81,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
77
  * **[Mansory](http://connekthq.com/plugins/ajax-load-more/examples/masonry/)** - Creating a flexible grid layout with Masonry JS
78
  * **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
79
  * **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
 
80
  * **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
81
  * **[SEO Paging](http://connekthq.com/plugins/ajax-load-more/examples/seo-paging/)** - Generate unique paging URLs with each Ajax Load More query
82
 
@@ -93,6 +98,10 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
93
  > The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.<br />
94
  > [Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)
95
  >
 
 
 
 
96
  > #### Search Engine Optimization
97
  > The **[SEO](http://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.<br />
98
  > [Get More Information](http://connekthq.com/plugins/ajax-load-more/seo/)
@@ -161,7 +170,7 @@ Your server must be able to read/write/create files. Ajax Load More creates the
161
 
162
  Yes, Ajax Load more uses admin-ajax and nonces in order to protect URLs and forms from being misused.
163
 
164
- = Can I make modifications to the plugin code? =
165
 
166
  Sure, but please be aware that if modifications are made it may affect future updates of the plugin.
167
 
@@ -211,20 +220,31 @@ How to install Ajax Load More.
211
  1. Settings screen
212
  2. Available Repeater Templates
213
  3. Custom Repeaters Add-On
214
- 4. Shortcode Builder (Admin screen)
215
- 5. Shortcode Builder (Page Edit screen)
216
- 6. Content Editor shortcode icon
217
  7. Shortcode and implementation examples
218
 
219
  == Changelog ==
220
 
221
 
222
- = 2.4.1 =
223
- * Adding query by Post Status(http://codex.wordpress.org/Class_Reference/WP_Query#Status_Parameters).
224
- * Adding 'load more' button class field to Ajax Load More settings page.
225
- * Fix for querying by custom taxonomy and category/tags/etc.
226
- * Fix for $alm_found_posts - now subtracting 'offset' value to get actual returned result total.
227
- * Fix for SEO add-on and pause="true". If SEO is true and page is greater 1, pause will be automatically set to false.
 
 
 
 
 
 
 
 
 
 
 
228
 
229
  = 2.4.0 =
230
  * Adding date query parameters - users can now query by day, month and year.
4
  Tags: ajax, query, loop, paging, filter, infinite scroll, infinite, dynamic, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, meta_query, post format, wmpl, archives, date
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
+ Stable tag: 2.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
19
 
20
  = Features =
21
 
22
+ * **Multiple Instances** - One, two, three or ten - you can now include multiple instances of Ajax Load More on a single page.
23
  * **Shortcode Builder** - Easily create your own Ajax Load More shortcode by adjusting the various WordPress query parameters in our easy-to-use shortcode builder.(see Shortcode Parameters).
24
  * **Query Parameters** - Ajax Load More allows you to query WordPress by many different content types. Query by Post Type, Post Format, Date, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
25
  * **Customizable Repeater Templates** - Edit and extend the functionality of Ajax Load More by creating your own repeater template to match the look and feel of your website (see screenshots).
 
26
  * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
27
 
28
  Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for more information!
36
  * **repeater** - Choose a repeater template (Add-on available). Default = ‘default’
37
  * **post_type** - Comma separated list of post types. Default = ‘post’
38
  * **post_format** - Query by post format. Default = null
39
+ * **category** - A comma separated list of categories to include by slug. Default = null
40
+ * **category__not_in** - A comma separated list of categories to exclude by ID. Default = null
41
+ * **tag** - A comma separated list of tags to include by slug. Default = null
42
+ * **tag__not_in** - A comma separated list of tags to exclude by ID. Default = null
43
  * **taxonomy** - Query by custom taxonomy name. Default = null
44
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
45
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
49
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
50
  * **meta_key** - Custom field key(name). Default = null
51
  * **meta_value** - Custom field value. Default = null
52
+ * **meta_compare** - Operator to compare meta_key and meta_value against (IN/NOT IN/=/!=/>/>=/</<= etc.). Default = ‘IN’
53
  * **author** - Query by author id. Default = null
54
  * **search** - Query search term (‘s’). Default = null
 
55
  * **order** - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’
56
  * **orderby** - Order posts by date, title, name, menu order, random, author, post ID or comment count. Default = ‘date’
57
  * **exclude** - Comma separated list of post ID’s to exclude from query. Default = null
60
  * **scroll** - Load more posts as the user scrolls the page (true/false). Default = ‘true’
61
  * **max_pages** - Maximum number of pages to load while user is scrolling (activated on when scroll = true). Default = '5'
62
  * **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
63
+ * **transition** - Choose a posts reveal transition (slide/fade/none). Default = 'slide'
64
+ * **destroy_after** - Remove ajax load more functionality after 'n' number of pages have been loaded. Default = null
65
  * **button_label** - The label text for Load More button. Default = 'Older Posts'
66
+ * **seo** - Enable address bar URL rewrites as users page through content - <a href="http://connekthq.com/plugins/ajax-load-more/search-engine-optimization/">add-on only</a> (true/false). Default = ‘false’
67
+ * **preloaded** - Should Ajax Load More preload posts? - <a href="http://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> (true/false). Default = ‘false’
68
+ * **preloaded_amount** - The amount of posts to preload. - <a href="http://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> Default = ‘5’
69
 
70
  ***
71
 
72
  = Example Shortcode =
73
+
74
+ [ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"]
75
 
76
  ***
77
 
81
  * **[Mansory](http://connekthq.com/plugins/ajax-load-more/examples/masonry/)** - Creating a flexible grid layout with Masonry JS
82
  * **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
83
  * **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
84
+ * **[Preloaded posts](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Easily preload an initial set of posts before completing any Ajax requests to the server
85
  * **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
86
  * **[SEO Paging](http://connekthq.com/plugins/ajax-load-more/examples/seo-paging/)** - Generate unique paging URLs with each Ajax Load More query
87
 
98
  > The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.<br />
99
  > [Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)
100
  >
101
+ > #### Preloaded
102
+ > The **[Preloaded](http://connekthq.com/plugins/ajax-load-more/preloaded)** add-on will allow you to quickly and easily preload an initial set of posts before completing any Ajax requests to the server.<br />
103
+ > [Get More Information](http://connekthq.com/plugins/ajax-load-more/preloaded)
104
+ >
105
  > #### Search Engine Optimization
106
  > The **[SEO](http://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.<br />
107
  > [Get More Information](http://connekthq.com/plugins/ajax-load-more/seo/)
170
 
171
  Yes, Ajax Load more uses admin-ajax and nonces in order to protect URLs and forms from being misused.
172
 
173
+ = Can I make modifications to the plugin code? =
174
 
175
  Sure, but please be aware that if modifications are made it may affect future updates of the plugin.
176
 
220
  1. Settings screen
221
  2. Available Repeater Templates
222
  3. Custom Repeaters Add-On
223
+ 4. Shortcode Builder
224
+ 5. Content Editor shortcode icon
225
+ 6. Edit Page Shortcode Builder
226
  7. Shortcode and implementation examples
227
 
228
  == Changelog ==
229
 
230
 
231
+ = 2.5.1 =
232
+ * FIX - Dynamic population of category, tag and author content within Shortcode Builder - now this actually works as requested and no database queries happen if this setting is true.
233
+ * FIX - Small issue with new destory_after parameter in core js.
234
+ * UPDATE - Updated language .pot file.
235
+ * UPDATE - Small admin interface tweaks.
236
+
237
+ = 2.5.0 =
238
+ * NEW - Adding query by multiple categories and tags.
239
+ * NEW - Adding required functionality for new Preloaded add-on - preload posts before any ajax queries kick in.
240
+ * NEW - Adding 'destroy_after' parameter to completely remove Ajax Load More functionality after 'n' number of pages.
241
+ * NEW - Adding setting to disable dynamic population of category, tag and author content within shortcode builder.
242
+ * NEW - Adding functionality to exclude categories('category__not_in').
243
+ * NEW - Adding functionality to exclude tags('tag__not_in').
244
+ * NEW - Adding option to copy repeater content and update templates from database directly on the Repeater Template settings page.
245
+ * NEW - Query by multiple meta query values e.g "cat, dog, fish".
246
+ * FIX - Issue with simultaneous query by category and custom taxonomy.
247
+ * Fix - Issue for SEO add-on when pause = "true". ALM will now set pause to false if page > 1 when using the SEO add-on.
248
 
249
  = 2.4.0 =
250
  * Adding date query parameters - users can now query by day, month and year.
admin/admin.php CHANGED
@@ -157,6 +157,8 @@ function alm_enqueue_admin_scripts(){
157
 
158
  //Load Admin CSS
159
  wp_enqueue_style( 'alm-admin-css', ALM_ADMIN_URL. 'css/admin.css');
 
 
160
  wp_enqueue_style( 'alm-core-css', ALM_URL. '/core/css/ajax-load-more.css');
161
  wp_enqueue_style( 'alm-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
162
 
@@ -182,6 +184,8 @@ function alm_enqueue_admin_scripts(){
182
  //Load JS
183
  wp_enqueue_script( 'jquery-form' );
184
  wp_enqueue_script( 'alm-select2', ALM_ADMIN_URL. 'js/libs/select2.min.js', array( 'jquery' ));
 
 
185
  wp_enqueue_script( 'alm-shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ));
186
  }
187
 
@@ -194,61 +198,12 @@ function alm_enqueue_admin_scripts(){
194
  * @since 2.0.0
195
  */
196
 
197
- function alm_settings_page(){ ?>
198
- <div class="admin ajax-load-more settings" id="alm-settings">
199
- <div class="wrap">
200
- <div class="header-wrap">
201
- <h2><?php echo ALM_TITLE; ?> <span><?php echo ALM_VERSION; ?></span></h2>
202
- <p><?php _e('A WordPress plugin for lazy loading posts with Ajax', ALM_NAME); ?></p>
203
- </div>
204
- <?php if( isset($_GET['settings-updated']) ) { ?>
205
- <div id="message" class="updated inline">
206
- <p><strong><?php _e('Ajax Load More settings have been saved.') ?></strong></p>
207
- </div>
208
- <?php } ?>
209
- <div class="cnkt-main">
210
- <div class="group">
211
- <form action="options.php" method="post" id="alm_OptionsForm">
212
- <?php
213
- settings_fields( 'alm-setting-group' );
214
- do_settings_sections( 'ajax-load-more' );
215
- //get the older values, wont work the first time
216
- $options = get_option( '_alm_settings' ); ?>
217
- <div class="row no-brd alm-save-settings">
218
- <?php submit_button('Save Settings'); ?>
219
- <div class="loading"></div>
220
- </div>
221
- </form>
222
- <script type="text/javascript">
223
- jQuery(document).ready(function() {
224
- jQuery('#alm_OptionsForm').submit(function() {
225
- jQuery('.alm-save-settings .loading').fadeIn();
226
- jQuery(this).ajaxSubmit({
227
- success: function(){
228
- jQuery('.alm-save-settings .loading').fadeOut(250, function(){
229
- window.location.reload();
230
- });
231
- },
232
- error: function(){
233
- alert("<?php _e('Sorry, settings could not be saved.', ALM_NAME); ?>");
234
- }
235
- });
236
- return false;
237
- });
238
- });
239
- </script>
240
- </div>
241
- </div>
242
- <div class="cnkt-sidebar">
243
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/resources.php'); ?>
244
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/about.php'); ?>
245
- </div>
246
- </div>
247
- </div>
248
- <?php
249
  }
250
 
251
 
 
252
  /*
253
  * alm_repeater_page
254
  * Custom Repeaters
@@ -256,275 +211,56 @@ function alm_settings_page(){ ?>
256
  * @since 2.0.0
257
  */
258
 
259
- function alm_repeater_page(){ ?>
260
- <div class="admin ajax-load-more" id="alm-repeaters">
261
- <div class="wrap">
262
- <div class="header-wrap">
263
- <h2><?php _e('Ajax Load More: Repeater Templates', ALM_NAME); ?></h2>
264
- <p><?php _e('The library of available templates to use within your theme', ALM_NAME); ?></p>
265
- </div>
266
- <div class="cnkt-main form-table repeaters">
267
-
268
- <!-- Repeaters -->
269
- <div class="group">
270
- <?php
271
- if (has_action('alm_custom_repeaters') || has_action('alm_unlimited_repeaters')){ ?>
272
- <span class="toggle-all"><span class="inner-wrap"><em class="collapse"><?php _e('Collapse All', ALM_NAME); ?></em><em class="expand"><?php _e('Expand All', ALM_NAME); ?></em></span></span>
273
- <?php } ?>
274
-
275
- <!-- Default -->
276
- <div class="row default-repeater">
277
- <?php
278
- $filename = ALM_PATH. 'core/repeater/default.php';
279
- $handle = fopen ($filename, "r");
280
- $contents = '';
281
- if(filesize ($filename) != 0){
282
- $contents = fread ($handle, filesize ($filename));
283
- }
284
- fclose ($handle);
285
- ?>
286
- <h3 class="heading"><?php _e('Default Template', ALM_NAME); ?></h3>
287
- <div class="expand-wrap">
288
- <div class="wrap repeater-wrap" data-name="default" data-type="default">
289
- <label class="template-title" for="template-default"><?php _e('Enter the HTML and PHP code for the default template', ALM_NAME); ?></label>
290
- <!-- <span class="option-update" data-editor-id="template-default">Update from database</span> -->
291
- <textarea rows="10" id="template-default" class="_alm_repeater"><?php echo $contents; ?></textarea>
292
- <script>
293
- var editorDefault = CodeMirror.fromTextArea(document.getElementById("template-default"), {
294
- mode: "application/x-httpd-php",
295
- lineNumbers: true,
296
- lineWrapping: true,
297
- indentUnit: 0,
298
- matchBrackets: true,
299
- //theme: 'pastel-on-dark',
300
- viewportMargin: Infinity,
301
- extraKeys: {"Ctrl-Space": "autocomplete"},
302
- });
303
- </script>
304
- <input type="submit" value="<?php _e('Save Template', ALM_NAME); ?>" class="button button-primary save-repeater" data-editor-id="template-default">
305
- <div class="saved-response">&nbsp;</div>
306
- </div>
307
- </div>
308
- </div>
309
- <?php
310
-
311
- // Custom Repeaters - /cta/extend.php
312
- // Removed in 2.2.8
313
- if (!has_action('alm_get_custom_repeaters')) {}
314
-
315
- // Custom Repeaters v2 - /cta/extend.php
316
- if (!has_action('alm_get_unlimited_repeaters')) {
317
-
318
- if (!has_action('alm_get_custom_repeaters')) { // If Custom Repeaters v1 is NOT installed
319
- echo '<div class="row no-brd">';
320
- include( ALM_PATH . 'admin/includes/cta/extend.php');
321
- echo '</div>';
322
- }
323
-
324
- }
325
- ?>
326
- <!-- End Default -->
327
- <?php
328
- if (has_action('alm_custom_repeaters'))
329
- do_action('alm_custom_repeaters');
330
- ?>
331
- <?php
332
- if (has_action('alm_unlimited_repeaters'))
333
- do_action('alm_unlimited_repeaters');
334
- ?>
335
-
336
- <script>
337
- jQuery(document).ready(function($) {
338
- "use strict";
339
- var _alm_admin = {};
340
-
341
- /*
342
- * _alm_admin.saveRepeater
343
- * Save Custom Repeater Value
344
- *
345
- * @since 2.0.0
346
- */
347
-
348
- _alm_admin.saveRepeater = function(btn, editorId) {
349
- var container = btn.parent('.repeater-wrap'),
350
- el = $('textarea._alm_repeater', container),
351
- btn = btn,
352
- value = '',
353
- repeater = container.data('name'), // Get templete name
354
- type = container.data('type'), // Get template type (default/repeater/unlimited)
355
- alias = ($('input._alm_repeater_alias', container).length) ? $('input._alm_repeater_alias', container).val() : '',
356
- responseText = $(".saved-response", container);
357
-
358
- if(type === undefined) // Fix for custom repeaters v1
359
- type = 'undefined';
360
-
361
- //Get value from CodeMirror textarea
362
- var id = editorId.replace('template-', ''); // Editor ID
363
-
364
- if(id === 'default'){ // Default Template
365
- value = editorDefault.getValue();
366
- }else{ // Repeater Templates
367
- var eid = window['editor_'+id]; // Set editor ID
368
- value = eid.getValue();
369
- }
370
-
371
- // if value is null, then set repeater to non breaking space
372
- if(value === '' || value === 'undefined'){
373
- value = '&nbsp;';
374
- }
375
-
376
- //If template is not already saving, then proceed
377
- if (!btn.hasClass('saving')) {
378
- btn.addClass('saving');
379
- responseText.addClass('loading').html('<?php _e('Saving template...', ALM_NAME) ?>');
380
- responseText.animate({'opacity' : 1});
381
-
382
- $.ajax({
383
- type: 'POST',
384
- url: alm_admin_localize.ajax_admin_url,
385
- data: {
386
- action: 'alm_save_repeater',
387
- value: value,
388
- repeater: repeater,
389
- type: type,
390
- alias: alias,
391
- nonce: alm_admin_localize.alm_admin_nonce,
392
- },
393
- success: function(response) {
394
-
395
- setTimeout(function() {
396
- responseText.delay(500).html(response).removeClass('loading');
397
- }, 250);
398
-
399
- setTimeout(function() {
400
- responseText.animate({'opacity': 0}, function(){
401
- responseText.html('&nbsp;');
402
- btn.removeClass('saving');
403
- });
404
-
405
- }, 6000);
406
-
407
- },
408
- error: function(xhr, status, error) {
409
- responseText.html('<?php _e('Something went wrong and the data could not be saved.', ALM_NAME) ?>').removeClass('loading');
410
- btn.removeClass('saving');
411
- }
412
- });
413
-
414
- }
415
- }
416
-
417
- $(document).on('click', 'input.save-repeater' ,function(){
418
- var btn = $(this),
419
- editorId = btn.data('editor-id');
420
- _alm_admin.saveRepeater(btn, editorId);
421
- });
422
-
423
-
424
-
425
- /*
426
- * _alm_admin.updateRepeater
427
- * Update Repeater Value
428
- *
429
- * COMING SOON
430
- * @since 2.4
431
- */
432
-
433
- _alm_admin.updateRepeater = function(btn, editorId) {
434
- var container = btn.parent('.repeater-wrap'),
435
- el = $('textarea._alm_repeater', container),
436
- btn = btn,
437
- repeater = container.data('name'), // Get templete name
438
- type = container.data('type'), // Get template type (default/repeater/unlimited)
439
- responseText = $(".saved-response", container);
440
-
441
- //Get value from CodeMirror textarea
442
- var id = editorId.replace('template-', ''); // Editor ID
443
-
444
- //If template is not already saving, then proceed
445
- if (!btn.hasClass('updating')) {
446
- btn.addClass('updating');
447
- responseText.addClass('loading').html('<?php _e('Updating template...', ALM_NAME) ?>');
448
- responseText.animate({'opacity' : 1});
449
-
450
- $.ajax({
451
- type: 'POST',
452
- url: alm_admin_localize.ajax_admin_url,
453
- data: {
454
- action: 'alm_update_repeater',
455
- repeater: repeater,
456
- type: type,
457
- nonce: alm_admin_localize.alm_admin_nonce,
458
- },
459
- success: function(response) {
460
- if(id === 'default'){ // Default Template
461
- editorDefault.setValue(response);
462
- }else{ // Repeater Templates
463
- var eid = window['editor_'+id]; // Set editor ID
464
- eid.setValue(response);
465
- }
466
-
467
- setTimeout(function() {
468
- responseText.animate({'opacity': 0}, function(){
469
- responseText.html('&nbsp;').removeClass('loading');
470
- btn.removeClass('updating');
471
- });
472
-
473
- }, 100);
474
- },
475
- error: function(xhr, status, error) {
476
- responseText.html('<?php _e('Something went wrong and the data could not be updated.', ALM_NAME) ?>').removeClass('loading');
477
- btn.removeClass('updating');
478
- }
479
- });
480
-
481
- }
482
- }
483
-
484
-
485
-
486
- $(document).on('click', '.option-update' ,function(){
487
- var btn = $(this),
488
- editorId = btn.data('editor-id');
489
- _alm_admin.updateRepeater(btn, editorId);
490
- });
491
-
492
- });
493
- </script>
494
- </div>
495
- <!-- End Repeaters -->
496
- </div>
497
- <div class="cnkt-sidebar">
498
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
499
- <div class="cta">
500
- <h3><?php _e('Templating Help', ALM_NAME); ?></h3>
501
- <div class="item">
502
- <p><strong><?php _e('What is a repeater template?', ALM_NAME); ?></strong></p>
503
- <p><?php _e('A repeater template is a snippet of code that will execute over and over within a <a href="http://codex.wordpress.org/The_Loop" target="_blank">WordPress loop</a>.</p>', ALM_NAME); ?></p>
504
- </div>
505
- <div class="item">
506
- <p><strong><?php _e('Can I include PHP in the repeater template?', ALM_NAME); ?></strong></p>
507
- <p><?php _e('Yes, PHP and core WordPress functions such as, <code>the_title()</code> and <code>the_permalink()</code> are required.</p>', ALM_NAME); ?></p>
508
- </div>
509
- <div class="item">
510
- <p><strong><?php _e('Tips and Tricks', ALM_NAME); ?></strong></p>
511
- <ul>
512
- <li><?php _e('Always open and close your templates with an HTML element. In some rare cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code>&lt;li> &lt;/li></code> or <code>&lt;div> &lt;/div></code>', ALM_NAME); ?><br/> </li>
513
- </ul>
514
- </div>
515
- </div>
516
- </div>
517
- </div>
518
- </div>
519
 
520
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  }
522
 
523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  /*
525
  * alm_save_repeater
526
  * Repeater Save function
527
  *
 
528
  * @since 2.0.0
529
  */
530
 
@@ -532,7 +268,7 @@ function alm_save_repeater(){
532
  $nonce = $_POST["nonce"];
533
  // Check our nonce, if they don't match then bounce!
534
  if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
535
- die('Get Bounced!');
536
 
537
  // Get _POST Vars
538
  $c = Trim(stripslashes($_POST["value"])); // Repeater Value
@@ -602,26 +338,26 @@ function alm_save_repeater(){
602
 
603
  /*
604
  * alm_update_repeater
605
- * Update repeater from database function
606
  *
607
  * - User story: User deletes plugin, the installs again and the version has not change - their default repeater will be in the default state and unable to be updated.
608
  *
609
- * COMING SOON
610
- * @since 2.4
611
  */
612
 
613
  function alm_update_repeater(){
614
  $nonce = $_POST["nonce"];
615
  // Check our nonce, if they don't match then bounce!
616
  if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
617
- die('Get Bounced!');
618
 
619
  // Get _POST Vars
620
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
621
- $t = Trim(stripslashes($_POST["type"])); // Repeater name
 
622
 
623
  // Get value from database
624
- //Save to database
625
  global $wpdb;
626
  $table_name = $wpdb->prefix . "alm";
627
 
@@ -630,62 +366,18 @@ function alm_update_repeater(){
630
 
631
  $the_repeater = $wpdb->get_var("SELECT repeaterDefault FROM " . $table_name . " WHERE name = '$n'");
632
 
633
-
634
-
635
- echo $the_repeater;
636
 
637
  die();
638
  }
639
 
640
 
641
 
642
- /*
643
- * alm_shortcode_builder_page
644
- * Shortcode Builder
645
- *
646
- * @since 2.0.0
647
- */
648
-
649
- function alm_shortcode_builder_page(){ ?>
650
- <div class="admin ajax-load-more shortcode-builder" id="alm-builder">
651
- <div class="wrap">
652
- <div class="header-wrap">
653
- <h2><?php _e('Ajax Load More: Shortcode Builder', ALM_NAME); ?></h2>
654
- <p><?php _e('Create your own Ajax Load More <a href="http://en.support.wordpress.com/shortcodes/" target="_blank">shortcode</a> by adjusting the values below', ALM_NAME); ?></p>
655
- </div>
656
- <div class="cnkt-main">
657
- <div class="group">
658
- <?php include( plugin_dir_path( __FILE__ ) . 'shortcode-builder/shortcode-builder.php'); ?>
659
- <div class="row no-brd">
660
- <p class="back2top"><a href="#wpcontent"><i class="fa fa-chevron-up"></i> <?php _e('Back to Top', ALM_NAME); ?></a></p>
661
- </div>
662
- </div>
663
- </div>
664
- <div class="cnkt-sidebar">
665
- <div class="table-of-contents">
666
- <div class="cta">
667
- <select class="toc"></select>
668
- </div>
669
- <div class="cta">
670
- <h3><?php _e('Shortcode Output', ALM_NAME); ?></h3>
671
- <p><?php _e('Place the following shortcode into the content editor or widget area of your theme.', ALM_NAME); ?></p>
672
- <div class="output-wrap">
673
- <div id="shortcode_output"></div>
674
- <span class="copy"><?php _e('Copy', ALM_NAME); ?></span>
675
- </div>
676
- </div>
677
- </div>
678
- </div>
679
- </div>
680
- </div>
681
- <?php
682
- }
683
-
684
-
685
  /*
686
  * alm_get_tax_terms
687
  * Get taxonomy terms for shortcode builder
688
  *
 
689
  * @since 2.1.0
690
  */
691
 
@@ -719,187 +411,6 @@ function alm_get_tax_terms(){
719
  }
720
 
721
 
722
- /*
723
- * alm_example_page
724
- * Examples Page
725
- *
726
- * @since 2.0.0
727
- */
728
-
729
- function alm_example_page(){ ?>
730
- <div class="admin ajax-load-more" id="alm-examples">
731
- <div class="wrap">
732
- <div class="header-wrap">
733
- <h2><?php _e('Ajax Load More: Examples', ALM_NAME); ?></h2>
734
- <p><?php _e('A collection of everyday shortcode usages and implementation examples', ALM_NAME); ?></p>
735
- </div>
736
- <div class="cnkt-main forceColors">
737
- <div class="group">
738
- <span class="toggle-all"><span class="inner-wrap"><em class="collapse"><?php _e('Collapse All', ALM_NAME); ?></em><em class="expand"><?php _e('Expand All', ALM_NAME); ?></em></span></span>
739
-
740
- <div class="row gist" id="example-archive">
741
- <h3 class="heading"><?php _e('Archive.php', ALM_NAME); ?></h3>
742
- <div class="expand-wrap">
743
- <p><?php _e('Shortcode for use on generic archive page.', ALM_NAME); ?></p>
744
- <div class="inner">
745
- <script src="https://gist.github.com/dcooney/ebe912c7772e669f1370.js"></script>
746
- </div>
747
- </div>
748
- </div>
749
-
750
- <div class="row gist" id="example-author">
751
- <h3 class="heading"><?php _e('Author.php', ALM_NAME); ?></h3>
752
- <div class="expand-wrap">
753
- <p><?php _e('Shortcode for use on author archive pages.', ALM_NAME); ?></p>
754
- <div class="inner">
755
- <script src="https://gist.github.com/dcooney/4d07ff95f7274f38fd3a.js"></script>
756
- </div>
757
- </div>
758
- </div>
759
- <div class="row gist" id="example-category">
760
- <h3 class="heading"><?php _e('Category.php', ALM_NAME); ?></h3>
761
- <div class="expand-wrap">
762
- <p><?php _e('Shortcode for use on category archive pages.', ALM_NAME); ?></p>
763
- <div class="inner">
764
- <script src="https://gist.github.com/dcooney/ae4caec3f9061dd47627.js"></script>
765
- </div>
766
- </div>
767
- </div>
768
- <div class="row gist" id="example-date">
769
- <h3 class="heading"><?php _e('Date Archives', ALM_NAME); ?></h3>
770
- <div class="expand-wrap">
771
- <p><?php _e('Shortcode for use for archiving by date.', ALM_NAME); ?></p>
772
- <div class="inner">
773
- <script src="https://gist.github.com/dcooney/6f74bebdd40cad9e3ee7.js"></script>
774
- </div>
775
- </div>
776
- </div>
777
- <div class="row gist" id="example-exclude">
778
- <h3 class="heading"><?php _e('Excluding Posts', ALM_NAME); ?></h3>
779
- <div class="expand-wrap">
780
- <p><?php _e('Shortcode for excluding an array of posts.', ALM_NAME); ?></p>
781
- <script src="https://gist.github.com/dcooney/9b037efbd166b4dba5ae.js"></script>
782
- </div>
783
- </div>
784
-
785
- <div class="row gist" id="example-tag">
786
- <h3 class="heading"><?php _e('Tag.php', ALM_NAME); ?></h3>
787
- <div class="expand-wrap">
788
- <p><?php _e('Shortcode for use on tag archive pages.', ALM_NAME); ?></p>
789
- <div class="inner">
790
- <script src="https://gist.github.com/dcooney/fc4276bebbdd05af64d1.js"></script>
791
- </div>
792
- </div>
793
- </div>
794
-
795
- <div class="row no-brd">
796
- <p class="back2top"><a href="#wpcontent"><i class="fa fa-chevron-up"></i> <?php _e('Back to Top', ALM_NAME); ?></a></p>
797
- </div>
798
- </div>
799
-
800
- </div>
801
- <div class="cnkt-sidebar">
802
-
803
- <div class="cta">
804
- <h3><?php _e('Did you know?', ALM_NAME); ?></h3>
805
- <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/shortcode-editor.jpg"><br/>
806
- <?php _e('<p class="addon-intro">You can generate shortcodes while editing pages!</p><p>Click the Ajax Load More icon in the content editor toolbar and the <a href="?page=ajax-load-more-shortcode-builder">shortcode builder</a> will open in an overlay window.', ALM_NAME); ?></p>
807
- </div>
808
-
809
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/resources.php'); ?>
810
-
811
- </div>
812
-
813
-
814
- </div>
815
- </div>
816
- <?php
817
- }
818
-
819
-
820
-
821
- /*
822
- * alm_add_ons_page
823
- * Ajax Load More Add-ons
824
- *
825
- * @since 2.0.0
826
- */
827
-
828
- function alm_add_ons_page(){ ?>
829
- <div class="admin ajax-load-more" id="alm-add-ons">
830
- <div class="wrap">
831
- <div class="header-wrap">
832
- <h2><?php _e('Ajax Load More: Add-ons', ALM_NAME); ?></h2>
833
- <p><?php _e('Add-ons are available to extend and enhance the core functionality of Ajax Load More.', ALM_NAME); ?></p>
834
- </div>
835
- <div class="cnkt-main">
836
-
837
- <!-- Custom Repeaters -->
838
- <div class="group">
839
- <div class="row no-brd">
840
- <div class="expand-wrap">
841
- <div class="section-title">
842
- <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/unlimited-add-ons.jpg">
843
- </div>
844
- <div class="wrap">
845
- <h2 class="addon-title"><?php _e('Custom Repeaters', ALM_NAME); ?></h2>
846
- <p class="addon-intro"><?php _e('Extend Ajax Load More with unlimited repeater templates.', ALM_NAME); ?></p>
847
- <p><?php _e('Create, delete and modify <a href="?page=ajax-load-more-repeaters">repeater templates</a> as you need them with absolutely zero restrictions.</p>', ALM_NAME); ?>
848
- </div>
849
- </div>
850
- </div>
851
- <?php
852
- $cr_url = 'http://connekthq.com/plugins/ajax-load-more/custom-repeaters/';
853
- if (has_action('alm_unlimited_installed')){
854
- echo '<a class="btn installed" href="'. $cr_url .'" target="_blank"><i class="fa fa-check-square"></i> Installed</a> ';
855
- }else{
856
- echo '<a class="btn" href="'. $cr_url .'" target="_blank"><i class="fa fa-download"></i> Purchase &amp; Install</a>';
857
- }
858
- ?>
859
- </div>
860
- <!-- End Custom Repeaters -->
861
-
862
- <!-- SEO -->
863
- <div class="group">
864
- <div class="row no-brd">
865
- <div class="expand-wrap">
866
- <div class="section-title">
867
- <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/seo-add-ons.jpg">
868
- </div>
869
- <div class="wrap">
870
- <h2 class="addon-title"><?php _e('Search Engine Optimization', ALM_NAME); ?></h2>
871
- <p class="addon-intro"><?php _e('Generate unique paging URLs with every Ajax Load More query.', ALM_NAME); ?></p>
872
- <p><?php _e('The SEO add-on will optimize your ajax loaded content for search engines and site visitors by generating unique paging URLs with every query.</p>', ALM_NAME); ?>
873
- </div>
874
- </div>
875
- </div>
876
- <?php
877
- $seo_url = 'http://connekthq.com/plugins/ajax-load-more/seo/';
878
- if (has_action('alm_seo_installed')){
879
- echo '<a class="btn installed" href="'. $seo_url .'" target="_blank"><i class="fa fa-check-square"></i> Installed</a> ';
880
- }else{
881
- echo '<a class="btn" href="'. $seo_url .'" target="_blank"><i class="fa fa-download"></i> Purchase &amp; Install</a>';
882
- }
883
- ?>
884
- </div>
885
- <!-- End SEO -->
886
-
887
- </div>
888
-
889
- <div class="cnkt-sidebar">
890
- <div class="cta">
891
- <h3><?php _e('Add-on Updates', ALM_NAME); ?></h3>
892
- <p><?php _e('All add-ons are installed as stand alone plugins and will receive plugin update notifications.', ALM_NAME); ?></p>
893
- </div>
894
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
895
- </div>
896
-
897
- </div>
898
- </div>
899
- <?php
900
- }
901
-
902
-
903
  /*
904
  * admin_init
905
  * Initiate the plugin, create our setting variables.
@@ -923,7 +434,8 @@ function alm_admin_init(){
923
  'ajax-load-more'
924
  );
925
 
926
- add_settings_field(
 
927
  '_alm_container_type',
928
  __('Container Type', ALM_NAME ),
929
  'alm_container_type_callback',
@@ -931,7 +443,7 @@ function alm_admin_init(){
931
  'alm_general_settings'
932
  );
933
 
934
- add_settings_field(
935
  '_alm_classname',
936
  __('Container Classes', ALM_NAME ),
937
  'alm_class_callback',
@@ -939,7 +451,7 @@ function alm_admin_init(){
939
  'alm_general_settings'
940
  );
941
 
942
- add_settings_field(
943
  '_alm_hide_btn',
944
  __('Editor Button', ALM_NAME ),
945
  'alm_hide_btn_callback',
@@ -947,7 +459,15 @@ function alm_admin_init(){
947
  'alm_general_settings'
948
  );
949
 
950
- add_settings_field(
 
 
 
 
 
 
 
 
951
  '_alm_disable_css',
952
  __('Disable CSS', ALM_NAME ),
953
  'alm_disable_css_callback',
@@ -955,15 +475,15 @@ function alm_admin_init(){
955
  'alm_general_settings'
956
  );
957
 
958
- add_settings_field(
959
  '_alm_btn_color',
960
  __('Button Color', ALM_NAME ),
961
  'alm_btn_color_callback',
962
  'ajax-load-more',
963
  'alm_general_settings'
964
- );
965
 
966
- add_settings_field(
967
  '_alm_btn_classname',
968
  __('Button Classes', ALM_NAME ),
969
  'alm_btn_class_callback',
@@ -971,8 +491,7 @@ function alm_admin_init(){
971
  'alm_general_settings'
972
  );
973
 
974
-
975
-
976
  if(has_action('alm_seo_installed')){
977
 
978
  add_settings_section(
@@ -1044,11 +563,11 @@ function alm_disable_css_callback(){
1044
  if(!isset($options['_alm_disable_css']))
1045
  $options['_alm_disable_css'] = '0';
1046
 
1047
- echo '<input type="hidden" name="alm_settings[_alm_disable_css]" value="0" />
1048
- <label><input type="checkbox" id="alm_disable_css_input" name="alm_settings[_alm_disable_css]" value="1"'. (($options['_alm_disable_css']) ? ' checked="checked"' : '') .' /> '.__('I want to use my own CSS styles', ALM_NAME).'</label>';
1049
- echo '<p class="desc"><i class="fa fa-file-text-o"></i> &nbsp;<a href="'.ALM_URL.'/core/css/ajax-load-more.css" target="blank">'.__('View Ajax Load More CSS', ALM_NAME).'</a></p>';
1050
- ?>
1051
- <?php
1052
  }
1053
 
1054
 
@@ -1064,8 +583,31 @@ function alm_hide_btn_callback(){
1064
  if(!isset($options['_alm_hide_btn']))
1065
  $options['_alm_hide_btn'] = '0';
1066
 
1067
- echo '<input type="hidden" name="alm_settings[_alm_hide_btn]" value="0" />
1068
- <label><input type="checkbox" name="alm_settings[_alm_hide_btn]" value="1"'. (($options['_alm_hide_btn']) ? ' checked="checked"' : '') .' /> '.__('Hide shortcode button in WYSIWYG editor', ALM_NAME).'</label>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1069
  }
1070
 
1071
 
@@ -1079,7 +621,10 @@ function alm_hide_btn_callback(){
1079
  function alm_class_callback(){
1080
  $options = get_option( 'alm_settings' );
1081
 
1082
- echo '<label for="alm_settings[_alm_classname]">'.__('Add classes to Ajax Load More container', ALM_NAME).'</label><br/><input type="text" id="alm_settings[_alm_classname]" name="alm_settings[_alm_classname]" value="'.$options['_alm_classname'].'" placeholder="posts listing etc..." /> ';
 
 
 
1083
  }
1084
 
1085
 
@@ -1152,7 +697,7 @@ function alm_btn_color_callback() {
1152
  if($color == 'white')
1153
  $selected5 = 'selected="selected"';
1154
 
1155
- $html = '<label for="alm_settings_btn_color">'.__('Choose your load more button color', ALM_NAME).'</label><br/>';
1156
  $html .= '<select id="alm_settings_btn_color" name="alm_settings[_alm_btn_color]">';
1157
  $html .= '<option value="default" ' . $selected0 .'>Default (Orange)</option>';
1158
  $html .= '<option value="blue" ' . $selected1 .'>Blue</option>';
@@ -1163,9 +708,30 @@ function alm_btn_color_callback() {
1163
  $html .= '<option value="white" ' . $selected6 .'>White</option>';
1164
  $html .= '</select>';
1165
 
1166
- $html .= '<div class="clear"></div><div class="ajax-load-more-wrap '.$color.'"><span>'.__('Preview', ALM_NAME) .'</span><button class="alm-load-more-btn loading" disabled="disabled">Show More</button></div>';
1167
  echo $html;
1168
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1169
  <script>
1170
  //Button preview
1171
  var colorArray = "default grey purple green red blue white";
@@ -1179,44 +745,24 @@ function alm_btn_color_callback() {
1179
  });
1180
 
1181
  // Check if Disable CSS === true
1182
- if(jQuery('input#alm_disable_css_input').is(":checked")){
1183
- //alert("true");
1184
- jQuery('input#alm_disable_css_input').parent().parent().parent('tr').next('tr').hide();
1185
  }
1186
  jQuery('input#alm_disable_css_input').change(function() {
1187
  var el = jQuery(this);
1188
  if(el.is(":checked")) {
1189
- el.parent().parent().parent('tr').next('tr').hide();
1190
- el.parent().parent().parent('tr').next('tr').next('tr').hide();
1191
  }else{
1192
- el.parent().parent().parent('tr').next('tr').show();
1193
- el.parent().parent().parent('tr').next('tr').next('tr').show();
1194
  }
1195
  });
1196
 
1197
  </script>
1198
- <?php
1199
  }
1200
 
1201
 
1202
 
1203
- /*
1204
- * alm_btn_class_callback
1205
- * Add classes to the Ajax Load More button
1206
- *
1207
- * @since 2.4.1
1208
- */
1209
-
1210
- function alm_btn_class_callback(){
1211
- $options = get_option( 'alm_settings' );
1212
-
1213
- if(!isset($options['_alm_btn_classname']))
1214
- $options['_alm_btn_classname'] = '';
1215
-
1216
- echo '<label for="alm_settings[_alm_btn_classname]">'.__('Add classes to the <em>Load More</em> button', ALM_NAME).'</label><br/><input type="text" id="alm_settings[_alm_btn_classname]" name="alm_settings[_alm_btn_classname]" value="'.$options['_alm_btn_classname'].'" placeholder="button rounded etc..." /> ';
1217
- }
1218
-
1219
-
1220
 
1221
  /*
1222
  * alm_seo_settings_callback
157
 
158
  //Load Admin CSS
159
  wp_enqueue_style( 'alm-admin-css', ALM_ADMIN_URL. 'css/admin.css');
160
+ wp_enqueue_style( 'alm-select2-css', ALM_ADMIN_URL. 'css/select2.css');
161
+ //wp_enqueue_style( 'alm-chosen-css', ALM_ADMIN_URL. 'css/chosen.css');
162
  wp_enqueue_style( 'alm-core-css', ALM_URL. '/core/css/ajax-load-more.css');
163
  wp_enqueue_style( 'alm-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css');
164
 
184
  //Load JS
185
  wp_enqueue_script( 'jquery-form' );
186
  wp_enqueue_script( 'alm-select2', ALM_ADMIN_URL. 'js/libs/select2.min.js', array( 'jquery' ));
187
+ wp_enqueue_script( 'alm-drops', ALM_ADMIN_URL. 'js/libs/jquery.drops.js', array( 'jquery' ));
188
+ wp_enqueue_script( 'alm-admin', ALM_ADMIN_URL. 'js/admin.js', array( 'jquery' ));
189
  wp_enqueue_script( 'alm-shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ));
190
  }
191
 
198
  * @since 2.0.0
199
  */
200
 
201
+ function alm_settings_page(){
202
+ include_once( ALM_PATH . 'admin/views/settings.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
204
 
205
 
206
+
207
  /*
208
  * alm_repeater_page
209
  * Custom Repeaters
211
  * @since 2.0.0
212
  */
213
 
214
+ function alm_repeater_page(){
215
+ include_once( ALM_PATH . 'admin/views/repeater-templates.php');
216
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
+
219
+
220
+ /*
221
+ * alm_shortcode_builder_page
222
+ * Shortcode Builder
223
+ *
224
+ * @since 2.0.0
225
+ */
226
+
227
+ function alm_shortcode_builder_page(){
228
+ include_once( ALM_PATH . 'admin/views/shortcode-builder.php');
229
+ }
230
+
231
+
232
+
233
+ /*
234
+ * alm_example_page
235
+ * Examples Page
236
+ *
237
+ * @since 2.0.0
238
+ */
239
+
240
+ function alm_example_page(){
241
+ include_once( ALM_PATH . 'admin/views/examples.php');
242
  }
243
 
244
 
245
+
246
+ /*
247
+ * alm_add_ons_page
248
+ * Ajax Load More Add-ons
249
+ *
250
+ * @since 2.0.0
251
+ */
252
+
253
+ function alm_add_ons_page(){
254
+ include_once( ALM_PATH . 'admin/views/add-ons.php');
255
+ }
256
+
257
+
258
+
259
  /*
260
  * alm_save_repeater
261
  * Repeater Save function
262
  *
263
+ * @return response
264
  * @since 2.0.0
265
  */
266
 
268
  $nonce = $_POST["nonce"];
269
  // Check our nonce, if they don't match then bounce!
270
  if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
271
+ die('Error - unable to verify nonce, please try again.');
272
 
273
  // Get _POST Vars
274
  $c = Trim(stripslashes($_POST["value"])); // Repeater Value
338
 
339
  /*
340
  * alm_update_repeater
341
+ * Update repeater template from database
342
  *
343
  * - User story: User deletes plugin, the installs again and the version has not change - their default repeater will be in the default state and unable to be updated.
344
  *
345
+ * @return DB value
346
+ * @since 2.5.0
347
  */
348
 
349
  function alm_update_repeater(){
350
  $nonce = $_POST["nonce"];
351
  // Check our nonce, if they don't match then bounce!
352
  if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
353
+ die('Error - unable to verify nonce, please try again.');
354
 
355
  // Get _POST Vars
356
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
357
+ $t = Trim(stripslashes($_POST["type"])); // Repeater type (default | unlimited)
358
+
359
 
360
  // Get value from database
 
361
  global $wpdb;
362
  $table_name = $wpdb->prefix . "alm";
363
 
366
 
367
  $the_repeater = $wpdb->get_var("SELECT repeaterDefault FROM " . $table_name . " WHERE name = '$n'");
368
 
369
+ echo $the_repeater; // Return repeater value
 
 
370
 
371
  die();
372
  }
373
 
374
 
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  /*
377
  * alm_get_tax_terms
378
  * Get taxonomy terms for shortcode builder
379
  *
380
+ * @return Taxonomy Terms
381
  * @since 2.1.0
382
  */
383
 
411
  }
412
 
413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  /*
415
  * admin_init
416
  * Initiate the plugin, create our setting variables.
434
  'ajax-load-more'
435
  );
436
 
437
+
438
+ add_settings_field( // Container type
439
  '_alm_container_type',
440
  __('Container Type', ALM_NAME ),
441
  'alm_container_type_callback',
443
  'alm_general_settings'
444
  );
445
 
446
+ add_settings_field( // Classnames
447
  '_alm_classname',
448
  __('Container Classes', ALM_NAME ),
449
  'alm_class_callback',
451
  'alm_general_settings'
452
  );
453
 
454
+ add_settings_field( // Hide btn
455
  '_alm_hide_btn',
456
  __('Editor Button', ALM_NAME ),
457
  'alm_hide_btn_callback',
459
  'alm_general_settings'
460
  );
461
 
462
+ add_settings_field( // Load dynamic queries
463
+ '_alm_disable_dynamic',
464
+ __('Dynamic Content', ALM_NAME ),
465
+ 'alm_disable_dynamic_callback',
466
+ 'ajax-load-more',
467
+ 'alm_general_settings'
468
+ );
469
+
470
+ add_settings_field( // Disbale CSS
471
  '_alm_disable_css',
472
  __('Disable CSS', ALM_NAME ),
473
  'alm_disable_css_callback',
475
  'alm_general_settings'
476
  );
477
 
478
+ add_settings_field( // Btn color
479
  '_alm_btn_color',
480
  __('Button Color', ALM_NAME ),
481
  'alm_btn_color_callback',
482
  'ajax-load-more',
483
  'alm_general_settings'
484
+ );
485
 
486
+ add_settings_field( // Button classes
487
  '_alm_btn_classname',
488
  __('Button Classes', ALM_NAME ),
489
  'alm_btn_class_callback',
491
  'alm_general_settings'
492
  );
493
 
494
+ //
 
495
  if(has_action('alm_seo_installed')){
496
 
497
  add_settings_section(
563
  if(!isset($options['_alm_disable_css']))
564
  $options['_alm_disable_css'] = '0';
565
 
566
+ $html = '<input type="hidden" name="alm_settings[_alm_disable_css]" value="0" />';
567
+ $html .= '<input type="checkbox" id="alm_disable_css_input" name="alm_settings[_alm_disable_css]" value="1"'. (($options['_alm_disable_css']) ? ' checked="checked"' : '') .' />';
568
+ $html .= '<label for="alm_disable_css_input">'.__('I want to use my own CSS styles', ALM_NAME).'<br/><span style="display:block;"><i class="fa fa-file-text-o"></i> &nbsp;<a href="'.ALM_URL.'/core/css/ajax-load-more.css" target="blank">'.__('View Ajax Load More CSS', ALM_NAME).'</a></span></label>';
569
+
570
+ echo $html;
571
  }
572
 
573
 
583
  if(!isset($options['_alm_hide_btn']))
584
  $options['_alm_hide_btn'] = '0';
585
 
586
+ $html = '<input type="hidden" name="alm_settings[_alm_hide_btn]" value="0" /><input type="checkbox" id="alm_hide_btn" name="alm_settings[_alm_hide_btn]" value="1"'. (($options['_alm_hide_btn']) ? ' checked="checked"' : '') .' />';
587
+ $html .= '<label for="alm_hide_btn">'.__('Hide shortcode button in WYSIWYG editor', ALM_NAME).'</label>';
588
+
589
+ echo $html;
590
+ }
591
+
592
+
593
+
594
+ /*
595
+ * alm_disable_dynamic_callback
596
+ * Disable the dynamic population of categories, tags and authors
597
+ *
598
+ * @since 3.0.0
599
+ */
600
+
601
+ function alm_disable_dynamic_callback(){
602
+ $options = get_option( 'alm_settings' );
603
+ if(!isset($options['_alm_disable_dynamic']))
604
+ $options['_alm_disable_dynamic'] = '0';
605
+
606
+ $html = '<input type="hidden" name="alm_settings[_alm_disable_dynamic]" value="0" />';
607
+ $html .= '<input type="checkbox" name="alm_settings[_alm_disable_dynamic]" id="_alm_disable_dynamic" value="1"'. (($options['_alm_disable_dynamic']) ? ' checked="checked"' : '') .' />';
608
+ $html .= '<label for="_alm_disable_dynamic">'.__('Disable dynamic population of categories, tags and authors in the Shortcode Builder.<span style="display:block">Recommended if you have an extraordinary number of categories, tags and/or authors.', ALM_NAME).'</label>';
609
+
610
+ echo $html;
611
  }
612
 
613
 
621
  function alm_class_callback(){
622
  $options = get_option( 'alm_settings' );
623
 
624
+ $html = '<label for="alm_settings[_alm_classname]">'.__('Add classes to Ajax Load More container', ALM_NAME).'</label><br/>';
625
+ $html .= '<input type="text" id="alm_settings[_alm_classname]" name="alm_settings[_alm_classname]" value="'.$options['_alm_classname'].'" placeholder="posts listing etc..." /> ';
626
+
627
+ echo $html;
628
  }
629
 
630
 
697
  if($color == 'white')
698
  $selected5 = 'selected="selected"';
699
 
700
+ $html = '<label for="alm_settings_btn_color">'.__('Choose your <strong>Load More</strong> button color', ALM_NAME).'</label><br/>';
701
  $html .= '<select id="alm_settings_btn_color" name="alm_settings[_alm_btn_color]">';
702
  $html .= '<option value="default" ' . $selected0 .'>Default (Orange)</option>';
703
  $html .= '<option value="blue" ' . $selected1 .'>Blue</option>';
708
  $html .= '<option value="white" ' . $selected6 .'>White</option>';
709
  $html .= '</select>';
710
 
711
+ $html .= '<div class="clear"></div><div class="ajax-load-more-wrap '.$color.'"><span>'.__('Preview', ALM_NAME) .'</span><button class="alm-load-more-btn loading" disabled="disabled">Load More</button></div>';
712
  echo $html;
713
+ }
714
+
715
+
716
+
717
+ /*
718
+ * alm_btn_class_callback
719
+ * Add classes to the Ajax Load More button
720
+ *
721
+ * @since 2.4.1
722
+ */
723
+
724
+ function alm_btn_class_callback(){
725
+ $options = get_option( 'alm_settings' );
726
+
727
+ if(!isset($options['_alm_btn_classname']))
728
+ $options['_alm_btn_classname'] = '';
729
+
730
+ $html = '<label for="alm_settings[_alm_btn_classname]">'.__('Add classes to your <strong>Load More</strong> button', ALM_NAME).'</label>';
731
+ $html .= '<input type="text" class="btn-classes" id="alm_settings[_alm_btn_classname]" name="alm_settings[_alm_btn_classname]" value="'.$options['_alm_btn_classname'].'" placeholder="button rounded listing etc..." /> ';
732
+
733
+ echo $html;
734
+ ?>
735
  <script>
736
  //Button preview
737
  var colorArray = "default grey purple green red blue white";
745
  });
746
 
747
  // Check if Disable CSS === true
748
+ if(jQuery('input#alm_disable_css_input').is(":checked")){
749
+ jQuery('select#alm_settings_btn_color').parent().parent().hide(); // Hide button color
 
750
  }
751
  jQuery('input#alm_disable_css_input').change(function() {
752
  var el = jQuery(this);
753
  if(el.is(":checked")) {
754
+ el.parent().parent('tr').next('tr').hide(); // Hide button color
 
755
  }else{
756
+ el.parent().parent('tr').next('tr').show(); // show button color
 
757
  }
758
  });
759
 
760
  </script>
761
+ <?php
762
  }
763
 
764
 
765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  /*
768
  * alm_seo_settings_callback
admin/css/admin.css CHANGED
@@ -1,5 +1,6 @@
1
  @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,600);
2
 
 
3
  /*
4
  * Admin - Popup Generator
5
  *
@@ -32,6 +33,9 @@
32
  padding: 15px 10px 140px !important;
33
  }
34
 
 
 
 
35
  .ajax-load-more code{
36
  background: #fcf3d0;
37
  }
@@ -79,6 +83,14 @@
79
  margin-top: -10px;
80
  opacity: 0.7;
81
  }
 
 
 
 
 
 
 
 
82
 
83
  /* Expand Collapse Headings */
84
  .ajax-load-more h3.heading{
@@ -94,7 +106,8 @@
94
  background: #f7f7f7;
95
  border-bottom: 1px solid #efefef;
96
  }
97
- .ajax-load-more h3.heading:hover:after{
 
98
  color: #f05452;
99
  }
100
  .ajax-load-more h3.heading:hover{
@@ -119,6 +132,13 @@
119
  border-bottom-color: transparent;
120
  }
121
 
 
 
 
 
 
 
 
122
  /* Expand/Collapse all rows */
123
  .ajax-load-more .toggle-all{
124
  position: absolute;
@@ -229,6 +249,37 @@
229
  margin: 0;
230
  padding: 0 0 0 10px;
231
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
 
234
  .ajax-load-more label,
@@ -396,15 +447,26 @@
396
  }
397
 
398
  /* Jump Menu */
399
- .jump-menu{
400
- position: absolute;
401
- top: 5px;
402
- right: 10px;
403
- z-index: 2;
404
  }
405
- .admin.ajax-load-more .jump-menu{
406
- display: none;
 
 
 
 
 
 
 
 
407
  }
 
 
 
 
408
 
409
  /* Table of Contents */
410
  .table-of-contents{}
@@ -440,12 +502,16 @@
440
  #alm-examples.ajax-load-more .expand-wrap{
441
  padding: 10px 10px 0;
442
  }
 
 
 
 
 
 
443
 
444
  .ajax-load-more .section-title {
445
  float: left;
446
- padding-right: 15px;
447
- padding-top: 18px;
448
- padding-left: 15px;
449
  width: 45%;
450
  }
451
  .ajax-load-more .section-title p{
@@ -453,6 +519,10 @@
453
  padding-left: 21px !important;
454
  color: #999;
455
  }
 
 
 
 
456
 
457
  .ajax-load-more .repeaters .section-title,
458
  .ajax-load-more .repeaters .row .wrap{
@@ -475,6 +545,10 @@
475
  line-height: normal !important;
476
  }
477
 
 
 
 
 
478
 
479
 
480
  .ajax-load-more .row .wrap{
@@ -577,6 +651,7 @@
577
  font-size: 13px;
578
  color: #fff;
579
  cursor: pointer;
 
580
  }
581
 
582
  .admin.ajax-load-more #shortcode_output{
@@ -660,6 +735,7 @@
660
  vertical-align: top;
661
  padding: 0 0 10px;
662
  max-width: 90%;
 
663
  }
664
  .form-table input[type=radio],
665
  .form-table input[type=checkbox]{
@@ -673,6 +749,7 @@
673
  .form-table label span{
674
  font-size: 13px;
675
  color: #999;
 
676
  }
677
 
678
  .admin.ajax-load-more .form-table textarea{
@@ -838,11 +915,17 @@ p.loading{
838
  position: static;
839
  }
840
  .saved-response.loading,
841
- p.loading{
 
842
  background: url(../img/loader.gif) no-repeat left center;
843
  padding-left: 24px;
844
  }
845
 
 
 
 
 
 
846
  input.save-repeater{
847
  margin-bottom: 10px !important;
848
  }
@@ -974,7 +1057,7 @@ table.highlight{
974
 
975
  /* Add-on Callout! */
976
  .call-out{
977
- background: #4DD5B0;
978
  padding: 13px 100px 13px 12px;
979
  border-radius: 3px;
980
  margin: 0;
@@ -1014,7 +1097,7 @@ table.highlight{
1014
  a.btn{
1015
  padding: 6px 10px;
1016
  display: inline-block;
1017
- background: #4DD5B0;
1018
  border: 1px solid #5da592;
1019
  border-radius: 3px;
1020
  position: static;
@@ -1325,7 +1408,10 @@ box-shadow: 0 0 0 3px #efefef;
1325
  }
1326
  .repeaters .alm-delete a:hover{
1327
  background-color: #c94141;
1328
- color: #fff;
 
 
 
1329
  }
1330
  .repeaters .alm-delete a:focus{
1331
  -webkit-box-shadow: none;
@@ -1333,9 +1419,9 @@ box-shadow: 0 0 0 3px #efefef;
1333
  box-shadow: none;
1334
  }
1335
  .repeaters .alm-delete a:active{
1336
- -webkit-box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.1);
1337
- -moz-box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.1);
1338
- box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.1);
1339
  background-color: #b93636;
1340
  }
1341
 
@@ -1379,9 +1465,9 @@ box-shadow: 0 0 0 3px #efefef;
1379
  background: #ff5a58;
1380
  border-color: #ff5a58;
1381
  color: #fff;
1382
- -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 0 rgba(0, 0, 0, 0.07);
1383
- -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 0 rgba(0, 0, 0, 0.07);
1384
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 0 rgba(0, 0, 0, 0.07);
1385
  text-shadow: none;
1386
  }
1387
  .alm-add-template a:focus{
@@ -1428,12 +1514,16 @@ box-shadow: 0 0 0 3px #efefef;
1428
  */
1429
 
1430
  .shortcode-builder input[type=checkbox],
1431
- .shortcode-builder input[type=radio] {
 
 
1432
  display:none;
1433
  }
1434
 
1435
- .shortcode-builder input[type=checkbox] + label,
1436
- .shortcode-builder input[type=radio] + label{
 
 
1437
  background: #fff url(../img/bkg-chkbox_off.png) no-repeat left top;
1438
  height: auto;
1439
  min-height: 20px;
@@ -1441,26 +1531,203 @@ box-shadow: 0 0 0 3px #efefef;
1441
  display:inline-block;
1442
  padding: 1px 0 0 26px;
1443
  margin: 0 0 5px;
1444
- font-size: 13px;
 
 
1445
  }
1446
- .shortcode-builder input[type=radio] + label{
 
1447
  background: #fff url(../img/bkg-radio_off.png) no-repeat left top;
1448
  }
1449
 
1450
- .shortcode-builder input[type=checkbox]:checked + label{
 
1451
  background-image: url(../img/bkg-chkbox_on.png);
1452
  }
1453
- .shortcode-builder input[type=radio]:checked + label{
 
1454
  background-image: url(../img/bkg-radio_on.png);
1455
  }
1456
 
1457
  .shortcode-builder input[type=checkbox] + label:hover,
1458
- .shortcode-builder input[type=radio] + label:hover{
 
 
1459
  color: #000;
1460
  }
 
1461
 
1462
-
1463
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1464
  /*
1465
  * Admin screen media queries
1466
  *
@@ -1468,17 +1735,16 @@ box-shadow: 0 0 0 3px #efefef;
1468
  */
1469
 
1470
  @media screen and (max-width: 1200px){
1471
- .ajax-load-more input[type=text],
1472
- .select2-container{
 
 
1473
  width: 95%;
1474
  }
1475
- }
1476
-
1477
-
1478
- @media screen and (max-width: 960px){
1479
-
1480
-
1481
 
 
 
 
1482
  }
1483
 
1484
  @media screen and (max-width: 900px){
@@ -1507,9 +1773,11 @@ box-shadow: 0 0 0 3px #efefef;
1507
  float: none;
1508
  padding: 10px;
1509
  }
1510
- .ajax-load-more input[type=text],
1511
- .select2-container{
1512
- width: 100%;
 
 
1513
  }
1514
  .ajax-load-more .row .wrap .inner.half {
1515
  display: block;
@@ -1527,273 +1795,13 @@ box-shadow: 0 0 0 3px #efefef;
1527
  #alm-add-ons .section-title{
1528
  width: 100%;
1529
  }
 
 
 
 
1530
 
1531
  }
1532
 
1533
 
1534
 
1535
- /*
1536
- * Select2 - form replacement - http://ivaynberg.github.io/select2/
1537
- *
1538
- * @since 1.0
1539
- */
1540
-
1541
- .select2-container {
1542
- position: relative;
1543
- display: inline-block;
1544
- zoom: 1;
1545
- *display: inline;
1546
- vertical-align: middle;
1547
- min-width: 60%;
1548
- }
1549
- .inner.half .select2-container{
1550
- min-width: 90%;
1551
- width: 90%;
1552
- }
1553
- .select2-container a.select2-choice {
1554
- display: block;
1555
- height: 40px;
1556
- padding: 0 10px;
1557
- overflow: hidden;
1558
- position: relative;
1559
- border: 1px solid #ccc;
1560
- white-space: nowrap;
1561
- line-height: 40px;
1562
- color: #333;
1563
- text-decoration: none;
1564
- background: #fff;
1565
- background: #f7f7f7;
1566
- border-radius:2px;
1567
- -webkit-background-clip: padding-box;
1568
- -moz-background-clip: padding;
1569
- background-clip: padding-box;
1570
- -webkit-touch-callout: none;
1571
- -webkit-user-select: none;
1572
- -khtml-user-select: none;
1573
- -moz-user-select: none;
1574
- -ms-user-select: none;
1575
- user-select: none;
1576
- font-size: 14px;
1577
- }
1578
-
1579
- .select2-dropdown-open.select2-container-active .select2-choice {
1580
- -webkit-border-radius: 4px 4px 0 0;
1581
- -moz-border-radius: 4px 4px 0 0;
1582
- border-radius: 4px 4px 0 0;
1583
- }
1584
-
1585
- .select2-container.select2-drop-above .select2-choice {
1586
- background: #fff;
1587
- -webkit-border-radius: 0 0 4px 4px;
1588
- -moz-border-radius: 0px 0px 4px 4px;
1589
- border-radius: 0 0 4px 4px;
1590
- }
1591
-
1592
- .select2-container .select2-choice span {
1593
- margin-right: 30px;
1594
- margin-left: 2px;
1595
- display: block;
1596
- overflow: hidden;
1597
- white-space: nowrap;
1598
- color: #666;
1599
- -ms-text-overflow: ellipsis;
1600
- -o-text-overflow: ellipsis;
1601
- text-overflow: ellipsis;
1602
- }
1603
-
1604
- .select2-container .select2-choice abbr:hover {
1605
- background-position: right -11px;
1606
- cursor: pointer;
1607
- }
1608
-
1609
- .select2-drop-mask {
1610
- position: absolute;
1611
- left: 0;
1612
- top: 0;
1613
- z-index: 8;
1614
- background-color: #fff;
1615
- opacity: 0;
1616
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
1617
- /* works in IE 8 */
1618
- filter: "alpha(opacity=0)";
1619
- /* expected to work in IE 8 */
1620
- filter: alpha(opacity = 0);
1621
- /* IE 4-7 */
1622
- }
1623
-
1624
- .select2-drop {
1625
- overflow: hidden;
1626
- width: 100%;
1627
- margin-top: -1px;
1628
- position: absolute;
1629
- z-index: 9;
1630
- top: 100%;
1631
- background: #fff;
1632
- color: #000;
1633
- border: 1px solid #ccc;
1634
- border-top: 0;
1635
- border-radius: 0 0 2px 2px;
1636
- box-shadow: 0 2px 1px rgba(0, 0, 0, 0.1);
1637
- font-size: 14px;
1638
- }
1639
-
1640
- .select2-drop.select2-drop-above {
1641
- margin-top: 1px;
1642
- border-top: 1px solid #ccc;
1643
- border-bottom: 0;
1644
- border-radius: 2px 2px 0 0;
1645
- box-shadow: 0 -2px -1px rgba(0, 0, 0, 0.1);
1646
- }
1647
-
1648
- .select2-container .select2-choice div {
1649
- display: block;
1650
- width: 30px;
1651
- height: 100%;
1652
- position: absolute;
1653
- right: 0;
1654
- top: 0;
1655
- }
1656
-
1657
- .select2-container .select2-choice div b {
1658
- display: block;
1659
- width: 100%;
1660
- height: 100%;
1661
- background: #fff url(../img/bkg-select.png) no-repeat center center;
1662
- }
1663
-
1664
- .select2-dropdown-open.select2-container-active div b {
1665
- display: block;
1666
- width: 100%;
1667
- height: 100%;
1668
- background-color: #fff;
1669
- }
1670
-
1671
- .select2-search {
1672
- display: none;
1673
- }
1674
-
1675
- /* results UL */
1676
- .select2-results {
1677
- max-height: 200px;
1678
- padding: 0 0 0 0;
1679
- margin: 0 0 0 0;
1680
- position: relative;
1681
- overflow-x: hidden;
1682
- overflow-y: auto;
1683
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
1684
- }
1685
-
1686
- .select2-results li {
1687
- list-style: none;
1688
- display: block;
1689
- background-image: none;
1690
- padding: 0;
1691
- margin: 0;
1692
- border-top: 1px solid #efefef;
1693
- color: #666;
1694
- width: auto;
1695
- }
1696
-
1697
- .select2-results li.select2-result-with-children > .select2-result-label {
1698
- font-weight: bold;
1699
- }
1700
-
1701
- .select2-results .select2-result-label {
1702
- margin: 0;
1703
- cursor: pointer;
1704
- min-height: 1em;
1705
- padding: 10px 7px;
1706
- border-left: 4px solid transparent;
1707
- -webkit-touch-callout: none;
1708
- -webkit-user-select: none;
1709
- -khtml-user-select: none;
1710
- -moz-user-select: none;
1711
- -ms-user-select: none;
1712
- user-select: none;
1713
- }
1714
-
1715
- .select2-results .select2-highlighted .select2-result-label{ /* Hover */
1716
- background: #f7f7f7;
1717
- color: #ca5252;
1718
- border-color: #efefef;
1719
- }
1720
-
1721
- .select2-results .select2-highlighted:active {
1722
- background: #fff;
1723
- }
1724
-
1725
- .select2-results li em {
1726
- background: #feffde;
1727
- font-style: normal;
1728
- }
1729
-
1730
- .select2-results .select2-highlighted em {
1731
- background: transparent;
1732
- }
1733
-
1734
- .select2-results .select2-highlighted ul {
1735
- background: white;
1736
- color: #000;
1737
- }
1738
-
1739
- .select2-results .select2-no-results,
1740
- .select2-results .select2-searching,
1741
- .select2-results .select2-selection-limit {
1742
- background: #f4f4f4;
1743
- display: list-item;
1744
- }
1745
-
1746
- /*
1747
- disabled look for disabled choices in the results dropdown
1748
- */
1749
- .select2-results .select2-disabled.select2-highlighted {
1750
- color: #666;
1751
- background: #f4f4f4;
1752
- display: list-item;
1753
- cursor: default;
1754
- }
1755
-
1756
- .select2-results .select2-disabled {
1757
- background: #f4f4f4;
1758
- display: list-item;
1759
- cursor: default;
1760
- }
1761
-
1762
- .select2-results .select2-selected {
1763
- display: none;
1764
- }
1765
-
1766
- .select2-more-results {
1767
- background: #f4f4f4;
1768
- display: list-item;
1769
- }
1770
-
1771
- /* disabled styles */
1772
- .select2-container.select2-container-disabled .select2-choice {
1773
- background-color: #f4f4f4;
1774
- background-image: none;
1775
- border: 1px solid #ddd;
1776
- cursor: default;
1777
- }
1778
-
1779
- .select2-container.select2-container-disabled .select2-choice div {
1780
- background-color: #f4f4f4;
1781
- background-image: none;
1782
- border-left: 0;
1783
- }
1784
-
1785
- .select2-container.select2-container-disabled .select2-choice abbr {
1786
- display: none;
1787
- }
1788
-
1789
- .select2-offscreen {
1790
- border: 0;
1791
- clip: rect(0 0 0 0);
1792
- height: 1px;
1793
- margin: -1px;
1794
- overflow: hidden;
1795
- padding: 0;
1796
- position: absolute;
1797
- width: 1px;
1798
- }
1799