Better Font Awesome - Version 0.9.4

Version Description

  • Switched default   being output. Now the default "space" attribute is false, and can be set to true to optionally include a space.
  • PLEASE NOTE: this will affect existing shortcodes.
Download this release

Release Info

Developer McGuive7
Plugin Icon 128x128 Better Font Awesome
Version 0.9.4
Comparing to
See all releases

Code changes from version 0.9.3 to 0.9.4

better-font-awesome.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  * Plugin Name: Better Font Awesome
4
  * Plugin URI: http://wordpress.org/plugins/better-font-awesome
5
- * Description: The better Font Awesome icon plugin for Wordpress.
6
- * Version: 0.9.3
7
  * Author: Mickey Kay
8
  * Author URI: mickey@mickeykaycreative.com
9
  * License: GPLv2+
@@ -12,29 +12,7 @@
12
  */
13
 
14
  /**
15
- * Copyright (c) 2014 Mickey Kay & MIGHTYminnow (email : mickey@mickeykaycreative.com)
16
- *
17
- * This program is free software; you can redistribute it and/or modify
18
- * it under the terms of the GNU General Public License, version 2 or, at
19
- * your discretion, any later version, as published by the Free
20
- * Software Foundation.
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU General Public License for more details.
26
- *
27
- * You should have received a copy of the GNU General Public License
28
- * along with this program; if not, write to the Free Software
29
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
- */
31
-
32
- /*--------------------------------------------*
33
- * Titan Framework
34
- *--------------------------------------------*/
35
- /*
36
- * When using the embedded framework, use it only if the framework
37
- * plugin isn't activated.
38
  */
39
 
40
  // Don't do anything when we're activating a plugin to prevent errors
