public static function addEditModule(EditPage $editPage, OutputPage $output) { $output->addModules('ext.wikieditor.huijiextra.top'); $output->addModules('ext.wikieditor.huijiextra.bottom'); $output->addHeadItem('loader', '<script language="JavaScript">' . "\n" . '$(window).load(function() {' . "\n" . '// Animate loader off screen' . "\n" . '$(".se-pre-con").fadeOut("slow");' . "\n" . 'var editFormSisyphus = $( "#editform" ).sisyphus( {' . "\n" . 'locationBased: true, ' . "\n" . 'timeout: 0,' . "\n" . 'autoRelease: true,' . "\n" . 'onBeforeRestore:function(){' . "\n" . '$("#autoRestoreModal").modal({' . "\n" . 'keyboard: false,' . "\n" . 'backdrop: "static"' . "\n" . '}); ' . "\n" . 'return false;' . "\n" . '}' . "\n" . '} ); ' . "\n" . '});' . "\n" . '</script>'); $output->prependHTML('<div class="se-pre-con"></div>'); }
protected static function maybeAddBacklogNotice(OutputPage &$out) { global $wgUser; if (!$wgUser->isAllowed('review')) { return true; // not relevant to user } $namespaces = FlaggedRevs::getReviewNamespaces(); $watchlist = SpecialPage::getTitleFor('Watchlist'); # Add notice to watchlist about pending changes... if ($out->getTitle()->equals($watchlist) && $namespaces) { $dbr = wfGetDB(DB_SLAVE, 'watchlist'); // consistency with watchlist $watchedOutdated = (bool) $dbr->selectField(array('watchlist', 'page', 'flaggedpages'), '1', array('wl_user' => $wgUser->getId(), 'wl_namespace' => $namespaces, 'wl_namespace = page_namespace', 'wl_title = page_title', 'fp_page_id = page_id', 'fp_pending_since IS NOT NULL'), __METHOD__); # Give a notice if pages on the users's wachlist have pending edits if ($watchedOutdated) { $css = 'plainlinks fr-watchlist-pending-notice'; $out->prependHTML("<div id='mw-fr-watchlist-pending-notice' class='{$css}'>" . wfMsgExt('flaggedrevs-watched-pending', 'parseinline') . "</div>"); } } return true; }