Bootstrap Shortcodes - Version 2.0

Version Description

  • Namespaced shortcodes to prevent conflicts with other plugins and themes
Download this release

Release Info

Developer sinetheta
Plugin Icon Bootstrap Shortcodes
Version 2.0
Comparing to
See all releases

Code changes from version 1.5.0 to 2.0

bootstrap-shortcodes.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Bootstrap Shortcodes
4
  Plugin URI: https://github.com/TheWebShop/bootstrap-shortcodes
5
  Description: A simple shortcode generator. Add buttons, columns, toggles and alerts to your theme.
6
- Version: 1.5.0
7
  Author: Kevin Attfield
8
  Author URI: https://github.com/Sinetheta
9
 
3
  Plugin Name: Bootstrap Shortcodes
4
  Plugin URI: https://github.com/TheWebShop/bootstrap-shortcodes
5
  Description: A simple shortcode generator. Add buttons, columns, toggles and alerts to your theme.
6
+ Version: 2.0
7
  Author: Kevin Attfield
8
  Author URI: https://github.com/Sinetheta
9
 
inc/bs_alert.php CHANGED
@@ -11,4 +11,4 @@ function bs_notice($params, $content = null){
11
  $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
- add_shortcode('notification', 'bs_notice');
11
  $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
+ add_shortcode('bs_notification', 'bs_notice');
inc/bs_buttons.php CHANGED
@@ -12,4 +12,4 @@ function bs_buttons($params, $content = null){
12
  $result = '<a class="btn btn-'.$size.' btn-'.$type.'" href="'.$href.'">'.$value.'</a>';
13
  return force_balance_tags( $result );
14
  }
15
- add_shortcode('button', 'bs_buttons');
12
  $result = '<a class="btn btn-'.$size.' btn-'.$type.'" href="'.$href.'">'.$value.'</a>';
13
  return force_balance_tags( $result );
14
  }
