Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59167
Change subject: jshint fixes
......................................................................
jshint fixes
Change-Id: Ide953be64e272a0a99ada4136dc635b674c74823
---
A .jshintrc
M js/ext.shortUrl.js
2 files changed, 53 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ShortUrl
refs/changes/67/59167/1
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..7fa138d
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,34 @@
+{
+ "predef": [
+ "mediaWiki",
+ "jQuery",
+ "QUnit"
+ ],
+
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "forin": false,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "nonew": true,
+ "quotmark": "single",
+ "regexp": false,
+ "undef": true,
+ "unused": true,
+ "strict": false,
+ "trailing": true,
+
+ "laxbreak": true,
+ "smarttabs": true,
+ "multistr": true,
+
+ "browser": true,
+
+ "nomen": true,
+ "onevar": true
+}
diff --git a/js/ext.shortUrl.js b/js/ext.shortUrl.js
index fc92710..bd0f41e 100644
--- a/js/ext.shortUrl.js
+++ b/js/ext.shortUrl.js
@@ -1,17 +1,21 @@
-jQuery( function( $ ) {
+
+( function ( mw, $ ) {
'use strict';
- if( $( '#t-shorturl' ).length ) {
- var url = $( '#t-shorturl a' ).attr( 'href' );
- /* Add protocol for proto-relative urls */
- var protoNonRelative = ( new mw.Uri( url ) ).toString();
- $( '#firstHeading' ).append(
- $( '<div class="title-shortlink-container"></div>')
- .append( $( '<a>' )
- .addClass( 'title-shortlink' )
- .attr( 'href', url )
- .text( protoNonRelative )
- )
- );
- }
-});
+ $( function () {
+ if ( $( '#t-shorturl' ).length ) {
+ var url = $( '#t-shorturl a' ).attr( 'href' ),
+ /* Add protocol for proto-relative urls */
+ protoNonRelative = ( new mw.Uri( url )
).toString();
+ $( '#firstHeading' ).append(
+ $( '<div
class="title-shortlink-container"></div>')
+ .append( $( '<a>' )
+ .addClass( 'title-shortlink' )
+ .attr( 'href', url )
+ .text( protoNonRelative )
+ )
+ );
+ }
+ });
+
+} ( mediaWiki, jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/59167
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide953be64e272a0a99ada4136dc635b674c74823
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ShortUrl
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits