Permalink
Browse files

Added minified js file

  • Loading branch information...
1 parent 836d6fc commit 248595340f0771ee5fea85b5bf49c20d5df54db8 @GeertDD committed Apr 16, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 javascript/tinymce-email-button.js
  2. +1 −0 javascript/tinymce-email-button.min.js
  3. +2 −1 tinymce-email-button.php
@@ -1,4 +1,4 @@
-;(function () {
+(function () {
tinymce.create('tinymce.plugins.email', {
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.email",{init:function(b){b.addButton("email",{cmd:"email",title:tinymce_email_button.title,image:tinymce_email_button.url+"images/email-button.png"});b.addCommand("email",function(){var c=b.selection.getContent({format:"text"}),a=c.match(/\S+@\S+\.[a-z]+/i);if(a=prompt(tinymce_email_button.prompt,a?a[0]:""))""===c&&(c=a),b.execCommand("mceInsertContent",!1,'<a href="mailto:'+a+'">'+c+"</a>")});b.onNodeChange.add(function(b,a,d){a.setActive("email",!1);a.setDisabled("email", !1);"A"===d.nodeName&&((d.href||"").match(/^mailto:/i)?a.setActive("email",!0):a.setDisabled("email",!0))})}});tinymce.PluginManager.add("email",tinymce.plugins.email)})();
@@ -98,7 +98,8 @@ public function mce_buttons($buttons)
*/
public function mce_external_plugins($plugins)
{
- $plugins['email'] = plugin_dir_url(__FILE__).'javascript/tinymce-email-button.js';
+ $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
+ $plugins['email'] = plugin_dir_url(__FILE__).'javascript/tinymce-email-button'.$suffix.'.js';
return $plugins;
}

0 comments on commit 2485953

Please sign in to comment.