From b35cd14b632e4b03672e6110f04018252369ea03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Tisza?= Date: Fri, 4 Apr 2014 22:02:16 +0000 Subject: [PATCH] Rename setRepoInlineStyle to setInlineStyle Forgot to do this when I originally extracted it. Change-Id: Iaa31ede4e151513652e1a05a44daa1ff636fbc85 --- resources/mmv/ui/mmv.ui.js | 2 +- resources/mmv/ui/mmv.ui.metadataPanel.js | 4 ++-- resources/mmv/ui/mmv.ui.stripeButtons.js | 4 ++-- tests/qunit/mmv/ui/mmv.ui.test.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/mmv/ui/mmv.ui.js b/resources/mmv/ui/mmv.ui.js index 82f348f2a..fa33559b3 100644 --- a/resources/mmv/ui/mmv.ui.js +++ b/resources/mmv/ui/mmv.ui.js @@ -104,7 +104,7 @@ * @param {string} key some name to identify the style * @param {string|null} style a CSS snippet (set to null to delete the given style) */ - EP.setRepoInlineStyle = function ( key, style ) { + EP.setInlineStyle = function ( key, style ) { if ( !this.$inlineStyles ) { this.$inlineStyles = []; diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js b/resources/mmv/ui/mmv.ui.metadataPanel.js index f5588b171..26786243d 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.js +++ b/resources/mmv/ui/mmv.ui.metadataPanel.js @@ -420,13 +420,13 @@ // This horror exists because the CSS uses a :before pseudo-class to // define the repo icon. This is the only way to override it. if ( favIcon ) { - this.setRepoInlineStyle( 'repoDisplay', + this.setInlineStyle( 'repoDisplay', '.mw-mmv-image-links li.mw-mmv-repo-li:before {' + 'background-image: url("' + favIcon + '");' + '}' ); } else { - this.setRepoInlineStyle( 'repoDisplay', null ); + this.setInlineStyle( 'repoDisplay', null ); } this.$repoLi.removeClass( 'empty' ); diff --git a/resources/mmv/ui/mmv.ui.stripeButtons.js b/resources/mmv/ui/mmv.ui.stripeButtons.js index d898f0b59..1719dc18d 100644 --- a/resources/mmv/ui/mmv.ui.stripeButtons.js +++ b/resources/mmv/ui/mmv.ui.stripeButtons.js @@ -208,7 +208,7 @@ this.buttons.$descriptionPage.addClass( 'mw-mmv-stripe-button-commons' ); } else { this.buttons.$descriptionPage.addClass( 'mw-mmv-stripe-button-dynamic' ); - this.setRepoInlineStyle( 'stripe-button-description-page', + this.setInlineStyle( 'stripe-button-description-page', '.mw-mmv-stripe-button-dynamic:before {' + 'background-image: url("' + repoInfo.favIcon + '");' + '}' @@ -229,7 +229,7 @@ this.buttons.$descriptionPage.attr( { href: null, title: null, 'original-title': null } ) .removeClass( 'mw-mmv-stripe-button-dynamic mw-mmv-stripe-button-commons' ); $( '.mw-mmv-stripe-button-dynamic-before' ).remove(); - this.setRepoInlineStyle( 'stripe-button-description-page', null ); + this.setInlineStyle( 'stripe-button-description-page', null ); } }; diff --git a/tests/qunit/mmv/ui/mmv.ui.test.js b/tests/qunit/mmv/ui/mmv.ui.test.js index a195881cc..a295665fb 100755 --- a/tests/qunit/mmv/ui/mmv.ui.test.js +++ b/tests/qunit/mmv/ui/mmv.ui.test.js @@ -15,17 +15,17 @@ $( document ).trigger( new $.Event( 'mmv-foo' ) ); } ); - QUnit.test( 'setRepoInlineStyle()', 3, function ( assert ) { + QUnit.test( 'setInlineStyle()', 3, function ( assert ) { var element = new mw.mmv.ui.Element( $( '
' ) ), $testDiv = $( '
!!!
' ).appendTo( '#qunit-fixture' ); assert.ok( $testDiv.is( ':visible' ), 'Test div is visible' ); - element.setRepoInlineStyle( 'test', '#mmv-testdiv { display: none; }' ); + element.setInlineStyle( 'test', '#mmv-testdiv { display: none; }' ); assert.ok( !$testDiv.is( ':visible' ), 'Test div is hidden by inline style' ); - element.setRepoInlineStyle( 'test', null ); + element.setInlineStyle( 'test', null ); assert.ok( $testDiv.is( ':visible' ), 'Test div is visible again' ); } );