Plugin Directory

Changeset 1320862


Ignore:
Timestamp:
01/04/2016 12:08:41 PM (10 years ago)
Author:
BCorp
Message:

added [bcorp_Added [bcorp_tabs] & [bcorp_tabbed] shortcodes.

Location:
bcorp-shortcodes/trunk
Files:
5 edited

Legend:

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

    r1320172 r1320862  
    44Plugin URI: http://shortcodes.bcorp.com
    55Description: Advanced word press shortcodes for use with any wordpress theme.
    6 Version: 0.11
     6Version: 0.12
    77Author: Tim Brattberg
    88Author URI: http://bcorp.com
     
    440440  }
    441441
     442  function bcorp_tabs_shortcode($atts,$content=null,$tag ) {
     443    $data=$GLOBALS['bcorp_shortcodes_data']->bcorp_sanitize_data($tag,$atts);
     444    $regex = '/ title\s*=\s*"(.*?)"/';
     445    preg_match_all($regex, $content, $titles);
     446    $regex = '/ showicon\s*=\s*"(.*?)"/';
     447    preg_match_all($regex, $content, $showicons);
     448    $regex = '/ icon\s*=\s*"(.*?)"/';
     449    preg_match_all($regex, $content, $icons);
     450    static $bcorp_id;
     451    $vertical ='';
     452    $width='';
     453    $style = '';
     454    if ($data['position'] == 'left') {
     455      $vertical = " bcorp-vertical-tab";
     456      $style = ' style="padding-left:'.$data['width'].';"';
     457      $width = ' style="width:'.(absint($data['width'])+1).'px;"';
     458    } else if ($data['position'] == 'right') {
     459      $vertical = " bcorp-vertical-tab bcorp-vertical-tab-right";
     460      $style = ' style="padding-right:'.$data['width'].';"';
     461      $width = ' style="width:'.(absint($data['width'])+1).'px;"';
     462    }
     463    if ($data['position'] == 'top') $vertical = " bcorp-tab-top";
     464
     465    $output = '<div class="bcorp-tabs'.$vertical.'"'.$style.'><ul'.$width.'>';
     466    $icon_count=0;
     467    for ($i = 0; $i < count($titles[1]); $i++) {
     468      $bcorp_id++;
     469      if ($showicons[1][$i]=='true') {
     470        if ($icons[1][$icon_count]) $bcorp_icon= '<span class="bcorp-tab-icon" aria-hidden="true" data-icon="&#x'.esc_attr($icons[1][$icon_count]).';"></span>'; else $bcorp_icon="";
     471          $icon_count++;
     472      } else $bcorp_icon="";
     473      $output .= '<li><a href="#bcorp-tab-'.$bcorp_id.'">'.$bcorp_icon.esc_html($titles[1][$i]).'</a></li>';
     474    }
     475    $output .= '</ul>'.do_shortcode($content).'</div>';
     476    return $output;
     477  }
     478
     479  function bcorp_tabbed_shortcode($atts,$content=null,$tag ) {
     480    /* [bcorp_tabbed]
     481     * title
     482     * showicon (true,false)
     483     * icon
     484     * textblock
     485     */
     486    static $bcorp_id;
     487    $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>';
     489  }
     490
     491
    442492  function bcorp_text_shortcode($atts,$content=null,$tag ) {
    443493    /* [bcorp_text]
  • bcorp-shortcodes/trunk/bcorp_shortcodes_data.php

    r1320172 r1320862  
    905905
    906906    $this->bcorp_add_shortcode(
     907      "bcorp_tabs",array(
     908        "title"=>"Tabs",
     909        "admin_icon"=>"&#xe822;",
     910        "accept_content"=>true,
     911        "child_element"=>"bcorp_tabbed",
     912        "width" => "1-1",
     913        "admin_default"=>'<div class="bcve-bcorp_tabs"><i class="bcve-icon bcve-header-icon">&#xe822;</i>
     914    <div class="bcve-bcorp_tabs-details">Position: <span class="bcve-bcorp_tabs-position">top</span></div></div>',
     915        "variables"=>array(
     916          'position'=>array(
     917            'name'=>'Position',
     918            'type'=>'dropdown',
     919            'default'=>'top',
     920            'dependents'=>array(
     921              'left'=>array('width'),
     922              'right'=>array('width')),
     923            'values'=>array(
     924              'top'=>'Top',
     925              'left'=>'Left',
     926              'right'=>'Right')),
     927            'width'=>array(
     928              'name'=>'Tab Width',
     929              'type'=>'textfield',
     930              'description'=>'Enter a size in px.',
     931              'type'=>'textfield',
     932              'units'=>array('px'),
     933              'default'=>'150px'),
     934        )
     935      )
     936    );
     937
     938    $this->bcorp_add_shortcode(
     939      "bcorp_tabbed",array(
     940        "title"=>"Tab Panel",
     941        "admin_icon"=>"&#xe822;",
     942        "only_child"=>true,
     943        "width"=>"1-3-min",
     944        "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>',
     946        "variables"=>array(
     947          'title'=>array(
     948            'name'=>'Title',
     949            'type'=>'textfield',
     950            'default' =>''),
     951          'showicon'=>array(
     952            'name'=>'Display Icon',
     953            'admin_tab'=>'Icon',
     954            'type'=>'checkbox',
     955            'default'=>'false',
     956            'dependents'=>array(
     957            'true'=>array('icon'))),
     958          'icon'=>array(
     959            'name'=>'Icon',
     960            'type'=>'icon',
     961            'default'=>'f005'),
     962          'textblock'=>array(
     963            'name'=>'Text Block',
     964            'type'=>'textarea',
     965            'editor'=>'tinymce',
     966            'default' =>''
     967          )
     968        )
     969      )
     970    );
     971
     972    $this->bcorp_add_shortcode(
    907973      "bcorp_text",array(
    908974        "title"=>"Text Block",
  • bcorp-shortcodes/trunk/css/bcsc.css

    r1320172 r1320862  
    127127.bcorp-button-large {padding:14px 29px; font-size:14px; line-height:17px; }
    128128.bcorp-button-xlarge {padding:18px 40px; font-size:18px; line-height:21px; }
    129 .bcorp-button a {box-shadow:none;  text-decoration:none; color:#000000 !important; }
     129.bcorp-button a {box-shadow:none;  text-decoration:none; color:#000000; }
    130130.bcorp-button div { border-style:solid; border-width:0;  color:#ffffff; }
    131131.bcorp-button-icon-left {margin-right:10px; }
     
    176176.bcorp-image-align-center img { display:table; margin:0 auto; }
    177177
     178/* [bcorp_tabs] */
     179.bcorp-tabs ul li { cursor: pointer;}
     180.bcorp-tabs a { outline:0; box-shadow:none; }
     181.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; }
     184.bcorp-tab-top {border-left-width:1px; border-left-style:solid; border-color:inherit;}
     185.bcorp-tab-top ul { margin:0px; font-size:14px; padding:0; height:46px; border-color:inherit; }
     186.bcorp-tab-top a { outline:0;}
     187.bcorp-tab-top li {display:inline-block; border-width:1px; border-style:solid; border-color:inherit;  padding:8px; border-left:none;}
     188.bcorp-tab-top li a { text-decoration:none; }
     189.bcorp-tab-top>div { border-width:1px; border-style:solid; border-color:inherit; border-left:none; margin-top:-1px;}
     190.bcorp-tab-top li.bcorp-active { border-bottom-width:0px; font-weight:bold; height:46px; }
     191
     192.bcorp-vertical-tab {  border:none;  padding:0; position:relative; border-color:inherit; }
     193.bcorp-vertical-tab ul { position:absolute; display:block; }
     194.bcorp-vertical-tab ul {  left:0; top: 0; margin:0; border-top-width:1px; border-top-style:solid; border-color:inherit; padding:0; }
     195.bcorp-vertical-tab ul li { font-size:14px; padding:10px 0px 10px 15px;  margin:0;   overflow: hidden; border-width:1px; border:1px; border-style:solid; border-color:inherit; border-top:none; }
     196.bcorp-vertical-tab ul li a {  text-decoration:none; }
     197.bcorp-vertical-tab li.bcorp-active { border-right:none; font-weight: bold; }
     198.bcorp-vertical-tab>div { float:right; padding:0em 1em; border-width:1px; border-style:solid; border-color:inherit;}
     199
     200.bcorp-vertical-tab-right { position: relative; }
     201.bcorp-vertical-tab-right ul { left:auto; right:0; }
     202.bcorp-vertical-tab-right ul li { padding:15px 0px 15px 20px; }
     203.bcorp-vertical-tab-right ul li.bcorp-active { border-left:none; border-right-width:1px; border-right-style:solid; border-right-color:inherit; }
     204
     205.bcorp-tabs ul li { height:46px; }
     206.bcorp-tab-icon { margin-right:6px; }
     207.bcorp-active, .bcorp-alt-background { background-color:#f0f0f0; }
     208
    178209/* [bcorp_widget] */
    179210.bcorp-wp-widget img.rss-widget-icon { display:inline; }
  • bcorp-shortcodes/trunk/js/bcsc.js

    r1319402 r1320862  
    1616        }
    1717    });
     18
     19    tabs('');
     20    function tabs(tabs) {
     21        $(tabs+'.bcorp-tabs').each(function(){
     22            if ($(this).hasClass('bcorp-vertical-tab')) $(this).css('min-height',$(this).find('ul').height());
     23            $(this).find('li:first').addClass('bcorp-active');
     24            $(this).find('.bcorp-tabbed').hide();
     25            $(this).find('.bcorp-tabbed:first').show();
     26
     27            $(this).find('li').click(function(){
     28                if(!$(this).hasClass('bcorp-active')){
     29                    $(this).parent().find('li').removeClass('bcorp-active');
     30                    $(this).addClass('bcorp-active');
     31                    $(this).parent().parent().find('.bcorp-tabbed').hide();
     32                    $($(this).find('a').attr('href')).show().find("div:first-child").hide().fadeIn();
     33                }
     34                return false;
     35            });
     36        });
     37    }
     38
     39
    1840});
  • bcorp-shortcodes/trunk/readme.txt

    r1320172 r1320862  
    55Requires at least: 4.2.0
    66Tested up to: 4.4
    7 Stable tag: 0.11
     7Stable tag: 0.12
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1010
    11 A shortcode collection including 13 Layout Options, 7 Shortcode Elements and 11 Wordpress Widgets.
     11Powerful shortcode collection configured in a simple popup window.
    1212
    1313== Description ==
     
    2020* [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"]
    2121
    22 **7 x Shortcode Elements**
     22**9 x Shortcode Elements**
    2323
    2424* [bcorp_alert]
     
    2828* [bcorp_divider]
    2929* [bcorp_icon]
     30* [bcorp_tabs] [bcorp_tabbed]
    3031* [bcorp_text]
    3132
     
    4243* [bcorp_wp_search]
    4344* [bcorp_wp_tag_cloud]
    44 * [bcorp_wp_text]]
     45* [bcorp_wp_text]
    4546
    4647Additional information and examples of usage is available at http://shortcodes.bcorp.com.
    4748
    48 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.
     49Many 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.
    4950
    5051== Installation ==
     
    6768== Changelog ==
    6869
     70= 0.12 =
     71Added [bcorp_tabs] & [bcorp_tabbed] shortcodes.
     72
    6973= 0.11 =
    7074Added 11 Wordpress widget shortcodes.
     
    7680== Upgrade Notice ==
    7781
     82= 0.12 =
     83Added [bcorp_tabs] & [bcorp_tabbed] shortcodes.
     84
    7885= 0.11 =
    7986Added 11 Wordpress widget shortcodes.
Note: See TracChangeset for help on using the changeset viewer.