jenkins-bot has submitted this change and it was merged. Change subject: Hygiene: Apply requirePaddingNewLinesInObjects rule ......................................................................
Hygiene: Apply requirePaddingNewLinesInObjects rule Change-Id: I9ae8f602a5a9114e57ae0e7ea07265cf920f0bd1 --- M javascripts/CtaDrawer.js M javascripts/Overlay.js M javascripts/OverlayManager.js M javascripts/PageApi.js M javascripts/Router.js M javascripts/api.js M javascripts/application.js M javascripts/loggingSchemas/mobileWebUploads.js M javascripts/loggingSchemas/mobileWebWikiGrok.js M javascripts/loggingSchemas/mobileWebWikiGrokError.js M javascripts/modules/editor/AbuseFilterPanel.js M javascripts/modules/editor/EditorApi.js M javascripts/modules/editor/EditorOverlay.js M javascripts/modules/editor/EditorOverlayBase.js M javascripts/modules/editor/VisualEditorOverlay.js M javascripts/modules/editor/init.js M javascripts/modules/issues/CleanupOverlay.js M javascripts/modules/issues/init.js M javascripts/modules/lastEdited/time.js M javascripts/modules/mediaViewer/ImageOverlay.js M javascripts/modules/nearby/Nearby.js M javascripts/modules/nearby/NearbyApi.js M javascripts/modules/notifications/NotificationsOverlay.js M javascripts/modules/notifications/notifications.js M javascripts/modules/references/ReferencesDrawer.js M javascripts/modules/references/ReferencesDrawerBeta.js M javascripts/modules/references/init.js M javascripts/modules/routes.js M javascripts/modules/search/SearchOverlay.js M javascripts/modules/search/init.js M javascripts/modules/talk/TalkOverlay.js M javascripts/modules/talk/TalkSectionAddOverlay.js M javascripts/modules/toc/TableOfContents.js M javascripts/modules/toggling/init.js M javascripts/modules/uploads/LeadPhotoUploaderButton.js M javascripts/modules/uploads/PhotoApi.js M javascripts/modules/uploads/PhotoUploadOverlay.js M javascripts/modules/uploads/PhotoUploaderButton.js M javascripts/modules/uploads/UploadTutorial.js M javascripts/modules/uploads/init.js M javascripts/modules/watchlist/WatchList.js M javascripts/modules/watchstar/Watchstar.js M javascripts/modules/wikigrok/WikiGrokDialog.js M javascripts/modules/wikigrok/WikiGrokDialogB.js M javascripts/settings.js M javascripts/specials/nearby.js M javascripts/specials/uploads.js M javascripts/specials/watchlist.js 48 files changed, 413 insertions(+), 145 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/javascripts/CtaDrawer.js b/javascripts/CtaDrawer.js index 639515c..7ae7771 100644 --- a/javascripts/CtaDrawer.js +++ b/javascripts/CtaDrawer.js @@ -12,7 +12,10 @@ */ CtaDrawer = Drawer.extend( { defaults: { - collapseButton: new Icon( { name: 'arrow-down', additionalClassNames: 'cancel' } ).toHtmlString(), + collapseButton: new Icon( { + name: 'arrow-down', + additionalClassNames: 'cancel' + } ).toHtmlString(), loginCaption: mw.msg( 'mobile-frontend-watchlist-cta-button-login' ), signupCaption: mw.msg( 'mobile-frontend-watchlist-cta-button-signup' ) }, @@ -20,10 +23,12 @@ preRender: function ( options ) { var params = $.extend( { - // use wgPageName as this includes the namespace if outside Main - returnto: options.returnTo || mw.config.get( 'wgPageName' ) - }, options.queryParams ), - signupParams = $.extend( { type: 'signup' }, options.signupQueryParams ); + // use wgPageName as this includes the namespace if outside Main + returnto: options.returnTo || mw.config.get( 'wgPageName' ) + }, options.queryParams ), + signupParams = $.extend( { + type: 'signup' + }, options.signupQueryParams ); options.loginUrl = mw.util.getUrl( 'Special:UserLogin', params ); options.signupUrl = mw.util.getUrl( 'Special:UserLogin', $.extend( params, signupParams ) ); diff --git a/javascripts/Overlay.js b/javascripts/Overlay.js index c111ab6..9ef7f7b 100644 --- a/javascripts/Overlay.js +++ b/javascripts/Overlay.js @@ -48,14 +48,18 @@ template: mw.template.get( 'mobile.overlays', 'Overlay.hogan' ), defaults: { saveMsg: mw.msg( 'mobile-frontend-editor-save' ), - cancelButton: new Icon( { tagName: 'button', - name: 'cancel', additionalClassNames: 'cancel', - label: mw.msg( 'mobile-frontend-overlay-close' ) - } ).toHtmlString(), - backButton: new Icon( { tagName: 'button', - name: 'back', additionalClassNames: 'back', - label: mw.msg( 'mobile-frontend-overlay-close' ) - } ).toHtmlString(), + cancelButton: new Icon( { + tagName: 'button', + name: 'cancel', + additionalClassNames: 'cancel', + label: mw.msg( 'mobile-frontend-overlay-close' ) + } ).toHtmlString(), + backButton: new Icon( { + tagName: 'button', + name: 'back', + additionalClassNames: 'back', + label: mw.msg( 'mobile-frontend-overlay-close' ) + } ).toHtmlString(), headerButtonsListClassName: '', fixedHeader: true, spinner: icons.spinner().toHtmlString() diff --git a/javascripts/OverlayManager.js b/javascripts/OverlayManager.js index 43eecf1..97b7fda 100644 --- a/javascripts/OverlayManager.js +++ b/javascripts/OverlayManager.js @@ -176,7 +176,10 @@ * which resolves to an overlay. */ add: function ( route, factory ) { - var entry = { route: route, factory: factory }; + var entry = { + route: route, + factory: factory + }; this.entries[route] = entry; // check if overlay should be shown for the current path diff --git a/javascripts/PageApi.js b/javascripts/PageApi.js index a0b3ec2..784f097 100644 --- a/javascripts/PageApi.js +++ b/javascripts/PageApi.js @@ -102,8 +102,13 @@ */ getPage: function ( title, endpoint, leadOnly ) { var page, timestamp, - options = endpoint ? { url: endpoint, dataType: 'jsonp' } : {}, - protection = { edit:[ '*' ] }; + options = endpoint ? { + url: endpoint, + dataType: 'jsonp' + } : {}, + protection = { + edit: [ '*' ] + }; if ( !this.cache[title] ) { page = this.cache[title] = $.Deferred(); @@ -124,7 +129,11 @@ page.reject( resp ); // FIXME: [LQT] remove when liquid threads is dead (see Bug 51586) } else if ( resp.mobileview.hasOwnProperty( 'liquidthreads' ) ) { - page.reject( { error: { code: 'lqt' } } ); + page.reject( { + error: { + code: 'lqt' + } + } ); } else { mv = resp.mobileview; sections = transformSections( mv.sections ); @@ -148,7 +157,9 @@ lead: sections[0].text, sections: sections.slice( 1 ), isMainPage: mv.hasOwnProperty( 'mainpage' ) ? true : false, - historyUrl: mw.util.getUrl( title, { action: 'history' } ), + historyUrl: mw.util.getUrl( title, { + action: 'history' + } ), lastModifiedTimestamp: timestamp, languageCount: mv.languagecount, hasVariants: mv.hasOwnProperty( 'hasvariants' ), @@ -236,7 +247,9 @@ .replace( '$1', title ) .replace( '$2', item.code ); } else { - variant.url = mw.util.getUrl( title, { variant: item.code } ); + variant.url = mw.util.getUrl( title, { + variant: item.code + } ); } variants.push( variant ); } ); @@ -282,7 +295,12 @@ var level = $( this )[0].tagName.substr( 1 ), $span = $( this ).find( 'span' ); - sections.push( { level: level, line: $span.html(), anchor: $span.attr( 'id' ) || '', text: '' } ); + sections.push( { + level: level, + line: $span.html(), + anchor: $span.attr( 'id' ) || '', + text: '' + } ); } ); return sections; }, diff --git a/javascripts/Router.js b/javascripts/Router.js index 1ff492e..6b18a7a 100644 --- a/javascripts/Router.js +++ b/javascripts/Router.js @@ -35,7 +35,9 @@ var routeEv; if ( self._enabled ) { - routeEv = $.Event( 'route', { path: self.getPath() } ); + routeEv = $.Event( 'route', { + path: self.getPath() + } ); self.emit( 'route', routeEv ); if ( !routeEv.isDefaultPrevented() ) { diff --git a/javascripts/api.js b/javascripts/api.js index 0252a56..ba9aa2a 100644 --- a/javascripts/api.js +++ b/javascripts/api.js @@ -167,7 +167,9 @@ } this.ajax( data, { url: endpoint || this.apiUrl, - xhrFields: { withCredentials: true } + xhrFields: { + withCredentials: true + } } ).done( function ( tokenData ) { if ( tokenData && tokenData.tokens && !tokenData.warnings ) { token = tokenData.tokens[ tokenType + 'token' ]; diff --git a/javascripts/application.js b/javascripts/application.js index 0d74e45..dd52b84 100644 --- a/javascripts/application.js +++ b/javascripts/application.js @@ -9,7 +9,9 @@ var Router = M.require( 'Router' ), OverlayManager = M.require( 'OverlayManager' ), Icon = M.require( 'Icon' ), - watchIcon = new Icon( { name: 'watched' } ), + watchIcon = new Icon( { + name: 'watched' + } ), qs = window.location.search.split( '?' )[1], PageApi = M.require( 'PageApi' ), pageApi = new PageApi(), diff --git a/javascripts/loggingSchemas/mobileWebUploads.js b/javascripts/loggingSchemas/mobileWebUploads.js index 092a8ed..6c6afd0 100644 --- a/javascripts/loggingSchemas/mobileWebUploads.js +++ b/javascripts/loggingSchemas/mobileWebUploads.js @@ -20,6 +20,8 @@ return logger; } - M.define( 'loggingSchemas/mobileWebUploads', { getLog: getLog } ); + M.define( 'loggingSchemas/mobileWebUploads', { + getLog: getLog + } ); }( mw.mobileFrontend, jQuery ) ); diff --git a/javascripts/loggingSchemas/mobileWebWikiGrok.js b/javascripts/loggingSchemas/mobileWebWikiGrok.js index 9d00590..8aa3479 100644 --- a/javascripts/loggingSchemas/mobileWebWikiGrok.js +++ b/javascripts/loggingSchemas/mobileWebWikiGrok.js @@ -14,6 +14,8 @@ return M.log( 'MobileWebWikiGrok', $.extend( options, data ) ); } - M.define( 'loggingSchemas/mobileWebWikiGrok', { log: log } ); + M.define( 'loggingSchemas/mobileWebWikiGrok', { + log: log + } ); } )( mw.mobileFrontend, jQuery ); diff --git a/javascripts/loggingSchemas/mobileWebWikiGrokError.js b/javascripts/loggingSchemas/mobileWebWikiGrokError.js index 4850196..eccbf0b 100644 --- a/javascripts/loggingSchemas/mobileWebWikiGrokError.js +++ b/javascripts/loggingSchemas/mobileWebWikiGrokError.js @@ -7,6 +7,8 @@ return M.log( 'MobileWebWikiGrokError', $.extend( options, data ) ); } - M.define( 'loggingSchemas/mobileWebWikiGrokError', { log: log } ); + M.define( 'loggingSchemas/mobileWebWikiGrokError', { + log: log + } ); } )( mw.mobileFrontend, jQuery ); diff --git a/javascripts/modules/editor/AbuseFilterPanel.js b/javascripts/modules/editor/AbuseFilterPanel.js index acf191a..fa89905 100644 --- a/javascripts/modules/editor/AbuseFilterPanel.js +++ b/javascripts/modules/editor/AbuseFilterPanel.js @@ -26,7 +26,9 @@ // OverlayManager will replace previous instance of the route if present M.overlayManager.add( /^\/abusefilter$/, function () { - return new AbuseFilterOverlay( { message: message } ); + return new AbuseFilterOverlay( { + message: message + } ); } ); if ( type === 'warning' ) { diff --git a/javascripts/modules/editor/EditorApi.js b/javascripts/modules/editor/EditorApi.js index 76d2f70..6924a4d 100644 --- a/javascripts/modules/editor/EditorApi.js +++ b/javascripts/modules/editor/EditorApi.js @@ -138,10 +138,16 @@ result.resolve(); } else if ( data && data.error ) { // Edit API error - result.reject( { type: 'error', details: data.error.code } ); + result.reject( { + type: 'error', + details: data.error.code + } ); } else if ( data && data.edit && data.edit.captcha ) { // CAPTCHAs - result.reject( { type: 'captcha', details: data.edit.captcha } ); + result.reject( { + type: 'captcha', + details: data.edit.captcha + } ); } else if ( data && data.edit && data.edit.code ) { code = data.edit.code; warning = data.edit.warning; @@ -149,30 +155,48 @@ // FIXME: AbuseFilter should have more consistent API responses if ( /^abusefilter-warning/.test( code ) ) { // AbuseFilter warning - result.reject( { type: 'abusefilter', details: { - type: 'warning', - message: warning - } } ); + result.reject( { + type: 'abusefilter', + details: { + type: 'warning', + message: warning + } + } ); } else if ( /^abusefilter-disallow/.test( code ) ) { // AbuseFilter disallow - result.reject( { type: 'abusefilter', details: { - type: 'disallow', - message: warning - } } ); + result.reject( { + type: 'abusefilter', + details: { + type: 'disallow', + message: warning + } + } ); } else if ( /^abusefilter/.test( code ) ) { // AbuseFilter other - result.reject( { type: 'abusefilter', details: { - type: 'other', - message: warning - } } ); + result.reject( { + type: 'abusefilter', + details: { + type: 'other', + message: warning + } + } ); } else { // other errors - result.reject( { type: 'error', details: code } ); + result.reject( { + type: 'error', + details: code + } ); } } else { - result.reject( { type: 'error', details: 'unknown' } ); + result.reject( { + type: 'error', + details: 'unknown' + } ); } - } ).fail( $.proxy( result, 'reject', { type: 'error', details: 'http' } ) ); + } ).fail( $.proxy( result, 'reject', { + type: 'error', + details: 'http' + } ) ); } saveContent(); diff --git a/javascripts/modules/editor/EditorOverlay.js b/javascripts/modules/editor/EditorOverlay.js index 0e2cf4e..1095b04 100644 --- a/javascripts/modules/editor/EditorOverlay.js +++ b/javascripts/modules/editor/EditorOverlay.js @@ -114,7 +114,9 @@ // use wgPageName as this includes the namespace if outside Main returnto: options.returnTo || mw.config.get( 'wgPageName' ) }, options.queryParams ), - signupParams = $.extend( { type: 'signup' }, options.signupQueryParams ); + signupParams = $.extend( { + type: 'signup' + }, options.signupQueryParams ); this.$content.hide(); this.showSpinner(); @@ -138,7 +140,9 @@ _prepareForSave: function () { var self = this, - params = { text: this.$content.val() }; + params = { + text: this.$content.val() + }; this._showHidden( '.save-header, .save-panel' ); @@ -240,7 +244,9 @@ */ _save: function () { var self = this, - options = { summary: this.$( '.summary' ).val() }; + options = { + summary: this.$( '.summary' ).val() + }; if ( self.sectionLine !== '' ) { options.summary = '/* ' + self.sectionLine + ' */' + options.summary; diff --git a/javascripts/modules/editor/EditorOverlayBase.js b/javascripts/modules/editor/EditorOverlayBase.js index 588c549..c24f895 100644 --- a/javascripts/modules/editor/EditorOverlayBase.js +++ b/javascripts/modules/editor/EditorOverlayBase.js @@ -14,13 +14,20 @@ */ EditorOverlayBase = Overlay.extend( { defaults: $.extend( {}, Overlay.prototype.defaults, { - switcherButton: new Icon( { tagName: 'button', - name: 'edit-switch', additionalClassNames: 'editor-switcher' } ).toHtmlString(), - sourceButton: new Icon( { name: 'edit-source', additionalClassNames: 'icon-32px editor-choice', + switcherButton: new Icon( { + tagName: 'button', + name: 'edit-switch', + additionalClassNames: 'editor-switcher' + } ).toHtmlString(), + sourceButton: new Icon( { + name: 'edit-source', + additionalClassNames: 'icon-32px editor-choice', hasText: true, label: mw.msg( 'mobile-frontend-editor-source-editor' ) } ).toHtmlString(), - veButton: new Icon( { name: 'edit-ve', additionalClassNames: 'icon-32px editor-choice', + veButton: new Icon( { + name: 'edit-ve', + additionalClassNames: 'icon-32px editor-choice', hasText: true, label: mw.msg( 'mobile-frontend-editor-visual-editor' ) } ).toHtmlString(), @@ -111,7 +118,9 @@ // Set a cookie for 30 days indicating that this user has edited from // the mobile interface. - $.cookie( 'mobileEditor', 'true', { expires: 30 } ); + $.cookie( 'mobileEditor', 'true', { + expires: 30 + } ); }, initialize: function ( options ) { if ( !options.previewingMsg ) { diff --git a/javascripts/modules/editor/VisualEditorOverlay.js b/javascripts/modules/editor/VisualEditorOverlay.js index 00a4889..6880b54 100644 --- a/javascripts/modules/editor/VisualEditorOverlay.js +++ b/javascripts/modules/editor/VisualEditorOverlay.js @@ -112,7 +112,9 @@ self = this, doc = this.target.surface.getModel().getDocument(), summary = this.$( '.save-panel .summary' ).val(), - options = { summary: summary }; + options = { + summary: summary + }; EditorOverlayBase.prototype._save.apply( this, arguments ); if ( this.confirmAborted ) { @@ -158,7 +160,9 @@ onSurfaceReady: function () { this.clearSpinner(); this.$( '.surface' ).show(); - this.target.surface.getModel().getDocument().connect( this, { transact: 'onTransact' } ); + this.target.surface.getModel().getDocument().connect( this, { + transact: 'onTransact' + } ); this.target.surface.$element.addClass( 'content' ); // we have to do it here because contenteditable elements still do not diff --git a/javascripts/modules/editor/init.js b/javascripts/modules/editor/init.js index ca027ba..5fe5b7e 100644 --- a/javascripts/modules/editor/init.js +++ b/javascripts/modules/editor/init.js @@ -3,8 +3,12 @@ var settings = M.require( 'settings' ), Icon = M.require( 'Icon' ), - disabledEditIcon = new Icon( { name: 'edit' } ), - enabledEditIcon = new Icon( { name: 'edit-enabled' } ), + disabledEditIcon = new Icon( { + name: 'edit' + } ), + enabledEditIcon = new Icon( { + name: 'edit-enabled' + } ), enabledClass = enabledEditIcon.getGlyphClassName(), disabledClass = disabledEditIcon.getGlyphClassName(), user = M.require( 'user' ), @@ -25,7 +29,9 @@ queryParams: { campaign: 'mobile_editPageActionCta' }, - signupQueryParams: { returntoquery: 'article_action=signup-edit' }, + signupQueryParams: { + returntoquery: 'article_action=signup-edit' + }, content: mw.msg( 'mobile-frontend-editor-cta' ) } ); @@ -43,14 +49,19 @@ } function makeCta( $el, section, allowAnonymous ) { - var options = { queryParams: { - returnto: mw.config.get( 'wgPageName' ), - returntoquery: 'action=edit§ion=' + section - } }; + var options = { + queryParams: { + returnto: mw.config.get( 'wgPageName' ), + returntoquery: 'action=edit§ion=' + section + } + }; if ( allowAnonymous ) { - options.links = [ { label: mw.msg( 'mobile-frontend-editor-anon' ), - href: $el[0].href, selector: 'edit-anon mw-ui-progressive' } ]; + options.links = [ { + label: mw.msg( 'mobile-frontend-editor-anon' ), + href: $el[0].href, + selector: 'edit-anon mw-ui-progressive' + } ]; } $el .on( 'click', function ( ev ) { diff --git a/javascripts/modules/issues/CleanupOverlay.js b/javascripts/modules/issues/CleanupOverlay.js index bdb1fbc..763e710 100644 --- a/javascripts/modules/issues/CleanupOverlay.js +++ b/javascripts/modules/issues/CleanupOverlay.js @@ -1,7 +1,11 @@ ( function ( M ) { var Overlay = M.require( 'Overlay' ), Icon = M.require( 'Icon' ), - icon = new Icon( { name: 'cleanup-gray', additionalClassNames: 'issue-notice', hasText: true } ), + icon = new Icon( { + name: 'cleanup-gray', + additionalClassNames: 'issue-notice', + hasText: true + } ), CleanupOverlay; /** diff --git a/javascripts/modules/issues/init.js b/javascripts/modules/issues/init.js index 9a5a08c..2a905c4 100644 --- a/javascripts/modules/issues/init.js +++ b/javascripts/modules/issues/init.js @@ -63,7 +63,10 @@ .$el.children().eq( 0 ).attr( 'href', '#/issues' ); M.overlayManager.add( /^\/issues$/, function () { - return new CleanupOverlay( { issues: issues, headingText: headingText } ); + return new CleanupOverlay( { + issues: issues, + headingText: headingText + } ); } ); $link.insertBefore( $metadata.eq( 0 ) ); diff --git a/javascripts/modules/lastEdited/time.js b/javascripts/modules/lastEdited/time.js index fe70f9e..8de7002 100644 --- a/javascripts/modules/lastEdited/time.js +++ b/javascripts/modules/lastEdited/time.js @@ -7,7 +7,10 @@ while ( i < limits.length && timestampDelta > limits[i + 1] ) { ++i; } - return { value: Math.round( timestampDelta / limits[i] ), unit: units[i] }; + return { + value: Math.round( timestampDelta / limits[i] ), + unit: units[i] + }; } function getTimeAgoDelta( timestamp ) { diff --git a/javascripts/modules/mediaViewer/ImageOverlay.js b/javascripts/modules/mediaViewer/ImageOverlay.js index 3602daf..2bd8d7e 100644 --- a/javascripts/modules/mediaViewer/ImageOverlay.js +++ b/javascripts/modules/mediaViewer/ImageOverlay.js @@ -19,9 +19,11 @@ closeOnBack: true, defaults: { - cancelButton: new Icon( { tagName: 'button', + cancelButton: new Icon( { + tagName: 'button', // Uses a dark theme so swap out the icon - name: 'cancel-light', additionalClassNames: 'cancel', + name: 'cancel-light', + additionalClassNames: 'cancel', label: mw.msg( 'mobile-frontend-overlay-close' ) } ).toHtmlString(), detailsMsg: mw.msg( 'mobile-frontend-media-details' ), diff --git a/javascripts/modules/nearby/Nearby.js b/javascripts/modules/nearby/Nearby.js index ddc3aa7..0f3b973 100644 --- a/javascripts/modules/nearby/Nearby.js +++ b/javascripts/modules/nearby/Nearby.js @@ -48,7 +48,10 @@ var result = $.Deferred(); if ( M.supportsGeoLocation() ) { navigator.geolocation.getCurrentPosition( function ( geo ) { - result.resolve( { latitude: geo.coords.latitude, longitude: geo.coords.longitude } ); + result.resolve( { + latitude: geo.coords.latitude, + longitude: geo.coords.longitude + } ); }, function ( err ) { // see https://developer.mozilla.org/en-US/docs/Web/API/PositionError @@ -173,7 +176,9 @@ } ).on( 'click', function () { window.location.hash = $( this ).attr( 'id' ); // name funnel for watchlists to catch subsequent uploads - $.cookie( 'mwUploadsFunnel', 'nearby', { expires: new Date( new Date().getTime() + 60000 ) } ); + $.cookie( 'mwUploadsFunnel', 'nearby', { + expires: new Date( new Date().getTime() + 60000 ) + } ); } ); // Restore the offset diff --git a/javascripts/modules/nearby/NearbyApi.js b/javascripts/modules/nearby/NearbyApi.js index 01a541f..6a66deb 100644 --- a/javascripts/modules/nearby/NearbyApi.js +++ b/javascripts/modules/nearby/NearbyApi.js @@ -86,7 +86,9 @@ * @return {jQuery.Deferred} Object taking list of pages as argument */ getPagesAroundPage: function ( page, range ) { - return this._search( { ggspage: page }, range, page ); + return this._search( { + ggspage: page + }, range, page ); }, /** @@ -137,7 +139,10 @@ // If we have coordinates then set them so that the results are sorted by // distance if ( params.ggscoord ) { - loc = { latitude: params.ggscoord[0], longitude: params.ggscoord[1] }; + loc = { + latitude: params.ggscoord[0], + longitude: params.ggscoord[1] + }; } // If we have no coords (searching for a page's nearby), find the // page in the results and get its coords. @@ -167,7 +172,10 @@ page.url = mw.util.getUrl( page.title ); if ( page.coordinates && loc ) { // FIXME: protect against bug 47133 (remove when resolved) coords = page.coordinates[0]; - lngLat = { latitude: coords.lat, longitude: coords.lon }; + lngLat = { + latitude: coords.lat, + longitude: coords.lon + }; page.dist = calculateDistance( loc, lngLat ); page.latitude = coords.lat; page.longitude = coords.lon; diff --git a/javascripts/modules/notifications/NotificationsOverlay.js b/javascripts/modules/notifications/NotificationsOverlay.js index c17d57a..7222edf 100644 --- a/javascripts/modules/notifications/NotificationsOverlay.js +++ b/javascripts/modules/notifications/NotificationsOverlay.js @@ -47,7 +47,10 @@ var notifications; if ( result.query && result.query.notifications ) { notifications = $.map( result.query.notifications.list, function ( a ) { - return { message: a['*'], timestamp: a.timestamp.mw }; + return { + message: a['*'], + timestamp: a.timestamp.mw + }; } ).sort( function ( a, b ) { return a.timestamp < b.timestamp ? 1 : -1; } ); diff --git a/javascripts/modules/notifications/notifications.js b/javascripts/modules/notifications/notifications.js index 48a76a0..06d6bc3 100644 --- a/javascripts/modules/notifications/notifications.js +++ b/javascripts/modules/notifications/notifications.js @@ -46,7 +46,10 @@ loadModuleScript( 'mobile.notifications.overlay' ).done( function () { var NotificationsOverlay = M.require( 'modules/notifications/NotificationsOverlay' ); result.resolve( - new NotificationsOverlay( { $badge: $btn, count: parseInt( $btn.find( 'span' ).text(), 10 ) } ) + new NotificationsOverlay( { + $badge: $btn, + count: parseInt( $btn.find( 'span' ).text(), 10 ) + } ) ); } ); diff --git a/javascripts/modules/references/ReferencesDrawer.js b/javascripts/modules/references/ReferencesDrawer.js index ef0813d..595edf2 100644 --- a/javascripts/modules/references/ReferencesDrawer.js +++ b/javascripts/modules/references/ReferencesDrawer.js @@ -11,7 +11,8 @@ ReferencesDrawer = Drawer.extend( { defaults: { cancelButton: new Icon( { - name: 'cancel', additionalClassNames: 'cancel', + name: 'cancel', + additionalClassNames: 'cancel', label: mw.msg( 'mobile-frontend-overlay-close' ) } ).toHtmlString() }, diff --git a/javascripts/modules/references/ReferencesDrawerBeta.js b/javascripts/modules/references/ReferencesDrawerBeta.js index acf9941..b6eb654 100644 --- a/javascripts/modules/references/ReferencesDrawerBeta.js +++ b/javascripts/modules/references/ReferencesDrawerBeta.js @@ -11,11 +11,13 @@ ReferencesDrawerBeta = ReferencesDrawer.extend( { defaults: { cancelButton: new Icon( { - name: 'cancel-light', additionalClassNames: 'cancel', + name: 'cancel-light', + additionalClassNames: 'cancel', label: mw.msg( 'mobile-frontend-overlay-close' ) } ).toHtmlString(), citation: new Icon( { - name: 'citation', additionalClassNames: 'text icon-16px', + name: 'citation', + additionalClassNames: 'text icon-16px', hasText: true, label: mw.msg( 'mobile-frontend-references-citation' ) } ).toHtmlString() diff --git a/javascripts/modules/references/init.js b/javascripts/modules/references/init.js index ace2520..5efda4e 100644 --- a/javascripts/modules/references/init.js +++ b/javascripts/modules/references/init.js @@ -55,6 +55,8 @@ setup(); } ); - M.define( 'references', { setup: setup } ); + M.define( 'references', { + setup: setup + } ); }( mw.mobileFrontend, jQuery ) ); diff --git a/javascripts/modules/routes.js b/javascripts/modules/routes.js index 0b7f460..b2cf80b 100644 --- a/javascripts/modules/routes.js +++ b/javascripts/modules/routes.js @@ -13,7 +13,9 @@ var result = $.Deferred(); M.loadModule( 'mobile.uploads' ).done( function () { var UploadTutorialNew = M.require( 'modules/uploads/UploadTutorial' ); - result.resolve( new UploadTutorialNew( { funnel: funnel || null } ) ); + result.resolve( new UploadTutorialNew( { + funnel: funnel || null + } ) ); } ); return result; } ); diff --git a/javascripts/modules/search/SearchOverlay.js b/javascripts/modules/search/SearchOverlay.js index 71a347b..89f57cf 100644 --- a/javascripts/modules/search/SearchOverlay.js +++ b/javascripts/modules/search/SearchOverlay.js @@ -20,7 +20,11 @@ className: 'overlay search-overlay', template: mw.template.get( 'mobile.search', 'SearchOverlay.hogan' ), defaults: { - clearIcon: new Icon( { tagName: 'button', name: 'clear', additionalClassNames: 'clear' } ).toHtmlString(), + clearIcon: new Icon( { + tagName: 'button', + name: 'clear', + additionalClassNames: 'clear' + } ).toHtmlString(), searchTerm: '', placeholderMsg: $( '#searchInput' ).attr( 'placeholder' ), clearMsg: mw.msg( 'mobile-frontend-clear-search' ), @@ -85,7 +89,11 @@ window.history.back(); // Add fulltext input to force fulltext search $( '<input>' ) - .attr( { type: 'hidden', name: 'fulltext', value: 'search' } ) + .attr( { + type: 'hidden', + name: 'fulltext', + value: 'search' + } ) .appendTo( $form ); $form.submit(); } ); @@ -146,7 +154,10 @@ .filter( data.results.length ? '.with-results' : '.without-results' ) .show(); self.$( '.spinner' ).hide(); - pageList = new PageList( { pages: data.results, el: $results } ); + pageList = new PageList( { + pages: data.results, + el: $results + } ); pageList.renderPageImages(); M.emit( 'search-results', self, data.results ); } diff --git a/javascripts/modules/search/init.js b/javascripts/modules/search/init.js index fc2b6fe..9b7065e 100644 --- a/javascripts/modules/search/init.js +++ b/javascripts/modules/search/init.js @@ -11,7 +11,9 @@ // http://stackoverflow.com/questions/6837543/show-virtual-keyboard-on-mobile-phones-in-javascript $( '#searchInput' ).on( 'click', function () { schema.log( 'search' ); - new SearchOverlay( { searchTerm: $( this ).val() } ).show(); + new SearchOverlay( { + searchTerm: $( this ).val() + } ).show(); M.router.navigate( '/search' ); } ); diff --git a/javascripts/modules/talk/TalkOverlay.js b/javascripts/modules/talk/TalkOverlay.js index 0995da6..8b83d26 100644 --- a/javascripts/modules/talk/TalkOverlay.js +++ b/javascripts/modules/talk/TalkOverlay.js @@ -85,7 +85,10 @@ // talk page doesn't exist yet. if ( resp === 'missingtitle' ) { // Create an empty page for new pages - self._addContent( { title: options.title, sections: [] }, options ); + self._addContent( { + title: options.title, + sections: [] + }, options ); } else { // If the API request fails for any other reason, load the talk // page manually rather than leaving the spinner spinning. diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js b/javascripts/modules/talk/TalkSectionAddOverlay.js index 9b1b826..a489ef3 100644 --- a/javascripts/modules/talk/TalkSectionAddOverlay.js +++ b/javascripts/modules/talk/TalkSectionAddOverlay.js @@ -120,7 +120,10 @@ } ).done( function () { result.resolve( 'ok' ); } ).fail( function ( msg ) { - result.reject( { type: 'error', details: msg } ); + result.reject( { + type: 'error', + details: msg + } ); } ); } else { if ( !text ) { @@ -129,7 +132,10 @@ if ( !heading ) { $subject.addClass( 'error' ); } - result.reject( { type: 'error', details: 'empty message or heading' } ); + result.reject( { + type: 'error', + details: 'empty message or heading' + } ); } return result; } diff --git a/javascripts/modules/toc/TableOfContents.js b/javascripts/modules/toc/TableOfContents.js index eb8295b..6a82d12 100644 --- a/javascripts/modules/toc/TableOfContents.js +++ b/javascripts/modules/toc/TableOfContents.js @@ -14,8 +14,10 @@ tocHeading: mw.template.get( 'mobile.toc', 'heading.hogan' ) }, defaults: { - tocIcon: new Icon( { tagName: 'span', - name: 'toc', additionalClasses: 'icon-16px' + tocIcon: new Icon( { + tagName: 'span', + name: 'toc', + additionalClasses: 'icon-16px' } ).toHtmlString(), contentsMsg: mw.msg( 'toc' ) }, diff --git a/javascripts/modules/toggling/init.js b/javascripts/modules/toggling/init.js index 78bc05d..dc3bf54 100644 --- a/javascripts/modules/toggling/init.js +++ b/javascripts/modules/toggling/init.js @@ -2,8 +2,15 @@ var currentPageTitle = M.getCurrentPage().title, settings = M.require( 'settings' ), Icon = M.require( 'Icon' ), - iconUp = new Icon( { name: 'arrow-up', hasText: true } ), - iconDown = new Icon( { name: 'arrow-down', hasText: true, additionalClassNames: 'icon-15px' } ), + iconUp = new Icon( { + name: 'arrow-up', + hasText: true + } ), + iconDown = new Icon( { + name: 'arrow-down', + hasText: true, + additionalClassNames: 'icon-15px' + } ), classOpen = iconUp.getGlyphClassName(), classClosed = iconDown.getGlyphClassName(); diff --git a/javascripts/modules/uploads/LeadPhotoUploaderButton.js b/javascripts/modules/uploads/LeadPhotoUploaderButton.js index 2a59b6f..5f53503 100644 --- a/javascripts/modules/uploads/LeadPhotoUploaderButton.js +++ b/javascripts/modules/uploads/LeadPhotoUploaderButton.js @@ -2,7 +2,10 @@ var PhotoUploaderButton = M.require( 'modules/uploads/PhotoUploaderButton' ), Icon = M.require( 'Icon' ), - uploadIcon = new Icon( { name: 'addimage-enabled', additionalClassNames: 'enabled' } ), + uploadIcon = new Icon( { + name: 'addimage-enabled', + additionalClassNames: 'enabled' + } ), LeadPhotoUploaderButton; /** diff --git a/javascripts/modules/uploads/PhotoApi.js b/javascripts/modules/uploads/PhotoApi.js index 10db27a..5bb6896 100644 --- a/javascripts/modules/uploads/PhotoApi.js +++ b/javascripts/modules/uploads/PhotoApi.js @@ -107,7 +107,10 @@ // FIXME: See UploadBase::checkWarnings - why these are not errors only the MediaWiki Gods know See Bug 48261 _handleWarnings: function ( result, warnings ) { var humanErrorMsg, - err = { stage: 'upload', type: 'warning' }; + err = { + stage: 'upload', + type: 'warning' + }; warnings = $.map( warnings, function ( value, code ) { return code + '/' + value; @@ -184,12 +187,17 @@ // send useformat=mobile for sites where endpoint is a desktop url so that they are mobile edit tagged url: uploadUrl, contentType: 'multipart/form-data', - xhrFields: { withCredentials: true }, + xhrFields: { + withCredentials: true + }, cache: false } ).done( function ( data ) { var descriptionUrl = '', warnings = data.upload ? data.upload.warnings : false, - err = { stage: 'upload', type: 'error' }; + err = { + stage: 'upload', + type: 'error' + }; if ( !data || !data.upload ) { // error uploading image @@ -213,7 +221,11 @@ } else if ( warnings ) { return self._handleWarnings( result, warnings ); } else { - return result.reject( { stage: 'upload', type: 'unknown', details: 'missing-filename' } ); + return result.reject( { + stage: 'upload', + type: 'unknown', + details: 'missing-filename' + } ); } } @@ -224,7 +236,9 @@ if ( self.editorApi && !isNewFile ) { self.editorApi.setPrependText( '[[File:' + options.fileName + '|thumbnail|' + options.description + ']]\n\n' ); - self.editorApi.save( { summary: mw.msg( 'mobile-frontend-photo-upload-comment' ) } ) + self.editorApi.save( { + summary: mw.msg( 'mobile-frontend-photo-upload-comment' ) + } ) .done( function () { result.resolve( options.fileName, descriptionUrl ); } ) @@ -241,7 +255,11 @@ } ).fail( function () { // error on the server side (abort happens when user cancels the upload) if ( status !== 'abort' ) { - result.reject( { stage: 'upload', type: 'error', details: 'http' } ); + result.reject( { + stage: 'upload', + type: 'error', + details: 'http' + } ); } } ); @@ -254,7 +272,11 @@ function getToken() { return self.getTokenWithEndpoint.apply( self, arguments ) - .fail( $.proxy( result, 'reject', { stage: 'upload', type: 'error', details: 'token' } ) ); + .fail( $.proxy( result, 'reject', { + stage: 'upload', + type: 'error', + details: 'token' + } ) ); } if ( self.useCentralAuthToken && endpoint ) { diff --git a/javascripts/modules/uploads/PhotoUploadOverlay.js b/javascripts/modules/uploads/PhotoUploadOverlay.js index 47481be..9210547 100644 --- a/javascripts/modules/uploads/PhotoUploadOverlay.js +++ b/javascripts/modules/uploads/PhotoUploadOverlay.js @@ -22,9 +22,10 @@ ownerStatement: ownershipMessage, heading: mw.msg( 'mobile-frontend-image-heading-describe' ), headerButtonsListClassName: 'overlay-action', - headerButtons: [ - { className: 'submit', msg: mw.msg( 'mobile-frontend-photo-submit' ) } - ] + headerButtons: [ { + className: 'submit', + msg: mw.msg( 'mobile-frontend-photo-submit' ) + } ] }, className: 'overlay photo-overlay', @@ -46,14 +47,18 @@ var dataUri = fileReader.result; // add mimetype if not present (some browsers need it, e.g. Android browser) dataUri = dataUri.replace( /^data:base64/, 'data:image/jpeg;base64' ); - self.log( { action: 'preview' } ); + self.log( { + action: 'preview' + } ); self.setImageUrl( dataUri ); }; } if ( options.insertInPage ) { this.api = new PhotoApi( { - editorApi: new EditorApi( { title: options.pageTitle } ) + editorApi: new EditorApi( { + title: options.pageTitle + } ) } ); } else { this.api = new PhotoApi(); @@ -64,7 +69,9 @@ this.progressPopup = new PhotoUploadProgress().on( 'cancel', function () { self.api.abort(); - self.log( { action: 'cancel' } ); + self.log( { + action: 'cancel' + } ); } ).on( 'submit', function () { // handle resubmitting after abusefilter message self._save(); @@ -99,7 +106,9 @@ this.api.save( saveOptions ).done( function ( fileName, descriptionUrl ) { self.progressPopup.hide( true ); - self.log( { action: 'success' } ); + self.log( { + action: 'success' + } ); if ( self.options.insertInPage ) { popup.show( mw.msg( 'mobile-frontend-photo-upload-success-article' ), 'toast' ); @@ -128,9 +137,9 @@ if ( typeof err.details === 'string' ) { errMsg += '/' + err.details; } - // Otherwise, record the stage as 'unknown' and record the type as the - // status message ("timeout", "error", "abort", etc. ) and include any - // HTTP error that was thrown. + // Otherwise, record the stage as 'unknown' and record the type as the + // status message ("timeout", "error", "abort", etc. ) and include any + // HTTP error that was thrown. } else { errMsg = 'unknown'; if ( statusMessage ) { @@ -140,7 +149,10 @@ } } } - self.log( { action: 'error', errorText: errMsg } ); + self.log( { + action: 'error', + errorText: errMsg + } ); } } ); }, @@ -162,7 +174,9 @@ $submitButton = this.$( '.submit' ) .prop( 'disabled', true ) .on( 'click', function () { - self.log( { action: 'previewSubmit' } ); + self.log( { + action: 'previewSubmit' + } ); self._submit(); } ); this.$description = this.$( 'textarea' ) @@ -191,9 +205,13 @@ EXIF.getData( this.file, function () { if ( $.isEmptyObject( this.exifdata ) ) { if ( window.confirm( mw.msg( 'mobile-frontend-photo-upload-copyvio' ) ) ) { - self.log( { action: 'copyvioOk' } ); + self.log( { + action: 'copyvioOk' + } ); } else { - self.log( { action: 'copyvioCancel' } ); + self.log( { + action: 'copyvioCancel' + } ); self.hide( true ); } } @@ -208,7 +226,9 @@ return _super.apply( this, arguments ); } else if ( window.confirm( mw.msg( 'mobile-frontend-image-cancel-confirm' ) ) ) { this.emit( 'cancel' ); - this.log( { action: 'previewCancel' } ); + this.log( { + action: 'previewCancel' + } ); return _super.apply( this, arguments ); } else { return false; @@ -226,7 +246,9 @@ this.imageUrl = url; this.$( '.spinner' ).hide(); this.$( '.help' ).on( 'click', function () { - self.log( { action: 'whatDoesThisMean' } ); + self.log( { + action: 'whatDoesThisMean' + } ); } ); $( '<img>' ) .attr( 'src', url ) diff --git a/javascripts/modules/uploads/PhotoUploaderButton.js b/javascripts/modules/uploads/PhotoUploaderButton.js index 6bea33c..57c09ba 100644 --- a/javascripts/modules/uploads/PhotoUploaderButton.js +++ b/javascripts/modules/uploads/PhotoUploaderButton.js @@ -1,8 +1,11 @@ ( function ( M, $ ) { var View = M.require( 'View' ), Icon = M.require( 'Icon' ), - photoIcon = new Icon( { name: 'photo', hasText: true, - additionalClassNames: 'mw-ui-progressive mw-ui-button button' } ), + photoIcon = new Icon( { + name: 'photo', + hasText: true, + additionalClassNames: 'mw-ui-progressive mw-ui-button button' + } ), PhotoUploaderButton; function isSupported() { diff --git a/javascripts/modules/uploads/UploadTutorial.js b/javascripts/modules/uploads/UploadTutorial.js index ea1bd75..70fbf3e 100644 --- a/javascripts/modules/uploads/UploadTutorial.js +++ b/javascripts/modules/uploads/UploadTutorial.js @@ -17,10 +17,14 @@ className: 'overlay carousel tutorial content-overlay', defaults: { - slideLeftButton: new Icon( { name: 'previous', - additionalClassNames: 'slider-button prev' } ).toHtmlString(), - slideRightButton: new Icon( { name: 'next', - additionalClassNames: 'slider-button next' } ).toHtmlString(), + slideLeftButton: new Icon( { + name: 'previous', + additionalClassNames: 'slider-button prev' + } ).toHtmlString(), + slideRightButton: new Icon( { + name: 'next', + additionalClassNames: 'slider-button next' + } ).toHtmlString(), inBeta: M.isBetaGroupMember(), pages: [ { diff --git a/javascripts/modules/uploads/init.js b/javascripts/modules/uploads/init.js index 35c31ac..e3e05bf 100644 --- a/javascripts/modules/uploads/init.js +++ b/javascripts/modules/uploads/init.js @@ -38,7 +38,9 @@ } } - new LeadPhotoUploaderButton( { funnel: funnel } ); + new LeadPhotoUploaderButton( { + funnel: funnel + } ); } if ( isSupported ) { diff --git a/javascripts/modules/watchlist/WatchList.js b/javascripts/modules/watchlist/WatchList.js index 34abed6..3582dfd 100644 --- a/javascripts/modules/watchlist/WatchList.js +++ b/javascripts/modules/watchlist/WatchList.js @@ -26,7 +26,9 @@ PageList.prototype.postRender.apply( this, arguments ); this.$el.find( 'a.title' ).on( 'mousedown', function () { // name funnel for watchlists to catch subsequent uploads - $.cookie( 'mwUploadsFunnel', 'watchlist', { expires: new Date( new Date().getTime() + 60000 ) } ); + $.cookie( 'mwUploadsFunnel', 'watchlist', { + expires: new Date( new Date().getTime() + 60000 ) + } ); } ); } } ); diff --git a/javascripts/modules/watchstar/Watchstar.js b/javascripts/modules/watchstar/Watchstar.js index 9857718..a18e8fc 100644 --- a/javascripts/modules/watchstar/Watchstar.js +++ b/javascripts/modules/watchstar/Watchstar.js @@ -4,8 +4,14 @@ View = M.require( 'View' ), WatchstarApi = M.require( 'modules/watchstar/WatchstarApi' ), Icon = M.require( 'Icon' ), - watchIcon = new Icon( { name: 'watch', additionalClassNames: 'icon-32px watch-this-article' } ), - watchedIcon = new Icon( { name: 'watched', additionalClassNames: 'icon-32px watch-this-article' } ), + watchIcon = new Icon( { + name: 'watch', + additionalClassNames: 'icon-32px watch-this-article' + } ), + watchedIcon = new Icon( { + name: 'watched', + additionalClassNames: 'icon-32px watch-this-article' + } ), toast = M.require( 'toast' ), user = M.require( 'user' ), api = new WatchstarApi(), diff --git a/javascripts/modules/wikigrok/WikiGrokDialog.js b/javascripts/modules/wikigrok/WikiGrokDialog.js index 0aa3b62..c12a29b 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialog.js +++ b/javascripts/modules/wikigrok/WikiGrokDialog.js @@ -1,4 +1,4 @@ -( function ( M, $ ) { + ( function ( M, $ ) { M.assertMode( [ 'beta', 'alpha' ] ); var Panel = M.require( 'Panel' ), @@ -34,8 +34,14 @@ // Play a game to help Wikipedia! // Help add tags to this page! buttons: [ - { classes: 'cancel inline mw-ui-button', label: 'No, thanks' }, - { classes: 'proceed inline mw-ui-button mw-ui-progressive', label: 'Okay!' } + { + classes: 'cancel inline mw-ui-button', + label: 'No, thanks' + }, + { + classes: 'proceed inline mw-ui-button mw-ui-progressive', + label: 'Okay!' + } ], noticeMsg: '<a class="wg-notice-link" href="#/wikigrok/about">Tell me more</a>' }, @@ -58,7 +64,9 @@ userToken: options.userToken, taskToken: this.defaults.taskToken } ); - this.apiWikiData = new WikiDataApi( { itemId: options.itemId } ); + this.apiWikiData = new WikiDataApi( { + itemId: options.itemId + } ); Panel.prototype.initialize.apply( this, arguments ); // log page impression and widget impression when the widget is shown @@ -191,9 +199,18 @@ // Re-render with new content for 'Question' step options.beginQuestions = true; options.buttons = [ - { classes: 'yes inline mw-ui-button mw-ui-progressive', label: 'Yes' }, - { classes: 'not-sure inline mw-ui-button', label: 'Not Sure' }, - { classes: 'no inline mw-ui-button mw-ui-progressive', label: 'No' } + { + classes: 'yes inline mw-ui-button mw-ui-progressive', + label: 'Yes' + }, + { + classes: 'not-sure inline mw-ui-button', + label: 'Not Sure' + }, + { + classes: 'no inline mw-ui-button mw-ui-progressive', + label: 'No' + } ]; options.noticeMsg = 'All submissions are <a class="wg-notice-link" href="#/wikigrok/about">released freely</a>'; self.render( options ); @@ -209,7 +226,10 @@ showError: function ( options, errorMsg ) { options.contentMsg = errorMsg; options.buttons = [ - { classes: 'cancel inline mw-ui-button mw-ui-progressive', label: 'OK' } + { + classes: 'cancel inline mw-ui-button mw-ui-progressive', + label: 'OK' + } ]; this.render( options ); }, diff --git a/javascripts/modules/wikigrok/WikiGrokDialogB.js b/javascripts/modules/wikigrok/WikiGrokDialogB.js index 299fdd7..862800c 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialogB.js +++ b/javascripts/modules/wikigrok/WikiGrokDialogB.js @@ -50,10 +50,10 @@ $.each( suggestions, function ( type, data ) { var prop = { - type: type, - name: data.name, - id: data.id - }; + type: type, + name: data.name, + id: data.id + }; allSuggestions = allSuggestions.concat( data.list ); // Make sure it's easy to look up the property later. diff --git a/javascripts/settings.js b/javascripts/settings.js index b16b88f..87a4881 100644 --- a/javascripts/settings.js +++ b/javascripts/settings.js @@ -14,7 +14,9 @@ return true; // Otherwise try to set mf_testcookie and return true if it was set } else { - $.cookie( 'mf_testcookie', 'test_value', { path: '/' } ); + $.cookie( 'mf_testcookie', 'test_value', { + path: '/' + } ); return $.cookie( 'mf_testcookie' ) === 'test_value'; } } @@ -28,9 +30,12 @@ * @returns {Boolean} Whether the save was successful or not */ function save( name, value, useCookieFallback ) { + var cookieOptions = { + expires: 1 + }; return M.supportsLocalStorage ? localStorage.setItem( name, value ) : - ( useCookieFallback ? $.cookie( name, value, { expires: 1 } ) : false ); + ( useCookieFallback ? $.cookie( name, value, cookieOptions ) : false ); } /** diff --git a/javascripts/specials/nearby.js b/javascripts/specials/nearby.js index e6b914b..62e95ca 100644 --- a/javascripts/specials/nearby.js +++ b/javascripts/specials/nearby.js @@ -5,7 +5,9 @@ $( function () { var nearby, - options = { el: $( '#mw-mf-nearby' ) }, + options = { + el: $( '#mw-mf-nearby' ) + }, $btn = $( '#secondary-button' ), icon, $icon; @@ -15,7 +17,8 @@ } // Create refresh button on the header - icon = new Icon( { name: 'refresh', + icon = new Icon( { + name: 'refresh', id: 'secondary-button', additionalClassNames: 'main-header-button', tagName: 'a', @@ -51,7 +54,9 @@ */ M.router.route( /^\/page\/(.+)$/, function ( pageTitle ) { $icon.hide(); - refresh( $.extend( {}, options, { pageTitle: pageTitle } ) ); + refresh( $.extend( {}, options, { + pageTitle: pageTitle + } ) ); } ); /* @@ -59,7 +64,9 @@ */ function refreshCurrentLocation() { $icon.show(); - refresh( $.extend( {}, options, { useCurrentLocation: true } ) ); + refresh( $.extend( {}, options, { + useCurrentLocation: true + } ) ); } /* diff --git a/javascripts/specials/uploads.js b/javascripts/specials/uploads.js index 47d346b..ae82b39 100644 --- a/javascripts/specials/uploads.js +++ b/javascripts/specials/uploads.js @@ -45,7 +45,9 @@ iiurlwidth: IMAGE_WIDTH }, { url: corsUrl || this.apiUrl, - xhrFields: { withCredentials: true } + xhrFields: { + withCredentials: true + } } ).done( function ( resp ) { if ( resp.query && resp.query.pages ) { // FIXME: [API] in an ideal world imageData would be a sorted array diff --git a/javascripts/specials/watchlist.js b/javascripts/specials/watchlist.js index 9f92ea1..bac6d66 100644 --- a/javascripts/specials/watchlist.js +++ b/javascripts/specials/watchlist.js @@ -12,7 +12,10 @@ // FIXME: find more elegant way to not show watchlist stars on recent changes if ( $( '.mw-mf-watchlist-selector' ).length === 0 ) { - watchlist = new WatchList( { el: $watchlist, enhance: true } ); + watchlist = new WatchList( { + el: $watchlist, + enhance: true + } ); watchlist.on( 'unwatch', function () { schema.log( actionNamePrefix + 'unwatch' ); } ); -- To view, visit https://gerrit.wikimedia.org/r/174637 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ae8f602a5a9114e57ae0e7ea07265cf920f0bd1 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Awjrichards <aricha...@wikimedia.org> Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits