<!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>[26214] trunk/src/wp-includes/js/tinymce/plugins: Fix JSHint errors in remaining WP TinyMCE plugin files.</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/26214">26214</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2013-11-15 15:04:04 +0000 (Fri, 15 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix JSHint errors in remaining WP TinyMCE plugin files.
fixes <a href="http://core.trac.wordpress.org/ticket/26048">#26048</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjstinymcepluginswordpresseditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpdialogseditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpeditimageeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpfullscreeneditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpgalleryeditor_plugin_srcjs">trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjstinymcepluginswordpresseditor_plugin_srcjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js (26213 => 26214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js 2013-11-15 14:26:36 UTC (rev 26213)
+++ trunk/src/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js 2013-11-15 15:04:04 UTC (rev 26214)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+/* global tinymce, getUserSetting, setUserSetting, switchEditors, autosave */
</ins><span class="cx"> /**
</span><span class="cx"> * WordPress plugin.
</span><span class="cx"> */
</span><span class="lines">@@ -142,7 +143,7 @@
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><del>- ed.onExecCommand.add( function( ed, cmd, ui, val ) {
</del><ins>+ ed.onExecCommand.add( function( ed, cmd ) {
</ins><span class="cx"> if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
</span><span class="cx"> ed.dom.remove( style );
</span><span class="cx"> });
</span><span class="lines">@@ -221,7 +222,7 @@
</span><span class="cx">
</span><span class="cx"> last = k;
</span><span class="cx"> });
</span><del>- };
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // keep empty paragraphs :(
</span><span class="cx"> ed.onSaveContent.addToTop(function(ed, o) {
</span><span class="lines">@@ -291,19 +292,19 @@
</span><span class="cx">
</span><span class="cx"> // popup buttons for images and the gallery
</span><span class="cx"> ed.onInit.add(function(ed) {
</span><del>- tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
</del><ins>+ tinymce.dom.Event.add(ed.getWin(), 'scroll', function() {
</ins><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><del>- tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) {
</del><ins>+ tinymce.dom.Event.add(ed.getBody(), 'dragstart', function() {
</ins><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx">
</span><del>- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
</del><ins>+ ed.onBeforeExecCommand.add( function( ed ) {
</ins><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><span class="cx">
</span><del>- ed.onSaveContent.add(function(ed, o) {
</del><ins>+ ed.onSaveContent.add( function( ed ) {
</ins><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -325,7 +326,7 @@
</span><span class="cx"> ed.windowManager.close(null, id);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- }
</del><ins>+ };
</ins><span class="cx">
</span><span class="cx"> // close popups when clicking on the background
</span><span class="cx"> tinymce.dom.Event.remove(document.body, 'click', closeOnClick);
</span><span class="lines">@@ -361,7 +362,7 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _showButtons : function(n, id) {
</span><del>- var ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
</del><ins>+ var ed = tinymce.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
</ins><span class="cx">
</span><span class="cx"> vp = ed.dom.getViewPort(ed.getWin());
</span><span class="cx"> p1 = DOM.getPos(ed.getContentAreaContainer());
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpdialogseditor_plugin_srcjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js (26213 => 26214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js 2013-11-15 14:26:36 UTC (rev 26213)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js 2013-11-15 15:04:04 UTC (rev 26214)
</span><span class="lines">@@ -1,16 +1,7 @@
</span><del>-/**
- * editor_plugin_src.js
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL
- *
- * License: http://tinymce.moxiecode.com/license
- * Contributing: http://tinymce.moxiecode.com/contributing
- */
-
</del><ins>+/* global tinymce */
</ins><span class="cx"> (function() {
</span><span class="cx"> tinymce.create('tinymce.plugins.WPDialogs', {
</span><del>- init : function(ed, url) {
</del><ins>+ init : function( ed ) {
</ins><span class="cx"> tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
</span><span class="cx"> WPWindowManager : function(ed) {
</span><span class="cx"> this.parent(ed);
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpeditimageeditor_plugin_srcjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js (26213 => 26214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js 2013-11-15 14:26:36 UTC (rev 26213)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js 2013-11-15 15:04:04 UTC (rev 26214)
</span><span class="lines">@@ -1,11 +1,13 @@
</span><ins>+/* global tinymce */
+(function() {
+ var mouse = {};
</ins><span class="cx">
</span><del>-(function() {
</del><span class="cx"> tinymce.create('tinymce.plugins.wpEditImage', {
</span><span class="cx"> url: '',
</span><span class="cx"> editor: {},
</span><span class="cx">
</span><span class="cx"> init: function(ed, url) {
</span><del>- var t = this, mouse = {};
</del><ins>+ var t = this;
</ins><span class="cx">
</span><span class="cx"> t.url = url;
</span><span class="cx"> t.editor = ed;
</span><span class="lines">@@ -27,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> // when pressing Return inside a caption move the caret to a new parapraph under it
</span><span class="cx"> ed.dom.events.add(ed.getBody(), 'keydown', function(e) {
</span><del>- var n, DL, DIV, P, content;
</del><ins>+ var n, DL, DIV, P;
</ins><span class="cx">
</span><span class="cx"> if ( e.keyCode == 13 ) {
</span><span class="cx"> n = ed.selection.getNode();
</span><span class="lines">@@ -105,7 +107,7 @@
</span><span class="cx">
</span><span class="cx"> // When inserting content, if the caret is inside a caption create new paragraph under
</span><span class="cx"> // and move the caret there
</span><del>- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
</del><ins>+ ed.onBeforeExecCommand.add( function( ed, cmd ) {
</ins><span class="cx"> var node, p;
</span><span class="cx">
</span><span class="cx"> if ( cmd == 'mceInsertContent' ) {
</span><span class="lines">@@ -227,7 +229,7 @@
</span><span class="cx"> title : ed.getLang('wpeditimage.edit_img')
</span><span class="cx"> });
</span><span class="cx">
</span><del>- tinymce.dom.Event.add(editButton, 'mousedown', function(e) {
</del><ins>+ tinymce.dom.Event.add(editButton, 'mousedown', function() {
</ins><span class="cx"> t._editImage();
</span><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><span class="lines">@@ -240,7 +242,7 @@
</span><span class="cx"> title : ed.getLang('wpeditimage.del_img')
</span><span class="cx"> });
</span><span class="cx">
</span><del>- tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
</del><ins>+ tinymce.dom.Event.add(dellButton, 'mousedown', function() {
</ins><span class="cx"> var ed = tinymce.activeEditor, el = ed.selection.getNode(), parent;
</span><span class="cx">
</span><span class="cx"> if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
</span><span class="lines">@@ -317,7 +319,7 @@
</span><span class="cx"> author : 'WordPress',
</span><span class="cx"> authorurl : 'http://wordpress.org',
</span><span class="cx"> infourl : '',
</span><del>- version : "1.0"
</del><ins>+ version : '1.0'
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpfullscreeneditor_plugin_srcjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js (26213 => 26214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js 2013-11-15 14:26:36 UTC (rev 26213)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js 2013-11-15 15:04:04 UTC (rev 26214)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+/* global tinymce:false, switchEditors, fullscreen */
</ins><span class="cx"> /**
</span><span class="cx"> * WP Fullscreen TinyMCE plugin
</span><span class="cx"> *
</span><span class="lines">@@ -8,26 +9,26 @@
</span><span class="cx"> tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
</span><span class="cx"> resize_timeout: false,
</span><span class="cx">
</span><del>- init : function(ed, url) {
- var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM;
</del><ins>+ init : function( ed ) {
+ var t = this, s = {}, DOM = tinymce.DOM;
</ins><span class="cx">
</span><span class="cx"> // Register commands
</span><span class="cx"> ed.addCommand('wpFullScreenClose', function() {
</span><del>- // this removes the editor, content has to be saved first with tinyMCE.execCommand('wpFullScreenSave');
</del><ins>+ // this removes the editor, content has to be saved first with tinymce.execCommand('wpFullScreenSave');
</ins><span class="cx"> if ( ed.getParam('wp_fullscreen_is_enabled') ) {
</span><span class="cx"> DOM.win.setTimeout(function() {
</span><del>- tinyMCE.remove(ed);
</del><ins>+ tinymce.remove(ed);
</ins><span class="cx"> DOM.remove('wp_mce_fullscreen_parent');
</span><del>- tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
</del><ins>+ tinymce.settings = tinymce.oldSettings; // Restore old settings
</ins><span class="cx"> }, 10);
</span><span class="cx"> }
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> ed.addCommand('wpFullScreenSave', function() {
</span><del>- var ed = tinyMCE.get('wp_mce_fullscreen'), edd;
</del><ins>+ var ed = tinymce.get('wp_mce_fullscreen'), edd;
</ins><span class="cx">
</span><span class="cx"> ed.focus();
</span><del>- edd = tinyMCE.get( ed.getParam('wp_fullscreen_editor_id') );
</del><ins>+ edd = tinymce.get( ed.getParam('wp_fullscreen_editor_id') );
</ins><span class="cx">
</span><span class="cx"> edd.setContent( ed.getContent({format : 'raw'}), {format : 'raw'} );
</span><span class="cx"> });
</span><span class="lines">@@ -35,11 +36,11 @@
</span><span class="cx"> ed.addCommand('wpFullScreenInit', function() {
</span><span class="cx"> var d, b, fsed;
</span><span class="cx">
</span><del>- ed = tinyMCE.activeEditor;
</del><ins>+ ed = tinymce.activeEditor;
</ins><span class="cx"> d = ed.getDoc();
</span><span class="cx"> b = d.body;
</span><span class="cx">
</span><del>- tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
</del><ins>+ tinymce.oldSettings = tinymce.settings; // Store old settings
</ins><span class="cx">
</span><span class="cx"> tinymce.each(ed.settings, function(v, n) {
</span><span class="cx"> s[n] = v;
</span><span class="lines">@@ -67,7 +68,7 @@
</span><span class="cx"> edd.setContent( switchEditors.wpautop( edd.getElement().value ) );
</span><span class="cx">
</span><span class="cx"> setTimeout(function(){ // add last
</span><del>- edd.onNodeChange.add(function(ed, cm, e){
</del><ins>+ edd.onNodeChange.add( function() {
</ins><span class="cx"> tinymce.each(buttons, function(c) {
</span><span class="cx"> var btn, cls;
</span><span class="cx">
</span><span class="lines">@@ -145,21 +146,21 @@
</span><span class="cx"> ed.dom.win.scrollTo(0, y);
</span><span class="cx"> }, 40);
</span><span class="cx"> }
</span><del>- };
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Add appropriate listeners for resizing content area
</span><del>- ed.onInit.add(function(ed, l) {
</del><ins>+ ed.onInit.add( function( ed ) {
</ins><span class="cx"> ed.onChange.add(resize);
</span><span class="cx"> ed.onSetContent.add(resize);
</span><span class="cx"> ed.onPaste.add(resize);
</span><span class="cx"> ed.onKeyUp.add(resize);
</span><span class="cx"> ed.onPostRender.add(resize);
</span><span class="cx">
</span><del>- ed.getBody().style.overflowY = "hidden";
</del><ins>+ ed.getBody().style.overflowY = 'hidden';
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> if ( ed.getParam('autoresize_on_init', true) ) {
</span><del>- ed.onLoadContent.add(function(ed, l) {
</del><ins>+ ed.onLoadContent.add( function() {
</ins><span class="cx"> // Because the content area resizes when its content CSS loads,
</span><span class="cx"> // and we can't easily add a listener to its onload event,
</span><span class="cx"> // we'll just trigger a resize after a short loading period
</span><span class="lines">@@ -169,7 +170,7 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
</del><ins>+ // Register the command so that it can be invoked by using tinymce.activeEditor.execCommand('mceExample');
</ins><span class="cx"> ed.addCommand('wpAutoResize', resize);
</span><span class="cx"> },
</span><span class="cx">
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgalleryeditor_plugin_srcjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js (26213 => 26214)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js 2013-11-15 14:26:36 UTC (rev 26213)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js 2013-11-15 15:04:04 UTC (rev 26214)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-
</del><ins>+/* global tinymce */
</ins><span class="cx"> (function() {
</span><span class="cx"> tinymce.create('tinymce.plugins.wpGallery', {
</span><span class="cx">
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> function getAttr(s, n) {
</span><span class="cx"> n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
</span><span class="cx"> return n ? tinymce.DOM.decode(n[1]) : '';
</span><del>- };
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
</span><span class="cx"> var cls = getAttr(im, 'class');
</span><span class="lines">@@ -112,10 +112,10 @@
</span><span class="cx"> title : ed.getLang('wordpress.editgallery')
</span><span class="cx"> });
</span><span class="cx">
</span><del>- tinymce.dom.Event.add(editButton, 'mousedown', function(e) {
</del><ins>+ tinymce.dom.Event.add( editButton, 'mousedown', function() {
</ins><span class="cx"> var ed = tinymce.activeEditor;
</span><span class="cx"> ed.wpGalleryBookmark = ed.selection.getBookmark('simple');
</span><del>- ed.execCommand("WP_Gallery");
</del><ins>+ ed.execCommand('WP_Gallery');
</ins><span class="cx"> ed.plugins.wordpress._hideButtons();
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx"> author : 'WordPress',
</span><span class="cx"> authorurl : 'http://wordpress.org',
</span><span class="cx"> infourl : '',
</span><del>- version : "1.0"
</del><ins>+ version : '1.0'
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> });
</span></span></pre>
</div>
</div>
</body>
</html>