Plugin Directory

Changeset 1321536


Ignore:
Timestamp:
01/05/2016 08:57:26 AM (10 years ago)
Author:
BCorp
Message:

Added Added [bcorp_accordion] & [bcorp_accordion_panel] shortcodes.

Location:
bcorp-shortcodes/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bcorp-shortcodes/trunk/bcorp_shortcodes.php

    r1320862 r1321536  
    44Plugin URI: http://shortcodes.bcorp.com
    55Description: Advanced word press shortcodes for use with any wordpress theme.
    6 Version: 0.12
     6Version: 0.13
    77Author: Tim Brattberg
    88Author URI: http://bcorp.com
     
    8080        return $buttons;
    8181    }
     82
     83  function bcorp_accordion_shortcode($atts,$content=null,$tag) {
     84    /* [bcorp_accordion]
     85       multiple (true,false)
     86     */
     87    $data=$GLOBALS['bcorp_shortcodes_data']->bcorp_sanitize_data($tag,$atts);
     88    static $bcorp_id;
     89    $bcorp_id++;
     90    $output = '<div class="bcorp-accordion bcorp-accordion-multiple-'.$data['multiple'].'" id="bcorp-accordion-'.$bcorp_id.'">'.do_shortcode($content).'</div>';
     91    return $output;
     92  }
     93
     94  function bcorp_accordion_panel_shortcode($atts,$content=null,$tag ) {
     95    /* [bcorp_accord]
     96       open (true,false)
     97       title
     98       textblock
     99     */
     100    $data=$GLOBALS['bcorp_shortcodes_data']->bcorp_sanitize_data($tag,$atts);
     101    return '<p class="bcorp-heading bcorp-accordion-header bcorp-accordion-header-hidden bcorp-accordion-open-'.$data['open'].'">'.$data['title'].'</p><div class="bcorp-accordion-content bcorp-alt-background">'.do_shortcode($content).'</div>';
     102  }
    82103
    83104  function bcorp_alert_box_shortcode($atts,$content=null,$tag ) {
     
    477498  }
    478499
    479   function bcorp_tabbed_shortcode($atts,$content=null,$tag ) {
    480     /* [bcorp_tabbed]
     500  function bcorp_tab_panel_shortcode($atts,$content=null,$tag ) {
     501    /* [bcorp_tab_panel]
    481502     * title
    482503     * showicon (true,false)
     
    486507    static $bcorp_id;
    487508    $bcorp_id++;
    488    return '<div class="bcorp-tabbed bcorp-alt-background" id="bcorp-tab-'.$bcorp_id.'"><div class="bcorp-tabbed-inner">'.do_shortcode(rawurldecode($content)).'</div></div>';
     509   return '<div class="bcorp-tab-panel bcorp-alt-background" id="bcorp-tab-'.$bcorp_id.'"><div class="bcorp-tab-panel-inner">'.do_shortcode(rawurldecode($content)).'</div></div>';
    489510  }
    490511
  • bcorp-shortcodes/trunk/bcorp_shortcodes_data.php

    r1320862 r1321536  
    502502
    503503    $this->bcorp_add_shortcode(
     504      "bcorp_accordion",array(
     505        "title"=>"Accordion",
     506        "admin_icon"=>"&#xe825;",
     507        "accept_content"=>true,
     508        "child_element"=>"bcorp_accordion_panel",
     509        "width" => "1-1",
     510        "closing_tag"=>true,
     511        "admin_default"=>'<div class="bcve-bcorp_accordion">
     512                            <i class="bcve-icon bcve-header-icon">&#xe825;</i>
     513                            <div class="bcve-bcorp_accordion-details">Multiple Open: <span class="bcve-bcorp_accordion-multiple">false</span></div>
     514                          </div>',
     515        "variables"=>array(
     516          'multiple'=>array(
     517            'name'=>'Allow Multiple Tabs Open At Once',
     518            'type'=>'checkbox',
     519            'default'=>'false'),
     520        )
     521      )
     522    );
     523
     524    $this->bcorp_add_shortcode(
     525      "bcorp_accordion_panel",array(
     526        "title"=>"Accordion Panel",
     527        "admin_icon"=>"&#xe825;",
     528        "only_child"=>true,
     529        "width"=>"1-3-min",
     530        "parent_element"=>"bcorp_accordion",
     531        "admin_default"=>'<div class="bcve-bcorp_accordion_panel">
     532                            <div class="bcve-bcorp_accordion_panel-details">
     533                              <span class="bcve-bcorp_accordion_panel-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Accordion - Edit Me</span>
     534                              <div class="bcve-bcorp_accordion_panel-textblock"><p>Accordion Content - Edit Me</p></div>
     535                            </div>
     536                          </div>',
     537        "variables"=>array(
     538          'open'=>array(
     539            'name'=>'Open Tab On Page Load',
     540            'type'=>'checkbox',
     541            'default'=>'false'),
     542          'title'=>array(
     543            'name'=>'Title',
     544            'type'=>'textfield',
     545            'default' =>''),
     546          'textblock'=>array(
     547            'name'=>'Text Block',
     548            'type'=>'textarea',
     549            'editor'=>'tinymce',
     550            'default' =>''
     551          )
     552        )
     553      )
     554    );
     555
     556    $this->bcorp_add_shortcode(
    504557      "bcorp_button",array(
    505558        "title"=>"Button",
     
    909962        "admin_icon"=>"&#xe822;",
    910963        "accept_content"=>true,
    911         "child_element"=>"bcorp_tabbed",
     964        "child_element"=>"bcorp_tab_panel",
    912965        "width" => "1-1",
    913966        "admin_default"=>'<div class="bcve-bcorp_tabs"><i class="bcve-icon bcve-header-icon">&#xe822;</i>
     
    937990
    938991    $this->bcorp_add_shortcode(
    939       "bcorp_tabbed",array(
     992      "bcorp_tab_panel",array(
    940993        "title"=>"Tab Panel",
    941994        "admin_icon"=>"&#xe822;",
     
    943996        "width"=>"1-3-min",
    944997        "parent_element"=>"bcorp_tabs",
    945         "admin_default"=>'<div class="bcve-bcorp_tabbed"><span class="bcve-bcorp_tabbed-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Tab - Edit Me</span><div class="bcve-bcorp_tabbed-textblock"><p>Tab Content - Edit Me</p></div></div>',
     998        "admin_default"=>'<div class="bcve-bcorp_tab_panel"><span class="bcve-bcorp_tab_panel-title bcve-bcorp_heading-text bcve-bcorp_heading-size-h3">Tab - Edit Me</span><div class="bcve-bcorp_tab_panel-textblock"><p>Tab Content - Edit Me</p></div></div>',
    946999        "variables"=>array(
    9471000          'title'=>array(
  • bcorp-shortcodes/trunk/css/bcsc.css

    r1320862 r1321536  
    104104}
    105105
     106/* [bcorp_accordion] */
     107.bcorp-accordion {padding-top:1px; border-color:inherit; }
     108.bcorp-accordion .bcorp-accordion-header { border-width:1px; border-style:solid; border-color:inherit; padding:2em; margin-top:-1px; border-top-left-radius:2px; border-top-right-radius:2px; }
     109.bcorp-accordion p.bcorp-accordion-header  { line-height:1em; padding:1.2em 2em; }
     110p.bcorp-accordion-header { margin-bottom: 0; }
     111.bcorp-accordion .bcorp-accordion-content {  display:none; border-width:1px; border-style:solid; border-color:inherit;  border-top:none; margin-bottom:5px; }
     112.bcorp-accordion-header-visible:before { content: "\f0d7"; font-family: "FontAwesome"; font-size:1.5em; position:relative; right:8px; top: 2px;}
     113.bcorp-accordion-header-hidden:before { content: "\f0da"; font-family: "FontAwesome"; font-size:1.5em; position:relative; right:8px; top: 2px;}
     114.bcorp-accordion-content { padding:1em; }
     115.bcorp-accordion-content > p:last-child { margin-bottom:0; }
    106116
    107117/* [bcorp_alert_box] */
     
    180190.bcorp-tabs a { outline:0; box-shadow:none; }
    181191.bcorp-tabs * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
    182 .bcorp-tabbed-inner {padding:1em; }
    183 .bcorp-tabbed-inner > p:last-child { margin-bottom:0; }
     192.bcorp-tab-panel-inner {padding:1em; }
     193.bcorp-tab-panel-inner > p:last-child { margin-bottom:0; }
    184194.bcorp-tab-top {border-left-width:1px; border-left-style:solid; border-color:inherit;}
    185195.bcorp-tab-top ul { margin:0px; font-size:14px; padding:0; height:46px; border-color:inherit; }
  • bcorp-shortcodes/trunk/js/bcsc.js

    r1320862 r1321536  
    2222            if ($(this).hasClass('bcorp-vertical-tab')) $(this).css('min-height',$(this).find('ul').height());
    2323            $(this).find('li:first').addClass('bcorp-active');
    24             $(this).find('.bcorp-tabbed').hide();
    25             $(this).find('.bcorp-tabbed:first').show();
     24            $(this).find('.bcorp-tab-panel').hide();
     25            $(this).find('.bcorp-tab-panel:first').show();
    2626
    2727            $(this).find('li').click(function(){
     
    2929                    $(this).parent().find('li').removeClass('bcorp-active');
    3030                    $(this).addClass('bcorp-active');
    31                     $(this).parent().parent().find('.bcorp-tabbed').hide();
     31                    $(this).parent().parent().find('.bcorp-tab-panel').hide();
    3232                    $($(this).find('a').attr('href')).show().find("div:first-child").hide().fadeIn();
    3333                }
     
    3737    }
    3838
     39    accordion('');
     40    function accordion(accordion) {
     41        $(accordion+'.bcorp-accordion .bcorp-accordion-header').click(function() {
     42            if($(this).next("div").is(":visible")){
     43                $(this).toggleClass("bcorp-accordion-header-visible").toggleClass("bcorp-accordion-header-hidden").next("div").slideUp();
     44            } else {
     45                if ($('#'+$(this).parent().attr('id')).hasClass('bcorp-accordion-multiple-false')) $('#'+$(this).parent().attr('id')+' .bcorp-accordion-content').slideUp();
     46                $(this).toggleClass("bcorp-accordion-header-visible").toggleClass("bcorp-accordion-header-hidden").next("div").slideToggle();
     47            }
     48        });
     49        $(accordion+".bcorp-accordion-open-true").toggleClass("bcorp-accordion-header-visible").toggleClass("bcorp-accordion-header-hidden").next("div").slideToggle();
     50    }
    3951
    4052});
  • bcorp-shortcodes/trunk/readme.txt

    r1320862 r1321536  
    55Requires at least: 4.2.0
    66Tested up to: 4.4
    7 Stable tag: 0.12
     7Stable tag: 0.13
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    1515The BCorp Shortcode includes the following elements. All of which include multiple display options configured in an easy to configure popup window.
    1616
     17Or you can download the BCorp Visual Editor at http://wordpress.org/plugins/bcorp-visual-editor/ to use them in a drag & drop page builder.
     18
     19Additional information and examples of usage is available at http://shortcodes.bcorp.com.
     20
    1721**13 x Layout Options**
    1822
     
    2024* [bcorp_cell width="1-6|1-5|1-4|1-3|2-5|1-2|3-5|2-3|3-4|4-5|5-6|1-1"]
    2125
    22 **9 x Shortcode Elements**
     26**11 x Shortcode Elements**
    2327
    2428* [bcorp_alert]
     29* [bcorp_accordion] [bcorp_accordion_panel]
    2530* [bcorp_button]
    2631* [bcorp_heading]
     
    2833* [bcorp_divider]
    2934* [bcorp_icon]
    30 * [bcorp_tabs] [bcorp_tabbed]
     35* [bcorp_tabs] [bcorp_tab_panel]
    3136* [bcorp_text]
    3237
     
    4550* [bcorp_wp_text]
    4651
    47 Additional information and examples of usage is available at http://shortcodes.bcorp.com.
    48 
    49 Many new shortcodes will be added to the collection shortly. Once the collection is complete I will also be releasing my exciting new Visual Editor which will make working with the shortcodes even simpler than ever.
     52Many new shortcodes will be added to the collection shortly.
    5053
    5154== Installation ==
     
    6871== Changelog ==
    6972
     73= 0.13 =
     74Added [bcorp_accordion] & [bcorp_accordion_panel] shortcodes.
     75Renamed [bcorp_tabbed] to [bcorp_tab_panel]
     76
    7077= 0.12 =
    7178Added [bcorp_tabs] & [bcorp_tabbed] shortcodes.
     
    8087== Upgrade Notice ==
    8188
     89= 0.13 =
     90Added [bcorp_accordion] & [bcorp_accordion_panel] shortcodes.
     91Renamed [bcorp_tabbed] to [bcorp_tab_panel]
     92
    8293= 0.12 =
    8394Added [bcorp_tabs] & [bcorp_tabbed] shortcodes.
Note: See TracChangeset for help on using the changeset viewer.