@@ -62,6 +40,17 @@ if ( $useEmbeddedFramework && ! class_exists( 'TitanFramework' ) ) {
62
  require_once( plugin_dir_path( __FILE__ ) . 'Titan-Framework/titan-framework.php' );
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Better Font Awesome plugin class
67
  */
@@ -78,7 +67,7 @@ class BetterFontAwesome {
78
  * Variables
79
  *--------------------------------------------*/
80
  public $prefix, $icons;
81
- protected $cdn_data, $titan, $version, $minified;
82
 
83
  /**
84
  * Constructor
@@ -105,8 +94,7 @@ class BetterFontAwesome {
105
  // Do scripts and styles - on 11 to make sure styles/scripts load after other plugins
106
  add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
107
  add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
108
- add_action( 'admin_enqueue_scripts', array( $this, 'custom_admin_css' ), 11 );
109
-
110
  }
111
 
112
  /**
@@ -140,10 +128,9 @@ class BetterFontAwesome {
140
 
141
  // Add Font Awesome stylesheet to TinyMCE
142
  add_editor_style( $this->stylesheet_url );
143
-
144
  }
145
 
146
- /*
147
  * Runs when admin is initialized
148
  */
149
  function admin_init() {
@@ -165,17 +152,17 @@ class BetterFontAwesome {
165
  $this->cdn_data = $decoded_data[0];
166
  }
167
 
168
- /*
169
  * Create list of available icons based on selected version of Font Awesome
170
  */
171
  function get_icons() {
172
  // Get Font Awesome CSS
173
  if( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == "on" )
174
- $prefix = 'https:';
175
  else
176
- $prefix = 'http:';
177
 
178
- $remote_data = wp_remote_get( $prefix . $this->stylesheet_url );
179
  $css = wp_remote_retrieve_body( $remote_data );
180
 
181
  // Get all CSS selectors that have a content: pseudo-element rule
@@ -193,16 +180,16 @@ class BetterFontAwesome {
193
  }
194
 
195
  // Alphabetize & join with comma for use in JS array
196
- sort( $this->icons );
197
-
198
  }
199
 
200
- /*
201
- * Set the Font Awesome stylesheet url to use based on the settings
202
  */
203
  function setup_global_variables() {
204
  $this->version = $this->titan->getOption( 'version' );
205
  $this->minified = $this->titan->getOption( 'minified' );
 
206
 
207
  // Get latest version if need be
208
  if ( 'latest' == $this->version )
@@ -210,18 +197,23 @@ class BetterFontAwesome {
210
 
211
  // Set stylesheet URL
212
  $stylesheet = $this->minified ? '/css/font-awesome.min.css' : '/css/font-awesome.css';
213
- $this->stylesheet_url = '//netdna.bootstrapcdn.com/font-awesome/' . $this->version . $stylesheet;
 
 
214
 
215
  // Set proper prefix based on version
216
  if ( 0 <= version_compare( $this->version, '4' ) )
217
- $this->prefix = 'fa-';
218
  elseif ( 0 <= version_compare( $this->version, '3' ) )
219
- $this->prefix = 'icon-';
220
 
221
  // Setup icons for selected version of Font Awesome
222
  $this->get_icons();
223
  }
224
 
 
 
 
225
  function do_options_page() {
226
 
227
  // Setup available versions
@@ -247,6 +239,18 @@ class BetterFontAwesome {
247
  'default' => $this->cdn_data->lastversion,
248
  ) );
249
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  $optionsPage->createOption( array(
251
  'name' => __( 'Use minified CSS', 'better-font-awesome' ),
252
  'id' => 'minified',
@@ -290,6 +294,8 @@ class BetterFontAwesome {
290
  * Example:
291
  * [icon name="flag" class="fw 2x spin"]
292
  *
 
 
293
  * @param array $atts Shortcode attributes
294
  * @return string <i> Font Awesome output
295
  */
@@ -297,6 +303,7 @@ class BetterFontAwesome {
297
  extract(shortcode_atts(array(
298
  'name' => '',
299
  'class' => '',
 
300
  'title' => '', /* For compatibility with other plugins */
301
  'size' => '', /* For compatibility with other plugins */
302
  'space' => '',
@@ -305,7 +312,7 @@ class BetterFontAwesome {
305
 
306
  // Include for backwards compatibility with Font Awesome More Icons plugin
307
  $title = $title ? 'title="' . $title . '" ' : '';
308
- $space = 'false' == $space ? '' : '&nbsp;';
309
  $size = $size ? ' '. $this->prefix . $size : '';
310
 
311
  // Remove "icon-" and "fa-" from name
@@ -316,7 +323,7 @@ class BetterFontAwesome {
316
  $name = str_replace( 'fa-', '', $name );
317
 
318
  // Add prefix to name
319
- $icon_name = $this->prefix . $name;
320
 
321
  // Remove "icon-" and "fa-" from classes
322
  $class = str_replace( 'icon-', '', $class );
@@ -327,37 +334,44 @@ class BetterFontAwesome {
327
  $class = preg_replace('/\s{3,}/',' ', $class );
328
 
329
  // Add prefix to each class (separated by space)
330
- $class = ' ' . $this->prefix . str_replace( ' ', ' ' . $this->prefix, $class );
 
 
 
331
 
332
  return '<i class="fa ' . $icon_name . $class . $size . '" ' . $title . '>' . $space . '</i>';
333
  }
334
 
335
  /**
336
- * Registers and enqueues stylesheets for the administration panel and the
337
- * public facing site.
338
  */
339
  function register_scripts_and_styles() {
 
 
340
  // Deregister any existing Font Awesome CSS (including Titan Framework)
341
  if ( $this->titan->getOption( 'remove_existing_fa' ) ) {
342
- wp_dequeue_style( 'tf-font-awesome' );
343
- wp_dequeue_style( 'font-awesome' );
 
 
 
344
  }
345
 
346
  // Enqueue Font Awesome CSS
347
- wp_register_style( 'font-awesome', $this->stylesheet_url, '', $this->version );
348
- wp_enqueue_style( 'font-awesome' );
349
  }
350
 
351
- /*
352
- * Load admin CSS
353
  */
354
- function custom_admin_css() {
355
  wp_enqueue_style( 'bfa-admin-styles', plugins_url( 'inc/css/admin-styles.css', __FILE__ ) );
356
  }
357
 
358
  /**
359
- * Load TinyMCE Font Awesome dropdown plugin
360
- */
361
  function register_tinymce_plugin( $plugin_array ) {
362
  global $tinymce_version;
363
 
@@ -371,8 +385,8 @@ class BetterFontAwesome {
371
  return $plugin_array;
372
  }
373
 
374
- /*
375
- * Add TinyMCE dropdown element
376
  */
377
  function add_tinymce_buttons( $buttons ) {
378
  array_push( $buttons, 'bfaSelect' );
@@ -381,7 +395,7 @@ class BetterFontAwesome {
381
  }
382
 
383
  /**
384
- * Add PHP variables in head for use by TinyMCE JavaScript
385
  */
386
  function admin_head_variables() {
387
  $icon_list = implode( ",", $this->icons );
@@ -397,6 +411,4 @@ class BetterFontAwesome {
397
  <?php
398
  }
399
 
400
- }
401
- global $better_font_awesome;
402
- $better_font_awesome = new BetterFontAwesome();
2
  /*
3
  * Plugin Name: Better Font Awesome
4
  * Plugin URI: http://wordpress.org/plugins/better-font-awesome
5
+ * Description: The ultimate Font Awesome icon plugin for Wordpress.
6
+ * Version: 0.9.5
7
  * Author: Mickey Kay
8
  * Author URI: mickey@mickeykaycreative.com
9
  * License: GPLv2+
12
  */
13
 
14
  /**
15
+ * Load Titan Framework
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  */
17
 
18
  // Don't do anything when we're activating a plugin to prevent errors
40
  require_once( plugin_dir_path( __FILE__ ) . 'Titan-Framework/titan-framework.php' );
41
  }
42
 
43
+ add_action( 'plugins_loaded', 'bfa_start' );
44
+ /**
45
+ * Initialize Better Font Awesome plugin.
46
+ *
47
+ * @since 0.9.5
48
+ */
49
+ function bfa_start() {
50
+ global $better_font_awesome;
51
+ $better_font_awesome = new BetterFontAwesome();
52
+ }
53
+
54
  /**
55
  * Better Font Awesome plugin class
56
  */
67
  * Variables
68
  *--------------------------------------------*/
69
  public $prefix, $icons;
70
+ protected $cdn_data, $titan, $cdn, $version, $minified;
71
 
72
  /**
73
  * Constructor
94
  // Do scripts and styles - on 11 to make sure styles/scripts load after other plugins
95
  add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
96
  add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
97
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts_and_styles' ), 11 );
 
98
  }
99
 
100
  /**
128
 
129
  // Add Font Awesome stylesheet to TinyMCE
130
  add_editor_style( $this->stylesheet_url );
 
131
  }
132
 
133
+ /**
134
  * Runs when admin is initialized
135
  */
136
  function admin_init() {
152
  $this->cdn_data = $decoded_data[0];
153
  }
154
 
155
+ /**
156
  * Create list of available icons based on selected version of Font Awesome
157
  */
158
  function get_icons() {
159
  // Get Font Awesome CSS
160
  if( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == "on" )
161
+ $protocol = 'https:';
162
  else
163
+ $protocol = 'http:';
164
 
165
+ $remote_data = wp_remote_get( $protocol . $this->stylesheet_url );
166
  $css = wp_remote_retrieve_body( $remote_data );
167
 
168
  // Get all CSS selectors that have a content: pseudo-element rule
180
  }
181
 
182
  // Alphabetize & join with comma for use in JS array
183
+ sort( $this->icons );
 
184
  }
185
 
186
+ /**
187
+ * Set the Font Awesome stylesheet url to use based on the settings.
188
  */
189
  function setup_global_variables() {
190
  $this->version = $this->titan->getOption( 'version' );
191
  $this->minified = $this->titan->getOption( 'minified' );
192
+ $this->cdn = $this->titan->getOption( 'cdn' );
193
 
194
  // Get latest version if need be
195
  if ( 'latest' == $this->version )
197
 
198
  // Set stylesheet URL
199
  $stylesheet = $this->minified ? '/css/font-awesome.min.css' : '/css/font-awesome.css';
200
+ $cdn_base_url = ( 'jsdelivr' == $this->cdn ) ? '//cdn.jsdelivr.net/fontawesome/' : '//netdna.bootstrapcdn.com/font-awesome/';
201
+
202
+ $this->stylesheet_url = $cdn_base_url . $this->version . $stylesheet;
203
 
204
  // Set proper prefix based on version
205
  if ( 0 <= version_compare( $this->version, '4' ) )
206
+ $this->prefix = 'fa';
207
  elseif ( 0 <= version_compare( $this->version, '3' ) )
208
+ $this->prefix = 'icon';
209
 
210
  // Setup icons for selected version of Font Awesome
211
  $this->get_icons();
212
  }
213
 
214
+ /**
215
+ * Set up admin options page
216
+ */
217
  function do_options_page() {
218
 
219
  // Setup available versions
239
  'default' => $this->cdn_data->lastversion,
240
  ) );
241
 
242
+ $optionsPage->createOption( array(
243
+ 'name' => __( 'CDN', 'better-font-awesome' ),
244
+ 'id' => 'cdn',
245
+ 'type' => 'select',
246
+ 'desc' => __( 'Select the CDN from which to load Font Awesome.', 'better-font-awesome') ,
247
+ 'options' => array(
248
+ 'jsdelivr' => 'jsDelivr',
249
+ 'bootstrap' => 'Bootstrap'
250
+ ),
251
+ 'default' => 'jsdelivr',
252
+ ) );
253
+
254
  $optionsPage->createOption( array(
255
  'name' => __( 'Use minified CSS', 'better-font-awesome' ),
256
  'id' => 'minified',
294
  * Example:
295
  * [icon name="flag" class="fw 2x spin"]
296
  *
297
+ * @since 0.9.0
298
+ *
299
  * @param array $atts Shortcode attributes
300
  * @return string <i> Font Awesome output
301
  */
303
  extract(shortcode_atts(array(
304
  'name' => '',
305
  'class' => '',
306
+ 'unprefixed_class' => '',
307
  'title' => '', /* For compatibility with other plugins */
308
  'size' => '', /* For compatibility with other plugins */
309
  'space' => '',
312
 
313
  // Include for backwards compatibility with Font Awesome More Icons plugin
314
  $title = $title ? 'title="' . $title . '" ' : '';
315
+ $space = 'true' == $space ? '&nbsp;' : '';
316
  $size = $size ? ' '. $this->prefix . $size : '';
317
 
318
  // Remove "icon-" and "fa-" from name
323
  $name = str_replace( 'fa-', '', $name );
324
 
325
  // Add prefix to name
326
+ $icon_name = $this->prefix . '-' . $name;
327
 
328
  // Remove "icon-" and "fa-" from classes
329
  $class = str_replace( 'icon-', '', $class );
334
  $class = preg_replace('/\s{3,}/',' ', $class );
335
 
336
  // Add prefix to each class (separated by space)
337
+ $class = $class ? ' ' . $this->prefix . '-' . str_replace( ' ', ' ' . $this->prefix . '-', $class ) : '';
338
+
339
+ // Add unprefixed classes
340
+ $class .= $unprefixed_class ? ' ' . $unprefixed_class : '';
341
 
342
  return '<i class="fa ' . $icon_name . $class . $size . '" ' . $title . '>' . $space . '</i>';
343
  }
344
 
345
  /**
346
+ * Register public scripts and styles.
 
347
  */
348
  function register_scripts_and_styles() {
349
+ global $wp_styles;
350
+
351
  // Deregister any existing Font Awesome CSS (including Titan Framework)
352
  if ( $this->titan->getOption( 'remove_existing_fa' ) ) {
353
+ // Loop through all registered styles and remove any that appear to be font-awesome
354
+ foreach ( $wp_styles->registered as $script => $details ) {
355
+ if ( strpos( $script, 'fontawesome' ) !== false || strpos( $script, 'font-awesome' ) !== false )
356
+ wp_dequeue_style( $script );
357
+ }
358
  }
359
 
360
  // Enqueue Font Awesome CSS
361
+ wp_register_style( 'bfa-font-awesome', $this->stylesheet_url, '', $this->version );
362
+ wp_enqueue_style( 'bfa-font-awesome' );
363
  }
364
 
365
+ /**
366
+ * Register admin scripts and styles.
367
  */
368
+ function register_admin_scripts_and_styles() {
369
  wp_enqueue_style( 'bfa-admin-styles', plugins_url( 'inc/css/admin-styles.css', __FILE__ ) );
370
  }
371
 
372
  /**
373
+ * Load TinyMCE Font Awesome dropdown plugin.
374
+ */
375
  function register_tinymce_plugin( $plugin_array ) {
376
  global $tinymce_version;
377
 
385
  return $plugin_array;
386
  }
387
 
388
+ /**
389
+ * Add TinyMCE dropdown element.
390
  */
391
  function add_tinymce_buttons( $buttons ) {
392
  array_push( $buttons, 'bfaSelect' );
395
  }
396
 
397
  /**
398
+ * Add PHP variables in head for use by TinyMCE JavaScript.
399
  */
400
  function admin_head_variables() {
401
  $icon_list = implode( ",", $this->icons );
411
  <?php
412
  }
413
 
414
+ }
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: McGuive7, MIGHTYminnow
3
  Tags: better, font, awesome, icon, bootstrap, fontstrap, cdn, shortcode
4
  Donate link: http://mightyminnow.com
5
  Requires at least: 3.0
6
- Tested up to: 3.9
7
- Stable tag: 0.9.3
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -32,11 +32,17 @@ All settings can be adjusted via **Settings &rarr; Better Font Awesome**.
32
  Better Font Awesome can be used in 3 different ways: shortcode, HTML, and TinyMCE
33
 
34
  = 1. Shortcode =
35
- `[icon name="flag" class="2x spin border" space="false"]`
36
 
37
- The `name` attribute is simply the name of the icon, and the `class` attribute can include any of the available Font Awesome classes listed on the Font Awesome [Examples Page](http://fortawesome.github.io/Font-Awesome/examples/ "Font Awesome Examples"). The optional `space` attribute can be set to "false" to omit the space that is included after the icon by default.
38
 
39
- Prefixes (`icon-` and `fa-`) are not necessary for shortcode usage. What's great is that Better Font Awesome will automatically remove and replace prefixes depending on the Font Awesome version you choose. So if you have existing Font Awesome shortcodes *with prefixes* (from other plugins, for example), they'll still work just fine.
 
 
 
 
 
 
40
 
41
  That means that the following shortcodes will all work, regardless of what version of Font Awesome you choose:
42
  `[icon name="flag" class="2x spin border"]`
@@ -62,7 +68,7 @@ Better Font Awesome also provides you with an easy-to-use drop down menu in the
62
  Please feel free to integrate Better Font Awesome in your plugin or theme! If you want to hook into Better Font Awesome, the best way is via the global `$better_font_awesome` object, which has a few public properties that might be useful:
63
 
64
  `$better_font_awesome->prefix`
65
- The prefix (e.g. "icon-" or "fa-") that should be used with the selected version of Font Awesome.
66
 
67
  `$better_font_awesome->icons`
68
  An alphabetical array of all available icons based on the selected version of Font Awesome.
@@ -108,6 +114,15 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS,
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
 
111
  = 0.9.3 =
112
  * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
113
  * Print JS variables in front-end to aid developers
@@ -125,6 +140,15 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS,
125
 
126
  == Upgrade Notice ==
127
 
 
 
 
 
 
 
 
 
 
128
  = 0.9.3 =
129
  * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
130
  * Print JS variables in front-end to aid developers
3
  Tags: better, font, awesome, icon, bootstrap, fontstrap, cdn, shortcode
4
  Donate link: http://mightyminnow.com
5
  Requires at least: 3.0
6
+ Tested up to: 3.9.1
7
+ Stable tag: 0.9.5
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
32
  Better Font Awesome can be used in 3 different ways: shortcode, HTML, and TinyMCE
33
 
34
  = 1. Shortcode =
35
+ `[icon name="flag" class="2x spin border" unprefixed_class="my-custom-class" space="true"]`
36
 
37
+ The **`name`** attribute is simply the name of the icon (see note below on prefixes, which are totally optional).
38
 
39
+ The **`class`** attribute can include any of the available Font Awesome classes listed on the Font Awesome [Examples Page](http://fortawesome.github.io/Font-Awesome/examples/ "Font Awesome Examples"). The appropriate prefix (`fa-` or `icon-`) will be automatically added.
40
+
41
+ The **`unprefixed_class`** attribute is where you can inlude classes that won't be prefixed.
42
+
43
+ The **`space`** attribute (optional) can be used to include a `&nbsp;` within the generated `<i>` element.
44
+
45
+ **Prefixes** (`icon-` and `fa-`) are not necessary for shortcode usage! What's great is that Better Font Awesome will automatically remove and replace prefixes depending on the Font Awesome version you choose. So if you have existing Font Awesome shortcodes *with prefixes* (from other plugins, for example), they'll still work just fine.
46
 
47
  That means that the following shortcodes will all work, regardless of what version of Font Awesome you choose:
48
  `[icon name="flag" class="2x spin border"]`
68
  Please feel free to integrate Better Font Awesome in your plugin or theme! If you want to hook into Better Font Awesome, the best way is via the global `$better_font_awesome` object, which has a few public properties that might be useful:
69
 
70
  `$better_font_awesome->prefix`
71
+ The prefix (e.g. "icon" or "fa") that should be used with the selected version of Font Awesome.
72
 
73
  `$better_font_awesome->icons`
74
  An alphabetical array of all available icons based on the selected version of Font Awesome.
114
 
115
  == Changelog ==
116
 
117
+ = 0.9.5 =
118
+ * Added ability to choose which CDN to use.
119
+ * Added `unprefixed_class` shortcode attribute to allow for unprefixed shortcodes.
120
+ * Updated prefixes to now return just the prefix without the dash (-).
121
+
122
+ = 0.9.4 =
123
+ * Switched default &nbsp; being output. Now the default "space" attribute is false, and can be set to true to optionally include a space.
124
+ * PLEASE NOTE: this will affect existing shortcodes.
125
+
126
  = 0.9.3 =
127
  * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
128
  * Print JS variables in front-end to aid developers
140
 
141
  == Upgrade Notice ==
142
 
143
+ = 0.9.5 =
144
+ * Added ability to choose which CDN to use.
145
+ * Added `unprefixed_class` shortcode attribute to allow for unprefixed shortcodes.
146
+ * Updated prefixes to now return just the prefix without the dash (-).
147
+
148
+ = 0.9.4 =
149
+ * Switched default &nbsp; being output. Now the default "space" attribute is false, and can be set to true to optionally include a space.
150
+ * PLEASE NOTE: this will affect existing shortcodes.
151
+
152
  = 0.9.3 =
153
  * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
154
  * Print JS variables in front-end to aid developers
trunk/Titan-Framework DELETED
@@ -1 +0,0 @@
1
- Subproject commit 5dfdb1441894850f74e1ef5f4e502947e3b556f0
 
trunk/better-font-awesome.php DELETED
@@ -1,402 +0,0 @@
1
- <?php
2
- /*
3
- * Plugin Name: Better Font Awesome
4
- * Plugin URI: http://wordpress.org/plugins/better-font-awesome
5
- * Description: The better Font Awesome icon plugin for Wordpress.
6
- * Version: 0.9.3
7
- * Author: Mickey Kay
8
- * Author URI: mickey@mickeykaycreative.com
9
- * License: GPLv2+
10
- * Text Domain: bfa
11
- * Domain Path: /languages
12
- */
13
-
14
- /**
15
- * Copyright (c) 2014 Mickey Kay & MIGHTYminnow (email : mickey@mickeykaycreative.com)
16
- *
17
- * This program is free software; you can redistribute it and/or modify
18
- * it under the terms of the GNU General Public License, version 2 or, at
19
- * your discretion, any later version, as published by the Free
20
- * Software Foundation.
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU General Public License for more details.
26
- *
27
- * You should have received a copy of the GNU General Public License
28
- * along with this program; if not, write to the Free Software
29
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
- */
31
-
32
- /*--------------------------------------------*
33
- * Titan Framework
34
- *--------------------------------------------*/
35
- /*
36
- * When using the embedded framework, use it only if the framework
37
- * plugin isn't activated.
38
- */
39
-
40
- // Don't do anything when we're activating a plugin to prevent errors
41
- // on redeclaring Titan classes
42
- if ( ! empty( $_GET['action'] ) && ! empty( $_GET['plugin'] ) ) {
43
- if ( $_GET['action'] == 'activate' ) {
44
- return;
45
- }
46
- }
47
- // Check if the framework plugin is activated
48
- $useEmbeddedFramework = true;
49
- $activePlugins = get_option('active_plugins');
50
- if ( is_array( $activePlugins ) ) {
51
- foreach ( $activePlugins as $plugin ) {
52
- if ( is_string( $plugin ) ) {
53
- if ( stripos( $plugin, '/Titan-Framework.php' ) !== false ) {
54
- $useEmbeddedFramework = false;
55
- break;
56
- }
57
- }
58
- }
59
- }
60
- // Use the embedded Titan Framework
61
- if ( $useEmbeddedFramework && ! class_exists( 'TitanFramework' ) ) {
62
- require_once( plugin_dir_path( __FILE__ ) . 'Titan-Framework/titan-framework.php' );
63
- }
64
-
65
- /**
66
- * Better Font Awesome plugin class
67
- */
68
- class BetterFontAwesome {
69
-
70
- /*--------------------------------------------*
71
- * Constants
72
- *--------------------------------------------*/
73
- const name = 'Better Font Awesome';
74
- const slug = 'better-font-awesome';
75
-
76
-
77
- /*--------------------------------------------*
78
- * Variables
79
- *--------------------------------------------*/
80
- public $prefix, $icons;
81
- protected $cdn_data, $titan, $version, $minified;
82
-
83
- /**
84
- * Constructor
85
- */
86
- function __construct() {
87
- // Register an activation hook for the plugin
88
- register_activation_hook( __FILE__, array( $this, 'install' ) );
89
-
90
- // Setup Titan instance
91
- $this->titan = TitanFramework::getInstance( 'better-font-awesome' );
92
-
93
- // Get CDN data
94
- $this->setup_cdn_data();
95
-
96
- // Do options page
97
- $this->do_options_page();
98
-
99
- // Hook up to the init action - on 11 to make sure it loads after other FA plugins
100
- add_action( 'init', array( $this, 'init' ), 11 );
101
-
102
- // Admin init
103
- add_action( 'admin_head', array( &$this, 'admin_init' ) );
104
-
105
- // Do scripts and styles - on 11 to make sure styles/scripts load after other plugins
106
- add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
107
- add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts_and_styles' ), 11 );
108
- add_action( 'admin_enqueue_scripts', array( $this, 'custom_admin_css' ), 11 );
109
-
110
- }
111
-
112
- /**
113
- * Runs when the plugin is activated
114
- */
115
- function install() {
116
- // do not generate any output here
117
- }
118
-
119
- /**
120
- * Runs when the plugin is initialized
121
- */
122
- function init() {
123
- // Setup localization
124
- load_plugin_textdomain( self::slug, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
125
-
126
- // Remove existing [icon] shortcodes added via other plugins/themes
127
- if ( $this->titan->getOption( 'remove_existing_fa' ) ) {
128
- remove_shortcode('icon');
129
- }
130
-
131
- // Register the shortcode [icon]
132
- add_shortcode( 'icon', array( $this, 'render_shortcode' ) );
133
-
134
- // Set Font Awesome variables (stylesheet url, prefix, etc)
135
- $this->setup_global_variables();
136
-
137
- // Add PHP variables in head for use by TinyMCY JavaScript
138
- add_action( 'wp_head', array( $this, 'admin_head_variables' ) );
139
- add_action( 'admin_head', array( $this, 'admin_head_variables' ) );
140
-
141
- // Add Font Awesome stylesheet to TinyMCE
142
- add_editor_style( $this->stylesheet_url );
143
-
144
- }
145
-
146
- /*
147
- * Runs when admin is initialized
148
- */
149
- function admin_init() {
150
- if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
151
- return;
152
-
153
- if ( get_user_option('rich_editing') == 'true' ) {
154
- add_filter( 'mce_external_plugins', array( $this, 'register_tinymce_plugin' ) );
155
- add_filter( 'mce_buttons', array( $this, 'add_tinymce_buttons' ) );
156
- }
157
- }
158
-
159
- /**
160
- * Get CDN data and prefix based on selected version
161
- */
162
- function setup_cdn_data() {
163
- $remote_data = wp_remote_get( 'http://api.jsdelivr.com/v1/bootstrap/libraries/font-awesome/' );
164
- $decoded_data = json_decode( wp_remote_retrieve_body( $remote_data ) );
165
- $this->cdn_data = $decoded_data[0];
166
- }
167
-
168
- /*
169
- * Create list of available icons based on selected version of Font Awesome
170
- */
171
- function get_icons() {
172
- // Get Font Awesome CSS
173
- if( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == "on" )
174
- $prefix = 'https:';
175
- else
176
- $prefix = 'http:';
177
-
178
- $remote_data = wp_remote_get( $prefix . $this->stylesheet_url );
179
- $css = wp_remote_retrieve_body( $remote_data );
180
-
181
- // Get all CSS selectors that have a content: pseudo-element rule
182
- preg_match_all('/(\.[^}]*)\s*{\s*(content:)/s', $css, $matches );
183
- $selectors = $matches[1];
184
-
185
- // Select all icon- and fa- selectors from and split where there are commas
186
- foreach ( $selectors as $selector ) {
187
- preg_match_all('/\.(icon-|fa-)([^,]*)\s*:before/s', $selector, $matches );
188
- $clean_selectors = $matches[2];
189
-
190
- // Create array of selectors
191
- foreach( $clean_selectors as $clean_selector )
192
- $this->icons[] = $clean_selector;
193
- }
194
-
195
- // Alphabetize & join with comma for use in JS array
196
- sort( $this->icons );
197
-
198
- }
199
-
200
- /*
201
- * Set the Font Awesome stylesheet url to use based on the settings
202
- */
203
- function setup_global_variables() {
204
- $this->version = $this->titan->getOption( 'version' );
205
- $this->minified = $this->titan->getOption( 'minified' );
206
-
207
- // Get latest version if need be
208
- if ( 'latest' == $this->version )
209
- $this->version = $this->cdn_data->lastversion;
210
-
211
- // Set stylesheet URL
212
- $stylesheet = $this->minified ? '/css/font-awesome.min.css' : '/css/font-awesome.css';
213
- $this->stylesheet_url = '//netdna.bootstrapcdn.com/font-awesome/' . $this->version . $stylesheet;
214
-
215
- // Set proper prefix based on version
216
- if ( 0 <= version_compare( $this->version, '4' ) )
217
- $this->prefix = 'fa-';
218
- elseif ( 0 <= version_compare( $this->version, '3' ) )
219
- $this->prefix = 'icon-';
220
-
221
- // Setup icons for selected version of Font Awesome
222
- $this->get_icons();
223
- }
224
-
225
- function do_options_page() {
226
-
227
- // Setup available versions
228
- $versions[ 'latest' ] = __( 'Always Latest', 'better-font-awesome' ) . ' (' . $this->cdn_data->lastversion . ')';
229
-
230
- foreach( $this->cdn_data->versions as $version ) {
231
- // Exclude v2.0
232
- if ( '2' != substr( $version, 0, 1 ) )
233
- $versions[$version] = $version;
234
- }
235
-
236
- $optionsPage = $this->titan->createAdminPanel( array(
237
- 'name' => __( 'Better Font Awesome', 'better-font-awesome'),
238
- 'parent' => 'options-general.php',
239
- ) );
240
-
241
- $optionsPage->createOption( array(
242
- 'name' => __( 'Font Awesome version', 'better-font-awesome' ),
243
- 'id' => 'version',
244
- 'type' => 'select',
245
- 'desc' => __( 'Select the version of Font Awesome you would like to use. Visit the <a href="http://fontawesome.io/" target="_blank">Font Awesome website</a> for more information.', 'better-font-awesome') ,
246
- 'options' => $versions,
247
- 'default' => $this->cdn_data->lastversion,
248
- ) );
249
-
250
- $optionsPage->createOption( array(
251
- 'name' => __( 'Use minified CSS', 'better-font-awesome' ),
252
- 'id' => 'minified',
253
- 'type' => 'checkbox',
254
- 'desc' => __( 'Whether to include the minified version of the CSS (checked), or the unminified version (unchecked).', 'better-font-awesome' ),
255
- 'default' => true,
256
- ) );
257
-
258
- $optionsPage->createOption( array(
259
- 'name' => __( 'Remove existing FA', 'better-font-awesome' ),
260
- 'id' => 'remove_existing_fa',
261
- 'type' => 'checkbox',
262
- 'desc' => __( 'Remove Font Awesome CSS and shortcodes added by other plugins and themes. This may help if icons are not rendering properly.', 'better-font-awesome' ),
263
- 'default' => false,
264
- ) );
265
-
266
- $optionsPage->createOption( array(
267
- 'name' => __( 'Usage', 'better-font-awesome' ),
268
- 'type' => 'note',
269
- 'desc' => __( '
270
- <b>Version 4</b>&nbsp;&nbsp;&nbsp;<small><a href="http://fontawesome.io/examples/">See all available classes &raquo;</a></small><br /><br />
271
- <i class="icon-star fa fa-star"></i> <code>[icon name="star"]</code> or <code>&lt;i class="fa-star"&gt;&lt;/i&gt;</code><br /><br />
272
- <i class="icon-star fa fa-star icon-2x fa-2x"></i> <code>[icon name="star" class="fa-2x"]</code> or <code>&lt;i class="fa-star fa-2x"&gt;&lt;/i&gt;</code><br /><br />
273
- <i class="icon-star fa fa-star icon-2x fa-2x icon-border fa-border"></i> <code>[icon name="star" class="fa-2x fa-border"]</code> or <code>&lt;i class="fa-star fa-2x fa-border"&gt;&lt;/i&gt;</code><br /><br /><br />
274
- <b>Version 3</b>&nbsp;&nbsp;&nbsp;<small><a href="http://fontawesome.io/3.2.1/examples/">See all available classes &raquo;</a></small><br /><br />
275
- <i class="icon-star fa fa-star"></i> <code>[icon name="star"]</code> or <code>&lt;i class="icon-star"&gt;&lt;/i&gt;</code><br /><br />
276
- <i class="icon-star fa fa-star icon-2x fa-2x"></i> <code>[icon name="star" class="icon-2x"]</code> or <code>&lt;i class="icon-star icon-2x"&gt;&lt;/i&gt;</code><br /><br />
277
- <i class="icon-star fa fa-star icon-2x fa-2x icon-border fa-border"></i> <code>[icon name="star" class="icon-2x icon-border"]</code> or <code>&lt;i class="icon-star icon-2x icon-border"&gt;&lt;/i&gt;</code>
278
-
279
- ', 'better-font-awesome' ),
280
- ) );
281
-
282
- $optionsPage->createOption( array(
283
- 'type' => 'save',
284
- ) );
285
- }
286
-
287
- /**
288
- * Output [icon] shortcode
289
- *
290
- * Example:
291
- * [icon name="flag" class="fw 2x spin"]
292
- *
293
- * @param array $atts Shortcode attributes
294
- * @return string <i> Font Awesome output
295
- */
296
- function render_shortcode( $atts ) {
297
- extract(shortcode_atts(array(
298
- 'name' => '',
299
- 'class' => '',
300
- 'title' => '', /* For compatibility with other plugins */
301
- 'size' => '', /* For compatibility with other plugins */
302
- 'space' => '',
303
- ), $atts)
304
- );
305
-
306
- // Include for backwards compatibility with Font Awesome More Icons plugin
307
- $title = $title ? 'title="' . $title . '" ' : '';
308
- $space = 'false' == $space ? '' : '&nbsp;';
309
- $size = $size ? ' '. $this->prefix . $size : '';
310
-
311
- // Remove "icon-" and "fa-" from name
312
- // This helps both:
313
- // 1. Incorrect shortcodes (when user includes full class name including prefix)
314
- // 2. Old shortcodes from other plugins that required prefixes
315
- $name = str_replace( 'icon-', '', $name );
316
- $name = str_replace( 'fa-', '', $name );
317
-
318
- // Add prefix to name
319
- $icon_name = $this->prefix . $name;
320
-
321
- // Remove "icon-" and "fa-" from classes
322
- $class = str_replace( 'icon-', '', $class );
323
- $class = str_replace( 'fa-', '', $class );
324
-
325
- // Remove extra spaces from class
326
- $class = trim( $class );
327
- $class = preg_replace('/\s{3,}/',' ', $class );
328
-
329
- // Add prefix to each class (separated by space)
330
- $class = ' ' . $this->prefix . str_replace( ' ', ' ' . $this->prefix, $class );
331
-
332
- return '<i class="fa ' . $icon_name . $class . $size . '" ' . $title . '>' . $space . '</i>';
333
- }
334
-
335
- /**
336
- * Registers and enqueues stylesheets for the administration panel and the
337
- * public facing site.
338
- */
339
- function register_scripts_and_styles() {
340
- // Deregister any existing Font Awesome CSS (including Titan Framework)
341
- if ( $this->titan->getOption( 'remove_existing_fa' ) ) {
342
- wp_dequeue_style( 'tf-font-awesome' );
343
- wp_dequeue_style( 'font-awesome' );
344
- }
345
-
346
- // Enqueue Font Awesome CSS
347
- wp_register_style( 'font-awesome', $this->stylesheet_url, '', $this->version );
348
- wp_enqueue_style( 'font-awesome' );
349
- }
350
-
351
- /*
352
- * Load admin CSS
353
- */
354
- function custom_admin_css() {
355
- wp_enqueue_style( 'bfa-admin-styles', plugins_url( 'inc/css/admin-styles.css', __FILE__ ) );
356
- }
357
-
358
- /**
359
- * Load TinyMCE Font Awesome dropdown plugin
360
- */
361
- function register_tinymce_plugin( $plugin_array ) {
362
- global $tinymce_version;
363
-
364
- // >= TinyMCE v4 - include newer plugin
365
- if ( version_compare( $tinymce_version, '4000', '>=' ) )
366
- $plugin_array['bfa_plugin'] = plugins_url( 'inc/js/tinymce-icons.js', __FILE__ );
367
- // < TinyMCE v4 - include old plugin
368
- else
369
- $plugin_array['bfa_plugin'] = plugins_url( 'inc/js/tinymce-icons-old.js', __FILE__ );
370
-
371
- return $plugin_array;
372
- }
373
-
374
- /*
375
- * Add TinyMCE dropdown element
376
- */
377
- function add_tinymce_buttons( $buttons ) {
378
- array_push( $buttons, 'bfaSelect' );
379
-
380
- return $buttons;
381
- }
382
-
383
- /**
384
- * Add PHP variables in head for use by TinyMCE JavaScript
385
- */
386
- function admin_head_variables() {
387
- $icon_list = implode( ",", $this->icons );
388
- ?>
389
- <!-- Better Font Awesome PHP variables for use by TinyMCE JavaScript -->
390
- <script type='text/javascript'>
391
- var bfa_vars = {
392
- 'fa_prefix': '<?php echo $this->prefix; ?>',
393
- 'fa_icons': '<?php echo $icon_list; ?>',
394
- };
395
- </script>
396
- <!-- TinyMCE Better Font Awesome Plugin -->
397
- <?php
398
- }
399
-
400
- }
401
- global $better_font_awesome;
402
- $better_font_awesome = new BetterFontAwesome();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/inc/css/admin-styles.css DELETED
@@ -1,36 +0,0 @@
1
- /* Options page */
2
- .settings_page_options-general-better-font-awesome .titan-framework-panel-wrap [class*="icon-"],
3
- .settings_page_options-general-better-font-awesome .titan-framework-panel-wrap [class*="fa-"] {
4
- display: inline-block;
5
- width: 44px;
6
- margin-right: 10px;
7
- text-align: center;
8
- vertical-align: middle;
9
- -webkit-box-sizing: border-box;
10
- -moz-box-sizing: border-box;
11
- box-sizing: border-box;
12
- }
13
-
14
- /* TinyMCE */
15
-
16
- /* Override editor rules blocking these native Font Awesome styles */
17
- #menu_content_content_bfaSelect_menu .icon-fw,
18
- #menu_content_content_bfaSelect_menu .fa-fw,
19
- .mce-stack-layout-item .icon-fw,
20
- .mce-stack-layout-item .fa-fw {
21
- display: inline-block;
22
- width: 1.2857142857142858em;
23
- text-align: center;
24
- }
25
-
26
- /* Override editor icon font family */
27
- .fa {
28
- font-family: FontAwesome !important;
29
- }
30
-
31
- /* BFA select icon (for versions < and >= TinyMCE 4) */
32
- #content_bfaSelect_text:before {
33
- content: "\f024";
34
- margin-right: .5em;
35
- font-family: FontAwesome;
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/inc/js/tinymce-icons-old.js DELETED
@@ -1,43 +0,0 @@
1
- (function() {
2
-
3
- if( typeof bfa_vars != 'undefined' ) {
4
- var icons = bfa_vars.fa_icons.split(',');
5
- var prefix = bfa_vars.fa_prefix;
6
-
7
- var icon_i = function(id) {
8
- return '<i class="fa ' + prefix + 'fw ' + prefix + id + '"></i>';
9
- }
10
-
11
- var icon_shortcode = function(id) {
12
- return '[icon name="' + id + '" class=""]';
13
- }
14
-
15
- var createControl = function(name, controlManager) {
16
- if (name != 'bfaSelect') return null;
17
- var listBox = controlManager.createListBox('bfaSelect', {
18
- title: 'Icons',
19
- onselect: function(v) {
20
- var editor = this.control_manager.editor;
21
- if (v) {
22
- editor.selection.setContent(icon_shortcode(v));
23
- }
24
- return false;
25
- }
26
- });
27
-
28
- for (var i = 0; i < icons.length; i++) {
29
- var _id = icons[i];
30
- listBox.add(icon_i(_id) + ' ' + _id, _id);
31
- }
32
-
33
- return listBox;
34
- };
35
-
36
- tinymce.create('tinymce.plugins.bfa_plugin', {
37
- createControl: createControl
38
- });
39
-
40
- tinymce.PluginManager.add('bfa_plugin', tinymce.plugins.bfa_plugin);
41
-
42
- }
43
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/inc/js/tinymce-icons.js DELETED
@@ -1,52 +0,0 @@
1
- ( function() {
2
- "use strict";
3
-
4
- var icons = bfa_vars.fa_icons.split(',');
5
- var prefix = bfa_vars.fa_prefix;
6
-
7
- var icon_i = function(id) {
8
- return '<i class="fa ' + prefix + 'fw ' + prefix + id + '"></i>';
9
- }
10
-
11
- var icon_shortcode = function(id) {
12
- return '[icon name="' + id + '" class=""]';
13
- }
14
-
15
- var bfaSelect = function( editor, url ) {
16
- editor.addButton('bfaSelect', function() {
17
- var values = [];
18
-
19
- for (var i = 0; i < icons.length; i++) {
20
- var _id = icons[i];
21
- values.push({text: _id, value: _id, icon: ' fa fa-fw icon-fw fa-' + _id + ' icon-' + _id });
22
- }
23
-
24
- return {
25
- type: 'listbox',
26
- name: 'bfaSelect',
27
- tooltip: 'Better Font Awesome Icons',
28
- icon: ' fa fa-flag icon-flag',
29
- text: 'Icons',
30
- label: 'Select :',
31
- fixedWidth: true,
32
- values: values,
33
- onselect: function(e) {
34
- if (e) {
35
- editor.insertContent(icon_shortcode(e.control.settings.value));
36
- }
37
-
38
- // Reset back to inital "Icons" text
39
- this.value(null);
40
-
41
- return false;
42
- },
43
- onPostRender: function() {
44
- this.addClass('bfaSelect');
45
- }
46
-
47
- };
48
- });
49
-
50
- };
51
- tinymce.PluginManager.add( 'bfa_plugin', bfaSelect );
52
- } )();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/better-font-awesome.pot DELETED
@@ -1,211 +0,0 @@
1
- # Copyright (C) 2014 Better Font Awesome
2
- # This file is distributed under the same license as the Better Font Awesome package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Better Font Awesome 0.9.3\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/better-font-awesome\n"
7
- "POT-Creation-Date: 2014-04-21 00:53:22+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #: Titan-Framework/class-admin-panel.php:290
16
- msgid "Settings saved."
17
- msgstr ""
18
-
19
- #: Titan-Framework/class-admin-panel.php:292
20
- msgid "Settings reset to default."
21
- msgstr ""
22
-
23
- #: Titan-Framework/class-meta-box.php:35
24
- #: Titan-Framework/class-theme-customizer-section.php:30
25
- msgid "More Options"
26
- msgstr ""
27
-
28
- #: Titan-Framework/class-option-save.php:20
29
- msgid "Save Changes"
30
- msgstr ""
31
-
32
- #: Titan-Framework/class-option-save.php:23
33
- msgid "Reset to Default"
34
- msgstr ""
35
-
36
- #: Titan-Framework/class-option-select-categories.php:37
37
- #: Titan-Framework/class-option-select-categories.php:104
38
- #: Titan-Framework/class-option-select-pages.php:30
39
- #: Titan-Framework/class-option-select-posts.php:38
40
- #: Titan-Framework/class-option-select-posts.php:106
41
- msgid "Select"
42
- msgstr ""
43
-
44
- #: Titan-Framework/class-option-select-googlefont.php:29
45
- msgid ""
46
- "%s has been deprecated and will be removed in version %s! Please use %s "
47
- "instead to avoid errors in the future."
48
- msgstr ""
49
-
50
- #: Titan-Framework/class-option-select-googlefont.php:108
51
- msgid "Ultra-light"
52
- msgstr ""
53
-
54
- #: Titan-Framework/class-option-select-googlefont.php:111
55
- msgid "Light"
56
- msgstr ""
57
-
58
- #: Titan-Framework/class-option-select-googlefont.php:114
59
- msgid "Book"
60
- msgstr ""
61
-
62
- #: Titan-Framework/class-option-select-googlefont.php:117
63
- msgid "Medium"
64
- msgstr ""
65
-
66
- #: Titan-Framework/class-option-select-googlefont.php:120
67
- msgid "Semi-Bold"
68
- msgstr ""
69
-
70
- #: Titan-Framework/class-option-select-googlefont.php:123
71
- msgid "Bold"
72
- msgstr ""
73
-
74
- #: Titan-Framework/class-option-select-googlefont.php:126
75
- msgid "Extra-Bold"
76
- msgstr ""
77
-
78
- #: Titan-Framework/class-option-select-googlefont.php:129
79
- msgid "Ultra-Bold"
80
- msgstr ""
81
-
82
- #: Titan-Framework/class-option-select-googlefont.php:132
83
- msgid "Regular"
84
- msgstr ""
85
-
86
- #: Titan-Framework/class-option-upload.php:196
87
- msgid "Select Image"
88
- msgstr ""
89
-
90
- #: Titan-Framework/class-option-upload.php:199
91
- msgid "Use image"
92
- msgstr ""
93
-
94
- #: Titan-Framework/class-option.php:40
95
- msgid "Option type or extended class %s does not exist."
96
- msgstr ""
97
-
98
- #: Titan-Framework/class-titan-framework.php:85
99
- msgid "All option IDs must be unique. The id %s has been used multiple times."
100
- msgstr ""
101
-
102
- #: Titan-Framework/class-titan-framework.php:346
103
- #: Titan-Framework/class-titan-framework.php:393
104
- msgid ""
105
- "Wrong usage of %s, this should be called inside a hook or from within a "
106
- "theme file."
107
- msgstr ""
108
-
109
- #: Titan-Framework/titan-framework.php:126
110
- msgid "Documentation"
111
- msgstr ""
112
-
113
- #: Titan-Framework/titan-framework.php:130
114
- msgid "GitHub Repo"
115
- msgstr ""
116
-
117
- #: Titan-Framework/titan-framework.php:134
118
- msgid "Issue Tracker"
119
- msgstr ""
120
-
121
- #: better-font-awesome.php:189
122
- msgid "Latest"
123
- msgstr ""
124
-
125
- #. #-#-#-#-# plugin.pot (Better Font Awesome 0.9.3) #-#-#-#-#
126
- #. Plugin Name of the plugin/theme
127
- #: better-font-awesome.php:198
128
- msgid "Better Font Awesome"
129
- msgstr ""
130
-
131
- #: better-font-awesome.php:203
132
- msgid "Font Awesome version"
133
- msgstr ""
134
-
135
- #: better-font-awesome.php:206
136
- msgid ""
137
- "Select the version of Font Awesome you would like to use. Visit the <a href="
138
- "\"http://fontawesome.io/\" target=\"_blank\">Font Awesome website</a> for "
139
- "more information."
140
- msgstr ""
141
-
142
- #: better-font-awesome.php:212
143
- msgid "Use minified CSS"
144
- msgstr ""
145
-
146
- #: better-font-awesome.php:215
147
- msgid ""
148
- "Whether to include the minified version of the CSS (checked), or the "
149
- "unminified version (unchecked)."
150
- msgstr ""
151
-
152
- #: better-font-awesome.php:220
153
- msgid "Remove existing Font Awesome styles and shortcodes"
154
- msgstr ""
155
-
156
- #: better-font-awesome.php:223
157
- msgid ""
158
- "Attempt to remove Font Awesome CSS and shortcodes included by other plugins "
159
- "and themes. This may help if icons are not rendering properly."
160
- msgstr ""
161
-
162
- #: better-font-awesome.php:228
163
- msgid "Usage"
164
- msgstr ""
165
-
166
- #: better-font-awesome.php:230
167
- msgid ""
168
- "\n"
169
- "\t\t \t\t<b>Version 4</b>&nbsp;&nbsp;&nbsp;<small><a href=\"http://"
170
- "fontawesome.io/examples/\">See all available classes &raquo;</a></small><br /"
171
- "><br />\n"
172
- "\t\t \t\t<i class=\"icon-star fa fa-star\"></i> <code>[icon name=\"star\"]"
173
- "</code> or <code>&lt;i class=\"fa-star\"&gt;&lt;/i&gt;</code><br /><br />\n"
174
- "\t\t \t\t<i class=\"icon-star fa fa-star icon-2x fa-2x\"></i> <code>[icon "
175
- "name=\"star\" class=\"fa-2x\"]</code> or <code>&lt;i class=\"fa-star fa-2x"
176
- "\"&gt;&lt;/i&gt;</code><br /><br />\n"
177
- "\t\t \t\t<i class=\"icon-star fa fa-star icon-2x fa-2x icon-border fa-"
178
- "border\"></i> <code>[icon name=\"star\" class=\"fa-2x fa-border\"]</code> or "
179
- "<code>&lt;i class=\"fa-star fa-2x fa-border\"&gt;&lt;/i&gt;</code><br /><br /"
180
- "><br />\n"
181
- "\t\t \t\t<b>Version 3</b>&nbsp;&nbsp;&nbsp;<small><a href=\"http://"
182
- "fontawesome.io/3.2.1/examples/\">See all available classes &raquo;</a></"
183
- "small><br /><br />\n"
184
- "\t\t \t\t<i class=\"icon-star fa fa-star\"></i> <code>[icon name=\"star\"]"
185
- "</code> or <code>&lt;i class=\"icon-star\"&gt;&lt;/i&gt;</code><br /><br />\n"
186
- "\t\t \t\t<i class=\"icon-star fa fa-star icon-2x fa-2x\"></i> <code>[icon "
187
- "name=\"star\" class=\"icon-2x\"]</code> or <code>&lt;i class=\"icon-star "
188
- "icon-2x\"&gt;&lt;/i&gt;</code><br /><br />\n"
189
- "\t\t \t\t<i class=\"icon-star fa fa-star icon-2x fa-2x icon-border fa-"
190
- "border\"></i> <code>[icon name=\"star\" class=\"icon-2x icon-border\"]</"
191
- "code> or <code>&lt;i class=\"icon-star icon-2x icon-border\"&gt;&lt;/i&gt;</"
192
- "code>\n"
193
- "\n"
194
- "\t\t \t\t"
195
- msgstr ""
196
-
197
- #. Plugin URI of the plugin/theme
198
- msgid "http://wordpress.org/plugins/better-font-awesome"
199
- msgstr ""
200
-
201
- #. Description of the plugin/theme
202
- msgid "The better Font Awesome icon plugin for Wordpress."
203
- msgstr ""
204
-
205
- #. Author of the plugin/theme
206
- msgid "Mickey Kay"
207
- msgstr ""
208
-
209
- #. Author URI of the plugin/theme
210
- msgid "mickey@mickeykaycreative.com"
211
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/readme.txt DELETED
@@ -1,137 +0,0 @@
1
- === Better Font Awesome ===
2
- Contributors: McGuive7, MIGHTYminnow
3
- Tags: better, font, awesome, icon, bootstrap, fontstrap, cdn, shortcode
4
- Donate link: http://mightyminnow.com
5
- Requires at least: 3.0
6
- Tested up to: 3.9
7
- Stable tag: 0.9.3
8
- License: GPLv2+
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- The Better Font Awesome plugin for WordPress. Shortcodes, HTML, TinyMCE, various Font Awesome versions, backwards compatibility, CDN speeds, and more.
12
-
13
- == Description ==
14
-
15
- Better Font Awesome gives you easy access to the full [Font Awesome](http://fortawesome.github.io/Font-Awesome/ "Font Awesome icon website") icon library using shortcodes, HTML, and TinyMCE, and allows you to update your version of Font Awesome without having to change your existing shortcodes.
16
-
17
-
18
- = Features =
19
-
20
- * **Choose your version** - automatically checks the [Font Awesome CDN](http://www.bootstrapcdn.com/#fontawesome_tab "Font Awesome CDN") for all available versions, and lets you choose which one you want to use from a simple drop down menu. You also have the option to choose "Latest," which means the plugin will automatically switch to the latest version of Font Awesome as soon as it's released.
21
-
22
- * **Backwards compatible** - shortcode output is automatically updated depending on which version you choose, meaning that you can switch versions without having to modify your shortcodes.
23
-
24
- * **Compatible with other plugins** - designed to work with shortcodes generated with plugins like [Font Awesome Icons](http://wordpress.org/plugins/font-awesome/ "Font Awesome Icons"), [Font Awesome More Icons](https://wordpress.org/plugins/font-awesome-more-icons/ "Font Awesome More Icons"), and [Font Awesome Shortcodes](https://wordpress.org/plugins/font-awesome-shortcodes/), so you can switch to Better Font Awesome and your existing shortcodes will still work.
25
-
26
- * **CDN speeds** - utilizes CSS &amp; font files hosted by the excellent [Bootstrap CDN](http://www.bootstrapcdn.com/ "Bootstrap CDN"), which means super-fast load times.
27
-
28
- = Settings =
29
- All settings can be adjusted via **Settings &rarr; Better Font Awesome**.
30
-
31
- = Usage =
32
- Better Font Awesome can be used in 3 different ways: shortcode, HTML, and TinyMCE
33
-
34
- = 1. Shortcode =
35
- `[icon name="flag" class="2x spin border" space="false"]`
36
-
37
- The `name` attribute is simply the name of the icon, and the `class` attribute can include any of the available Font Awesome classes listed on the Font Awesome [Examples Page](http://fortawesome.github.io/Font-Awesome/examples/ "Font Awesome Examples"). The optional `space` attribute can be set to "false" to omit the space that is included after the icon by default.
38
-
39
- Prefixes (`icon-` and `fa-`) are not necessary for shortcode usage. What's great is that Better Font Awesome will automatically remove and replace prefixes depending on the Font Awesome version you choose. So if you have existing Font Awesome shortcodes *with prefixes* (from other plugins, for example), they'll still work just fine.
40
-
41
- That means that the following shortcodes will all work, regardless of what version of Font Awesome you choose:
42
- `[icon name="flag" class="2x spin border"]`
43
- `[icon name="icon-flag" class="icon-2x icon-spin icon-border"]`
44
- `[icon name="fa-flag" class="fa-2x fa-spin fa-border"]`
45
- `[icon name="icon-flag" class="fa-2x spin icon-border"]`
46
-
47
- *Note: icon names and classes will only work for Font Awesome versions in which they are included.*
48
-
49
- = 2. HTML =
50
- Note that prefixes are required for HTML usage, and are version-specific. For this reason, shortcode usage is encouraged over HTML.
51
-
52
- Version 4:
53
- `<i class="fa-flag fa-2x fa-spin fa-border"></i>`
54
-
55
- Version 3:
56
- `<i class="icon-flag icon-2x icon-spin icon-border"></i>`
57
-
58
- = 3. TinyMCE =
59
- Better Font Awesome also provides you with an easy-to-use drop down menu in the default WordPress TinyMCE, which you can use to automatically generate shortcodes for the icons you want. This drop-down list will automatically update with all available icons for whichever version you choose. Check out our [Screenshots](https://wordpress.org/plugins/better-font-awesome/screenshots/ "Screenshots") to see what it looks like.
60
-
61
- = Advanced =
62
- Please feel free to use BFA! If you want to hook into BFA, the best way is via the global `$better_font_awesome` variable, which has a few public variables that might be useful:
63
-
64
- `$better_font_awesome->prefix' - the FontAwesome prefix to use with the selected version of Font Awesome.
65
- `$better_font_awesome->icons` - an alphabetical array of all available icons based on the selected version of Font Awesome.
66
-
67
-
68
- = Credits =
69
- Many thanks to the following plugins and their authors:
70
-
71
- * [Font Awesome Icons](http://wordpress.org/plugins/font-awesome/ "Font Awesome Icons") by [Rachel Baker](http://rachelbaker.me/ "Rachel Baker")
72
- * [Font Awesome More Icons](https://wordpress.org/plugins/font-awesome-more-icons/ "Font Awesome More Icons") by [Web Guys](http://webguysaz.com/ "Web Guys")
73
- * [Font Awesome Shortcodes](https://wordpress.org/plugins/font-awesome-shortcodes/) by [FoolsRun](https://profiles.wordpress.org/foolsrun/ "FoolsRun")
74
-
75
-
76
- == Installation ==
77
-
78
- This section describes how to install the plugin and get it working.
79
-
80
- 1. Upload Font Awesome Icons to the /wp-content/plugins/ directory.
81
- 1. Activate the plugin through the 'Plugins' menu in WordPress.
82
- 1. That's it! Now you can use 3 different methods (shortcode, HTML, TinyMCE) to insert Font Awesome icons, all outlined in the [Description](https://wordpress.org/plugins/better-font-awesome "Description") section.
83
-
84
-
85
- == Frequently Asked Questions ==
86
-
87
- = How is this plugin different from other Font Awesome plugins? =
88
-
89
- This plugin is unique in that it automatically pulls in *all* available versions of Font Awesome, meaning you never have to wait for the plugin developer to add the latest version. Furthermore, Better Font Awesome is designed to work with a wide variety of shortcode formats used by other Font Awesome plugins - this means that you can easily switch to Better Font Awesome (if, for example, you need to include icons from the most recent version of Font Awesome, which isn't always available with other plugins), and they will still work.
90
-
91
- = Do I have to install any font files? =
92
-
93
- Nope. Better Font Awesome automatically pulls in everything you need, and it does it from the lightning-fast Bootstrap CDN.
94
-
95
- = What happens if I have another plugin/theme that uses Font Awesome? =
96
-
97
- Better Font Awesome does it's best to load after any existing Font Awesome CSS, which can minimize conflicts. If you are experiencing any unexpected behavior resulting from plugin/theme conflicts, you can try checking the box to "Remove existing Font Awesome styles" in under **Settings &rarr; Better Font Awesome**.
98
-
99
-
100
- == Screenshots ==
101
-
102
- 1. Better Font Awesome settings, accessed via Settings &rarr; Better Font Awesome
103
- 2. Using Better Font Awesome via TinyMCE
104
-
105
-
106
- == Changelog ==
107
-
108
- = 0.9.3 =
109
- * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
110
- * Print JS variables in front-end to aid developers
111
- * Create global $better_font_awesome object for developers to access
112
-
113
- = 0.9.2 =
114
- * Fixes issue of missing icon drop-down select menu in TinyMCE (adds compatibility for TinyMCE v4)
115
-
116
- = 0.9.1 =
117
- * Added fixes for older versions of PHP (Titan Framework not found, unexpected "[")
118
-
119
- = 0.9.0 =
120
- * First release!
121
-
122
-
123
- == Upgrade Notice ==
124
-
125
- = 0.9.3 =
126
- * Fixed admin-styles.css bug that was applying FontAwesome font-face outside TinyMCE
127
- * Print JS variables in front-end to aid developers
128
- * Create global $better_font_awesome object for developers to access
129
-
130
- = 0.9.2 =
131
- * Fixes issue of missing icon drop-down select menu in TinyMCE (adds compatibility for TinyMCE v4)
132
-
133
- = 0.9.1 =
134
- * Added fixes for older versions of PHP (Titan Framework not found, unexpected "[")
135
-
136
- = 0.9.0 =
137
- * First release!