jenkins-bot has submitted this change and it was merged. Change subject: Migrate 'wgBreakFrames' from wikibits.js to mediawiki.page.ready ......................................................................
Migrate 'wgBreakFrames' from wikibits.js to mediawiki.page.ready This module now contains the same code as in wikibits.js. For cached entries the new code works automatically since both legacy wikibits and mediawiki.page.ready are already present in the load() queue of existing pages. Change-Id: I18b068fbcf4ba0646fb07313c3d9676cc76a0ad5 --- M resources/src/mediawiki.page/mediawiki.page.ready.js M skins/common/wikibits.js 2 files changed, 10 insertions(+), 9 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.page/mediawiki.page.ready.js b/resources/src/mediawiki.page/mediawiki.page.ready.js index ccddb3e..a05a054 100644 --- a/resources/src/mediawiki.page/mediawiki.page.ready.js +++ b/resources/src/mediawiki.page/mediawiki.page.ready.js @@ -1,6 +1,16 @@ ( function ( mw, $ ) { var supportsPlaceholder = 'placeholder' in document.createElement( 'input' ); + // Break out of framesets + if ( mw.config.get( 'wgBreakFrames' ) ) { + // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet) + // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266) + if ( window.top !== window.self ) { + // Un-trap us from framesets + window.top.location = window.location; + } + } + mw.hook( 'wikipage.content' ).add( function ( $content ) { var $sortableTables; diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index fdfca0a..b6689f9 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -8,15 +8,6 @@ isIE6 = ( /msie ([0-9]{1,}[\.0-9]{0,})/.exec( ua ) && parseFloat( RegExp.$1 ) <= 6.0 ), onloadFuncts = []; -if ( mw.config.get( 'wgBreakFrames' ) ) { - // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet) - // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266) - if ( win.top !== win.self ) { - // Un-trap us from framesets - win.top.location = win.location; - } -} - /** * User-agent sniffing. * -- To view, visit https://gerrit.wikimedia.org/r/139672 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18b068fbcf4ba0646fb07313c3d9676cc76a0ad5 Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits