diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /resources/src/mediawiki/mediawiki.hlist.js | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'resources/src/mediawiki/mediawiki.hlist.js')
-rw-r--r-- | resources/src/mediawiki/mediawiki.hlist.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/resources/src/mediawiki/mediawiki.hlist.js b/resources/src/mediawiki/mediawiki.hlist.js new file mode 100644 index 00000000..0bbf8fad --- /dev/null +++ b/resources/src/mediawiki/mediawiki.hlist.js @@ -0,0 +1,31 @@ +/*! + * .hlist fallbacks for IE 6, 7 and 8. + * @author [[User:Edokter]] + */ +( function ( mw, $ ) { + var profile = $.client.profile(); + + if ( profile.name === 'msie' ) { + if ( profile.versionNumber === 8 ) { + /* IE 8: Add pseudo-selector class to last-child list items */ + mw.hook( 'wikipage.content' ).add( function ( $content ) { + $content.find( '.hlist' ).find( 'dd:last-child, dt:last-child, li:last-child' ) + .addClass( 'hlist-last-child' ); + } ); + } + else if ( profile.versionNumber <= 7 ) { + /* IE 7 and below: Generate interpuncts and parentheses */ + mw.hook( 'wikipage.content' ).add( function ( $content ) { + var $hlists = $content.find( '.hlist' ); + $hlists.find( 'dt:not(:last-child)' ) + .append( ': ' ); + $hlists.find( 'dd:not(:last-child)' ) + .append( '<b>·</b> ' ); + $hlists.find( 'li:not(:last-child)' ) + .append( '<b>·</b> ' ); + $hlists.find( 'dl dl, dl ol, dl ul, ol dl, ol ol, ol ul, ul dl, ul ol, ul ul' ) + .prepend( '( ' ).append( ') ' ); + } ); + } + } +}( mediaWiki, jQuery ) ); |