<!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>[27085] trunk/src: Minor cleanup (jshint) of wp-fullscreen.js and /wordpress/plugin.js, see #24067</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/27085">27085</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2014-02-03 21:30:25 +0000 (Mon, 03 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Minor cleanup (jshint) of wp-fullscreen.js and /wordpress/plugin.js, see <a href="http://core.trac.wordpress.org/ticket/24067">#24067</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjswpfullscreenjs">trunk/src/wp-admin/js/wp-fullscreen.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresspluginjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjswpfullscreenjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/js/wp-fullscreen.js (27084 => 27085)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/js/wp-fullscreen.js   2014-02-03 21:26:39 UTC (rev 27084)
+++ trunk/src/wp-admin/js/wp-fullscreen.js      2014-02-03 21:30:25 UTC (rev 27085)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-/* global ajaxurl, deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit, wp_fullscreen_settings, wpActiveEditor:true, wpLink */
</del><ins>+/* global deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit */
</ins><span class="cx"> /**
</span><span class="cx">  * Distraction Free Writing
</span><span class="cx">  * (wp-fullscreen)
</span><span class="lines">@@ -7,7 +7,6 @@
</span><span class="cx">  */
</span><span class="cx"> ( function( $, window ) {
</span><span class="cx">  var api, ps, s, toggleUI, uiTimer, PubSub,
</span><del>-               oldheight = 0,
</del><span class="cx">           uiScrollTop = 0,
</span><span class="cx">          transitionend = 'transitionend webkitTransitionEnd',
</span><span class="cx">          $body = $( document.body ),
</span><span class="lines">@@ -86,7 +85,6 @@
</span><span class="cx"> 
</span><span class="cx">  function _hideUI() {
</span><span class="cx">          $body.removeClass('wp-dfw-show-ui');
</span><del>-               uiShown = false;
</del><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  /**
</span><span class="lines">@@ -136,7 +134,7 @@
</span><span class="cx">   * @param string mode Optional. Switch to the given mode before opening.
</span><span class="cx">   */
</span><span class="cx">  api.on = function() {
</span><del>-               var id, $dfwWrap, editor, titleId;
</del><ins>+                var id, $dfwWrap, titleId;
</ins><span class="cx"> 
</span><span class="cx">          if ( s.visible ) {
</span><span class="cx">                  return;
</span><span class="lines">@@ -264,7 +262,7 @@
</span><span class="cx">          var $hidden = $('#hiddenaction'),
</span><span class="cx">                  oldVal = $hidden.val(),
</span><span class="cx">                  $spinner = $('#wp-fullscreen-save .spinner'),
</span><del>-                       $saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message')
</del><ins>+                        $saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message'),
</ins><span class="cx">                   $errorMessage = $('#wp-fullscreen-save .wp-fullscreen-error-message');
</span><span class="cx"> 
</span><span class="cx">          $spinner.show();
</span><span class="lines">@@ -405,7 +403,7 @@
</span><span class="cx">                  $( '#wp-fullscreen-title-placeholder' ).before( s.$dfwTitle.removeClass('wp-fullscreen-title').css( 'width', '' ) ).remove();
</span><span class="cx">          }
</span><span class="cx"> 
</span><del>-               s.$dfwWrap.removeClass( 'wp-fullscreen-wrap' )
</del><ins>+                s.$dfwWrap.removeClass( 'wp-fullscreen-wrap' );
</ins><span class="cx">           s.$editorContainer.css( 'width', '' );
</span><span class="cx">          s.$dfwTextarea.add( '#' + s.id + '_ifr' ).height( s.origHeight );
</span><span class="cx"> 
</span><span class="lines">@@ -455,7 +453,7 @@
</span><span class="cx">   */
</span><span class="cx">  api.ui = {
</span><span class="cx">          init: function() {
</span><del>-                       var toolbar, last = 0;
</del><ins>+                        var toolbar;
</ins><span class="cx"> 
</span><span class="cx">                  s.toolbar = toolbar = $('#fullscreen-topbar');
</span><span class="cx">                  s.$fullscreenFader = $('#fullscreen-fader');
</span><span class="lines">@@ -465,29 +463,29 @@
</span><span class="cx">                          $('#wp-fullscreen-mode-bar').hide();
</span><span class="cx"> 
</span><span class="cx">                  $document.keyup( function(e) {
</span><del>-                               var c = e.keyCode || e.charCode, a, data;
</del><ins>+                                var c = e.keyCode || e.charCode, modKey;
</ins><span class="cx"> 
</span><span class="cx">                          if ( ! s.visible ) {
</span><span class="cx">                                  return;
</span><span class="cx">                          }
</span><span class="cx"> 
</span><span class="cx">                          if ( navigator.platform && navigator.platform.indexOf('Mac') !== -1 ) {
</span><del>-                                       a = e.ctrlKey; // Ctrl key for Mac
</del><ins>+                                        modKey = e.ctrlKey; // Ctrl key for Mac
</ins><span class="cx">                           } else {
</span><del>-                                       a = e.altKey; // Alt key for Win & Linux
</del><ins>+                                        modKey = e.altKey; // Alt key for Win & Linux
</ins><span class="cx">                           }
</span><span class="cx"> 
</span><del>-                               if ( a && (61 == c || 107 == c || 187 == c) ) { // +
</del><ins>+                                if ( modKey && ( 61 === c || 107 === c || 187 === c ) ) { // +
</ins><span class="cx">                                   api.dfwWidth( 25 );
</span><span class="cx">                                  e.preventDefault();
</span><span class="cx">                          }
</span><span class="cx"> 
</span><del>-                               if ( a && (45 == c || 109 == c || 189 == c) ) { // -
</del><ins>+                                if ( modKey && ( 45 === c || 109 === c || 189 === c ) ) { // -
</ins><span class="cx">                                   api.dfwWidth( -25 );
</span><span class="cx">                                  e.preventDefault();
</span><span class="cx">                          }
</span><span class="cx"> 
</span><del>-                               if ( a && 48 == c ) { // 0
</del><ins>+                                if ( modKey && 48 === c ) { // 0
</ins><span class="cx">                                   api.dfwWidth( 0 );
</span><span class="cx">                                  e.preventDefault();
</span><span class="cx">                          }
</span><span class="lines">@@ -664,12 +662,12 @@
</span><span class="cx">   * Automatically updates textarea height.
</span><span class="cx">   */
</span><span class="cx">  api.bind_resize = function() {
</span><del>-               s.$dfwTextarea.on( 'keydown.wp-dfw-resize click.wp-dfw-resize paste.wp-dfw-resize', function(e) {
-                       api.resizeTextarea(e);
</del><ins>+                s.$dfwTextarea.on( 'keydown.wp-dfw-resize click.wp-dfw-resize paste.wp-dfw-resize', function() {
+                       api.resizeTextarea();
</ins><span class="cx">           });
</span><span class="cx">  };
</span><span class="cx"> 
</span><del>-       api.resizeTextarea = function( event ) {
</del><ins>+        api.resizeTextarea = function() {
</ins><span class="cx">           var node = s.$dfwTextarea[0];
</span><span class="cx"> 
</span><span class="cx">          if ( node.scrollHeight > node.clientHeight ) {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswordpresspluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js (27084 => 27085)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js     2014-02-03 21:26:39 UTC (rev 27084)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js        2014-02-03 21:30:25 UTC (rev 27085)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-/* global tinymce, autosave, getUserSetting, setUserSetting, switchEditors */
</del><ins>+/* global tinymce, getUserSetting, setUserSetting, switchEditors */
</ins><span class="cx"> tinymce.PluginManager.add( 'wordpress', function( editor ) {
</span><span class="cx">  var DOM = tinymce.DOM, wpAdvButton, modKey, style,
</span><span class="cx">          last = 0;
</span><span class="lines">@@ -127,25 +127,25 @@
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="cx">  // Make sure the "more" tag is in a separate paragraph
</span><del>-       editor.on( 'PreProcess', function( event ) { 
-               var more; 
</del><ins>+        editor.on( 'PreProcess', function( event ) {
+               var more;
</ins><span class="cx"> 
</span><del>-               if ( event.save ) { 
-                       more = editor.dom.select( 'img.wp-more-tag', event.node ); 
</del><ins>+                if ( event.save ) {
+                       more = editor.dom.select( 'img.wp-more-tag', event.node );
</ins><span class="cx"> 
</span><del>-                       if ( more.length ) { 
-                               tinymce.each( more, function( node ) { 
-                                       var parent = node.parentNode, p; 
</del><ins>+                        if ( more.length ) {
+                               tinymce.each( more, function( node ) {
+                                       var parent = node.parentNode, p;
</ins><span class="cx"> 
</span><del>-                                       if ( parent.nodeName === 'P' && parent.childNodes.length > 1 ) { 
-                                               p = editor.dom.create('p'); 
-                                               parent.parentNode.insertBefore( p, parent ); 
-                                               p.appendChild( node ); 
-                                       } 
-                               }); 
-                       } 
-               } 
-       }); 
</del><ins>+                                        if ( parent.nodeName === 'P' && parent.childNodes.length > 1 ) {
+                                               p = editor.dom.create('p');
+                                               parent.parentNode.insertBefore( p, parent );
+                                               p.appendChild( node );
+                                       }
+                               });
+                       }
+               }
+       });
</ins><span class="cx"> 
</span><span class="cx">  // Register commands
</span><span class="cx">  editor.addCommand( 'WP_More', function( tag ) {
</span></span></pre>
</div>
</div>

</body>
</html>