<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26667] trunk: Define globals and add semicolons to wp-fullscreen.js.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26667">26667</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2013-12-05 16:04:59 +0000 (Thu, 05 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Define globals and add semicolons to wp-fullscreen.js.

`grunt jshint` now runs clean for WordPress core!

props mattwiebe.
fixes <a href="http://core.trac.wordpress.org/ticket/26029">#26029</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunksrcwpadminjswpfullscreenjs">trunk/src/wp-admin/js/wp-fullscreen.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4>Modified: trunk/Gruntfile.js (26666 => 26667)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Gruntfile.js       2013-12-05 08:29:34 UTC (rev 26666)
+++ trunk/Gruntfile.js  2013-12-05 16:04:59 UTC (rev 26667)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">                  colors: {
</span><span class="cx">                          options: {
</span><span class="cx">                                  processContent: function( src ) {
</span><del>-                                               return src.replace( /([^/]+)\.css/gi, "$1-rtl.css" );
</del><ins>+                                                return src.replace( /([^/]+)\.css/gi, '$1-rtl.css' );
</ins><span class="cx">                                   }
</span><span class="cx">                          },
</span><span class="cx">                          expand: true,
</span></span></pre></div>
<a id="trunksrcwpadminjswpfullscreenjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/wp-fullscreen.js (26666 => 26667)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/wp-fullscreen.js   2013-12-05 08:29:34 UTC (rev 26666)
+++ trunk/src/wp-admin/js/wp-fullscreen.js      2013-12-05 16:04:59 UTC (rev 26667)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+/* global ajaxurl, deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit, wp_fullscreen_settings, wpActiveEditor:true, wpLink */
</ins><span class="cx"> /**
</span><span class="cx">  * PubSub
</span><span class="cx">  *
</span><span class="lines">@@ -63,7 +64,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> (function($){
</span><del>-       var api, ps, bounder, s;
</del><ins>+        var api, ps, bounder, s, timer, block, set_title_hint;
</ins><span class="cx"> 
</span><span class="cx">  // Initialize the fullscreen/api object
</span><span class="cx">  fullscreen = api = {};
</span><span class="lines">@@ -80,7 +81,7 @@
</span><span class="cx">          title_id : '',
</span><span class="cx">          timer : 0,
</span><span class="cx">          toolbar_shown : false
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Bounder
</span><span class="lines">@@ -156,7 +157,7 @@
</span><span class="cx">          if ( ! s.element )
</span><span class="cx">                  api.ui.init();
</span><span class="cx"> 
</span><del>-               s.is_mce_on = s.has_tinymce && typeof( tinyMCE.get(s.editor_id) ) != 'undefined';
</del><ins>+                s.is_mce_on = s.has_tinymce && typeof( tinymce.get(s.editor_id) ) != 'undefined';
</ins><span class="cx"> 
</span><span class="cx">          api.ui.fade( 'show', 'showing', 'shown' );
</span><span class="cx">  };
</span><span class="lines">@@ -227,7 +228,7 @@
</span><span class="cx">          }, 'json');
</span><span class="cx"> 
</span><span class="cx">          hidden.val(old);
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  api.savecontent = function() {
</span><span class="cx">          var ed, content;
</span><span class="lines">@@ -235,7 +236,7 @@
</span><span class="cx">          if ( s.title_id )
</span><span class="cx">                  $('#' + s.title_id).val( $('#wp-fullscreen-title').val() );
</span><span class="cx"> 
</span><del>-               if ( s.mode === 'tinymce' && (ed = tinyMCE.get('wp_mce_fullscreen')) ) {
</del><ins>+                if ( s.mode === 'tinymce' && (ed = tinymce.get('wp_mce_fullscreen')) ) {
</ins><span class="cx">                   content = ed.save();
</span><span class="cx">          } else {
</span><span class="cx">                  content = $('#wp_mce_fullscreen').val();
</span><span class="lines">@@ -243,14 +244,14 @@
</span><span class="cx"> 
</span><span class="cx">          $('#' + s.editor_id).val( content );
</span><span class="cx">          $(document).triggerHandler('wpcountwords', [ content ]);
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  set_title_hint = function( title ) {
</span><span class="cx">          if ( ! title.val().length )
</span><span class="cx">                  title.siblings('label').css( 'visibility', '' );
</span><span class="cx">          else
</span><span class="cx">                  title.siblings('label').css( 'visibility', 'hidden' );
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  api.dfw_width = function(n) {
</span><span class="cx">          var el = $('#wp-fullscreen-wrap'), w = el.width();
</span><span class="lines">@@ -268,7 +269,7 @@
</span><span class="cx"> 
</span><span class="cx">          el.width( w );
</span><span class="cx">          setUserSetting('dfw_width', w);
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  ps.subscribe( 'showToolbar', function() {
</span><span class="cx">          s.toolbars.removeClass('fade-1000').addClass('fade-300');
</span><span class="lines">@@ -305,7 +306,7 @@
</span><span class="cx">          s.textarea_obj.value = s.qt_canvas.value;
</span><span class="cx"> 
</span><span class="cx">          if ( s.has_tinymce && s.mode === 'tinymce' )
</span><del>-                       tinyMCE.execCommand('wpFullScreenInit');
</del><ins>+                        tinymce.execCommand('wpFullScreenInit');
</ins><span class="cx"> 
</span><span class="cx">          s.orig_y = $(window).scrollTop();
</span><span class="cx">  });
</span><span class="lines">@@ -349,7 +350,7 @@
</span><span class="cx">                  };
</span><span class="cx"> 
</span><span class="cx">                  tinymce.onAddEditor.add(interim_init);
</span><del>-                       tinyMCE.init(tinyMCEPreInit.mceInit[s.editor_id]);
</del><ins>+                        tinymce.init(tinyMCEPreInit.mceInit[s.editor_id]);
</ins><span class="cx"> 
</span><span class="cx">                  s.is_mce_on = true;
</span><span class="cx">          }
</span><span class="lines">@@ -373,7 +374,7 @@
</span><span class="cx">          $(s.textarea_obj).unbind('.grow');
</span><span class="cx"> 
</span><span class="cx">          if ( s.has_tinymce && s.mode === 'tinymce' )
</span><del>-                       tinyMCE.execCommand('wpFullScreenSave');
</del><ins>+                        tinymce.execCommand('wpFullScreenSave');
</ins><span class="cx"> 
</span><span class="cx">          if ( s.title_id )
</span><span class="cx">                  set_title_hint( $('#' + s.title_id) );
</span><span class="lines">@@ -393,7 +394,7 @@
</span><span class="cx">          $('#wp_mce_fullscreen, #wp-fullscreen-title').removeAttr('style');
</span><span class="cx"> 
</span><span class="cx">          if ( s.has_tinymce && s.is_mce_on )
</span><del>-                       tinyMCE.execCommand('wpFullScreenClose');
</del><ins>+                        tinymce.execCommand('wpFullScreenClose');
</ins><span class="cx"> 
</span><span class="cx">          s.textarea_obj.value = '';
</span><span class="cx">          api.oldheight = 0;
</span><span class="lines">@@ -406,15 +407,15 @@
</span><span class="cx">          if ( !s.has_tinymce || !s.is_mce_on )
</span><span class="cx">                  return;
</span><span class="cx"> 
</span><del>-               ed = tinyMCE.get('wp_mce_fullscreen');
</del><ins>+                ed = tinymce.get('wp_mce_fullscreen');
</ins><span class="cx"> 
</span><span class="cx">          if ( from === 'html' && to === 'tinymce' ) {
</span><span class="cx"> 
</span><del>-                       if ( tinyMCE.get(s.editor_id).getParam('wpautop') && typeof(switchEditors) != 'undefined' )
</del><ins>+                        if ( tinymce.get(s.editor_id).getParam('wpautop') && typeof(switchEditors) != 'undefined' )
</ins><span class="cx">                           s.textarea_obj.value = switchEditors.wpautop( s.textarea_obj.value );
</span><span class="cx"> 
</span><span class="cx">                  if ( 'undefined' == typeof(ed) )
</span><del>-                               tinyMCE.execCommand('wpFullScreenInit');
</del><ins>+                                tinymce.execCommand('wpFullScreenInit');
</ins><span class="cx">                   else
</span><span class="cx">                          ed.show();
</span><span class="cx"> 
</span><span class="lines">@@ -436,55 +437,55 @@
</span><span class="cx">   */
</span><span class="cx">  api.b = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('Bold');
-       }
</del><ins>+                        tinymce.execCommand('Bold');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.i = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('Italic');
-       }
</del><ins>+                        tinymce.execCommand('Italic');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.ul = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('InsertUnorderedList');
-       }
</del><ins>+                        tinymce.execCommand('InsertUnorderedList');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.ol = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('InsertOrderedList');
-       }
</del><ins>+                        tinymce.execCommand('InsertOrderedList');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.link = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('WP_Link');
</del><ins>+                        tinymce.execCommand('WP_Link');
</ins><span class="cx">           else
</span><span class="cx">                  wpLink.open();
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  api.unlink = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('unlink');
-       }
</del><ins>+                        tinymce.execCommand('unlink');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.atd = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('mceWritingImprovementTool');
-       }
</del><ins>+                        tinymce.execCommand('mceWritingImprovementTool');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.help = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('WP_Help');
-       }
</del><ins>+                        tinymce.execCommand('WP_Help');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.blockquote = function() {
</span><span class="cx">          if ( s.has_tinymce && 'tinymce' === s.mode )
</span><del>-                       tinyMCE.execCommand('mceBlockQuote');
-       }
</del><ins>+                        tinymce.execCommand('mceBlockQuote');
+       };
</ins><span class="cx"> 
</span><span class="cx">  api.medialib = function() {
</span><span class="cx">          if ( typeof wp !== 'undefined' && wp.media && wp.media.editor )
</span><span class="cx">                  wp.media.editor.open(s.editor_id);
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  api.refresh_buttons = function( fade ) {
</span><span class="cx">          fade = fade || false;
</span><span class="lines">@@ -509,7 +510,7 @@
</span><span class="cx">                  else
</span><span class="cx">                          $('#wp-fullscreen-button-bar').removeClass('wp-html-mode');
</span><span class="cx">          }
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * UI Elements
</span><span class="lines">@@ -591,12 +592,12 @@
</span><span class="cx">                          });
</span><span class="cx">                  }
</span><span class="cx"> 
</span><del>-                       topbar.mouseenter(function(e){
</del><ins>+                        topbar.mouseenter(function(){
</ins><span class="cx">                           s.toolbars.addClass('fullscreen-make-sticky');
</span><span class="cx">                          $( document ).unbind( '.fullscreen' );
</span><span class="cx">                          clearTimeout( s.timer );
</span><span class="cx">                          s.timer = 0;
</span><del>-                       }).mouseleave(function(e){
</del><ins>+                        }).mouseleave(function(){
</ins><span class="cx">                           s.toolbars.removeClass('fullscreen-make-sticky');
</span><span class="cx"> 
</span><span class="cx">                          if ( s.visible )
</span><span class="lines">@@ -619,7 +620,7 @@
</span><span class="cx">                          api.fade.Out( s.element, 600, function() {
</span><span class="cx">                                  if ( after )
</span><span class="cx">                                          ps.publish( after );
</span><del>-                               })
</del><ins>+                                });
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx">  };
</span><span class="lines">@@ -712,7 +713,7 @@
</span><span class="cx">          $(s.textarea_obj).bind('keypress.grow click.grow paste.grow', function(){
</span><span class="cx">                  setTimeout( api.resize_textarea, 200 );
</span><span class="cx">          });
</span><del>-       }
</del><ins>+        };
</ins><span class="cx"> 
</span><span class="cx">  api.oldheight = 0;
</span><span class="cx">  api.resize_textarea = function() {
</span></span></pre>
</div>
</div>

</body>
</html>