This repository was archived by the owner on Oct 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ <h2 data-l10n-id="other"></h2>
129129 < button data-click ="nav " data-click-location ="create " data-l10n-title ="create "> < span class ="icon icon-pencil "> </ span > </ button >
130130 < button data-click ="sidebar " data-click-id ="welcome " class ="drawerEnabled " data-l10n-title ="menu "> < span class ="icon icon-menu "> </ span > </ button >
131131 </ menu >
132- < h1 class ="firetext icon- "> < img src ="style/icons/app/firetext.svg " alt ="Firetext "> </ h1 >
132+ < h1 class ="firetext icon- "> < img src ="style/icons/app/firetext.svg " alt ="Firetext " id =" welcome-wordmark " > </ h1 >
133133 </ header >
134134 < div role ="main " class ="header-only " id ="welcome-main-area ">
135135 < menu type ="toolbar " class ="desktop-only mainButtons ">
Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ function initModules(callback) {
158158 } ;
159159 rate . init ( "firetext" , version , config ) ;
160160 rate . promptRequired ( ) ;
161+
162+ // Initialize Christmas
163+ christmas ( ) ;
161164}
162165
163166function initElementTitles ( ) {
@@ -1630,3 +1633,30 @@ function setDocumentTitle() {
16301633 }
16311634 }
16321635}
1636+
1637+ function christmas ( ) {
1638+ var testDate = new Date ( ) ,
1639+ testMonth = testDate . getMonth ( ) + 1 ,
1640+ testDay = testDate . getDate ( ) ;
1641+ if ( testMonth === 12 && ( testDay >= 13 && testDay <= 31 ) ) {
1642+ doChristmas ( ) ;
1643+ window . addEventListener ( 'night.changed' , doChristmas ) ;
1644+ }
1645+
1646+ function doChristmas ( ) {
1647+ var wordmark = document . getElementById ( 'welcome-wordmark' ) ;
1648+ if ( html . classList . contains ( 'night' ) != true ) {
1649+ if ( ! wordmark . hasAttribute ( 'data-original-src' ) ) {
1650+ wordmark . setAttribute ( 'data-original-src' , wordmark . src ) ;
1651+ }
1652+ wordmark . src = 'style/icons/app/firetext_christmas.svg' ;
1653+ } else {
1654+ if ( wordmark . hasAttribute ( 'data-original-src' ) ) {
1655+ wordmark . src = wordmark . getAttribute ( 'data-original-src' ) ;
1656+ }
1657+ }
1658+
1659+ // Override theme color
1660+ themeColor . setAttribute ( 'content' , '#034f20' ) ;
1661+ }
1662+ }
Original file line number Diff line number Diff line change 1010------------------------*/
1111var ncss , dcss = document . getElementsByTagName ( "link" ) [ 25 ] ;
1212var nightTheme = '#111' , dayTheme = '#fff' ;
13+ var nightChangeEvent = new CustomEvent ( 'night.changed' ) ;
1314
1415function night ( ) {
1516 if ( firetext . settings . get ( 'nightmode' ) == 'true' ) {
@@ -72,4 +73,7 @@ function startNight(start) {
7273 }
7374 }
7475 updatePreviewNightModes ( document . querySelectorAll ( '[data-type="list"] li.fileListItem .fileItemDescription iframe' ) ) ;
76+
77+ // Notify app
78+ window . dispatchEvent ( nightChangeEvent ) ;
7579}
You can’t perform that action at this time.
0 commit comments