Changeset 1762562
- Timestamp:
- 11/10/2017 06:54:32 AM (8 years ago)
- Location:
- mpcx-accordion
- Files:
-
- 8 edited
- 1 copied
-
tags/1.2.6 (copied) (copied from mpcx-accordion/trunk)
-
tags/1.2.6/mpcx-accordion.php (modified) (4 diffs)
-
tags/1.2.6/public/js/accordion.min.js (modified) (1 diff)
-
tags/1.2.6/readme.txt (modified) (1 diff)
-
tags/1.2.6/update.php (modified) (1 diff)
-
trunk/mpcx-accordion.php (modified) (4 diffs)
-
trunk/public/js/accordion.min.js (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/update.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mpcx-accordion/tags/1.2.6/mpcx-accordion.php
r1674395 r1762562 9 9 * Plugin URI: https://github.com/tronsha/wp-accordion-plugin 10 10 * Description: Just an Accordion Plugin. 11 * Version: 1.2. 511 * Version: 1.2.6 12 12 * Author: Stefan Hüsges 13 13 * Author URI: http://www.mpcx.net/ … … 21 21 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 22 22 23 define( 'MPCX_ACCORDION_VERSION', '1.2. 5' );23 define( 'MPCX_ACCORDION_VERSION', '1.2.6' ); 24 24 25 25 load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); … … 103 103 $first = true; 104 104 foreach ( $accordion[ $att['id'] ]['data'] as $data ) { 105 $content .= '<h3 data-hash="' . urlencode( $data['headline'] ) . '">' . esc_html( $data['headline']) . '</h3><div' . ( true === $first && '1' === $accordion[ $att['id'] ]['open'] ? ' class="open" style="height: auto;"' : '' ) . '>' . do_shortcode( $data['text'] ) . '</div>';105 $content .= '<h3 data-hash="' . urlencode( $data['headline'] ) . '">' . preg_replace( '/<\s*(\/?)\s*(sub|sup)\s*>/is', '<$1$2>', esc_html( $data['headline'] ) ) . '</h3><div' . ( true === $first && '1' === $accordion[ $att['id'] ]['open'] ? ' class="open" style="height: auto;"' : '' ) . '>' . do_shortcode( $data['text'] ) . '</div>'; 106 106 $first = false; 107 107 } … … 110 110 } 111 111 112 return '<div class="accordion no-js"' . (intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>';112 return '<div class="accordion scroll no-js"' . ( isset( $att['id'] ) && intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>'; 113 113 } 114 114 ); -
mpcx-accordion/tags/1.2.6/public/js/accordion.min.js
r1674395 r1762562 1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.removeClass("no-js");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||( c.hasClass("open")===true&&(window.location.hash===""||window.location.hash==="#!"))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.on("click",function(){var e=d.next("div");if(e.hasClass("open")===false){if(d.attr("data-hash")!==undefined){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(d.attr("data-hash")!==undefined){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}})})});1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.removeClass("no-js");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||(true===c.hasClass("open")&&(""===window.location.hash||"#!"===window.location.hash))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.on("click",function(){var e=d.next("div");if(false===e.hasClass("open")){if(undefined!==d.attr("data-hash")){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(undefined!==d.attr("data-hash")){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}});c.find("a").each(function(){var f=b(this);var e=f.attr("href");if(0===e.indexOf("#")){f.on("click",function(){b('[data-hash="'+e.replace("#","")+'"]').trigger("click")})}})})}); -
mpcx-accordion/tags/1.2.6/readme.txt
r1674395 r1762562 4 4 Tags: accordion, jquery, shortcode, javascript, js, plugin 5 5 Requires at least: 4.0 6 Tested up to: 4. 87 Stable tag: 1.2. 56 Tested up to: 4.9 7 Stable tag: 1.2.6 8 8 License: MIT 9 9 License URI: https://raw.githubusercontent.com/tronsha/wp-accordion-plugin/master/LICENSE -
mpcx-accordion/tags/1.2.6/update.php
r1674395 r1762562 5 5 */ 6 6 7 define( 'MPCX_ACCORDION_UPDATE_VERSION', '1.2. 5' );7 define( 'MPCX_ACCORDION_UPDATE_VERSION', '1.2.6' ); 8 8 $data = get_option( 'mpcx_accordion' ); 9 9 if ( true === isset( $data['version'] ) && version_compare( $data['version'], MPCX_ACCORDION_UPDATE_VERSION, '<' ) ) { -
mpcx-accordion/trunk/mpcx-accordion.php
r1674395 r1762562 9 9 * Plugin URI: https://github.com/tronsha/wp-accordion-plugin 10 10 * Description: Just an Accordion Plugin. 11 * Version: 1.2. 511 * Version: 1.2.6 12 12 * Author: Stefan Hüsges 13 13 * Author URI: http://www.mpcx.net/ … … 21 21 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 22 22 23 define( 'MPCX_ACCORDION_VERSION', '1.2. 5' );23 define( 'MPCX_ACCORDION_VERSION', '1.2.6' ); 24 24 25 25 load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); … … 103 103 $first = true; 104 104 foreach ( $accordion[ $att['id'] ]['data'] as $data ) { 105 $content .= '<h3 data-hash="' . urlencode( $data['headline'] ) . '">' . esc_html( $data['headline']) . '</h3><div' . ( true === $first && '1' === $accordion[ $att['id'] ]['open'] ? ' class="open" style="height: auto;"' : '' ) . '>' . do_shortcode( $data['text'] ) . '</div>';105 $content .= '<h3 data-hash="' . urlencode( $data['headline'] ) . '">' . preg_replace( '/<\s*(\/?)\s*(sub|sup)\s*>/is', '<$1$2>', esc_html( $data['headline'] ) ) . '</h3><div' . ( true === $first && '1' === $accordion[ $att['id'] ]['open'] ? ' class="open" style="height: auto;"' : '' ) . '>' . do_shortcode( $data['text'] ) . '</div>'; 106 106 $first = false; 107 107 } … … 110 110 } 111 111 112 return '<div class="accordion no-js"' . (intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>';112 return '<div class="accordion scroll no-js"' . ( isset( $att['id'] ) && intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>'; 113 113 } 114 114 ); -
mpcx-accordion/trunk/public/js/accordion.min.js
r1674395 r1762562 1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.removeClass("no-js");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||( c.hasClass("open")===true&&(window.location.hash===""||window.location.hash==="#!"))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.on("click",function(){var e=d.next("div");if(e.hasClass("open")===false){if(d.attr("data-hash")!==undefined){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(d.attr("data-hash")!==undefined){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}})})});1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.removeClass("no-js");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||(true===c.hasClass("open")&&(""===window.location.hash||"#!"===window.location.hash))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.on("click",function(){var e=d.next("div");if(false===e.hasClass("open")){if(undefined!==d.attr("data-hash")){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(undefined!==d.attr("data-hash")){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}});c.find("a").each(function(){var f=b(this);var e=f.attr("href");if(0===e.indexOf("#")){f.on("click",function(){b('[data-hash="'+e.replace("#","")+'"]').trigger("click")})}})})}); -
mpcx-accordion/trunk/readme.txt
r1674395 r1762562 4 4 Tags: accordion, jquery, shortcode, javascript, js, plugin 5 5 Requires at least: 4.0 6 Tested up to: 4. 87 Stable tag: 1.2. 56 Tested up to: 4.9 7 Stable tag: 1.2.6 8 8 License: MIT 9 9 License URI: https://raw.githubusercontent.com/tronsha/wp-accordion-plugin/master/LICENSE -
mpcx-accordion/trunk/update.php
r1674395 r1762562 5 5 */ 6 6 7 define( 'MPCX_ACCORDION_UPDATE_VERSION', '1.2. 5' );7 define( 'MPCX_ACCORDION_UPDATE_VERSION', '1.2.6' ); 8 8 $data = get_option( 'mpcx_accordion' ); 9 9 if ( true === isset( $data['version'] ) && version_compare( $data['version'], MPCX_ACCORDION_UPDATE_VERSION, '<' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.