-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3edf684
commit 9324dca
Showing
8 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { h } from 'tsx-dom'; | ||
import '../../types'; | ||
import unwrapWidget from '../../util/unwrapWidget'; | ||
import swapElements from '../../util/swapElements'; | ||
|
||
/** | ||
* @return A MessageWidget for reloading a page with an outdated configuration. | ||
*/ | ||
export default function ConfigurationReloadBanner(): JSX.Element { | ||
const r = 'deputy-' + Math.random().toString().slice( 2 ); | ||
|
||
const messageBox = new OO.ui.MessageWidget( { | ||
classes: [ | ||
'deputy', 'dp-mb' | ||
], | ||
type: 'info', | ||
label: new OO.ui.HtmlSnippet( ( <span> | ||
<b>{ | ||
mw.msg( 'deputy.settings.wikiOutdated' ) | ||
}</b><br/>{ | ||
mw.msg( 'deputy.settings.wikiOutdated.help' ) | ||
}<br/> | ||
<span id={r}></span> | ||
</span> ).innerHTML ) | ||
} ); | ||
|
||
const reloadButton = new OO.ui.ButtonWidget( { | ||
flags: [ 'progressive', 'primary' ], | ||
label: mw.msg( 'deputy.settings.wikiOutdated.reload' ) | ||
} ); | ||
reloadButton.on( 'click', async () => { | ||
window.location.reload(); | ||
} ); | ||
|
||
const box = unwrapWidget( messageBox ); | ||
swapElements( box.querySelector( `#${r}` ), unwrapWidget( reloadButton ) ); | ||
|
||
box.style.fontSize = 'calc(1em * 0.875)'; | ||
|
||
return box; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters