Bootstrap Shortcodes - Version 3.0

Version Description

Download this release

Release Info

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

Code changes from version 2.1.1 to 3.0

bootstrap-shortcodes.php CHANGED
@@ -3,23 +3,23 @@
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.1.1
7
- Author: Kevin Attfield
8
  Author URI: https://github.com/Sinetheta
9
 
10
  Forked from DW Shortcodes Bootstrap http://wordpress.org/plugins/dw-shortcodes-bootstrap/
11
  */
12
 
13
- require_once('inc/bs_grid.php');
14
- require_once('inc/bs_tabs.php');
15
- require_once('inc/bs_collapse.php');
16
- require_once('inc/bs_alert.php');
17
- require_once('inc/bs_well.php');
18
- require_once('inc/bs_buttons.php');
19
- require_once('inc/bs_labels.php');
20
- require_once('inc/bs_icons.php');
21
- require_once('inc/bs_lead.php');
22
- require_once('inc/bs_tooltip.php');
23
 
24
  class BootstrapShortcodes{
25
 
@@ -37,86 +37,75 @@ class BootstrapShortcodes{
37
  );
38
 
39
  public function __construct() {
40
- add_action( 'init' , array( &$this, 'init' ) );
41
-
42
- register_activation_hook(__FILE__, array(&$this, 'add_options_defaults'));
43
-
44
  add_action( 'admin_init', array( &$this, 'register_settings' ) );
45
  add_action( 'admin_menu', array( &$this, 'register_settings_page' ) );
46
  }
47
 
48
  function init() {
49
- $options = get_option('bs_options');
50
-
51
- if(!is_admin()){
52
- if( isset($options['chk_default_options_css']) && $options['chk_default_options_css'] ) {
53
- wp_enqueue_style("bs_bootstrap", plugins_url('css/bootstrap.css', __FILE__ ) );
54
- wp_enqueue_style("bs_shortcodes", plugins_url('css/shortcodes.css', __FILE__ ) );
55
  }
56
- if( isset($options['chk_default_options_js']) && $options['chk_default_options_js'] ) {
57
- wp_enqueue_script('bs_bootstrap', plugins_url('js/bootstrap.js', __FILE__ ) , array('jquery'));
58
  }
59
  wp_enqueue_script('bs_init', plugins_url('js/init.js', __FILE__ ) , array('bs_bootstrap'));
60
  } else {
61
- wp_enqueue_style("bs_admin_style", plugins_url('css/admin.css', __FILE__ ) );
62
  }
63
-
64
- if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) {
65
  return;
66
  }
67
-
68
- if ( get_user_option('rich_editing') == 'true' ) {
69
- //wp_enqueue_style("dws_bootstrap", plugins_url('css/bootstrap.css', __FILE__ ));
70
- add_filter( 'mce_external_plugins', array(&$this, 'regplugins') );
71
- add_filter( 'mce_buttons_3', array(&$this, 'regbtns') );
72
  }
73
  }
74
 
75
- function regbtns($buttons) {
76
-
77
- $options = get_option('bs_options');
78
-
79
- foreach ($this->shortcodes as &$shortcode) {
80
- if( isset($options['chk_default_options_' . $shortcode]) ) {
81
- array_push($buttons, 'bs_' . $shortcode);
82
  }
83
  }
84
-
85
  return $buttons;
86
  }
87
 
88
- function regplugins($plgs) {
89
-
90
- foreach ($this->shortcodes as &$shortcode) {
91
- $plgs['bs_' . $shortcode] = plugins_url('js/plugins/' . $shortcode . '.js', __FILE__ );
92
  }
93
-
94
  return $plgs;
95
  }
96
 
97
  function register_settings_page() {
98
- add_options_page(__('BS Shortcodes','bsshortcodes'), __('BS Shortcodes','bsshortcodes'), 'manage_options', __FILE__, array(&$this, 'dw_render_form'));
99
  }
100
 
101
  function add_options_defaults() {
102
- $arr = array(
103
- "chk_default_options_css" => "1",
104
- "chk_default_options_js" => "1",
105
- "chk_default_options_grid" => "1",
106
- "chk_default_options_tabs" => "1",
107
- "chk_default_options_collapse" => "1",
108
- "chk_default_options_alerts" => "1",
109
- "chk_default_options_wells" => "1",
110
- "chk_default_options_buttons" => "1",
111
- "chk_default_options_labels" => "1",
112
- "chk_default_options_icons" => "1",
113
- "chk_default_options_lead" => "1",
114
- "chk_default_options_tooltip" => "1"
115
  );
116
  update_option( 'bs_options', $arr );
117
  }
118
 
119
- function register_settings(){
120
  register_setting( 'bs_plugin_options', 'bs_options' );
121
  }
122
 
@@ -126,35 +115,35 @@ class BootstrapShortcodes{
126
  <div class="icon32" id="icon-options-general"><br></div>
127
  <h2>Bootstrap Shortcodes Options</h2>
128
  <form method="post" action="options.php">
129
- <?php settings_fields('bs_plugin_options'); ?>
130
- <?php $options = get_option('bs_options'); ?>
131
  <table class="form-table">
132
-
133
  <tr><td colspan="2"><div style="margin-top:10px;"></div></td></tr>
134
 
135
  <tr valign="top" style="border-top:#dddddd 1px solid;">
136
  <th scope="row">Twitter Bootstrap CSS</th>
137
  <td>
138
- <label><input name="bs_options[chk_default_options_css]" type="checkbox" value="1" <?php if (isset($options['chk_default_options_css'])) { checked('1', $options['chk_default_options_css']); } ?> /> Load Twitter Bootstrap css file</label><br /><span style="color:#666666;margin-left:2px;">Uncheck this if you already include Bootstrap css on your template</span>
139
  </td>
140
  </tr>
141
  <tr valign="top">
142
  <th scope="row">Twitter Bootstrap JS</th>
143
  <td>
144
- <label><input name="bs_options[chk_default_options_js]" type="checkbox" value="1" <?php if (isset($options['chk_default_options_js'])) { checked('1', $options['chk_default_options_js']); } ?> /> Load Twitter Bootstrap javascript file</label><br /><span style="color:#666666;margin-left:2px;">Uncheck this if you already include Bootstrap javascript on your template</span>
145
  </td>
146
  </tr>
147
  <tr valign="top">
148
  <th scope="row">Twitter Bootstrap Shortcodes</th>
149
  <td>
150
 
151
- <?php foreach ($this->shortcodes as &$shortcode): ?>
152
  <label>
153
- <input
154
  name="bs_options[chk_default_options_<?php echo $shortcode; ?>]"
155
  type="checkbox"
156
- value="1"
157
- <?php if (isset($options['chk_default_options_'.$shortcode])) { checked('1', $options['chk_default_options_'.$shortcode]); } ?>
158
  /> <?php echo $shortcode; ?>
159
  </label>
160
  <br />
@@ -172,4 +161,5 @@ class BootstrapShortcodes{
172
  </div><?php
173
  }
174
  }
 
175
  $bscodes = new BootstrapShortcodes();
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: 3.0.0
7
+ Author: Kevin Attfield
8
  Author URI: https://github.com/Sinetheta
9
 
10
  Forked from DW Shortcodes Bootstrap http://wordpress.org/plugins/dw-shortcodes-bootstrap/
11
  */
12
 
13
+ require_once( 'inc/bs_grid.php' );
14
+ require_once( 'inc/bs_tabs.php' );
15
+ require_once( 'inc/bs_collapse.php' );
16
+ require_once( 'inc/bs_alert.php' );
17
+ require_once( 'inc/bs_well.php' );
18
+ require_once( 'inc/bs_buttons.php' );
19
+ require_once( 'inc/bs_labels.php' );
20
+ require_once( 'inc/bs_icons.php' );
21
+ require_once( 'inc/bs_lead.php' );
22
+ require_once( 'inc/bs_tooltip.php' );
23
 
24
  class BootstrapShortcodes{
25
 
37
  );
38
 
39
  public function __construct() {
40
+ add_action( 'init', array( &$this, 'init' ) );
41
+ register_activation_hook( __FILE__, array( &$this, 'add_options_defaults' ) );
 
 
42
  add_action( 'admin_init', array( &$this, 'register_settings' ) );
43
  add_action( 'admin_menu', array( &$this, 'register_settings_page' ) );
44
  }
45
 
46
  function init() {
47
+ $options = get_option( 'bs_options' );
48
+ if( !is_admin() ) {
49
+ if( isset( $options[ 'chk_default_options_css' ] ) && $options[ 'chk_default_options_css' ] ) {
50
+ wp_enqueue_style( 'bs_bootstrap', plugins_url( 'css/bootstrap.css', __FILE__ ) );
51
+ wp_enqueue_style( 'bs_shortcodes', plugins_url( 'css/shortcodes.css', __FILE__ ) );
 
52
  }
53
+ if( isset( $options[ 'chk_default_options_js' ]) && $options[ 'chk_default_options_js' ] ) {
54
+ wp_enqueue_script( 'bs_bootstrap', plugins_url( 'js/bootstrap.js', __FILE__ ) , array( 'jquery' ) );
55
  }
56
  wp_enqueue_script('bs_init', plugins_url('js/init.js', __FILE__ ) , array('bs_bootstrap'));
57
  } else {
58
+ wp_enqueue_style( 'bs_admin_style', plugins_url( 'css/admin.css', __FILE__ ) );
59
  }
60
+ if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
 
61
  return;
62
  }
63
+ if ( get_user_option( 'rich_editing' ) == 'true' ) {
64
+ add_filter( 'mce_external_plugins', array( &$this, 'regplugins' ) );
65
+ add_filter( 'mce_buttons_3', array( &$this, 'regbtns' ) );
 
 
66
  }
67
  }
68
 
69
+ function regbtns( $buttons ) {
70
+ $options = get_option( 'bs_options' );
71
+ foreach ( $this->shortcodes as &$shortcode ) {
72
+ if ( isset( $options[ 'chk_default_options_' . $shortcode ] ) ) {
73
+ array_push( $buttons, 'bs_' . $shortcode );
 
 
74
  }
75
  }
 
76
  return $buttons;
77
  }
78
 
79
+ function regplugins( $plgs) {
80
+ foreach ( $this->shortcodes as &$shortcode ) {
81
+ $plgs[ 'bs_' . $shortcode ] = plugins_url( 'js/plugins/' . $shortcode . '.js', __FILE__ );
 
82
  }
 
83
  return $plgs;
84
  }
85
 
86
  function register_settings_page() {
87
+ add_options_page( __( 'BS Shortcodes', 'bsshortcodes' ), __( 'BS Shortcodes', 'bsshortcodes' ), 'manage_options', __FILE__, array( &$this, 'dw_render_form') );
88
  }
89
 
90
  function add_options_defaults() {
91
+ $arr = array(
92
+ 'chk_default_options_css' => '1',
93
+ 'chk_default_options_js' => '1',
94
+ 'chk_default_options_grid' => '1',
95
+ 'chk_default_options_tabs' => '1',
96
+ 'chk_default_options_collapse' => '1',
97
+ 'chk_default_options_alerts' => '1',
98
+ 'chk_default_options_wells' => '1',
99
+ 'chk_default_options_buttons' => '1',
100
+ 'chk_default_options_labels' => '1',
101
+ 'chk_default_options_icons' => '1',
102
+ 'chk_default_options_lead' => '1',
103
+ 'chk_default_options_tooltip' => '1'
104
  );
105
  update_option( 'bs_options', $arr );
106
  }
107
 
108
+ function register_settings() {
109
  register_setting( 'bs_plugin_options', 'bs_options' );
110
  }
111
 
115
  <div class="icon32" id="icon-options-general"><br></div>
116
  <h2>Bootstrap Shortcodes Options</h2>
117
  <form method="post" action="options.php">
118
+ <?php settings_fields( 'bs_plugin_options' ); ?>
119
+ <?php $options = get_option( 'bs_options'); ?>
120
  <table class="form-table">
121
+
122
  <tr><td colspan="2"><div style="margin-top:10px;"></div></td></tr>
123
 
124
  <tr valign="top" style="border-top:#dddddd 1px solid;">
125
  <th scope="row">Twitter Bootstrap CSS</th>
126
  <td>
127
+ <label><input name="bs_options[chk_default_options_css]" type="checkbox" value="1" <?php if ( isset( $options[ 'chk_default_options_css' ] ) ) { checked( '1', $options[ 'chk_default_options_css' ] ); } ?> /> Load Twitter Bootstrap css file</label><br /><span style="color:#666666;margin-left:2px;">Uncheck this if you already include Bootstrap css on your template</span>
128
  </td>
129
  </tr>
130
  <tr valign="top">
131
  <th scope="row">Twitter Bootstrap JS</th>
132
  <td>
133
+ <label><input name="bs_options[chk_default_options_js]" type="checkbox" value="1" <?php if ( isset( $options[ 'chk_default_options_js' ] ) ) { checked( '1', $options[ 'chk_default_options_js' ] ); } ?> /> Load Twitter Bootstrap javascript file</label><br /><span style="color:#666666;margin-left:2px;">Uncheck this if you already include Bootstrap javascript on your template</span>
134
  </td>
135
  </tr>
136
  <tr valign="top">
137
  <th scope="row">Twitter Bootstrap Shortcodes</th>
138
  <td>
139
 
140
+ <?php foreach ( $this->shortcodes as &$shortcode ): ?>
141
  <label>
142
+ <input
143
  name="bs_options[chk_default_options_<?php echo $shortcode; ?>]"
144
  type="checkbox"
145
+ value=1
146
+ <?php if ( isset( $options[ 'chk_default_options_' . $shortcode ] ) ) { checked( '1', $options[ 'chk_default_options_' . $shortcode ] ); } ?>
147
  /> <?php echo $shortcode; ?>
148
  </label>
149
  <br />
161
  </div><?php
162
  }
163
  }
164
+
165
  $bscodes = new BootstrapShortcodes();
inc/bs_alert.php CHANGED
@@ -1,14 +1,13 @@
1
  <?php
2
-
3
- function bs_notice($params, $content = null){
4
- extract(shortcode_atts(array(
5
  'type' => 'unknown'
6
- ), $params));
7
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
8
- $result = '<div class="alert alert-'.$type.' alert-dismissable">';
9
  $result .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
10
- $result .= do_shortcode($content );
11
- $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
- add_shortcode('bs_notification', 'bs_notice');
1
  <?php
2
+ function bs_notice( $params, $content=null ) {
3
+ extract( shortcode_atts( array(
 
4
  'type' => 'unknown'
5
+ ), $params ) );
6
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
7
+ $result = '<div class="alert alert-'.$type.' alert-dismissable">';
8
  $result .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
9
+ $result .= do_shortcode( $content );
10
+ $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
+ add_shortcode( 'bs_notification', 'bs_notice' );
inc/bs_buttons.php CHANGED
@@ -1,15 +1,14 @@
1
- <?php
2
-
3
- function bs_buttons($params, $content = null){
4
  extract(shortcode_atts(array(
5
  'size' => 'default',
6
  'type' => 'default',
7
  'value' => 'button',
8
  'href' => "#"
9
- ), $params));
10
 
11
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
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');
1
+ <?php
2
+ function bs_buttons( $params, $content=null ) {
 
3
  extract(shortcode_atts(array(
4
  'size' => 'default',
5
  'type' => 'default',
6
  'value' => 'button',
7
  'href' => "#"
8
+ ), $params ) );
9
 
10
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
11
+ $result = '<a class="btn btn-' . $size . ' btn-' . $type . '" href="' . $href . '">' . $value . '</a>';
12
  return force_balance_tags( $result );
13
  }
14
+ add_shortcode( 'bs_button', 'bs_buttons' );
inc/bs_collapse.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
 
3
- function bs_collapse($params, $content = null){
4
- extract(shortcode_atts(array(
5
  'id'=>''
6
- ), $params));
7
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
8
- $result = '<div class="panel-group" id="'.$id.'">';
9
- $result .= do_shortcode($content );
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){
17
- extract(shortcode_atts(array(
18
- 'id'=>'',
19
- 'title'=>'Collapse title',
20
  'parent' => ''
21
- ), $params));
22
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
23
- $result = ' <div class="panel panel-default">';
24
- $result .= ' <div class="panel-heading">';
25
- $result .= ' <h4 class="panel-title">';
26
- $result .= '<a class="accordion-toggle" data-toggle="collapse" data-parent="#'.$parent.'" href="#'.$id.'">';
27
  $result .= $title;
28
  $result .= '</a>';
29
- $result .= '</h4>';
 
 
 
 
 
 
30
  $result .= '</div>';
31
- $result .= '<div id="'.$id.'" class="panel-collapse collapse">';
32
- $result .= '<div class="panel-body">';
33
- $result .= do_shortcode($content );
34
- $result .= '</div>';
35
- $result .= '</div>';
36
- $result .= '</div>';
37
  return force_balance_tags( $result );
38
  }
39
- add_shortcode('bs_citem', 'bs_citem');
1
+ <?php
2
 
3
+ function bs_collapse( $params, $content=null ){
4
+ extract( shortcode_atts( array(
5
  'id'=>''
6
+ ), $params ) );
7
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
8
+ $result = '<div class="panel-group" id="' . $id . '">';
9
+ $result .= do_shortcode( $content );
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 ){
17
+ extract( shortcode_atts( array(
18
+ 'id'=> '',
19
+ 'title'=> 'Collapse title',
20
  'parent' => ''
21
+ ), $params ) );
22
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
23
+ $result = '<div class="panel panel-default">';
24
+ $result .= ' <div class="panel-heading">';
25
+ $result .= ' <h4 class="panel-title">';
26
+ $result .= '<a class="accordion-toggle" data-toggle="collapse" data-parent="#' . $parent . '" href="#' . $id . '">';
27
  $result .= $title;
28
  $result .= '</a>';
29
+ $result .= ' </h4>';
30
+ $result .= ' </div>';
31
+ $result .= ' <div id="' . $id . '" class="panel-collapse collapse">';
32
+ $result .= ' <div class="panel-body">';
33
+ $result .= do_shortcode( $content );
34
+ $result .= ' </div>';
35
+ $result .= ' </div>';
36
  $result .= '</div>';
 
 
 
 
 
 
37
  return force_balance_tags( $result );
38
  }
39
+ add_shortcode('bs_citem', 'bs_citem' );
inc/bs_grid.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
 
3
- function bs_row($params, $content = null){
4
- extract(shortcode_atts(array(
5
  'class' => 'row'
6
- ), $params));
7
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
8
- $result = '<div class="'.$class.'">';
9
- $result .= do_shortcode($content );
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(
17
  'class' => 'col-xs-1'
18
- ), $params));
19
 
20
- $result = '<div class="'.$class.'">';
21
- $result .= do_shortcode($content );
22
- $result .= '</div>';
23
  return force_balance_tags( $result );
24
  }
25
- add_shortcode('bs_col', 'bs_span');
1
+ <?php
2
 
3
+ function bs_row( $params, $content=null ) {
4
+ extract( shortcode_atts( array(
5
  'class' => 'row'
6
+ ), $params ) );
7
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
8
+ $result = '<div class="' . $class . '">';
9
+ $result .= do_shortcode( $content );
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(
17
  'class' => 'col-xs-1'
18
+ ), $params ) );
19
 
20
+ $result = '<div class="' . $class . '">';
21
+ $result .= do_shortcode( $content );
22
+ $result .= '</div>';
23
  return force_balance_tags( $result );
24
  }
25
+ add_shortcode( 'bs_col', 'bs_span' );
inc/bs_icons.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
 
3
- function bs_icons($params, $content = null){
4
  extract(shortcode_atts(array(
5
  'name' => 'default'
6
  ), $params));
7
 
8
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
9
- $result = '<i class="'.$name.'"></i>';
10
  return force_balance_tags( $result );
11
  }
12
- add_shortcode('bs_icon', 'bs_icons');
1
+ <?php
2
 
3
+ function bs_icons( $params, $content=null ) {
4
  extract(shortcode_atts(array(
5
  'name' => 'default'
6
  ), $params));
7
 
8
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
9
+ $result = '<i class="' . $name . '"></i>';
10
  return force_balance_tags( $result );
11
  }
12
+ add_shortcode( 'bs_icon', 'bs_icons' );
inc/bs_labels.php CHANGED
@@ -1,13 +1,11 @@
1
- <?php
 
 
 
 
2
 
3
- function bs_labels($params, $content = null){
4
- extract(shortcode_atts(array(
5
- 'type' => 'default',
6
- 'text' => 'my label'
7
- ), $params));
8
-
9
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
10
- $result = '<span class="label label-'.$type.'">'.$text.'</span>';
11
  return force_balance_tags( $result );
12
  }
13
- add_shortcode('bs_label', 'bs_labels');
1
+ <?php
2
+ function bs_labels( $params, $content=null ) {
3
+ extract( shortcode_atts( array(
4
+ 'type' => 'default'
5
+ ), $params ) );
6
 
7
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
8
+ $result = '<span class="label label-' . $type . '">' . $content . '</span>';
 
 
 
 
 
 
9
  return force_balance_tags( $result );
10
  }
11
+ add_shortcode( 'bs_label', 'bs_labels' );
inc/bs_lead.php CHANGED
@@ -1,12 +1,11 @@
1
  <?php
 
2
 
3
- function bs_lead($params, $content = null){
4
-
5
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
6
  $result = '<div class="lead">';
7
- $result .= do_shortcode($content );
8
  $result .= '</div>';
9
 
10
  return force_balance_tags( $result );
11
  }
12
- add_shortcode('bs_lead', 'bs_lead');
1
  <?php
2
+ function bs_lead( $params, $content=null ){
3
 
4
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
 
 
5
  $result = '<div class="lead">';
6
+ $result .= do_shortcode( $content );
7
  $result .= '</div>';
8
 
9
  return force_balance_tags( $result );
10
  }
11
+ add_shortcode( 'bs_lead', 'bs_lead' );
inc/bs_tabs.php CHANGED
@@ -1,88 +1,88 @@
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){
18
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
19
- $result = '<div class="tab_wrap">';
20
- $result .= do_shortcode($content );
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);
28
- $result = '<ul class="nav nav-tabs">';
29
- $result .= do_shortcode($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(
37
- 'href' => '#',
38
- 'title' => '',
39
- 'class' => ''
40
- ), $params));
41
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
42
 
43
- $result = '<li class="'.$class.'">';
44
- $result .= '<a data-toggle="tab" href="'.$href.'">'.$title.'</a>';
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;
52
- extract(shortcode_atts(array(
53
- 'title' => '',
54
- 'id' => '',
55
- 'class' => '',
56
- ), $params));
57
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
58
- $result = '<li class="dropdown">';
59
- $result .= '<a class="'.$class.'" id="'.$id.'" class="dropdown-toggle" data-toggle="dropdown">'.$title.'<b class="caret"></b></a>';
60
- $result .='<ul class="dropdown-menu">';
61
- $result .= do_shortcode($content);
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);
69
- $result = '<div class="tab-content">';
70
- $result .= do_shortcode($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(
78
- 'id' => '',
79
- 'class'=>'',
80
- ), $params));
81
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
82
- $class= ($class=='active')?'active in':'';
83
- $result = '<div class="tab-pane fade '.$class.'" id='.$id.'>';
84
- $result .= do_shortcode($content );
85
- $result .= '</div>';
86
- return force_balance_tags( $result );
87
  }
88
- add_shortcode('bs_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 ){
18
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
19
+ $result = '<div class="tab_wrap">';
20
+ $result .= do_shortcode( $content );
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 );
28
+ $result = '<ul class="nav nav-tabs">';
29
+ $result .= do_shortcode( $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(
37
+ 'href' => '#',
38
+ 'title' => '',
39
+ 'class' => ''
40
+ ), $params ) );
41
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
42
 
43
+ $result = '<li class="' . $class . '">';
44
+ $result .= '<a data-toggle="tab" href="' . $href . '">' . $title . '</a>';
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;
52
+ extract( shortcode_atts( array(
53
+ 'title' => '',
54
+ 'id' => '',
55
+ 'class' => '',
56
+ ), $params ) );
57
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
58
+ $result = '<li class="dropdown">';
59
+ $result .= '<a class="' . $class . '" id="' . $id . '" class="dropdown-toggle" data-toggle="dropdown">' . $title . '<b class="caret"></b></a>';
60
+ $result .= '<ul class="dropdown-menu">';
61
+ $result .= do_shortcode( $content );
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 );
69
+ $result = '<div class="tab-content">';
70
+ $result .= do_shortcode( $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(
78
+ 'id' => '',
79
+ 'class'=>'',
80
+ ), $params ) );
81
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
82
+ $class = ($class=='active')? 'active in': '';
83
+ $result = '<div class="tab-pane fade ' . $class . '" id=' . $id . '>';
84
+ $result .= do_shortcode( $content );
85
+ $result .= '</div>';
86
+ return force_balance_tags( $result );
87
  }
88
+ add_shortcode( 'bs_tcontent', 'bs_tcontent' );
inc/bs_tooltip.php CHANGED
@@ -1,16 +1,15 @@
1
- <?php
2
-
3
- function bs_tooltip($params, $content = null){
4
- extract(shortcode_atts(array(
5
  'placement' => 'top',
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');
1
+ <?php
2
+ function bs_tooltip( $params, $content=null ) {
3
+ extract( shortcode_atts( array(
 
4
  'placement' => 'top',
5
  'trigger' => 'hover',
6
  'href' => "#"
7
+ ), $params ) );
8
+
9
+ $placement = (in_array( $placement, array( 'top', 'right', 'bottom', 'left' ) ))? $placement: 'top';
10
  $content = preg_replace('/<br class="nc".\/>/', '', $content);
11
+ $title = explode( '\n', wordwrap( $content, 20, '\n' ) );
12
+ $result = '<a href="#" data-toggle="tooltip" title="' . $title[0] . '" data-placement="' . esc_attr( $placement ) . '" data-trigger="' . esc_attr( $trigger ) . '">' . esc_attr( $content ) . '</a>';
13
  return force_balance_tags( $result );
14
  }
15
+ add_shortcode( 'bs_tooltip', 'bs_tooltip' );
inc/bs_well.php CHANGED
@@ -1,14 +1,13 @@
1
- <?php
2
-
3
- function bs_well($params, $content = null){
4
- extract(shortcode_atts(array(
5
  'size' => 'unknown'
6
  ), $params));
7
 
8
- $content = preg_replace('/<br class="nc".\/>/', '', $content);
9
- $result = '<div class="well well-'.$size.'">';
10
- $result .= do_shortcode($content );
11
- $result .= '</div>';
12
  return force_balance_tags( $result );
13
  }
14
- add_shortcode('bs_well', 'bs_well');
1
+ <?php
2
+ function bs_well( $params, $content=null ) {
3
+ extract( shortcode_atts( array(
 
4
  'size' => 'unknown'
5
  ), $params));
6
 
7
+ $content = preg_replace( '/<br class="nc".\/>/', '', $content );
8
+ $result = '<div class="well well-' . $size . '">';
9
+ $result .= do_shortcode( $content );
10
+ $result .= '</div>';
11
  return force_balance_tags( $result );
12
  }
13
+ add_shortcode( 'bs_well', 'bs_well' );
js/init.js CHANGED
@@ -1,4 +1,4 @@
1
- (function($){
2
  $(document).ready(function() {
3
  $('[data-toggle="tooltip"]').tooltip()
4
  // Stop "click triggered" tootips from acting as bookmarks to top of page
1
+ (function($) {
2
  $(document).ready(function() {
3
  $('[data-toggle="tooltip"]').tooltip()
4
  // Stop "click triggered" tootips from acting as bookmarks to top of page
js/plugins/alerts.js CHANGED
@@ -1,40 +1,13 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_alerts', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_alerts':
8
- var c = cm.createSplitButton('bs_alerts', {
9
- title : 'Notification',
10
- onclick : function() {
11
- }
12
- });
13
-
14
- c.onRenderMenu.add(function(c, m) {
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
- });
31
-
32
- // Return the new splitbutton instance
33
- return c;
34
-
35
- }
36
- return null;
37
- }
38
  });
39
- tinymce.PluginManager.add('bs_alerts', tinymce.plugins.bs_alerts);
40
- })();
1
+ tinymce.PluginManager.add( 'bs_alerts', function( editor, url ) {
2
+ editor.addButton( 'bs_alerts', {
3
+ type: 'menubutton',
4
+ tooltip: 'Alerts',
5
+ icon: 'bs-alerts',
6
+ menu: [
7
+ { text: 'Success notification', onclick: function() { editor.insertContent('[bs_notification type="success"]<strong>Well done!</strong>You successfully read <a href="#" class="alert-link">this important alert message</a>.[/bs_notification]');} },
8
+ { text: 'Info notification', onclick: function() { editor.insertContent('[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]');} },
9
+ { text: 'Warning notification', onclick: function() { editor.insertContent('[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]');} },
10
+ { text: 'Error notification', onclick: function() { editor.insertContent('[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]');} }
11
+ ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  });
13
+ });
 
js/plugins/buttons.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel="stylesheet" href="../../css/bootstrap.css" />
6
+ <link rel="stylesheet" href="../../css/admin.css" />
7
+ <script type="text/javascript" src="../jquery.js"></script>
8
+ <script type="text/javascript" src="../bootstrap.js"></script>
9
+ <script type="text/javascript">
10
+ (function($) {
11
+ $('#insert').click(function() {
12
+ var size = $('select[name=size]').val();
13
+ var type = $('select[name=type]').val();
14
+ var value = $('input[name=value]').val();
15
+ var link = $('input[name=link]').val();
16
+ top.tinymce.activeEditor.insertContent('[bs_button size="'+size.toLowerCase()+'" type="'+type.toLowerCase()+'" value="'+value+'" href="'+link+'"]');
17
+ top.tinymce.activeEditor.windowManager.close();
18
+ });
19
+ }(jQuery));
20
+ </script>
21
+ </head>
22
+ <body>
23
+ <div class="container">
24
+ <form role="form">
25
+ <div class="form-group">
26
+ <label for="size">Size</label>
27
+ <select class="form-control" id="size" name="size">
28
+ <option value="xs">Mini</option>
29
+ <option value="sm">Small</option>
30
+ <option value="md" selected>Normal</option>
31
+ <option value="lg">Large</option>
32
+ </select>
33
+ <label for="type">Types</label>
34
+ <select class="form-control" id="type" name="type">
35
+ <option value="Default"> Default</option>
36
+ <option value="Primary"> Primary</option>
37
+ <option value="Success"> Success</option>
38
+ <option value="Info" selected> Info</option>
39
+ <option value="Warning"> Warning</option>
40
+ <option value="Danger"> Danger</option>
41
+ <option value="Link"> Link</option>
42
+ </select>
43
+ <label for="value">Value</label>
44
+ <input type="text" class="form-control" id="value" name="value" placeholder="Value" onclick="this.select()" />
45
+ <label for="link">Link</label>
46
+ <input type="text" class="form-control" id="link" name="link" placeholder="#" onclick="this.select()" />
47
+ </div>
48
+ <button type="submit" id="insert" class="btn btn-primary">Insert</button>
49
+ </form>
50
+ </div>
51
+ </body>
52
+ </html>
js/plugins/buttons.js CHANGED
@@ -1,70 +1,14 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_buttons', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_buttons':
8
- var c = cm.createSplitButton('bs_buttons', {
9
- title : 'Buttons',
10
- onclick : function() {
11
-
12
- }
13
- //'class':'mceListBoxMenu'
14
- });
15
-
16
-
17
- c.onRenderMenu.add(function(c, m) {
18
- m.onShowMenu.add(function(c,m){
19
- jQuery('#menu_'+c.id).height('auto').width('auto');
20
- jQuery('#menu_'+c.id+'_co').height('auto').addClass('mceListBoxMenu');
21
- var $menu = jQuery('#menu_'+c.id+'_co').find('tbody:first');
22
- if($menu.data('added')) return;
23
- $menu.append('');
24
- $menu.append('<div style="padding: 0 10px 10px"><label>Size<br/>\
25
- <select name="size">\
26
- <option value="xs">Mini</option>\
27
- <option value="sm">Small</option>\
28
- <option value="Normal" selected>Normal</option>\
29
- <option value="lg">Large</option>\
30
- </select></label>\
31
- <label>Types<br/>\
32
- <select name="type">\
33
- <option value="Default"> Default</option>\
34
- <option value="Primary"> Primary</option>\
35
- <option value="Success"> Success</option>\
36
- <option value="Info" selected> Info</option>\
37
- <option value="Warning"> Warning</option>\
38
- <option value="Danger"> Danger</option>\
39
- <option value="Link"> Link</option>\
40
- </select>\
41
- <label>Link<br />\
42
- <input type="text" name="link" value="#" onclick="this.select()" /></label>\
43
- </div>');
44
-
45
- jQuery('<input type="button" class="button" value="Insert" />').appendTo($menu)
46
- .click(function(){
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
-
54
- $menu.data('added',true);
55
-
56
- });
57
-
58
- // XSmall
59
- m.add({title : 'Buttons', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
60
-
61
- });
62
- // Return the new splitbutton instance
63
- return c;
64
-
65
- }
66
- return null;
67
  }
68
  });
69
- tinymce.PluginManager.add('bs_buttons', tinymce.plugins.bs_buttons);
70
- })();
1
+ tinymce.PluginManager.add('bs_buttons', function(editor, url) {
2
+ editor.addButton('bs_buttons', {
3
+ tooltip: 'Buttons',
4
+ icon: 'bs-buttons',
5
+ onclick: function() {
6
+ tinymce.activeEditor.windowManager.open({
7
+ title: 'Buttons',
8
+ url: url + '/buttons.html',
9
+ width: 480,
10
+ height: 320
11
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
  });
14
+ });
 
js/plugins/collapse.js CHANGED
@@ -1,72 +1,43 @@
1
- // JavaScript Document
2
  (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_collapse', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_collapse':
8
- var c = cm.createSplitButton('bs_collapse', {
9
- title : 'Collapse',
10
- onclick : function() {
11
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
- //'class':'mceListBoxMenu'
14
  });
15
-
16
- c.onRenderMenu.add(function(c, m) {
17
- m.onShowMenu.add(function(c,m){
18
- jQuery('#menu_'+c.id).height('auto').width('auto');
19
- jQuery('#menu_'+c.id+'_co').height('auto').addClass('mceListBoxMenu');
20
- var $menu = jQuery('#menu_'+c.id+'_co').find('tbody:first');
21
- if($menu.data('added')) return;
22
- $menu.append('');
23
- $menu.append('<div style="padding:0 10px 10px">\
24
- <label>Number of items<br />\
25
- <input type="text" name="itemnum" value="3" onclick="this.select()" /></label>\
26
- </div>');
27
-
28
- jQuery('<input type="button" class="button" value="Insert" />').appendTo($menu)
29
- .click(function(){
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();
54
- }).wrap('<div style="padding: 0 10px 10px"></div>')
55
-
56
- $menu.data('added',true);
57
-
58
- });
59
-
60
- // XSmall
61
- m.add({title : 'Collapse', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
62
-
63
- });
64
- // Return the new splitbutton instance
65
- return c;
66
-
67
  }
68
- return null;
69
- }
70
  });
71
- tinymce.PluginManager.add('bs_collapse', tinymce.plugins.bs_collapse);
 
 
 
 
 
 
72
  })();
 
1
  (function() {
2
+ tinymce.PluginManager.add('bs_collapse', function(editor, url) {
3
+ editor.addButton('bs_collapse', {
4
+ tooltip: 'Collapse',
5
+ icon: 'bs-collapse',
6
+ onclick: function() {
7
+ // Open window
8
+ editor.windowManager.open({
9
+ title: 'Collapse',
10
+ body: [{
11
+ type: 'textbox',
12
+ name: 'itemnum',
13
+ value: '3',
14
+ label: 'Number of items'
15
+ }],
16
+ onsubmit: function(e) {
17
+ // Insert content when the window form is submitted
18
+ var uID = guid();
19
+ var shortcode = '[bs_collapse id="collapse_' + uID + '"]<br class="nc"/>';
20
+ var num = e.data.itemnum;
21
+ for (i = 0; i < num; i++) {
22
+ var id = guid();
23
+ var title = 'Collapsible Group Item ' + (i + 1);
24
+ shortcode += '[bs_citem title="' + title + '" id="citem_' + id + '" parent="collapse_' + uID + '"]<br class="nc"/>';
25
+ shortcode += 'Collapse content goes here....<br class="nc"/>';
26
+ shortcode += '[/bs_citem]<br class="nc"/>';
27
+ }
28
+
29
+ shortcode += '[/bs_collapse]';
30
+ editor.insertContent(shortcode);
31
  }
 
32
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
+ });
 
35
  });
36
+
37
+ function guid() {
38
+ function s4() {
39
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
40
+ }
41
+ return s4() + '-' + s4();
42
+ }
43
  })();
js/plugins/grid.html CHANGED
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <link rel="stylesheet" href="../../css/bootstrap.css" />
@@ -7,105 +7,108 @@
7
  <script type="text/javascript" src="../jquery.js"></script>
8
  <script type="text/javascript" src="../bootstrap.js"></script>
9
  <script type="text/javascript">
10
- $(function(){
11
- $('#btn_insert, h5.preview').fadeOut();
12
-
13
- setInterval(function(){
14
- //Set popup's width
15
- var pwidth = 800;
16
- parent.jQuery('#TB_window,#TB_iframeContent').width(pwidth);
17
- parent.jQuery('#TB_window').css('margin-left',-(pwidth/2));
18
- },100);
19
-
20
- $('#frm_create').submit(function(e){
21
- e.preventDefault();
22
- append_grid($('#quantity').val());
23
- });
 
24
 
25
- $('#quantity').bind('keyup change',function(){
26
- var lastQuantity = $(this).data('lastQuantity');
27
- var currentQuantity = $(this).val();
28
 
29
- if (currentQuantity === lastQuantity) {
30
- return 'no need to update'
31
- } else {
32
- $(this).data('lastQuantity', currentQuantity);
33
- append_grid(currentQuantity);
34
- }
35
- });
36
 
37
- $('#col-width').bind('change keyup',function(){
38
- var $active = $('#demo_grid div.active');
39
- var val = $(this).val();
40
- if(isNaN(val)||val>12||val<1) return;
41
- var cw = $active.find('.grid').text().split(' ')[1];
42
 
43
- $active.removeClass('col-xs-'+cw).addClass('col-xs-'+$(this).val());
44
- $active.find('.grid').text('Grid '+ $(this).val() );
45
- });
46
 
47
- $('#col-offset').bind('keyup change',function(){
48
 
49
- var val = $(this).val();
50
- if(isNaN(val)||val>12||val<0) return;
51
 
52
- var $active = $('#demo_grid div.active');
53
 
54
 
55
- var cw = $active.find('.offset').text().split(' ')[1];
56
 
57
- if(isNaN(cw)||cw>12) return;
58
 
59
- $active.removeClass('col-xs-offset-'+cw).addClass('col-xs-offset-'+$(this).val());
60
- $active.find('.offset').text('Offset '+ $(this).val() );
61
- });
62
 
63
 
64
- $('#demo_grid').on('click', '.demo_col', function(){
65
- $('#demo_grid div').removeClass('active');
66
- $(this).addClass('active');
67
- var cw = $(this).find('.grid').text().split(' ')[1];
68
- var os = $(this).find('.offset').text().split(' ')[1];
69
- $('#col-width').val(cw);
70
- $('#col-offset').val(os);
71
 
72
- $('#col-edit').fadeIn();
73
 
74
- });
75
 
76
- $('#btn_insert').click(function(){
77
 
78
- var shortcodes = '[bs_row class="row"]';
79
- $('#demo_grid > div').each(function(){
80
- $(this).removeClass('demo_col active');
81
- var clss = $(this).attr('class');
82
- shortcodes+= '<br class="nc"/>[bs_col class="'+clss+'"]Text[/bs_col]';
83
 
 
 
 
 
84
  });
85
- shortcodes+= '<br class="nc"/>[/bs_row]';
86
- parent.tinymce.activeEditor.execCommand('mceInsertContent',false,shortcodes);
87
 
88
- parent.tb_remove();
89
  });
90
 
91
- });
92
- function append_grid(cols){
93
- if(isNaN(cols)||cols>12) return;
94
 
95
- $('#btn_insert, h5.preview').fadeIn();
96
 
97
- var basewidth = Math.floor(12/cols);
98
- var extrawidth = 12- (basewidth*cols);
99
- var offset = 0;
100
 
101
- $('#demo_grid').empty();
102
 
103
- for(i=0;i<cols;i++){
104
- var cwidth = (extrawidth>0)?1:0;
105
- $('#demo_grid').append('<div class="col-xs-'+(basewidth+cwidth)+' demo_col"><span class="grid">Grid '+(basewidth+cwidth)+'</span> <span class="offset">Offset '+offset+'</span><h5>Click to edit</h5></div>');
106
- extrawidth--;
 
107
  }
108
- }
 
109
  </script>
110
 
111
  </head>
@@ -116,10 +119,15 @@ function append_grid(cols){
116
  <div class="form-group">
117
  <label for="quantity" class="col-sm-4 control-label">Number of columns</label>
118
  <div class="col-sm-8">
119
- <input type="number" class="form-control"
120
- id="quantity" name="quantity"
121
- required pattern="\b([1-9]|1[0-2])\b" min="1"
122
- placeholder="Input number from 1 - 12">
 
 
 
 
 
123
  </div>
124
  </div>
125
  </form>
@@ -127,19 +135,31 @@ function append_grid(cols){
127
  <div class="form-group">
128
  <label for="col-width" class="col-sm-4 control-label">Grid</label>
129
  <div class="col-sm-8">
130
- <input type="number" class="form-control"
131
- id="col-width" name="col-width"
132
- value="1"
133
- required pattern="\b([1-9]|1[0-2])\b" min="1" max="12">
 
 
 
 
 
 
134
  </div>
135
  </div>
136
  <div class="form-group">
137
  <label for="col-offset" class="col-sm-4 control-label">Offset</label>
138
  <div class="col-sm-8">
139
- <input type="number" class="form-control"
140
- id="col-offset" name="col-offset"
141
- value="0"
142
- required pattern="\b([0-9]|1[0-1])\b" min="0" max="11">
 
 
 
 
 
 
143
  </div>
144
  </div>
145
  </form>
@@ -148,9 +168,9 @@ function append_grid(cols){
148
  <div id="demo_grid" class="row show-grid"></div>
149
 
150
  <div class="form-group">
151
- <button id="btn_insert" class="btn btn-primary" style="display: none;">Insert shortcode</button>
152
  </div>
153
  </div>
154
  </div>
155
  </body>
156
- </html>
1
+ <!doctype html>
2
+ <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <link rel="stylesheet" href="../../css/bootstrap.css" />
7
  <script type="text/javascript" src="../jquery.js"></script>
8
  <script type="text/javascript" src="../bootstrap.js"></script>
9
  <script type="text/javascript">
10
+ (function($) {
11
+ $(document).ready(function() {
12
+ $('#btn_insert, h5.preview').fadeOut();
13
+
14
+ setInterval(function() {
15
+ //Set popup's width
16
+ var pwidth = 800;
17
+ parent.jQuery('#TB_window,#TB_iframeContent').width(pwidth);
18
+ parent.jQuery('#TB_window').css('margin-left', -(pwidth / 2));
19
+ }, 100);
20
+
21
+ $('#frm_create').submit(function(e) {
22
+ e.preventDefault();
23
+ append_grid($('#quantity').val());
24
+ });
25
 
26
+ $('#quantity').bind('keyup change', function() {
27
+ var lastQuantity = $(this).data('lastQuantity');
28
+ var currentQuantity = $(this).val();
29
 
30
+ if (currentQuantity === lastQuantity) {
31
+ return 'no need to update'
32
+ } else {
33
+ $(this).data('lastQuantity', currentQuantity);
34
+ append_grid(currentQuantity);
35
+ }
36
+ });
37
 
38
+ $('#col-width').bind('change keyup', function() {
39
+ var $active = $('#demo_grid div.active');
40
+ var val = $(this).val();
41
+ if (isNaN(val) || val > 12 || val < 1) return;
42
+ var cw = $active.find('.grid').text().split(' ')[1];
43
 
44
+ $active.removeClass('col-xs-' + cw).addClass('col-xs-' + $(this).val());
45
+ $active.find('.grid').text('Grid ' + $(this).val());
46
+ });
47
 
48
+ $('#col-offset').bind('keyup change', function() {
49
 
50
+ var val = $(this).val();
51
+ if (isNaN(val) || val > 12 || val < 0) return;
52
 
53
+ var $active = $('#demo_grid div.active');
54
 
55
 
56
+ var cw = $active.find('.offset').text().split(' ')[1];
57
 
58
+ if (isNaN(cw) || cw > 12) return;
59
 
60
+ $active.removeClass('col-xs-offset-' + cw).addClass('col-xs-offset-' + $(this).val());
61
+ $active.find('.offset').text('Offset ' + $(this).val());
62
+ });
63
 
64
 
65
+ $('#demo_grid').on('click', '.demo_col', function() {
66
+ $('#demo_grid div').removeClass('active');
67
+ $(this).addClass('active');
68
+ var cw = $(this).find('.grid').text().split(' ')[1];
69
+ var os = $(this).find('.offset').text().split(' ')[1];
70
+ $('#col-width').val(cw);
71
+ $('#col-offset').val(os);
72
 
73
+ $('#col-edit').fadeIn();
74
 
75
+ });
76
 
77
+ $('#btn_insert').click(function() {
78
 
79
+ var shortcodes = '[bs_row class="row"]';
80
+ $('#demo_grid > div').each(function() {
81
+ $(this).removeClass('demo_col active');
82
+ var clss = $(this).attr('class');
83
+ shortcodes += '<br class="nc"/>[bs_col class="' + clss + '"]Text[/bs_col]';
84
 
85
+ });
86
+ shortcodes += '<br class="nc"/>[/bs_row]';
87
+ top.tinymce.activeEditor.execCommand('mceInsertContent', false, shortcodes);
88
+ top.tinymce.activeEditor.windowManager.close();
89
  });
 
 
90
 
 
91
  });
92
 
93
+ function append_grid(cols) {
94
+ if (isNaN(cols) || cols > 12) return;
 
95
 
96
+ $('#btn_insert, h5.preview').fadeIn();
97
 
98
+ var basewidth = Math.floor(12 / cols);
99
+ var extrawidth = 12 - (basewidth * cols);
100
+ var offset = 0;
101
 
102
+ $('#demo_grid').empty();
103
 
104
+ for (i = 0; i < cols; i++) {
105
+ var cwidth = (extrawidth > 0) ? 1 : 0;
106
+ $('#demo_grid').append('<div class="col-xs-' + (basewidth + cwidth) + ' demo_col"><span class="grid">Grid ' + (basewidth + cwidth) + '</span> <span class="offset">Offset ' + offset + '</span><h5>Click to edit</h5></div>');
107
+ extrawidth--;
108
+ }
109
  }
110
+ }(jQuery));
111
+
112
  </script>
113
 
114
  </head>
119
  <div class="form-group">
120
  <label for="quantity" class="col-sm-4 control-label">Number of columns</label>
121
  <div class="col-sm-8">
122
+ <input
123
+ id="quantity"
124
+ name="quantity"
125
+ type="number"
126
+ class="form-control"
127
+ required
128
+ pattern="\b([1-9]|1[0-2])\b"
129
+ min="1"
130
+ placeholder="Input number from 1 - 12">
131
  </div>
132
  </div>
133
  </form>
135
  <div class="form-group">
136
  <label for="col-width" class="col-sm-4 control-label">Grid</label>
137
  <div class="col-sm-8">
138
+ <input
139
+ id="col-width"
140
+ name="col-width"
141
+ type="number"
142
+ class="form-control"
143
+ value="1"
144
+ required
145
+ pattern="\b([1-9]|1[0-2])\b"
146
+ min="1"
147
+ max="12">
148
  </div>
149
  </div>
150
  <div class="form-group">
151
  <label for="col-offset" class="col-sm-4 control-label">Offset</label>
152
  <div class="col-sm-8">
153
+ <input
154
+ id="col-offset"
155
+ name="col-offset"
156
+ type="number"
157
+ class="form-control"
158
+ value="0"
159
+ required
160
+ pattern="\b([0-9]|1[0-1])\b"
161
+ min="0"
162
+ max="11">
163
  </div>
164
  </div>
165
  </form>
168
  <div id="demo_grid" class="row show-grid"></div>
169
 
170
  <div class="form-group">
171
+ <button id="btn_insert" class="btn btn-primary" style="display: none;">Insert</button>
172
  </div>
173
  </div>
174
  </div>
175
  </body>
176
+ </html>
js/plugins/grid.js CHANGED
@@ -1,49 +1,26 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_grid', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_grid':
8
- var c = cm.createSplitButton('bs_grid', {
9
- title : 'Grid',
10
- onclick : function() {
11
- }
12
- });
13
-
14
- c.onRenderMenu.add(function(c, m) {
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');
37
- }});
38
-
39
- });
40
-
41
- // Return the new splitbutton instance
42
- return c;
43
-
44
  }
45
- return null;
46
- }
47
  });
48
- tinymce.PluginManager.add('bs_grid', tinymce.plugins.bs_grid);
49
- })();
1
+ tinymce.PluginManager.add('bs_grid', function(editor, url) {
2
+ editor.addButton('bs_grid', {
3
+ type: 'menubutton',
4
+ tooltip: 'Grid',
5
+ icon: 'bs-grid',
6
+ menu: [
7
+ { text: '12 Columns', onclick: function() { editor.insertContent('[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]'); } },
8
+ { text: '6 Columns', onclick: function() { editor.insertContent('[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]'); } },
9
+ { text: '4 Columns', onclick: function() { editor.insertContent('[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]'); } },
10
+ { text: '3 Columns', onclick: function() { editor.insertContent('[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]'); } },
11
+ { text: '2 Columns', onclick: function() { editor.insertContent('[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]'); } },
12
+ { text: '1 Columns', onclick: function() { editor.insertContent('[bs_row class="row"]<br class="nc"/>[bs_col class="col-xs-12"]Text[/bs_col]<br class="nc"/>[/bs_row]'); } },
13
+ {
14
+ text: 'Custom Grid',
15
+ onclick: function() {
16
+ tinymce.activeEditor.windowManager.open({
17
+ title: 'Custom Grid',
18
+ url: url + '/grid.html',
19
+ width: 580,
20
+ height: 420
21
+ });
22
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
+ ]
 
25
  });
26
+ });
 
js/plugins/icons.html CHANGED
@@ -1,6 +1,5 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
-
4
  <head>
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
  <link rel="stylesheet" href="../../css/bootstrap.css" />
@@ -8,16 +7,14 @@
8
  <script type="text/javascript" src="../jquery.js"></script>
9
  <script type="text/javascript" src="../bootstrap.js"></script>
10
  <script type="text/javascript">
11
- (function($) {
12
- $(document).ready(function() {
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
  });
20
- }(jQuery));
21
  </script>
22
  <style type="text/css">
23
  .glyphicons {
@@ -47,406 +44,206 @@
47
  <body>
48
  <div id="bs-wrapper">
49
  <ul class="glyphicons">
50
- <li>
51
- <span class="glyphicon glyphicon-adjust"></span>adjust</li>
52
- <li>
53
- <span class="glyphicon glyphicon-align-center"></span>align-center</li>
54
- <li>
55
- <span class="glyphicon glyphicon-align-justify"></span>align-justify</li>
56
- <li>
57
- <span class="glyphicon glyphicon-align-left"></span>align-left</li>
58
- <li>
59
- <span class="glyphicon glyphicon-align-right"></span>align-right</li>
60
- <li>
61
- <span class="glyphicon glyphicon-arrow-down"></span>arrow-down</li>
62
- <li>
63
- <span class="glyphicon glyphicon-arrow-left"></span>arrow-left</li>
64
- <li>
65
- <span class="glyphicon glyphicon-arrow-right"></span>arrow-right</li>
66
- <li>
67
- <span class="glyphicon glyphicon-arrow-up"></span>arrow-up</li>
68
- <li>
69
- <span class="glyphicon glyphicon-asterisk"></span>asterisk</li>
70
- <li>
71
- <span class="glyphicon glyphicon-backward"></span>backward</li>
72
- <li>
73
- <span class="glyphicon glyphicon-ban-circle"></span>ban-circle</li>
74
- <li>
75
- <span class="glyphicon glyphicon-barcode"></span>barcode</li>
76
- <li>
77
- <span class="glyphicon glyphicon-bell"></span>bell</li>
78
- <li>
79
- <span class="glyphicon glyphicon-bold"></span>bold</li>
80
- <li>
81
- <span class="glyphicon glyphicon-book"></span>book</li>
82
- <li>
83
- <span class="glyphicon glyphicon-bookmark"></span>bookmark</li>
84
- <li>
85
- <span class="glyphicon glyphicon-briefcase"></span>briefcase</li>
86
- <li>
87
- <span class="glyphicon glyphicon-bullhorn"></span>bullhorn</li>
88
- <li>
89
- <span class="glyphicon glyphicon-calendar"></span>calendar</li>
90
- <li>
91
- <span class="glyphicon glyphicon-camera"></span>camera</li>
92
- <li>
93
- <span class="glyphicon glyphicon-certificate"></span>certificate</li>
94
- <li>
95
- <span class="glyphicon glyphicon-check"></span>check</li>
96
- <li>
97
- <span class="glyphicon glyphicon-chevron-down"></span>chevron-down</li>
98
- <li>
99
- <span class="glyphicon glyphicon-chevron-left"></span>chevron-left</li>
100
- <li>
101
- <span class="glyphicon glyphicon-chevron-right"></span>chevron-right</li>
102
- <li>
103
- <span class="glyphicon glyphicon-chevron-up"></span>chevron-up</li>
104
- <li>
105
- <span class="glyphicon glyphicon-circle-arrow-down"></span>circle-arrow-down</li>
106
- <li>
107
- <span class="glyphicon glyphicon-circle-arrow-left"></span>circle-arrow-left</li>
108
- <li>
109
- <span class="glyphicon glyphicon-circle-arrow-right"></span>circle-arrow-right</li>
110
- <li>
111
- <span class="glyphicon glyphicon-circle-arrow-up"></span>circle-arrow-up</li>
112
- <li>
113
- <span class="glyphicon glyphicon-cloud"></span>cloud</li>
114
- <li>
115
- <span class="glyphicon glyphicon-cloud-download"></span>cloud-download</li>
116
- <li>
117
- <span class="glyphicon glyphicon-cloud-upload"></span>cloud-upload</li>
118
- <li>
119
- <span class="glyphicon glyphicon-cog"></span>cog</li>
120
- <li>
121
- <span class="glyphicon glyphicon-collapse-down"></span>collapse-down</li>
122
- <li>
123
- <span class="glyphicon glyphicon-collapse-up"></span>collapse-up</li>
124
- <li>
125
- <span class="glyphicon glyphicon-comment"></span>comment</li>
126
- <li>
127
- <span class="glyphicon glyphicon-compressed"></span>compressed</li>
128
- <li>
129
- <span class="glyphicon glyphicon-copyright-mark"></span>copyright-mark</li>
130
- <li>
131
- <span class="glyphicon glyphicon-credit-card"></span>credit-card</li>
132
- <li>
133
- <span class="glyphicon glyphicon-cutlery"></span>cutlery</li>
134
- <li>
135
- <span class="glyphicon glyphicon-dashboard"></span>dashboard</li>
136
- <li>
137
- <span class="glyphicon glyphicon-download"></span>download</li>
138
- <li>
139
- <span class="glyphicon glyphicon-download-alt"></span>download-alt</li>
140
- <li>
141
- <span class="glyphicon glyphicon-earphone"></span>earphone</li>
142
- <li>
143
- <span class="glyphicon glyphicon-edit"></span>edit</li>
144
- <li>
145
- <span class="glyphicon glyphicon-eject"></span>eject</li>
146
- <li>
147
- <span class="glyphicon glyphicon-envelope"></span>envelope</li>
148
- <li>
149
- <span class="glyphicon glyphicon-euro"></span>euro</li>
150
- <li>
151
- <span class="glyphicon glyphicon-exclamation-sign"></span>exclamation-sign</li>
152
- <li>
153
- <span class="glyphicon glyphicon-expand"></span>expand</li>
154
- <li>
155
- <span class="glyphicon glyphicon-export"></span>export</li>
156
- <li>
157
- <span class="glyphicon glyphicon-eye-close"></span>eye-close</li>
158
- <li>
159
- <span class="glyphicon glyphicon-eye-open"></span>eye-open</li>
160
- <li>
161
- <span class="glyphicon glyphicon-facetime-video"></span>facetime-video</li>
162
- <li>
163
- <span class="glyphicon glyphicon-fast-backward"></span>fast-backward</li>
164
- <li>
165
- <span class="glyphicon glyphicon-fast-forward"></span>fast-forward</li>
166
- <li>
167
- <span class="glyphicon glyphicon-file"></span>file</li>
168
- <li>
169
- <span class="glyphicon glyphicon-film"></span>film</li>
170
- <li>
171
- <span class="glyphicon glyphicon-filter"></span>filter</li>
172
- <li>
173
- <span class="glyphicon glyphicon-fire"></span>fire</li>
174
- <li>
175
- <span class="glyphicon glyphicon-flag"></span>flag</li>
176
- <li>
177
- <span class="glyphicon glyphicon-flash"></span>flash</li>
178
- <li>
179
- <span class="glyphicon glyphicon-floppy-disk"></span>floppy-disk</li>
180
- <li>
181
- <span class="glyphicon glyphicon-floppy-open"></span>floppy-open</li>
182
- <li>
183
- <span class="glyphicon glyphicon-floppy-remove"></span>floppy-remove</li>
184
- <li>
185
- <span class="glyphicon glyphicon-floppy-save"></span>floppy-save</li>
186
- <li>
187
- <span class="glyphicon glyphicon-floppy-saved"></span>floppy-saved</li>
188
- <li>
189
- <span class="glyphicon glyphicon-folder-close"></span>folder-close</li>
190
- <li>
191
- <span class="glyphicon glyphicon-folder-open"></span>folder-open</li>
192
- <li>
193
- <span class="glyphicon glyphicon-font"></span>font</li>
194
- <li>
195
- <span class="glyphicon glyphicon-forward"></span>forward</li>
196
- <li>
197
- <span class="glyphicon glyphicon-fullscreen"></span>fullscreen</li>
198
- <li>
199
- <span class="glyphicon glyphicon-gbp"></span>gbp</li>
200
- <li>
201
- <span class="glyphicon glyphicon-gift"></span>gift</li>
202
- <li>
203
- <span class="glyphicon glyphicon-glass"></span>glass</li>
204
- <li>
205
- <span class="glyphicon glyphicon-globe"></span>globe</li>
206
- <li>
207
- <span class="glyphicon glyphicon-hand-down"></span>hand-down</li>
208
- <li>
209
- <span class="glyphicon glyphicon-hand-left"></span>hand-left</li>
210
- <li>
211
- <span class="glyphicon glyphicon-hand-right"></span>hand-right</li>
212
- <li>
213
- <span class="glyphicon glyphicon-hand-up"></span>hand-up</li>
214
- <li>
215
- <span class="glyphicon glyphicon-hd-video"></span>hd-video</li>
216
- <li>
217
- <span class="glyphicon glyphicon-hdd"></span>hdd</li>
218
- <li>
219
- <span class="glyphicon glyphicon-header"></span>header</li>
220
- <li>
221
- <span class="glyphicon glyphicon-headphones"></span>headphones</li>
222
- <li>
223
- <span class="glyphicon glyphicon-heart"></span>heart</li>
224
- <li>
225
- <span class="glyphicon glyphicon-heart-empty"></span>heart-empty</li>
226
- <li>
227
- <span class="glyphicon glyphicon-home"></span>home</li>
228
- <li>
229
- <span class="glyphicon glyphicon-import"></span>import</li>
230
- <li>
231
- <span class="glyphicon glyphicon-inbox"></span>inbox</li>
232
- <li>
233
- <span class="glyphicon glyphicon-indent-left"></span>indent-left</li>
234
- <li>
235
- <span class="glyphicon glyphicon-indent-right"></span>indent-right</li>
236
- <li>
237
- <span class="glyphicon glyphicon-info-sign"></span>info-sign</li>
238
- <li>
239
- <span class="glyphicon glyphicon-italic"></span>italic</li>
240
- <li>
241
- <span class="glyphicon glyphicon-leaf"></span>leaf</li>
242
- <li>
243
- <span class="glyphicon glyphicon-link"></span>link</li>
244
- <li>
245
- <span class="glyphicon glyphicon-list"></span>list</li>
246
- <li>
247
- <span class="glyphicon glyphicon-list-alt"></span>list-alt</li>
248
- <li>
249
- <span class="glyphicon glyphicon-lock"></span>lock</li>
250
- <li>
251
- <span class="glyphicon glyphicon-log-in"></span>log-in</li>
252
- <li>
253
- <span class="glyphicon glyphicon-log-out"></span>log-out</li>
254
- <li>
255
- <span class="glyphicon glyphicon-magnet"></span>magnet</li>
256
- <li>
257
- <span class="glyphicon glyphicon-map-marker"></span>map-marker</li>
258
- <li>
259
- <span class="glyphicon glyphicon-minus"></span>minus</li>
260
- <li>
261
- <span class="glyphicon glyphicon-minus-sign"></span>minus-sign</li>
262
- <li>
263
- <span class="glyphicon glyphicon-move"></span>move</li>
264
- <li>
265
- <span class="glyphicon glyphicon-music"></span>music</li>
266
- <li>
267
- <span class="glyphicon glyphicon-new-window"></span>new-window</li>
268
- <li>
269
- <span class="glyphicon glyphicon-off"></span>off</li>
270
- <li>
271
- <span class="glyphicon glyphicon-ok"></span>ok</li>
272
- <li>
273
- <span class="glyphicon glyphicon-ok-circle"></span>ok-circle</li>
274
- <li>
275
- <span class="glyphicon glyphicon-ok-sign"></span>ok-sign</li>
276
- <li>
277
- <span class="glyphicon glyphicon-open"></span>open</li>
278
- <li>
279
- <span class="glyphicon glyphicon-paperclip"></span>paperclip</li>
280
- <li>
281
- <span class="glyphicon glyphicon-pause"></span>pause</li>
282
- <li>
283
- <span class="glyphicon glyphicon-pencil"></span>pencil</li>
284
- <li>
285
- <span class="glyphicon glyphicon-phone"></span>phone</li>
286
- <li>
287
- <span class="glyphicon glyphicon-phone-alt"></span>phone-alt</li>
288
- <li>
289
- <span class="glyphicon glyphicon-picture"></span>picture</li>
290
- <li>
291
- <span class="glyphicon glyphicon-plane"></span>plane</li>
292
- <li>
293
- <span class="glyphicon glyphicon-play"></span>play</li>
294
- <li>
295
- <span class="glyphicon glyphicon-play-circle"></span>play-circle</li>
296
- <li>
297
- <span class="glyphicon glyphicon-plus"></span>plus</li>
298
- <li>
299
- <span class="glyphicon glyphicon-plus-sign"></span>plus-sign</li>
300
- <li>
301
- <span class="glyphicon glyphicon-print"></span>print</li>
302
- <li>
303
- <span class="glyphicon glyphicon-pushpin"></span>pushpin</li>
304
- <li>
305
- <span class="glyphicon glyphicon-qrcode"></span>qrcode</li>
306
- <li>
307
- <span class="glyphicon glyphicon-question-sign"></span>question-sign</li>
308
- <li>
309
- <span class="glyphicon glyphicon-random"></span>random</li>
310
- <li>
311
- <span class="glyphicon glyphicon-record"></span>record</li>
312
- <li>
313
- <span class="glyphicon glyphicon-refresh"></span>refresh</li>
314
- <li>
315
- <span class="glyphicon glyphicon-registration-mark"></span>registration-mark</li>
316
- <li>
317
- <span class="glyphicon glyphicon-remove"></span>remove</li>
318
- <li>
319
- <span class="glyphicon glyphicon-remove-circle"></span>remove-circle</li>
320
- <li>
321
- <span class="glyphicon glyphicon-remove-sign"></span>remove-sign</li>
322
- <li>
323
- <span class="glyphicon glyphicon-repeat"></span>repeat</li>
324
- <li>
325
- <span class="glyphicon glyphicon-resize-full"></span>resize-full</li>
326
- <li>
327
- <span class="glyphicon glyphicon-resize-horizontal"></span>resize-horizontal</li>
328
- <li>
329
- <span class="glyphicon glyphicon-resize-small"></span>resize-small</li>
330
- <li>
331
- <span class="glyphicon glyphicon-resize-vertical"></span>resize-vertical</li>
332
- <li>
333
- <span class="glyphicon glyphicon-retweet"></span>retweet</li>
334
- <li>
335
- <span class="glyphicon glyphicon-road"></span>road</li>
336
- <li>
337
- <span class="glyphicon glyphicon-save"></span>save</li>
338
- <li>
339
- <span class="glyphicon glyphicon-saved"></span>saved</li>
340
- <li>
341
- <span class="glyphicon glyphicon-screenshot"></span>screenshot</li>
342
- <li>
343
- <span class="glyphicon glyphicon-sd-video"></span>sd-video</li>
344
- <li>
345
- <span class="glyphicon glyphicon-search"></span>search</li>
346
- <li>
347
- <span class="glyphicon glyphicon-send"></span>send</li>
348
- <li>
349
- <span class="glyphicon glyphicon-share"></span>share</li>
350
- <li>
351
- <span class="glyphicon glyphicon-share-alt"></span>share-alt</li>
352
- <li>
353
- <span class="glyphicon glyphicon-shopping-cart"></span>shopping-cart</li>
354
- <li>
355
- <span class="glyphicon glyphicon-signal"></span>signal</li>
356
- <li>
357
- <span class="glyphicon glyphicon-sort"></span>sort</li>
358
- <li>
359
- <span class="glyphicon glyphicon-sort-by-alphabet"></span>sort-by-alphabet</li>
360
- <li>
361
- <span class="glyphicon glyphicon-sort-by-alphabet-alt"></span>sort-by-alphabet-alt</li>
362
- <li>
363
- <span class="glyphicon glyphicon-sort-by-attributes"></span>sort-by-attributes</li>
364
- <li>
365
- <span class="glyphicon glyphicon-sort-by-attributes-alt"></span>sort-by-attributes-alt</li>
366
- <li>
367
- <span class="glyphicon glyphicon-sort-by-order"></span>sort-by-order</li>
368
- <li>
369
- <span class="glyphicon glyphicon-sort-by-order-alt"></span>sort-by-order-alt</li>
370
- <li>
371
- <span class="glyphicon glyphicon-sound-5-1"></span>sound-5-1</li>
372
- <li>
373
- <span class="glyphicon glyphicon-sound-6-1"></span>sound-6-1</li>
374
- <li>
375
- <span class="glyphicon glyphicon-sound-7-1"></span>sound-7-1</li>
376
- <li>
377
- <span class="glyphicon glyphicon-sound-dolby"></span>sound-dolby</li>
378
- <li>
379
- <span class="glyphicon glyphicon-sound-stereo"></span>sound-stereo</li>
380
- <li>
381
- <span class="glyphicon glyphicon-star"></span>star</li>
382
- <li>
383
- <span class="glyphicon glyphicon-star-empty"></span>star-empty</li>
384
- <li>
385
- <span class="glyphicon glyphicon-stats"></span>stats</li>
386
- <li>
387
- <span class="glyphicon glyphicon-step-backward"></span>step-backward</li>
388
- <li>
389
- <span class="glyphicon glyphicon-step-forward"></span>step-forward</li>
390
- <li>
391
- <span class="glyphicon glyphicon-stop"></span>stop</li>
392
- <li>
393
- <span class="glyphicon glyphicon-subtitles"></span>subtitles</li>
394
- <li>
395
- <span class="glyphicon glyphicon-tag"></span>tag</li>
396
- <li>
397
- <span class="glyphicon glyphicon-tags"></span>tags</li>
398
- <li>
399
- <span class="glyphicon glyphicon-tasks"></span>tasks</li>
400
- <li>
401
- <span class="glyphicon glyphicon-text-height"></span>text-height</li>
402
- <li>
403
- <span class="glyphicon glyphicon-text-width"></span>text-width</li>
404
- <li>
405
- <span class="glyphicon glyphicon-th"></span>th</li>
406
- <li>
407
- <span class="glyphicon glyphicon-th-large"></span>th-large</li>
408
- <li>
409
- <span class="glyphicon glyphicon-th-list"></span>th-list</li>
410
- <li>
411
- <span class="glyphicon glyphicon-thumbs-down"></span>thumbs-down</li>
412
- <li>
413
- <span class="glyphicon glyphicon-thumbs-up"></span>thumbs-up</li>
414
- <li>
415
- <span class="glyphicon glyphicon-time"></span>time</li>
416
- <li>
417
- <span class="glyphicon glyphicon-tint"></span>tint</li>
418
- <li>
419
- <span class="glyphicon glyphicon-tower"></span>tower</li>
420
- <li>
421
- <span class="glyphicon glyphicon-transfer"></span>transfer</li>
422
- <li>
423
- <span class="glyphicon glyphicon-trash"></span>trash</li>
424
- <li>
425
- <span class="glyphicon glyphicon-tree-conifer"></span>tree-conifer</li>
426
- <li>
427
- <span class="glyphicon glyphicon-tree-deciduous"></span>tree-deciduous</li>
428
- <li>
429
- <span class="glyphicon glyphicon-unchecked"></span>unchecked</li>
430
- <li>
431
- <span class="glyphicon glyphicon-upload"></span>upload</li>
432
- <li>
433
- <span class="glyphicon glyphicon-usd"></span>usd</li>
434
- <li>
435
- <span class="glyphicon glyphicon-user"></span>user</li>
436
- <li>
437
- <span class="glyphicon glyphicon-volume-down"></span>volume-down</li>
438
- <li>
439
- <span class="glyphicon glyphicon-volume-off"></span>volume-off</li>
440
- <li>
441
- <span class="glyphicon glyphicon-volume-up"></span>volume-up</li>
442
- <li>
443
- <span class="glyphicon glyphicon-warning-sign"></span>warning-sign</li>
444
- <li>
445
- <span class="glyphicon glyphicon-wrench"></span>wrench</li>
446
- <li>
447
- <span class="glyphicon glyphicon-zoom-in"></span>zoom-in</li>
448
- <li>
449
- <span class="glyphicon glyphicon-zoom-out"></span>zoom-out</li>
450
  </ul>
451
  </div>
452
  </body>
1
+ <!doctype html>
2
+ <html>
 
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <link rel="stylesheet" href="../../css/bootstrap.css" />
7
  <script type="text/javascript" src="../jquery.js"></script>
8
  <script type="text/javascript" src="../bootstrap.js"></script>
9
  <script type="text/javascript">
10
+ $(document).ready(function() {
11
+ $('.glyphicons').on('click', 'li', function() {
12
+ var iclass = $(this).find('.glyphicon').attr('class');
 
13
 
14
+ top.tinymce.activeEditor.execCommand('mceInsertContent', false, '[bs_icon name="' + iclass + '"]');
15
+ top.tinymce.activeEditor.windowManager.close();
 
16
  });
17
+ });
18
  </script>
19
  <style type="text/css">
20
  .glyphicons {
44
  <body>
45
  <div id="bs-wrapper">
46
  <ul class="glyphicons">
47
+ <li><span class="glyphicon glyphicon-adjust"></span>adjust</li>
48
+ <li><span class="glyphicon glyphicon-align-center"></span>align-center</li>
49
+ <li><span class="glyphicon glyphicon-align-justify"></span>align-justify</li>
50
+ <li><span class="glyphicon glyphicon-align-left"></span>align-left</li>
51
+ <li><span class="glyphicon glyphicon-align-right"></span>align-right</li>
52
+ <li><span class="glyphicon glyphicon-arrow-down"></span>arrow-down</li>
53
+ <li><span class="glyphicon glyphicon-arrow-left"></span>arrow-left</li>
54
+ <li><span class="glyphicon glyphicon-arrow-right"></span>arrow-right</li>
55
+ <li><span class="glyphicon glyphicon-arrow-up"></span>arrow-up</li>
56
+ <li><span class="glyphicon glyphicon-asterisk"></span>asterisk</li>
57
+ <li><span class="glyphicon glyphicon-backward"></span>backward</li>
58
+ <li><span class="glyphicon glyphicon-ban-circle"></span>ban-circle</li>
59
+ <li><span class="glyphicon glyphicon-barcode"></span>barcode</li>
60
+ <li><span class="glyphicon glyphicon-bell"></span>bell</li>
61
+ <li><span class="glyphicon glyphicon-bold"></span>bold</li>
62
+ <li><span class="glyphicon glyphicon-book"></span>book</li>
63
+ <li><span class="glyphicon glyphicon-bookmark"></span>bookmark</li>
64
+ <li><span class="glyphicon glyphicon-briefcase"></span>briefcase</li>
65
+ <li><span class="glyphicon glyphicon-bullhorn"></span>bullhorn</li>
66
+ <li><span class="glyphicon glyphicon-calendar"></span>calendar</li>
67
+ <li><span class="glyphicon glyphicon-camera"></span>camera</li>
68
+ <li><span class="glyphicon glyphicon-certificate"></span>certificate</li>
69
+ <li><span class="glyphicon glyphicon-check"></span>check</li>
70
+ <li><span class="glyphicon glyphicon-chevron-down"></span>chevron-down</li>
71
+ <li><span class="glyphicon glyphicon-chevron-left"></span>chevron-left</li>
72
+ <li><span class="glyphicon glyphicon-chevron-right"></span>chevron-right</li>
73
+ <li><span class="glyphicon glyphicon-chevron-up"></span>chevron-up</li>
74
+ <li><span class="glyphicon glyphicon-circle-arrow-down"></span>circle-arrow-down</li>
75
+ <li><span class="glyphicon glyphicon-circle-arrow-left"></span>circle-arrow-left</li>
76
+ <li><span class="glyphicon glyphicon-circle-arrow-right"></span>circle-arrow-right</li>
77
+ <li><span class="glyphicon glyphicon-circle-arrow-up"></span>circle-arrow-up</li>
78
+ <li><span class="glyphicon glyphicon-cloud"></span>cloud</li>
79
+ <li><span class="glyphicon glyphicon-cloud-download"></span>cloud-download</li>
80
+ <li><span class="glyphicon glyphicon-cloud-upload"></span>cloud-upload</li>
81
+ <li><span class="glyphicon glyphicon-cog"></span>cog</li>
82
+ <li><span class="glyphicon glyphicon-collapse-down"></span>collapse-down</li>
83
+ <li><span class="glyphicon glyphicon-collapse-up"></span>collapse-up</li>
84
+ <li><span class="glyphicon glyphicon-comment"></span>comment</li>
85
+ <li><span class="glyphicon glyphicon-compressed"></span>compressed</li>
86
+ <li><span class="glyphicon glyphicon-copyright-mark"></span>copyright-mark</li>
87
+ <li><span class="glyphicon glyphicon-credit-card"></span>credit-card</li>
88
+ <li><span class="glyphicon glyphicon-cutlery"></span>cutlery</li>
89
+ <li><span class="glyphicon glyphicon-dashboard"></span>dashboard</li>
90
+ <li><span class="glyphicon glyphicon-download"></span>download</li>
91
+ <li><span class="glyphicon glyphicon-download-alt"></span>download-alt</li>
92
+ <li><span class="glyphicon glyphicon-earphone"></span>earphone</li>
93
+ <li><span class="glyphicon glyphicon-edit"></span>edit</li>
94
+ <li><span class="glyphicon glyphicon-eject"></span>eject</li>
95
+ <li><span class="glyphicon glyphicon-envelope"></span>envelope</li>
96
+ <li><span class="glyphicon glyphicon-euro"></span>euro</li>
97
+ <li><span class="glyphicon glyphicon-exclamation-sign"></span>exclamation-sign</li>
98
+ <li><span class="glyphicon glyphicon-expand"></span>expand</li>
99
+ <li><span class="glyphicon glyphicon-export"></span>export</li>
100
+ <li><span class="glyphicon glyphicon-eye-close"></span>eye-close</li>
101
+ <li><span class="glyphicon glyphicon-eye-open"></span>eye-open</li>
102
+ <li><span class="glyphicon glyphicon-facetime-video"></span>facetime-video</li>
103
+ <li><span class="glyphicon glyphicon-fast-backward"></span>fast-backward</li>
104
+ <li><span class="glyphicon glyphicon-fast-forward"></span>fast-forward</li>
105
+ <li><span class="glyphicon glyphicon-file"></span>file</li>
106
+ <li><span class="glyphicon glyphicon-film"></span>film</li>
107
+ <li><span class="glyphicon glyphicon-filter"></span>filter</li>
108
+ <li><span class="glyphicon glyphicon-fire"></span>fire</li>
109
+ <li><span class="glyphicon glyphicon-flag"></span>flag</li>
110
+ <li><span class="glyphicon glyphicon-flash"></span>flash</li>
111
+ <li><span class="glyphicon glyphicon-floppy-disk"></span>floppy-disk</li>
112
+ <li><span class="glyphicon glyphicon-floppy-open"></span>floppy-open</li>
113
+ <li><span class="glyphicon glyphicon-floppy-remove"></span>floppy-remove</li>
114
+ <li><span class="glyphicon glyphicon-floppy-save"></span>floppy-save</li>
115
+ <li><span class="glyphicon glyphicon-floppy-saved"></span>floppy-saved</li>
116
+ <li><span class="glyphicon glyphicon-folder-close"></span>folder-close</li>
117
+ <li><span class="glyphicon glyphicon-folder-open"></span>folder-open</li>
118
+ <li><span class="glyphicon glyphicon-font"></span>font</li>
119
+ <li><span class="glyphicon glyphicon-forward"></span>forward</li>
120
+ <li><span class="glyphicon glyphicon-fullscreen"></span>fullscreen</li>
121
+ <li><span class="glyphicon glyphicon-gbp"></span>gbp</li>
122
+ <li><span class="glyphicon glyphicon-gift"></span>gift</li>
123
+ <li><span class="glyphicon glyphicon-glass"></span>glass</li>
124
+ <li><span class="glyphicon glyphicon-globe"></span>globe</li>
125
+ <li><span class="glyphicon glyphicon-hand-down"></span>hand-down</li>
126
+ <li><span class="glyphicon glyphicon-hand-left"></span>hand-left</li>
127
+ <li><span class="glyphicon glyphicon-hand-right"></span>hand-right</li>
128
+ <li><span class="glyphicon glyphicon-hand-up"></span>hand-up</li>
129
+ <li><span class="glyphicon glyphicon-hd-video"></span>hd-video</li>
130
+ <li><span class="glyphicon glyphicon-hdd"></span>hdd</li>
131
+ <li><span class="glyphicon glyphicon-header"></span>header</li>
132
+ <li><span class="glyphicon glyphicon-headphones"></span>headphones</li>
133
+ <li><span class="glyphicon glyphicon-heart"></span>heart</li>
134
+ <li><span class="glyphicon glyphicon-heart-empty"></span>heart-empty</li>
135
+ <li><span class="glyphicon glyphicon-home"></span>home</li>
136
+ <li><span class="glyphicon glyphicon-import"></span>import</li>
137
+ <li><span class="glyphicon glyphicon-inbox"></span>inbox</li>
138
+ <li><span class="glyphicon glyphicon-indent-left"></span>indent-left</li>
139
+ <li><span class="glyphicon glyphicon-indent-right"></span>indent-right</li>
140
+ <li><span class="glyphicon glyphicon-info-sign"></span>info-sign</li>
141
+ <li><span class="glyphicon glyphicon-italic"></span>italic</li>
142
+ <li><span class="glyphicon glyphicon-leaf"></span>leaf</li>
143
+ <li><span class="glyphicon glyphicon-link"></span>link</li>
144
+ <li><span class="glyphicon glyphicon-list"></span>list</li>
145
+ <li><span class="glyphicon glyphicon-list-alt"></span>list-alt</li>
146
+ <li><span class="glyphicon glyphicon-lock"></span>lock</li>
147
+ <li><span class="glyphicon glyphicon-log-in"></span>log-in</li>
148
+ <li><span class="glyphicon glyphicon-log-out"></span>log-out</li>
149
+ <li><span class="glyphicon glyphicon-magnet"></span>magnet</li>
150
+ <li><span class="glyphicon glyphicon-map-marker"></span>map-marker</li>
151
+ <li><span class="glyphicon glyphicon-minus"></span>minus</li>
152
+ <li><span class="glyphicon glyphicon-minus-sign"></span>minus-sign</li>
153
+ <li><span class="glyphicon glyphicon-move"></span>move</li>
154
+ <li><span class="glyphicon glyphicon-music"></span>music</li>
155
+ <li><span class="glyphicon glyphicon-new-window"></span>new-window</li>
156
+ <li><span class="glyphicon glyphicon-off"></span>off</li>
157
+ <li><span class="glyphicon glyphicon-ok"></span>ok</li>
158
+ <li><span class="glyphicon glyphicon-ok-circle"></span>ok-circle</li>
159
+ <li><span class="glyphicon glyphicon-ok-sign"></span>ok-sign</li>
160
+ <li><span class="glyphicon glyphicon-open"></span>open</li>
161
+ <li><span class="glyphicon glyphicon-paperclip"></span>paperclip</li>
162
+ <li><span class="glyphicon glyphicon-pause"></span>pause</li>
163
+ <li><span class="glyphicon glyphicon-pencil"></span>pencil</li>
164
+ <li><span class="glyphicon glyphicon-phone"></span>phone</li>
165
+ <li><span class="glyphicon glyphicon-phone-alt"></span>phone-alt</li>
166
+ <li><span class="glyphicon glyphicon-picture"></span>picture</li>
167
+ <li><span class="glyphicon glyphicon-plane"></span>plane</li>
168
+ <li><span class="glyphicon glyphicon-play"></span>play</li>
169
+ <li><span class="glyphicon glyphicon-play-circle"></span>play-circle</li>
170
+ <li><span class="glyphicon glyphicon-plus"></span>plus</li>
171
+ <li><span class="glyphicon glyphicon-plus-sign"></span>plus-sign</li>
172
+ <li><span class="glyphicon glyphicon-print"></span>print</li>
173
+ <li><span class="glyphicon glyphicon-pushpin"></span>pushpin</li>
174
+ <li><span class="glyphicon glyphicon-qrcode"></span>qrcode</li>
175
+ <li><span class="glyphicon glyphicon-question-sign"></span>question-sign</li>
176
+ <li><span class="glyphicon glyphicon-random"></span>random</li>
177
+ <li><span class="glyphicon glyphicon-record"></span>record</li>
178
+ <li><span class="glyphicon glyphicon-refresh"></span>refresh</li>
179
+ <li><span class="glyphicon glyphicon-registration-mark"></span>registration-mark</li>
180
+ <li><span class="glyphicon glyphicon-remove"></span>remove</li>
181
+ <li><span class="glyphicon glyphicon-remove-circle"></span>remove-circle</li>
182
+ <li><span class="glyphicon glyphicon-remove-sign"></span>remove-sign</li>
183
+ <li><span class="glyphicon glyphicon-repeat"></span>repeat</li>
184
+ <li><span class="glyphicon glyphicon-resize-full"></span>resize-full</li>
185
+ <li><span class="glyphicon glyphicon-resize-horizontal"></span>resize-horizontal</li>
186
+ <li><span class="glyphicon glyphicon-resize-small"></span>resize-small</li>
187
+ <li><span class="glyphicon glyphicon-resize-vertical"></span>resize-vertical</li>
188
+ <li><span class="glyphicon glyphicon-retweet"></span>retweet</li>
189
+ <li><span class="glyphicon glyphicon-road"></span>road</li>
190
+ <li><span class="glyphicon glyphicon-save"></span>save</li>
191
+ <li><span class="glyphicon glyphicon-saved"></span>saved</li>
192
+ <li><span class="glyphicon glyphicon-screenshot"></span>screenshot</li>
193
+ <li><span class="glyphicon glyphicon-sd-video"></span>sd-video</li>
194
+ <li><span class="glyphicon glyphicon-search"></span>search</li>
195
+ <li><span class="glyphicon glyphicon-send"></span>send</li>
196
+ <li><span class="glyphicon glyphicon-share"></span>share</li>
197
+ <li><span class="glyphicon glyphicon-share-alt"></span>share-alt</li>
198
+ <li><span class="glyphicon glyphicon-shopping-cart"></span>shopping-cart</li>
199
+ <li><span class="glyphicon glyphicon-signal"></span>signal</li>
200
+ <li><span class="glyphicon glyphicon-sort"></span>sort</li>
201
+ <li><span class="glyphicon glyphicon-sort-by-alphabet"></span>sort-by-alphabet</li>
202
+ <li><span class="glyphicon glyphicon-sort-by-alphabet-alt"></span>sort-by-alphabet-alt</li>
203
+ <li><span class="glyphicon glyphicon-sort-by-attributes"></span>sort-by-attributes</li>
204
+ <li><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>sort-by-attributes-alt</li>
205
+ <li><span class="glyphicon glyphicon-sort-by-order"></span>sort-by-order</li>
206
+ <li><span class="glyphicon glyphicon-sort-by-order-alt"></span>sort-by-order-alt</li>
207
+ <li><span class="glyphicon glyphicon-sound-5-1"></span>sound-5-1</li>
208
+ <li><span class="glyphicon glyphicon-sound-6-1"></span>sound-6-1</li>
209
+ <li><span class="glyphicon glyphicon-sound-7-1"></span>sound-7-1</li>
210
+ <li><span class="glyphicon glyphicon-sound-dolby"></span>sound-dolby</li>
211
+ <li><span class="glyphicon glyphicon-sound-stereo"></span>sound-stereo</li>
212
+ <li><span class="glyphicon glyphicon-star"></span>star</li>
213
+ <li><span class="glyphicon glyphicon-star-empty"></span>star-empty</li>
214
+ <li><span class="glyphicon glyphicon-stats"></span>stats</li>
215
+ <li><span class="glyphicon glyphicon-step-backward"></span>step-backward</li>
216
+ <li><span class="glyphicon glyphicon-step-forward"></span>step-forward</li>
217
+ <li><span class="glyphicon glyphicon-stop"></span>stop</li>
218
+ <li><span class="glyphicon glyphicon-subtitles"></span>subtitles</li>
219
+ <li><span class="glyphicon glyphicon-tag"></span>tag</li>
220
+ <li><span class="glyphicon glyphicon-tags"></span>tags</li>
221
+ <li><span class="glyphicon glyphicon-tasks"></span>tasks</li>
222
+ <li><span class="glyphicon glyphicon-text-height"></span>text-height</li>
223
+ <li><span class="glyphicon glyphicon-text-width"></span>text-width</li>
224
+ <li><span class="glyphicon glyphicon-th"></span>th</li>
225
+ <li><span class="glyphicon glyphicon-th-large"></span>th-large</li>
226
+ <li><span class="glyphicon glyphicon-th-list"></span>th-list</li>
227
+ <li><span class="glyphicon glyphicon-thumbs-down"></span>thumbs-down</li>
228
+ <li><span class="glyphicon glyphicon-thumbs-up"></span>thumbs-up</li>
229
+ <li><span class="glyphicon glyphicon-time"></span>time</li>
230
+ <li><span class="glyphicon glyphicon-tint"></span>tint</li>
231
+ <li><span class="glyphicon glyphicon-tower"></span>tower</li>
232
+ <li><span class="glyphicon glyphicon-transfer"></span>transfer</li>
233
+ <li><span class="glyphicon glyphicon-trash"></span>trash</li>
234
+ <li><span class="glyphicon glyphicon-tree-conifer"></span>tree-conifer</li>
235
+ <li><span class="glyphicon glyphicon-tree-deciduous"></span>tree-deciduous</li>
236
+ <li><span class="glyphicon glyphicon-unchecked"></span>unchecked</li>
237
+ <li><span class="glyphicon glyphicon-upload"></span>upload</li>
238
+ <li><span class="glyphicon glyphicon-usd"></span>usd</li>
239
+ <li><span class="glyphicon glyphicon-user"></span>user</li>
240
+ <li><span class="glyphicon glyphicon-volume-down"></span>volume-down</li>
241
+ <li><span class="glyphicon glyphicon-volume-off"></span>volume-off</li>
242
+ <li><span class="glyphicon glyphicon-volume-up"></span>volume-up</li>
243
+ <li><span class="glyphicon glyphicon-warning-sign"></span>warning-sign</li>
244
+ <li><span class="glyphicon glyphicon-wrench"></span>wrench</li>
245
+ <li><span class="glyphicon glyphicon-zoom-in"></span>zoom-in</li>
246
+ <li><span class="glyphicon glyphicon-zoom-out"></span>zoom-out</li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  </ul>
248
  </div>
249
  </body>
js/plugins/icons.js CHANGED
@@ -1,23 +1,14 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_icons', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_icons':
8
- var c = cm.createButton('bs_icons', {
9
- title : 'Icons',
10
- onclick : function() {
11
- tb_show('Select icons', '../wp-content/plugins/bootstrap-shortcodes/js/plugins/icons.html?TB_iframe=1');
12
- }
13
- });
14
-
15
- // Return the new splitbutton instance
16
- return c;
17
- }
18
- return null;
19
  }
20
  });
21
- tinymce.PluginManager.add('bs_icons', tinymce.plugins.bs_icons);
22
- })();
23
-
1
+ tinymce.PluginManager.add('bs_icons', function(editor, url) {
2
+ editor.addButton('bs_icons', {
3
+ tooltip : 'Icons',
4
+ icon : 'bs-icons',
5
+ onclick : function() {
6
+ tinymce.activeEditor.windowManager.open({
7
+ title : 'Icons',
8
+ url : url + '/icons.html',
9
+ width : 480,
10
+ height : 320
11
+ });
 
 
 
 
 
 
 
12
  }
13
  });
14
+ });
 
 
js/plugins/labels.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel="stylesheet" href="../../css/bootstrap.css" />
6
+ <link rel="stylesheet" href="../../css/admin.css" />
7
+ <script type="text/javascript" src="../jquery.js"></script>
8
+ <script type="text/javascript" src="../bootstrap.js"></script>
9
+ <script type="text/javascript">
10
+ $(document).ready(function() {
11
+ $('#insert').click(function() {
12
+ var type = $('select[name=type]').val();
13
+ var text = $('input[name=text]').val();
14
+ top.tinymce.activeEditor.insertContent('[bs_label type="' + type.toLowerCase() + '"]' + text + '[/bs_label]');
15
+ top.tinymce.activeEditor.windowManager.close();
16
+ });
17
+ });
18
+ </script>
19
+ </head>
20
+
21
+ <body>
22
+ <div class="container">
23
+ <form role="form">
24
+ <div class="form-group">
25
+ <label for="type">Types</label>
26
+ <select class="form-control" id="type" name="type">
27
+ <option value="Default"> Default</option>
28
+ <option value="Primary"> Primary</option>
29
+ <option value="Success"> Success</option>
30
+ <option value="Info" selected> Info</option>
31
+ <option value="Warning"> Warning</option>
32
+ <option value="Danger"> Danger</option>
33
+ <option value="Link"> Link</option>
34
+ </select>
35
+ <label for="text">Text</label>
36
+ <input type="text" class="form-control" id="text" name="text" placeholder="Text" onclick="this.select()" />
37
+ </div>
38
+ <button type="submit" id="insert" class="btn btn-primary">Insert</button>
39
+ </form>
40
+ </div>
41
+ </body>
42
+ </html>
js/plugins/labels.js CHANGED
@@ -1,63 +1,15 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_labels', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_labels':
8
- var c = cm.createSplitButton('bs_labels', {
9
- title : 'Labels',
10
- onclick : function() {
11
 
12
- }
13
- //'class':'mceListBoxMenu'
14
- });
15
-
16
-
17
- c.onRenderMenu.add(function(c, m) {
18
- m.onShowMenu.add(function(c,m){
19
- jQuery('#menu_'+c.id).height('auto').width('auto');
20
- jQuery('#menu_'+c.id+'_co').height('auto').addClass('mceListBoxMenu');
21
- var $menu = jQuery('#menu_'+c.id+'_co').find('tbody:first');
22
- if($menu.data('added')) return;
23
- $menu.append('');
24
- $menu.append('<div style="padding: 0 10px 10px">\
25
- <label>Types<br/>\
26
- <select name="type">\
27
- <option value="Default"> Default</option>\
28
- <option value="Primary"> Primary</option>\
29
- <option value="Success"> Success</option>\
30
- <option value="Info" selected> Info</option>\
31
- <option value="Warning"> Warning</option>\
32
- <option value="Danger"> Danger</option>\
33
- <option value="Link"> Link</option>\
34
- </select>\
35
- <label>Text<br />\
36
- <input type="text" name="text" value="my text" onclick="this.select()" /></label>\
37
- </div>');
38
-
39
- jQuery('<input type="button" class="button" value="Insert" />').appendTo($menu)
40
- .click(function(){
41
- var type = $menu.find('select[name=type]').val();
42
- var text = $menu.find('input[name=text]').val();
43
- tinymce.activeEditor.execCommand('mceInsertContent',false,'[bs_label type="'+type.toLowerCase()+'"]'+text+'[/bs_label]');
44
- c.hideMenu();
45
- }).wrap('<div style="padding: 0 10px 10px"></div>')
46
-
47
- $menu.data('added',true);
48
-
49
- });
50
-
51
- // XSmall
52
- m.add({title : 'Labels', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
53
-
54
- });
55
- // Return the new splitbutton instance
56
- return c;
57
-
58
- }
59
- return null;
60
  }
61
  });
62
- tinymce.PluginManager.add('bs_labels', tinymce.plugins.bs_labels);
63
- })();
 
 
 
 
 
 
 
 
 
 
1
 
2
+ tinymce.PluginManager.add('bs_labels', function(editor, url) {
3
+ editor.addButton('bs_labels', {
4
+ tooltip: 'Labels',
5
+ icon: 'bs-labels',
6
+ onclick: function() {
7
+ tinymce.activeEditor.windowManager.open({
8
+ title: 'Labels',
9
+ url: url + '/labels.html',
10
+ width: 480,
11
+ height: 320
12
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
  });
15
+ });
 
js/plugins/lead.js CHANGED
@@ -1,21 +1,9 @@
1
- (function() {
2
- // Creates a new plugin class and a custom listbox
3
- tinymce.create('tinymce.plugins.bs_lead', {
4
- createControl: function(n, cm) {
5
- switch (n) {
6
- case 'bs_lead':
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
14
- return c;
15
-
16
- }
17
- return null;
18
  }
19
  });
20
- tinymce.PluginManager.add('bs_lead', tinymce.plugins.bs_lead);
21
- })();
1
+ tinymce.PluginManager.add('bs_lead', function(editor, url) {
2
+ editor.addButton('bs_lead', {
3
+ tooltip: 'Lead',
4
+ icon: 'bs-lead',
5
+ onclick: function() {
6
+ editor.insertContent('[bs_lead]This is a lead text and needs your attention.[/bs_lead]');
 
 
 
 
 
 
 
 
 
 
 
7
  }
8
  });
9
+ });
 
js/plugins/tabs.html CHANGED
@@ -1,15 +1,13 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
-
4
  <head>
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
  <link rel="stylesheet" href="../../css/bootstrap.css" />
7
  <link rel="stylesheet" href="../../css/admin.css" />
8
  <script type="text/javascript" src="../jquery.js"></script>
9
  <script type="text/javascript" src="../bootstrap.js"></script>
10
-
11
  <script type="text/javascript">
12
- jQuery(function($) {
13
  $('[data-editable]').live('click', function() {
14
  if ($(this).find('input').length > 0) return;
15
  var val = $.trim($(this).html());
@@ -39,7 +37,6 @@
39
 
40
 
41
 
42
-
43
  $('input[name=type]').on('change', function() {
44
  if (this.id == 'sl_container') {
45
  $('#c_parent').hide();
@@ -173,10 +170,10 @@
173
  });
174
  shortcode += '[/bs_tcontents]<br class="nc"/>[/bs_tabs]';
175
 
176
- parent.tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
 
177
 
178
- parent.tb_remove();
179
- })
180
 
181
 
182
  $('.tab_title').live('keyup', function() {
@@ -251,7 +248,7 @@
251
  if ($('#myTab a[href=' + id + ']').closest('.dropdown').length == 0) return
252
  $('#myTab a[href=' + id + ']').parent().addClass('active').prependTo($('#myTab'));
253
  }
254
- })
255
 
256
  $('#new_type').on('change', function() {
257
  if ($(this).val() == 1) {
@@ -266,7 +263,7 @@
266
  $('#new_type').val('');
267
  $('#new_parent').val('').show();
268
  $('#new_content').val('').show();
269
- })
270
 
271
  $('#new_tab').click(function(e) {
272
  var title = $('#new_title').val();
1
+ <!doctype html>
2
+ <html>
 
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <link rel="stylesheet" href="../../css/bootstrap.css" />
6
  <link rel="stylesheet" href="../../css/admin.css" />
7
  <script type="text/javascript" src="../jquery.js"></script>
8
  <script type="text/javascript" src="../bootstrap.js"></script>
 
9
  <script type="text/javascript">
10
+ $(document).ready(function() {
11
  $('[data-editable]').live('click', function() {
12
  if ($(this).find('input').length > 0) return;
13
  var val = $.trim($(this).html());
37
 
38
 
39
 
 
40
  $('input[name=type]').on('change', function() {
41
  if (this.id == 'sl_container') {
42
  $('#c_parent').hide();
170
  });
171
  shortcode += '[/bs_tcontents]<br class="nc"/>[/bs_tabs]';
172
 
173
+ top.tinymce.activeEditor.execCommand('mceInsertContent', false, shortcode);
174
+ top.tinymce.activeEditor.windowManager.close();
175
 
176
+ });
 
177
 
178
 
179
  $('.tab_title').live('keyup', function() {
248
  if ($('#myTab a[href=' + id + ']').closest('.dropdown').length == 0) return
249
  $('#myTab a[href=' + id + ']').parent().addClass('active').prependTo($('#myTab'));
250
  }
251
+ });
252
 
253
  $('#new_type').on('change', function() {
254
  if ($(this).val() == 1) {
263
  $('#new_type').val('');
264
  $('#new_parent').val('').show();
265
  $('#new_content').val('').show();
266
+ });
267
 
268
  $('#new_tab').click(function(e) {
269
  var title = $('#new_title').val();
js/plugins/tabs.js CHANGED
@@ -1,22 +1,14 @@
1
- (function() {
2
- // Creates a new plugin class and a custom listbox
3
- tinymce.create('tinymce.plugins.bs_tabs', {
4
- createControl: function(n, cm) {
5
- switch (n) {
6
- case 'bs_tabs':
7
- var c = cm.createButton('bs_tabs', {
8
- title : 'Tabs',
9
- onclick : function() {
10
- tb_show('Tab builder', '../wp-content/plugins/bootstrap-shortcodes/js/plugins/tabs.html?TB_iframe=1');
11
- }
12
- });
13
-
14
- // Return the new splitbutton instance
15
- return c;
16
-
17
- }
18
- return null;
19
  }
20
  });
21
- tinymce.PluginManager.add('bs_tabs', tinymce.plugins.bs_tabs);
22
- })();
1
+ tinymce.PluginManager.add('bs_tabs', function(editor, url) {
2
+ editor.addButton('bs_tabs', {
3
+ tooltip: 'Tabs',
4
+ icon: 'bs-tabs',
5
+ onclick: function() {
6
+ tinymce.activeEditor.windowManager.open({
7
+ title: 'Tabs',
8
+ url: url + '/tabs.html',
9
+ width: 480,
10
+ height: 320
11
+ });
 
 
 
 
 
 
 
12
  }
13
  });
14
+ });
 
js/plugins/tooltip.html ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+ <link rel="stylesheet" href="../../css/bootstrap.css" />
6
+ <link rel="stylesheet" href="../../css/admin.css" />
7
+ <script type="text/javascript" src="../jquery.js"></script>
8
+ <script type="text/javascript" src="../bootstrap.js"></script>
9
+ <script type="text/javascript">
10
+ $(document).ready(function() {
11
+ $('#insert').click(function() {
12
+ var content = $('body').find('input[name=content]').val();
13
+ var placement = $('body').find('select[name=placement]').val();
14
+ var trigger = $('body').find('select[name=trigger]').val();
15
+ var shortcode = '[bs_tooltip placement="' + placement + '" trigger="' + trigger + '"]';
16
+ shortcode += content;
17
+ shortcode += '[/bs_tooltip]';
18
+
19
+ top.tinymce.activeEditor.insertContent(shortcode);
20
+ top.tinymce.activeEditor.windowManager.close();
21
+ });
22
+ });
23
+ </script>
24
+ </head>
25
+
26
+ <body>
27
+ <div class="container">
28
+ <form role="form">
29
+ <div class="form-group">
30
+ <label for="text">Text</label>
31
+ <input type="text" class="form-control" id="content" name="content" placeholder="Content" onclick="this.select()" />
32
+ <label for="placement">Placement</label>
33
+ <select class="form-control" id="placement" name="placement">
34
+ <option value="top" selected>Top</option>
35
+ <option value="right">Right</option>
36
+ <option value="bottom">Bottom</option>
37
+ <option value="left">Left</option>
38
+ </select>
39
+ <label for="trigger">Trigger</label>
40
+ <select class="form-control" id="trigger" name="trigger">
41
+ <option value="click">Click</option>
42
+ <option value="hover" selected>Hover</option>
43
+ <option value="focus">Focus</option>
44
+ </select>
45
+ </div>
46
+ <button type="submit" id="insert" class="btn btn-primary">Insert</button>
47
+ </form>
48
+ </div>
49
+ </body>
50
+ </html>
js/plugins/tooltip.js CHANGED
@@ -1,70 +1,14 @@
1
- /**
2
- * Shortcode markup
3
- * -----------------------
4
- * [tooltip placement="" trigger="" ]content
5
- * [/tooltip]
6
- * -----------------------
7
- */
8
- (function($) {
9
- // Creates a new plugin class and a custom listbox
10
- tinymce.create('tinymce.plugins.bs_tooltip', {
11
- createControl: function(n, cm) {
12
- switch (n) {
13
- case 'bs_tooltip':
14
- var c = cm.createSplitButton('bs_tooltip', {
15
- title : 'Tooltip'
16
- });
17
-
18
- c.onRenderMenu.add(function(c, m) {
19
- m.onShowMenu.add(function(c,m){
20
- $('#menu_'+c.id).height('auto').width('auto');
21
- $('#menu_'+c.id+'_co').height('auto').addClass('mceListBoxMenu');
22
- var $menu = $('#menu_'+c.id+'_co').find('tbody:first');
23
- if($menu.data('added')) return;
24
- $menu.append('<div style="padding:0 10px 10px">\
25
- <label>Content</label>\
26
- <input type="text" name="content" value="The Tooltip" onclick="this.select()" />\
27
- <label>Placement</label>\
28
- <select name="placement">\
29
- <option value="top" selected>Top</option>\
30
- <option value="right">Right</option>\
31
- <option value="bottom">Bottom</option>\
32
- <option value="left">Left</option>\
33
- </select>\
34
- <label>Trigger</label>\
35
- <select name="trigger">\
36
- <option value="click">Click</option>\
37
- <option value="hover" selected>Hover</option>\
38
- <option value="focus">Focus</option>\
39
- </select>\
40
- </div>');
41
-
42
- $('<input type="button" class="button" value="Insert" />')
43
- .wrap('<div style="padding: 0 10px 10px"></div>')
44
- .appendTo($menu)
45
- .on('click', function() {
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();
55
- });
56
-
57
- $menu.data('added', true);
58
- });
59
-
60
- // XSmall
61
- m.add({title : 'Tooltip', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
62
- });
63
- // Return the new splitbutton instance
64
- return c;
65
- }
66
- return null;
67
  }
68
  });
69
- tinymce.PluginManager.add('bs_tooltip', tinymce.plugins.bs_tooltip);
70
- })(jQuery);
1
+ tinymce.PluginManager.add('bs_tooltip', function(editor, url) {
2
+ editor.addButton('bs_tooltip', {
3
+ tooltip: 'Tooltip',
4
+ icon: 'bs-tooltip',
5
+ onclick: function() {
6
+ tinymce.activeEditor.windowManager.open({
7
+ title: 'Tooltip',
8
+ url: url + '/tooltip.html',
9
+ width: 480,
10
+ height: 320
11
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
  });
14
+ });
 
js/plugins/wells.js CHANGED
@@ -1,36 +1,12 @@
1
- // JavaScript Document
2
- (function() {
3
- // Creates a new plugin class and a custom listbox
4
- tinymce.create('tinymce.plugins.bs_wells', {
5
- createControl: function(n, cm) {
6
- switch (n) {
7
- case 'bs_wells':
8
- var c = cm.createSplitButton('bs_wells', {
9
- title : 'Well',
10
- onclick : function() {
11
- }
12
- });
13
-
14
- c.onRenderMenu.add(function(c, m) {
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
- });
28
-
29
- // Return the new splitbutton instance
30
- return c;
31
- }
32
- return null;
33
- }
34
  });
35
- tinymce.PluginManager.add('bs_wells', tinymce.plugins.bs_wells);
36
- })();
1
+ tinymce.PluginManager.add('bs_wells', function(editor, url) {
2
+ editor.addButton('bs_wells', {
3
+ type: 'menubutton',
4
+ tooltip: 'Well',
5
+ icon: 'bs-wells',
6
+ menu: [
7
+ { text: 'Small well', onclick: function() { editor.insertContent('[bs_well size="sm"]This well needs your attention.[/bs_well]'); } },
8
+ { text: 'Medium well', onclick: function() { editor.insertContent('[bs_well size="md"]This well needs your attention.[/bs_well]'); } },
9
+ { text: 'Large well', onclick: function() { editor.insertContent('[bs_well size="lg"]This well needs your attention.[/bs_well]'); } }
10
+ ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  });
12
+ });
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.8.1
6
- Stable tag: 2.1.1
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
  = 2.1.1 =
30
  * Fixed grid wizard
31
 
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.9
6
+ Stable tag: 3.0.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
+ = 3.0.0 =
30
+ * Updated for Wordpress 3.9 and TinyMCE 4
31
+
32
  = 2.1.1 =
33
  * Fixed grid wizard
34