2020-01-09 22:11:00 +00:00
import mustache from 'mustache' ;
import { htmluserlangattributes } from './utils' ;
import skinTemplate from '!!raw-loader!../includes/templates/index.mustache' ;
import { placeholder } from './utils' ;
import '../resources/skins.vector.styles/screen.less' ;
2020-02-28 22:17:31 +00:00
import { NAVIGATION _TEMPLATE _DATA , navTemplate , NAVIGATION _TEMPLATE _PARTIALS } from './Navigation.stories.data' ;
import { FOOTER _TEMPLATE _DATA , footerTemplate } from './Footer.stories.data' ;
2020-02-17 19:49:43 +00:00
const TEMPLATE _PARTIALS = Object . assign ( { } , NAVIGATION _TEMPLATE _PARTIALS , {
Navigation : navTemplate ,
Footer : footerTemplate
} ) ;
2020-01-09 22:11:00 +00:00
export default {
title : 'Skin'
} ;
const HTML _INDICATORS = ` <div class="mw-indicators mw-body-content">
< div id = "mw-indicator-good-star" class = "mw-indicator" >
< a href = "/wiki/Wikipedia:Good_articles"
title = "This is a good article. Follow the link for more information." >
< img alt = "This is a good article. Follow the link for more information."
src = "//upload.wikimedia.org/wikipedia/en/thumb/9/94/Symbol_support_vote.svg/19px-Symbol_support_vote.svg.png" decoding = "async" width = "19" height = "20"
srcset = "//upload.wikimedia.org/wikipedia/en/thumb/9/94/Symbol_support_vote.svg/29px-Symbol_support_vote.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/9/94/Symbol_support_vote.svg/39px-Symbol_support_vote.svg.png 2x" data - file - width = "180" data - file - height = "185" / >
< / a >
< / d i v >
< div id = "mw-indicator-pp-autoreview" class = "mw-indicator" >
< a href = "/wiki/Wikipedia:Protection_policy#pending"
title = "All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users" >
< img alt = "Page protected with pending changes" src = "//upload.wikimedia.org/wikipedia/en/thumb/b/b7/Pending-protection-shackle.svg/20px-Pending-protection-shackle.svg.png"
decoding = "async" width = "20" height = "20" srcset = "//upload.wikimedia.org/wikipedia/en/thumb/b/b7/Pending-protection-shackle.svg/30px-Pending-protection-shackle.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/b/b7/Pending-protection-shackle.svg/40px-Pending-protection-shackle.svg.png 2x" data - file - width = "512" data - file - height = "512" / >
< / a >
< / d i v >
< / d i v >
` ;
export const vector2019LoggedOut = ( ) => mustache . render ( skinTemplate , {
'html-title' : 'Vector 2019' ,
'page-isarticle' : true ,
'msg-tagline' : 'From Wikipedia, the free encyclopedia' ,
'html-userlangattributes' : htmluserlangattributes ,
'msg-jumptonavigation' : 'Jump to navigation' ,
'msg-jumptosearch' : 'Jump to search' ,
2020-02-17 19:49:43 +00:00
'data-navigation' : NAVIGATION _TEMPLATE _DATA . loggedOutWithVariants ,
2020-01-09 22:11:00 +00:00
// site specific
2020-02-17 19:49:43 +00:00
'data-footer' : FOOTER _TEMPLATE _DATA ,
2020-01-09 22:11:00 +00:00
'html-sitenotice' : placeholder ( 'a site notice or central notice banner may go here' , 70 ) ,
// article dependent
'html-bodycontent' : placeholder ( 'Article content goes here' ) ,
'html-printfooter' : ` Retrieved from ‘ <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>’ ` ,
'html-catlinks' : placeholder ( 'Category links component from mediawiki core' , 50 ) ,
// extension dependent..
'html-hook-vector-before-footer' : placeholder ( 'VectorBeforeFooter hook output' , 100 ) ,
'html-dataAfterContent' : placeholder ( 'Extensions can add here e.g. Related Articles.' , 100 ) ,
'html-indicators' : HTML _INDICATORS ,
'html-subtitle' : placeholder ( 'Extensions can configure subtitle' , 20 )
2020-02-17 19:49:43 +00:00
} , TEMPLATE _PARTIALS ) ;
2020-01-09 22:11:00 +00:00
export const vector2019LoggedIn = ( ) => mustache . render ( skinTemplate , {
'html-title' : 'Vector 2019' ,
'page-isarticle' : true ,
'msg-tagline' : 'From Wikipedia, the free encyclopedia' ,
'html-userlangattributes' : htmluserlangattributes ,
'msg-jumptonavigation' : 'Jump to navigation' ,
'msg-jumptosearch' : 'Jump to search' ,
2020-02-17 19:49:43 +00:00
'data-navigation' : NAVIGATION _TEMPLATE _DATA . loggedInWithMoreActions ,
2020-01-09 22:11:00 +00:00
// site specific
2020-02-17 19:49:43 +00:00
'data-footer' : FOOTER _TEMPLATE _DATA ,
2020-01-09 22:11:00 +00:00
'html-sitenotice' : placeholder ( 'a site notice or central notice banner may go here' , 70 ) ,
// article dependent
'html-bodycontent' : placeholder ( 'Article content goes here' ) ,
'html-printfooter' : ` Retrieved from ‘ <a dir="ltr" href="#">https://en.wikipedia.org/w/index.php?title=this&oldid=blah</a>’ ` ,
'html-catlinks' : placeholder ( 'Category links component from mediawiki core' , 50 )
2020-02-17 19:49:43 +00:00
} , TEMPLATE _PARTIALS ) ;