[MediaWiki-commits] [Gerrit] mediawiki...Popups[mpga]: Remove unused code in repo
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/335713 ) Change subject: Remove unused code in repo .. Remove unused code in repo The existence of these files was causing me much confusion as I thought they were still being used in the mpga branch. If this is note the case they should be removed to make the repo easier to understand. Changes: * Move the ext.popups.animation.less into ext.popups since that's where its shipped. * Remove files which are not being used. * Since csslint now runs on ext.popups.animation.less fix the linting issues (previously linting was not occuring) Change-Id: Iae0a78d0b8a13353de70794b67387f2c3bab44c6 --- M extension.json D resources/ext.popups.core/ext.popups.core.js D resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js D resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js R resources/ext.popups/styles/ext.popups.animation.less D tests/qunit/ext.popups.core.test.js D tests/qunit/ext.popups.desktopRenderer.test.js D tests/qunit/ext.popups.renderer.article.test.js D tests/qunit/ext.popups.schemaPopups.utils.test.js 9 files changed, 3 insertions(+), 1,136 deletions(-) Approvals: jenkins-bot: Verified Phuedx: Looks good to me, approved diff --git a/extension.json b/extension.json index e9ec449..c59442c 100644 --- a/extension.json +++ b/extension.json @@ -112,7 +112,7 @@ }, "styles": [ "resources/ext.popups/styles/ext.popups.core.less", - "resources/ext.popups.desktop/ext.popups.animation.less", + "resources/ext.popups/styles/ext.popups.animation.less", "resources/ext.popups/styles/ext.popups.settings.less" ], "messages": [ diff --git a/resources/ext.popups.core/ext.popups.core.js b/resources/ext.popups.core/ext.popups.core.js deleted file mode 100644 index bc4fe65..000 --- a/resources/ext.popups.core/ext.popups.core.js +++ /dev/null @@ -1,134 +0,0 @@ -( function ( $, mw ) { - 'use strict'; - var previewCountStorageKey = 'ext.popups.core.previewCount', - popupsEnabledStorageKey = 'mwe-popups-enabled'; - - /** -* @class mw.popups -* @singleton -*/ - mw.popups = {}; - - /** -* The API object used for all this extension's requests -* @property {Object} api -*/ - mw.popups.api = new mw.Api(); - - /** -* Whether the page is being scrolled. -* @property {boolean} scrolled -*/ - mw.popups.scrolled = false; - - /** -* Temporarily remove the title attribute of a link so that -* the tooltip doesn't show up alongside the Hovercard. -* -* @method removeTooltip -* @param {jQuery.Object} $link link from which to strip title -*/ - mw.popups.removeTooltip = function ( $link ) { - // We shouldn't empty the title attribute of links that - // can't have Hovercards, ie. TextExtracts didn't return - // anything. It's set in the article.init after attempting - // to make an API request. - if ( - $link.data( 'dont-empty-title' ) !== true && - $link.filter( '[title]:not([title=""])' ).length - ) { - $link - .data( 'title', $link.attr( 'title' ) ) - .attr( 'title', '' ); - } - }; - - /** -* Restore previously-removed title attribute. -* -* @method restoreTooltip -* @param {jQuery.Object} $link link to which to restore title -*/ - mw.popups.restoreTooltip = function ( $link ) { - $link.attr( 'title', $link.data( 'title' ) ); - }; - - /** -* Register a hover event that may render a popup on an appropriate link. -* -* @method setupTriggers -* @param {jQuery.Object} $elements to bind events to -* @param {string} events to bind to -*/ - mw.popups.setupTriggers = function ( $elements, events ) { - $elements.on( events, function ( event ) { - if ( mw.popups.scrolled ) { - return; - } - - mw.popups.render.render( $( this ), event, mw.popups.getRandomToken() ); - } ); - }; - - /** -* Get action based on click event -* -* @method getAction -* @param {Object} event -* @return {string} -*/ - mw.popups.getAction = function ( event ) { - if ( event.which === 2 ) { // middle click -
[MediaWiki-commits] [Gerrit] mediawiki...Popups[mpga]: Remove unused code in repo
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/335713 ) Change subject: Remove unused code in repo .. Remove unused code in repo The existence of these files was causing me much confusion as I thought they were still being used in the mpga branch. If this is note the case they should be removed to make the repo easier to understand. Changes: * Move the ext.popups.animation.less into ext.popups since that's where its shipped. * Remove files which are not being used. Change-Id: Iae0a78d0b8a13353de70794b67387f2c3bab44c6 --- M extension.json D resources/ext.popups.core/ext.popups.core.js D resources/ext.popups.schemaPopups.utils/ext.popups.schemaPopups.utils.js D resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js R resources/ext.popups/styles/ext.popups.animation.less D tests/qunit/ext.popups.core.test.js D tests/qunit/ext.popups.desktopRenderer.test.js D tests/qunit/ext.popups.renderer.article.test.js D tests/qunit/ext.popups.schemaPopups.utils.test.js 9 files changed, 1 insertion(+), 1,134 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/13/335713/1 diff --git a/extension.json b/extension.json index e9ec449..c59442c 100644 --- a/extension.json +++ b/extension.json @@ -112,7 +112,7 @@ }, "styles": [ "resources/ext.popups/styles/ext.popups.core.less", - "resources/ext.popups.desktop/ext.popups.animation.less", + "resources/ext.popups/styles/ext.popups.animation.less", "resources/ext.popups/styles/ext.popups.settings.less" ], "messages": [ diff --git a/resources/ext.popups.core/ext.popups.core.js b/resources/ext.popups.core/ext.popups.core.js deleted file mode 100644 index bc4fe65..000 --- a/resources/ext.popups.core/ext.popups.core.js +++ /dev/null @@ -1,134 +0,0 @@ -( function ( $, mw ) { - 'use strict'; - var previewCountStorageKey = 'ext.popups.core.previewCount', - popupsEnabledStorageKey = 'mwe-popups-enabled'; - - /** -* @class mw.popups -* @singleton -*/ - mw.popups = {}; - - /** -* The API object used for all this extension's requests -* @property {Object} api -*/ - mw.popups.api = new mw.Api(); - - /** -* Whether the page is being scrolled. -* @property {boolean} scrolled -*/ - mw.popups.scrolled = false; - - /** -* Temporarily remove the title attribute of a link so that -* the tooltip doesn't show up alongside the Hovercard. -* -* @method removeTooltip -* @param {jQuery.Object} $link link from which to strip title -*/ - mw.popups.removeTooltip = function ( $link ) { - // We shouldn't empty the title attribute of links that - // can't have Hovercards, ie. TextExtracts didn't return - // anything. It's set in the article.init after attempting - // to make an API request. - if ( - $link.data( 'dont-empty-title' ) !== true && - $link.filter( '[title]:not([title=""])' ).length - ) { - $link - .data( 'title', $link.attr( 'title' ) ) - .attr( 'title', '' ); - } - }; - - /** -* Restore previously-removed title attribute. -* -* @method restoreTooltip -* @param {jQuery.Object} $link link to which to restore title -*/ - mw.popups.restoreTooltip = function ( $link ) { - $link.attr( 'title', $link.data( 'title' ) ); - }; - - /** -* Register a hover event that may render a popup on an appropriate link. -* -* @method setupTriggers -* @param {jQuery.Object} $elements to bind events to -* @param {string} events to bind to -*/ - mw.popups.setupTriggers = function ( $elements, events ) { - $elements.on( events, function ( event ) { - if ( mw.popups.scrolled ) { - return; - } - - mw.popups.render.render( $( this ), event, mw.popups.getRandomToken() ); - } ); - }; - - /** -* Get action based on click event -* -* @method getAction -* @param {Object} event -* @return {string} -*/ - mw.popups.getAction = function ( event ) { - if ( event.which === 2 ) { // middle click - return 'opened in new tab'; - } else if ( event.which === 1 ) { -