From 772e39caf2f8bde3b0a069eed8134ff7fb765821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiemo=20M=C3=A4ttig?= Date: Mon, 17 Mar 2014 22:01:52 +0100 Subject: [PATCH] Unify coding style of jQuery( '' ) calls According to the jQuery documentation (and code) all kinds of $( '' ) $( '' ) $( '' ) $( '' ) are identical. So yes, this patch does not change anything. All it does is removing characters that are ignored anyway. Using the same style everywhere makes the code easier to read and understand and may save a few bytes when it is gzipped. The current WikiEditor code contains 67 usages of that jQuery call. Only very few of them are not in the most simple style. Personally I consider the style
confusing since a
can not be a void element. Change-Id: I816b4cccc9ee329e9bcdd9bd2353e5653fd10c36 --- modules/jquery.wikiEditor.iframe.js | 10 ++--- modules/jquery.wikiEditor.templateEditor.js | 6 +-- modules/jquery.wikiEditor.toolbar.js | 42 ++++++++++----------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/jquery.wikiEditor.iframe.js b/modules/jquery.wikiEditor.iframe.js index 538fcb18..e084a452 100644 --- a/modules/jquery.wikiEditor.iframe.js +++ b/modules/jquery.wikiEditor.iframe.js @@ -119,7 +119,7 @@ context.evt = $.extend( context.evt, { setTimeout( function() { context.$content.find( 'br' ).each( function() { if ( $(this).parent().is( 'body' ) ) { - $(this).wrap( $( '

' ) ); + $(this).wrap( $( '

' ) ); } } ); }, 100 ); @@ -297,7 +297,7 @@ context.fn = $.extend( context.fn, { var origHTML = html; // We use this elaborate trickery for cross-browser compatibility - // IE does overzealous whitespace collapsing for $( '

' ).html( html );
+		// IE does overzealous whitespace collapsing for $( '
' ).html( html );
 		// We also do 
and easy cases for

conversion here, complicated cases are handled later html = html .replace( /\r?\n/g, '' ) // IE7 inserts newlines before block elements @@ -682,7 +682,7 @@ context.fn = $.extend( context.fn, { * Sets up the iframe in place of the textarea to allow more advanced operations */ setupIframe: function () { - context.$iframe = $( '' ) + context.$iframe = $( '