Changeset 1599538
- Timestamp:
- 02/20/2017 08:47:43 AM (9 years ago)
- Location:
- mpcx-accordion/trunk
- Files:
-
- 1 deleted
- 8 edited
-
admin/delete.php (modified) (1 diff)
-
admin/edit.php (modified) (3 diffs)
-
admin/list.php (modified) (2 diffs)
-
admin/options.php (modified) (1 diff)
-
localization (deleted)
-
mpcx-accordion.php (modified) (4 diffs)
-
public/css/accordion.min.css (modified) (1 diff)
-
public/js/accordion.min.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mpcx-accordion/trunk/admin/delete.php
r1541458 r1599538 12 12 if ( $id !== 0 ) { 13 13 unset( $accordions[ $id ] ); 14 update_option( 'mpcx_accordion', json_encode( $accordions ));14 update_option( 'mpcx_accordion', $accordions ); 15 15 } 16 16 -
mpcx-accordion/trunk/admin/edit.php
r1546646 r1599538 11 11 12 12 if ( $id === 0 ) { 13 $id = 1 + (int) $accordions[ 0]['index'];13 $id = 1 + (int) $accordions['index']; 14 14 $new = true; 15 15 } … … 17 17 if ( isset( $_POST['submit'] ) === true ) { 18 18 if ( isset( $_POST['index'] ) === true ) { 19 $accordions[ 0]['index'] = $_POST['index'];19 $accordions['index'] = $_POST['index']; 20 20 } 21 21 if ( isset( $_POST['headline'] ) === true && is_array( $_POST['text'] ) === true ) { … … 32 32 $accordions[ $id ]['title'] = stripslashes( $_POST['title'] ); 33 33 $accordions[ $id ]['open'] = stripslashes( $_POST['open'] ); 34 update_option( 'mpcx_accordion', json_encode( $accordions ));34 update_option( 'mpcx_accordion', $accordions ); 35 35 echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The changes are saved.', 'mpcx-accordion' ) . '</p></div>'; 36 36 } -
mpcx-accordion/trunk/admin/list.php
r1541458 r1599538 32 32 </thead> 33 33 <tbody> 34 <?php foreach ( $accordions as $key => $accordion ): ?> 35 <?php if ( $key === 0 ) { 36 continue; 37 } ?> 34 <?php 35 for ( $key = 1; $key <= $accordions['index']; $key++ ) { 36 if ( isset( $accordions[ $key ]) === false ) { 37 continue; 38 } 39 $accordion = $accordions[ $key ]; 40 ?> 38 41 <tr> 39 42 <td class="column-title column-primary"> … … 57 60 </td> 58 61 </tr> 59 <?php endforeach; ?> 62 <?php 63 } 64 ?> 60 65 </tbody> 61 66 </table> -
mpcx-accordion/trunk/admin/options.php
r1541458 r1599538 8 8 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 9 9 10 $accordions = json_decode( get_option( 'mpcx_accordion' ), true);10 $accordions = get_option( 'mpcx_accordion' ); 11 11 12 12 if ( $accordions === null ) { 13 $accordions = array( 0 => array( 'version' => '1.2.0' ));13 $accordions = array( 'version' => MPCX_ACCORDION_VERSION ); 14 14 } 15 15 -
mpcx-accordion/trunk/mpcx-accordion.php
r1546646 r1599538 9 9 * Plugin URI: https://github.com/tronsha/wp-accordion-plugin 10 10 * Description: Just an Accordion Plugin. 11 * Version: 1.2. 211 * Version: 1.2.3 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. 2' );23 define( 'MPCX_ACCORDION_VERSION', '1.2.3' ); 24 24 25 load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/l ocalization' );25 load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 26 26 27 27 register_activation_hook( 28 28 __FILE__, 29 29 function () { 30 add_option( 'mpcx_accordion', json_encode( array( 0 => array( 'version' => MPCX_ACCORDION_VERSION ) )) );30 add_option( 'mpcx_accordion', array( 'version' => MPCX_ACCORDION_VERSION ) ); 31 31 } 32 ); 33 34 add_action( 35 'upgrader_process_complete', 36 function ( $object, $options ) { 37 if ( $options['action'] === 'update' && $options['type'] === 'plugin' ) { 38 if ( in_array( plugin_basename( __FILE__ ), $options['plugins'] ) === true ) { 39 include plugin_dir_path( __FILE__ ) . 'update.php'; 40 } 41 } 42 }, 43 10, 44 2 32 45 ); 33 46 … … 82 95 function ( $att = array(), $content = null ) { 83 96 if ( isset( $att['id'] ) === true && $att['id'] > 0 ) { 84 $accordion = json_decode( get_option( 'mpcx_accordion' ), true);97 $accordion = get_option( 'mpcx_accordion' ); 85 98 $content = ''; 86 99 $first = true; … … 92 105 $content = do_shortcode( $content ); 93 106 } 94 return '<div class="accordion"' . ( intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>'; 107 108 return '<div class="accordion no-js"' . ( intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>'; 95 109 } 96 110 ); -
mpcx-accordion/trunk/public/css/accordion.min.css
r1543570 r1599538 1 .accordion>h2,.accordion>h3,.accordion>h4,.accordion>h5,.accordion>h6,.accordion>strong{background:#0e0e0e;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7D7E7D',endColorstr='#0E0E0E',GradientType=0);border-radius:3px;color:#fff;cursor:pointer;display:block;margin:4px 0 0 0 !important;max-width:100%;padding:4px 8px !important}.accordion .arrow-icons{font-family:dashicons;font-size:75%;font-style:normal;font-weight:400;margin-right:2px}.accordion>div{display:block;height:0;margin:4px 0 0 0;max-width:100%;padding:0 8px;overflow:hidden} html.no-js .accordion>div{height:auto}1 .accordion>h2,.accordion>h3,.accordion>h4,.accordion>h5,.accordion>h6,.accordion>strong{background:#0e0e0e;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7D7E7D',endColorstr='#0E0E0E',GradientType=0);border-radius:3px;color:#fff;cursor:pointer;display:block;margin:4px 0 0 0 !important;max-width:100%;padding:4px 8px !important}.accordion .arrow-icons{font-family:dashicons;font-size:75%;font-style:normal;font-weight:400;margin-right:2px}.accordion>div{display:block;height:0;margin:4px 0 0 0;max-width:100%;padding:0 8px;overflow:hidden}.accordion.no-js>div{height:auto} -
mpcx-accordion/trunk/public/js/accordion.min.js
r1541458 r1599538 1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");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.bind("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||(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.bind("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")}})})}); -
mpcx-accordion/trunk/readme.txt
r1546646 r1599538 2 2 Contributors: DeusTron 3 3 Donate link: http://www.mpcx.net/wordpress/donate/ 4 Tags: accordion, jquery, shortcode, plugin4 Tags: accordion, jquery, shortcode, javascript, js, plugin 5 5 Requires at least: 4.0 6 6 Tested up to: 4.7 7 Stable tag: 1.2. 27 Stable tag: 1.2.3 8 8 License: MIT 9 9 License URI: https://raw.githubusercontent.com/tronsha/wp-accordion-plugin/master/LICENSE
Note: See TracChangeset
for help on using the changeset viewer.