15
+ add_shortcode('bs_button', 'bs_buttons');
inc/bs_collapse.php CHANGED
@@ -10,7 +10,7 @@ function bs_collapse($params, $content = null){
10
  $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
- add_shortcode('collapse', 'bs_collapse');
14
 
15
 
16
  function bs_citem($params, $content = null){
@@ -36,4 +36,4 @@ function bs_citem($params, $content = null){
36
  $result .= '</div>';
37
  return force_balance_tags( $result );
38
  }
39
- add_shortcode('citem', 'bs_citem');
10
  $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
+ add_shortcode('bs_collapse', 'bs_collapse');
14
 
15
 
16
  function bs_citem($params, $content = null){
36
  $result .= '</div>';
37
  return force_balance_tags( $result );
38
  }
39
+ add_shortcode('bs_citem', 'bs_citem');
inc/bs_grid.php CHANGED
@@ -10,7 +10,7 @@ function bs_row($params, $content = null){
10
  $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
- add_shortcode('row', 'bs_row');
14
 
15
  function bs_span($params,$content=null){
16
  extract(shortcode_atts(array(
@@ -22,4 +22,4 @@ function bs_span($params,$content=null){
22
  $result .= '</div>';
23
  return force_balance_tags( $result );
24
  }
25
- add_shortcode('col', 'bs_span');
10
  $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
+ add_shortcode('bs_row', 'bs_row');
14
 
15
  function bs_span($params,$content=null){
16
  extract(shortcode_atts(array(
22
  $result .= '</div>';
23
  return force_balance_tags( $result );
24
  }
25
+ add_shortcode('bs_col', 'bs_span');
inc/bs_icons.php CHANGED
@@ -9,4 +9,4 @@ function bs_icons($params, $content = null){
9
  $result = '<i class="'.$name.'"></i>';
10
  return force_balance_tags( $result );
11
  }
12
- add_shortcode('icon', 'bs_icons');
9
  $result = '<i class="'.$name.'"></i>';
10
  return force_balance_tags( $result );
11
  }
12
+ add_shortcode('bs_icon', 'bs_icons');
inc/bs_lead.php CHANGED
@@ -9,4 +9,4 @@ function bs_lead($params, $content = null){
9
 
10
  return force_balance_tags( $result );
11
  }
12
- add_shortcode('lead', 'bs_lead');
9
 
10
  return force_balance_tags( $result );
11
  }
12
+ add_shortcode('bs_lead', 'bs_lead');
inc/bs_tabs.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
  //--------------
3
- // [tabs]
4
- // [thead]
5
- // [tab href="#link" title="title"]
6
- // [dropdown title="title"]
7
- // [tab href="#link" title="title"]
8
- // [/dropdown]
9
- // [/thead]
10
- // [tcontents]
11
- // [tcontent id="link"]
12
- // [/tcontent]
13
- // [/tcontents]
14
- // [/tabs]
15
  // ---------------
16
 
17
  function bs_tabs($params, $content = null){
@@ -21,7 +21,7 @@ function bs_tabs($params, $content = null){
21
  $result .= '</div>';
22
  return force_balance_tags( $result );
23
  }
24
- add_shortcode('tabs', 'bs_tabs');
25
 
26
  function bs_thead($params, $content = null){
27
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
@@ -30,7 +30,7 @@ function bs_thead($params, $content = null){
30
  $result .= '</ul>';
31
  return force_balance_tags( $result );
32
  }
33
- add_shortcode('thead', 'bs_thead');
34
 
35
  function bs_tab($params, $content = null){
36
  extract(shortcode_atts(array(
@@ -45,7 +45,7 @@ function bs_tab($params, $content = null){
45
  $result .= '</li>';
46
  return force_balance_tags( $result );
47
  }
48
- add_shortcode('tab', 'bs_tab');
49
 
50
  function bs_dropdown($params, $content = null){
51
  global $bs_timestamp;
@@ -62,7 +62,7 @@ function bs_dropdown($params, $content = null){
62
  $result .= '</ul></li>';
63
  return force_balance_tags( $result );
64
  }
65
- add_shortcode('dropdown', 'bs_dropdown');
66
 
67
  function bs_tcontents($params, $content = null){
68
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
@@ -71,7 +71,7 @@ function bs_tcontents($params, $content = null){
71
  $result .= '</div>';
72
  return force_balance_tags( $result );
73
  }
74
- add_shortcode('tcontents', 'bs_tcontents');
75
 
76
  function bs_tcontent($params, $content = null){
77
  extract(shortcode_atts(array(
@@ -85,4 +85,4 @@ function bs_tcontent($params, $content = null){
85
  $result .= '</div>';
86
  return force_balance_tags( $result );
87
  }
88
- add_shortcode('tcontent', 'bs_tcontent');
1
  <?php
2
  //--------------
3
+ // [bs_tabs]
4
+ // [bs_thead]
5
+ // [bs_tab href="#link" title="title"]
6
+ // [bs_dropdown title="title"]
7
+ // [bs_tab href="#link" title="title"]
8
+ // [/bs_dropdown]
9
+ // [/bs_thead]
10
+ // [bs_tcontents]
11
+ // [bs_tcontent id="link"]
12
+ // [/bs_tcontent]
13
+ // [/bs_tcontents]
14
+ // [/bs_tabs]
15
  // ---------------
16
 
17
  function bs_tabs($params, $content = null){
21
  $result .= '</div>';
22
  return force_balance_tags( $result );
23
  }
24
+ add_shortcode('bs_tabs', 'bs_tabs');
25
 
26
  function bs_thead($params, $content = null){
27
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
30
  $result .= '</ul>';
31
  return force_balance_tags( $result );
32
  }
33
+ add_shortcode('bs_thead', 'bs_thead');
34
 
35
  function bs_tab($params, $content = null){
36
  extract(shortcode_atts(array(
45
  $result .= '</li>';
46
  return force_balance_tags( $result );
47
  }
48
+ add_shortcode('bs_tab', 'bs_tab');
49
 
50
  function bs_dropdown($params, $content = null){
51
  global $bs_timestamp;
62
  $result .= '</ul></li>';
63
  return force_balance_tags( $result );
64
  }
65
+ add_shortcode('bs_dropdown', 'bs_dropdown');
66
 
67
  function bs_tcontents($params, $content = null){
68
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
71
  $result .= '</div>';
72
  return force_balance_tags( $result );
73
  }
74
+ add_shortcode('bs_tcontents', 'bs_tcontents');
75
 
76
  function bs_tcontent($params, $content = null){
77
  extract(shortcode_atts(array(
85
  $result .= '</div>';
86
  return force_balance_tags( $result );
87
  }
88
+ add_shortcode('bs_tcontent', 'bs_tcontent');
inc/bs_tooltip.php CHANGED
@@ -6,11 +6,11 @@ function bs_tooltip($params, $content = null){
6
  'trigger' => 'hover',
7
  'href' => "#"
8
  ), $params));
9
-
10
  $placement = (in_array($placement, array('top', 'right', 'bottom', 'left'))) ? $placement : "top";
11
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
12
  $title = explode("\n", wordwrap($content, 20, "\n"));
13
- $result .= '<a href="#" data-toggle="tooltip" title="'.$title[0].'" data-placement="'.esc_attr($placement).'" data-trigger="'.esc_attr($trigger).'">'.esc_attr($content).'</a>';
14
  return force_balance_tags( $result );
15
  }
16
- add_shortcode('tooltip', 'bs_tooltip');
6
  'trigger' => 'hover',
7
  'href' => "#"
8
  ), $params));
9
+
10
  $placement = (in_array($placement, array('top', 'right', 'bottom', 'left'))) ? $placement : "top";
11
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
12
  $title = explode("\n", wordwrap($content, 20, "\n"));
13
+ $result = '<a href="#" data-toggle="tooltip" title="'.$title[0].'" data-placement="'.esc_attr($placement).'" data-trigger="'.esc_attr($trigger).'">'.esc_attr($content).'</a>';
14
  return force_balance_tags( $result );
15
  }
16
+ add_shortcode('bs_tooltip', 'bs_tooltip');
inc/bs_well.php CHANGED
@@ -11,4 +11,4 @@ function bs_well($params, $content = null){
11
  $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
- add_shortcode('well', 'bs_well');
11
  $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
+ add_shortcode('bs_well', 'bs_well');
js/plugins/alerts.js CHANGED
@@ -15,16 +15,16 @@
15
  // Boxes & frames
16
  m.add({title : 'Alerts', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Success notification', onclick : function() {
18
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[notification type="success"]<strong>Well done!</strong> You successfully read <a href="#" class="alert-link">this important alert message</a>. [/notification]' );
19
  }});
20
  m.add({title : 'Info notification', onclick : function() {
21
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[notification type="info"]<strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it\'s not super important. [/notification]' );
22
  }});
23
  m.add({title : 'Warning notification', onclick : function() {
24
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[notification type="warning"]<strong>Warning!</strong> Best check yo self, you\'re <a href="#" class="alert-link">not looking too good</a>. [/notification]' );
25
  }});
26
  m.add({title : 'Error notification', onclick : function() {
27
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[notification type="danger"]<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things</a> up and try submitting again.[/notification]' );
28
  }});
29
 
30
  });
15
  // Boxes & frames
16
  m.add({title : 'Alerts', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Success notification', onclick : function() {
18
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_notification type="success"]<strong>Well done!</strong> You successfully read <a href="#" class="alert-link">this important alert message</a>. [/bs_notification]' );
19
  }});
20
  m.add({title : 'Info notification', onclick : function() {
21
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_notification type="info"]<strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it\'s not super important. [/bs_notification]' );
22
  }});
23
  m.add({title : 'Warning notification', onclick : function() {
24
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_notification type="warning"]<strong>Warning!</strong> Best check yo self, you\'re <a href="#" class="alert-link">not looking too good</a>. [/bs_notification]' );
25
  }});
26
  m.add({title : 'Error notification', onclick : function() {
27
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_notification type="danger"]<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things</a> up and try submitting again.[/bs_notification]' );
28
  }});
29
 
30
  });
js/plugins/buttons.js CHANGED
@@ -47,7 +47,7 @@
47
  var size = $menu.find('select[name=size]').val();
48
  var type = $menu.find('select[name=type]').val();
49
  var link = $menu.find('input[name=link]').val();
50
- tinymce.activeEditor.execCommand('mceInsertContent',false,'[button size="'+size.toLowerCase()+'" type="'+type.toLowerCase()+'" value="'+type+'" href="'+link+'"]');
51
  c.hideMenu();
52
  }).wrap('<div style="padding: 0 10px 10px"></div>')
53
 
47
  var size = $menu.find('select[name=size]').val();
48
  var type = $menu.find('select[name=type]').val();
49
  var link = $menu.find('input[name=link]').val();
50
+ tinymce.activeEditor.execCommand('mceInsertContent',false,'[bs_button size="'+size.toLowerCase()+'" type="'+type.toLowerCase()+'" value="'+type+'" href="'+link+'"]');
51
  c.hideMenu();
52
  }).wrap('<div style="padding: 0 10px 10px"></div>')
53
 
js/plugins/collapse.js CHANGED
@@ -30,24 +30,24 @@
30
  /**
31
  * Shortcode markup
32
  * -----------------------
33
- * [collapse id="#"]
34
- * [citem title="" id="" parent=""]
35
- * [/citem]
36
- * [/collapse]
37
  * -----------------------
38
  */
39
  var uID = Math.floor((Math.random()*100)+1);
40
- var shortcode = '[collapse id="collapse_'+uID+'"]<br class="nc"/>';
41
  var num = $menu.find('input[name=itemnum]').val();
42
  for(i=0;i<num;i++){
43
  var id = Math.floor((Math.random()*100)+1);
44
  var title = 'Collapsible Group Item '+(i+1);
45
- shortcode+= '[citem title="'+title+'" id="citem_'+id+'" parent="collapse_'+uID+'"]<br class="nc"/>';
46
  shortcode += 'Collapse content goes here....<br class="nc"/>';
47
- shortcode += '[/citem]<br class="nc"/>';
48
  }
49
 
50
- shortcode+= '[/collapse]';
51
 
52
  tinymce.activeEditor.execCommand('mceInsertContent',false,shortcode);
53
  c.hideMenu();
30
  /**
31
  * Shortcode markup
32
  * -----------------------
33
+ * [bs_collapse id="#"]
34
+ * [bs_citem title="" id="" parent=""]
35
+ * [/bs_citem]
36
+ * [/bs_collapse]
37
  * -----------------------
38
  */
39
  var uID = Math.floor((Math.random()*100)+1);
40
+ var shortcode = '[bs_collapse id="collapse_'+uID+'"]<br class="nc"/>';
41
  var num = $menu.find('input[name=itemnum]').val();
42
  for(i=0;i<num;i++){
43
  var id = Math.floor((Math.random()*100)+1);
44
  var title = 'Collapsible Group Item '+(i+1);
45
+ shortcode+= '[bs_citem title="'+title+'" id="citem_'+id+'" parent="collapse_'+uID+'"]<br class="nc"/>';
46
  shortcode += 'Collapse content goes here....<br class="nc"/>';
47
+ shortcode += '[/bs_citem]<br class="nc"/>';
48
  }
49
 
50
+ shortcode+= '[/bs_collapse]';
51
 
52
  tinymce.activeEditor.execCommand('mceInsertContent',false,shortcode);
53
  c.hideMenu();
js/plugins/grid.html CHANGED
@@ -68,14 +68,14 @@ $(function(){
68
 
69
  $('#btn_insert').click(function(){
70
 
71
- var shortcodes = '[row class="row"]';
72
  $('#demo_grid > div').each(function(){
73
  var clss = $(this).attr('class').replace(' demo_col','');
74
- shortcodes+= '<br class="nc"/>[col class="'+clss+'"]Text[/col]';
75
 
76
  });
77
 
78
- shortcodes+= '<br class="nc"/>[/row]';
79
  parent.tinymce.activeEditor.execCommand('mceInsertContent',false,shortcodes);
80
 
81
  parent.tb_remove();
68
 
69
  $('#btn_insert').click(function(){
70
 
71
+ var shortcodes = '[bs_row class="row"]';
72
  $('#demo_grid > div').each(function(){
73
  var clss = $(this).attr('class').replace(' demo_col','');
74
+ shortcodes+= '<br class="nc"/>[bs_col class="'+clss+'"]Text[/col]';
75
 
76
  });
77
 
78
+ shortcodes+= '<br class="nc"/>[/bs_row]';
79
  parent.tinymce.activeEditor.execCommand('mceInsertContent',false,shortcodes);
80
 
81
  parent.tb_remove();
js/plugins/grid.js CHANGED
@@ -15,22 +15,22 @@
15
  // Boxes & frames
16
  m.add({title : 'Fluid grid system', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : '12 Columns', onclick : function() {
18
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[col class="col-xs-1"]Text[/col]<br class="nc"/>[/row]' );
19
  }});
20
  m.add({title : '6 Columns', onclick : function() {
21
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[col class="col-xs-2"]Text[/col]<br class="nc"/>[/row]' );
22
  }});
23
  m.add({title : '4 Columns', onclick : function() {
24
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-3"]Text[/col]<br class="nc"/>[col class="col-xs-3"]Text[/col]<br class="nc"/>[col class="col-xs-3"]Text[/col]<br class="nc"/>[col class="col-xs-3"]Text[/col]<br class="nc"/>[/row]' );
25
  }});
26
  m.add({title : '3 Columns', onclick : function() {
27
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-4"]Text[/col]<br class="nc"/>[col class="col-xs-4"]Text[/col]<br class="nc"/>[col class="col-xs-4"]Text[/col]<br class="nc"/>[/row]' );
28
  }});
29
  m.add({title : '2 Columns', onclick : function() {
30
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-6"]Text[/col]<br class="nc"/>[col class="col-xs-6"]Text[/col]<br class="nc"/>[/row]' );
31
  }});
32
  m.add({title : '1 Columns', onclick : function() {
33
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[row class="row"]<br class="nc"/>[col class="col-xs-12"]Text[/col]<br class="nc"/>[/row]' );
34
  }});
35
  m.add({title : 'Custom Grid', onclick : function() {
36
  tb_show('Custom Grid', '../wp-content/plugins/bootstrap-shortcodes/js/plugins/grid.html?TB_iframe=1');
15
  // Boxes & frames
16
  m.add({title : 'Fluid grid system', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : '12 Columns', onclick : function() {
18
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-1"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
19
  }});
20
  m.add({title : '6 Columns', onclick : function() {
21
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-2"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
22
  }});
23
  m.add({title : '4 Columns', onclick : function() {
24
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-3"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-3"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-3"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-3"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
25
  }});
26
  m.add({title : '3 Columns', onclick : function() {
27
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-4"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-4"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-4"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
28
  }});
29
  m.add({title : '2 Columns', onclick : function() {
30
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-6"]Text[/bs_col]<br class="nc"/>[bs_col class="col-xs-6"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
31
  }});
32
  m.add({title : '1 Columns', onclick : function() {
33
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-12"]Text[/bs_col]<br class="nc"/>[/bs_row]' );
34
  }});
35
  m.add({title : 'Custom Grid', onclick : function() {
36
  tb_show('Custom Grid', '../wp-content/plugins/bootstrap-shortcodes/js/plugins/grid.html?TB_iframe=1');
js/plugins/icons.html CHANGED
@@ -13,7 +13,7 @@
13
  $('.glyphicons').on('click', 'li', function() {
14
  var iclass = $(this).find('.glyphicon').attr('class');
15
 
16
- parent.tinymce.activeEditor.execCommand('mceInsertContent', false, '[icon name="' + iclass + '"]');
17
  parent.tb_remove()
18
  });
19
  });
13
  $('.glyphicons').on('click', 'li', function() {
14
  var iclass = $(this).find('.glyphicon').attr('class');
15
 
16
+ parent.tinymce.activeEditor.execCommand('mceInsertContent', false, '[bs_icon name="' + iclass + '"]');
17
  parent.tb_remove()
18
  });
19
  });
js/plugins/labels.js CHANGED
@@ -15,10 +15,10 @@
15
  // Boxes & frames
16
  m.add({title : 'Labels & Badges', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Default', onclick : function() {
18
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[label]Default[/label]' );
19
  }});
20
  m.add({title : 'Success', onclick : function() {
21
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[label class="success"]Default[/label]' );
22
  }});
23
  });
24
 
15
  // Boxes & frames
16
  m.add({title : 'Labels & Badges', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Default', onclick : function() {
18
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_label]Default[/bs_label]' );
19
  }});
20
  m.add({title : 'Success', onclick : function() {
21
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_label class="success"]Default[/bs_label]' );
22
  }});
23
  });
24
 
js/plugins/lead.js CHANGED
@@ -7,7 +7,7 @@
7
  var c = cm.createButton('bs_lead', {
8
  title : 'Lead',
9
  onclick : function() {
10
- tinyMCE.activeEditor.execCommand('mceInsertContent', false, '[lead]This is a lead text and needs your attention.[/lead]');
11
  }
12
  });
13
  // Return the new splitbutton instance
7
  var c = cm.createButton('bs_lead', {
8
  title : 'Lead',
9
  onclick : function() {
10
+ tinyMCE.activeEditor.execCommand('mceInsertContent', false, '[bs_lead]This is a lead text and needs your attention.[/bs_lead]');
11
  }
12
  });
13
  // Return the new splitbutton instance
js/plugins/tabs.html CHANGED
@@ -119,24 +119,24 @@
119
  $('#btn_insert').click(function(e) {
120
  //Generate shortcode
121
  //--------------
122
- // [tabs]
123
- // [thead]
124
- // [tab type="tab" href="#link" title="title"]
125
- // [dropdown title="title"]
126
- // [tab type="tab" href="#link" title="title"]
127
- // [/dropdown]
128
- // [/thead]
129
- // [tcontents]
130
- // [tcontent id="link"]
131
- // [/tcontent]
132
- // [/tcontents]
133
- // [/tabs]
134
  // ---------------
135
 
136
  //Clean tab
137
  $('#myTab li.add-new').remove();
138
  $('#myTabContent').find('#bs_container,#bs_new_tab').remove();
139
- var shortcode = '[tabs]<br class="nc"/>[thead]<br class="nc"/>';
140
  var tid = Math.floor((Math.random() * 100) + 1);
141
  //Generate header
142
  $('#myTab>li').each(function(i, e) {
@@ -146,32 +146,32 @@
146
  var sclass = (i == 0) ? 'active' : '';
147
  if ($this.hasClass('dropdown')) {
148
  var id = $this.find('a:first').attr('id') + tid;
149
- shortcode += '[dropdown id="' + id + '" title="' + title + '"]<br class="nc"/>';
150
  var subcode = '';
151
  $(this).find('li').each(function() {
152
  var shref = $(this).find('a').attr('href') + tid;
153
  var stitle = $(this).find('a').text();
154
 
155
- subcode += '[tab type="tab" href="' + shref + '" title="' + stitle + '"]<br class="nc"/>';
156
  });
157
  shortcode += subcode;
158
- shortcode += '[/dropdown]<br class="nc"/>';
159
  } else {
160
 
161
- shortcode += '[tab class="' + sclass + '" type="tab" href="' + href + '" title="' + title + '"]<br class="nc"/>';
162
  }
163
 
164
  })
165
- shortcode += '[/thead][tcontents]<br class="nc"/>';
166
 
167
  //Generate content
168
  $('#myTabContent > div').each(function(j, e) {
169
  var content = $(this).find('.tab_content').val();
170
  var id = this.id + tid;
171
  sclass = (j == 0) ? 'active' : '';
172
- shortcode += '[tcontent class="' + sclass + '" id="' + id + '"]' + content + '[/tcontent]<br class="nc"/>';
173
  });
174
- shortcode += '[/tcontents]<br class="nc"/>[/tabs]';
175
 
176
  parent.tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
177
 
119
  $('#btn_insert').click(function(e) {
120
  //Generate shortcode
121
  //--------------
122
+ // [bs_tabs]
123
+ // [bs_thead]
124
+ // [bs_tab type="tab" href="#link" title="title"]
125
+ // [bs_dropdown title="title"]
126
+ // [bs_tab type="tab" href="#link" title="title"]
127
+ // [/bs_dropdown]
128
+ // [/bs_thead]
129
+ // [bs_tcontents]
130
+ // [bs_tcontent id="link"]
131
+ // [/bs_tcontent]
132
+ // [/bs_tcontents]
133
+ // [/bs_tabs]
134
  // ---------------
135
 
136
  //Clean tab
137
  $('#myTab li.add-new').remove();
138
  $('#myTabContent').find('#bs_container,#bs_new_tab').remove();
139
+ var shortcode = '[bs_tabs]<br class="nc"/>[bs_thead]<br class="nc"/>';
140
  var tid = Math.floor((Math.random() * 100) + 1);
141
  //Generate header
142
  $('#myTab>li').each(function(i, e) {
146
  var sclass = (i == 0) ? 'active' : '';
147
  if ($this.hasClass('dropdown')) {
148
  var id = $this.find('a:first').attr('id') + tid;
149
+ shortcode += '[bs_dropdown id="' + id + '" title="' + title + '"]<br class="nc"/>';
150
  var subcode = '';
151
  $(this).find('li').each(function() {
152
  var shref = $(this).find('a').attr('href') + tid;
153
  var stitle = $(this).find('a').text();
154
 
155
+ subcode += '[bs_tab type="tab" href="' + shref + '" title="' + stitle + '"]<br class="nc"/>';
156
  });
157
  shortcode += subcode;
158
+ shortcode += '[/bs_dropdown]<br class="nc"/>';
159
  } else {
160
 
161
+ shortcode += '[bs_tab class="' + sclass + '" type="tab" href="' + href + '" title="' + title + '"]<br class="nc"/>';
162
  }
163
 
164
  })
165
+ shortcode += '[/bs_thead][bs_tcontents]<br class="nc"/>';
166
 
167
  //Generate content
168
  $('#myTabContent > div').each(function(j, e) {
169
  var content = $(this).find('.tab_content').val();
170
  var id = this.id + tid;
171
  sclass = (j == 0) ? 'active' : '';
172
+ shortcode += '[bs_tcontent class="' + sclass + '" id="' + id + '"]' + content + '[/bs_tcontent]<br class="nc"/>';
173
  });
174
+ shortcode += '[/bs_tcontents]<br class="nc"/>[/bs_tabs]';
175
 
176
  parent.tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
177
 
js/plugins/tooltip.js CHANGED
@@ -46,9 +46,9 @@
46
  var content = $menu.find('input[name=content]').val();
47
  var placement = $menu.find('select[name=placement]').val();
48
  var trigger = $menu.find('select[name=trigger]').val();
49
- var shortcode = '[tooltip placement="' + placement + '" trigger="' + trigger + '"]';
50
  shortcode+= content;
51
- shortcode+= '[/tooltip]';
52
 
53
  tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
54
  c.hideMenu();
46
  var content = $menu.find('input[name=content]').val();
47
  var placement = $menu.find('select[name=placement]').val();
48
  var trigger = $menu.find('select[name=trigger]').val();
49
+ var shortcode = '[bs_tooltip placement="' + placement + '" trigger="' + trigger + '"]';
50
  shortcode+= content;
51
+ shortcode+= '[/bs_tooltip]';
52
 
53
  tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
54
  c.hideMenu();
js/plugins/wells.js CHANGED
@@ -15,13 +15,13 @@
15
  // Boxes & frames
16
  m.add({title : 'Well', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Small well', onclick : function() {
18
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[well size="sm"]This well needs your attention.[/well]' );
19
  }});
20
  m.add({title : 'Medium well', onclick : function() {
21
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[well size="md"]This well needs your attention.[/well]' );
22
  }});
23
  m.add({title : 'Large well', onclick : function() {
24
- tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[well size="lg"]This well needs your attention.[/well]' );
25
  }});
26
 
27
  });
15
  // Boxes & frames
16
  m.add({title : 'Well', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
17
  m.add({title : 'Small well', onclick : function() {
18
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_well size="sm"]This well needs your attention.[/bs_well]' );
19
  }});
20
  m.add({title : 'Medium well', onclick : function() {
21
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_well size="md"]This well needs your attention.[/bs_well]' );
22
  }});
23
  m.add({title : 'Large well', onclick : function() {
24
+ tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, '[bs_well size="lg"]This well needs your attention.[/bs_well]' );
25
  }});
26
 
27
  });
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Bootstrap Shortcodes ===
2
- Contributors: sinetheta, beaurixon, Designwall Team
3
  Tags: shortcode, shortcodes, bootstrap, buttons, grid, well, responsive, widget
4
  Requires at least: 3.0
5
  Tested up to: 3.6
6
- Stable tag: 1.5.0
7
  License: GNU General Public License v2.0
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -26,6 +26,9 @@ Please report issues [here](https://github.com/TheWebShop/bootstrap-shortcodes/i
26
 
27
  == Changelog ==
28
 
 
 
 
29
  = 1.5 =
30
  * Added support for tooltips
31
 
1
  === Bootstrap Shortcodes ===
2
+ Contributors: sinetheta, beaurixon, no3x, Designwall Team
3
  Tags: shortcode, shortcodes, bootstrap, buttons, grid, well, responsive, widget
4
  Requires at least: 3.0
5
  Tested up to: 3.6
6
+ Stable tag: 2.0
7
  License: GNU General Public License v2.0
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
26
 
27
  == Changelog ==
28
 
29
+ = 2.0 =
30
+ * Namespaced shortcodes to prevent conflicts with other plugins and themes
31
+
32
  = 1.5 =
33
  * Added support for tooltips
34