+ * @author Wolfgang Fahl
+ * @package MediaWiki
+ * @subpackage Extensions
+ */
+
+class S5SlideShowHooks {
+ static $styles = [
+ 'core.css' => 's5-core.css',
+ 'base.css' => 's5-base.css',
+ 'framing.css' => 's5-framing.css',
+ 'pretty.css' => '$skin/pretty.css',
+ ];
+ static $parsingSlide = false;
+
+ // Setup parser hooks for S5
+ static function ParserFirstCallInit( $parser ) {
+ if ( !isset( $parser->extS5Hooks ) ) {
+ $parser->setHook(
+ 'slideshow', [ 'S5SlideShow\Render', 'slideshow_view' ]
+ );
+ $parser->setHook(
+ 'slide', 'S5SlideShow\Render::slideshow_legacy'
+ );
+ $parser->setHook(
+ 'slides', 'S5SlideShow\Render::slides_view'
+ );
+ $parser->setHook(
+ 'slidecss', 'S5SlideShow\Render::slidecss_view'
+ );
+ } elseif ( $parser->extS5Hooks === 'parse' ) {
+ $parser->setHook( 'slideshow', [ $parser->extS5, 'slideshow_parse' ] );
+ $parser->setHook( 'slide', [ $parser->extS5, 'slideshow_parse' ] );
+ $parser->setHook(
+ 'slides', 'S5SlideShow\Render::empty_tag_hook'
+ );
+ $parser->setHook(
+ 'slidecss', 'S5SlideShow\Render::empty_tag_hook'
+ );
+ } elseif ( $parser->extS5Hooks === 'parse2' ) {
+ $parser->setHook(
+ 'slideshow', 'S5SlideShow\Render::empty_tag_hook'
+ );
+ $parser->setHook(
+ 'slide', 'S5SlideShow\Render::empty_tag_hook'
+ );
+ $parser->setHook( 'slides', [ $parser->extS5, 'slides_parse' ] );
+ $parser->setHook( 'slidecss', [ $parser->extS5, 'slidecss_parse' ] );
+ }
+ }
+
+ // Setup hook for image scaling hack
+ static function Setup() {
+ // global $wgActions;
+ // echo "";var_dump($wgActions);exit;
+ // global $egS5BrowserScaleHack, $wgHooks;
+ // if ( $egS5BrowserScaleHack ) {
+ // $wgHooks['ImageBeforeProduceHTML'][]
+ // = 'MediaWiki\Extensions\S5SlideShow\Hooks::ImageBeforeProduceHTML';
+ // }
+ }
+
+ // Hook that creates {{S5SLIDESHOW}} magic word
+ static function MagicWordwgVariableIDs( &$mVariablesIDs ) {
+ $mVariablesIDs[] = 's5slideshow';
+ }
+
+ // Hook that evaluates {{S5SLIDESHOW}} magic word
+ static function ParserGetVariableValueSwitch( $parser, $varCache, $index, &$ret ) {
+ if ( $index === 's5slideshow' ) {
+ $ret = empty( self::$parsingSlide ) ? '' : '1';
+ }
+ }
+
+ // Render pictures differently in slide show mode
+ static function ImageBeforeProduceHTML(
+ $skin, $title, $file, $frameParams, $handlerParams, $time, &$res
+ ) {
+ global $egS5BrowserScaleHack;
+ if ( !$egS5BrowserScaleHack ) {
+ return;
+ }
+
+ if (
+ empty( self::$parsingSlide ) || !$file || !$file->exists() ||
+ !isset( $handlerParams['width'] )
+ ) {
+ return true;
+ }
+ $fp = &$frameParams;
+ $hp = &$handlerParams;
+ $center = false;
+ if ( isset( $fp['align'] ) && $fp['align'] === 'center' ) {
+ $center = true;
+ $fp['align'] = 'none';
+ }
+ $thumb = $file->getUnscaledThumb(
+ isset( $hp['page'] ) ? [ 'page' => $hp['page'] ] : false
+ );
+ $params['alt'] = $fp['alt'] ?? null;
+ $params['title'] = $fp['title'] ?? null;
+
+ $params['override-height']
+ = ceil( $thumb->getHeight() * $hp['width'] / $thumb->getWidth() );
+ $params['override-width'] = $hp['width'];
+ if ( !empty( $fp['link-url'] ) ) {
+ $params['custom-url-link'] = $fp['link-url'];
+ } elseif ( !empty( $fp['link-title'] ) ) {
+ $params['custom-title-link'] = $fp['link-title'];
+ } elseif ( !empty( $fp['no-link'] ) ) {
+ } else {
+ $params['desc-link'] = true;
+ }
+ $res .= $thumb->toHtml( $params );
+ if ( isset( $fp['thumbnail'] ) ) {
+ $outerWidth = $thumb->getWidth() + 2;
+ $res = ""
+ . "
$res
"
+ . "
$fp[caption]
";
+ }
+ if ( isset( $fp['align'] ) && $fp['align'] ) {
+ $res = "$res
";
+ }
+ if ( $center ) {
+ $res = "$res
";
+ }
+ return false;
+ }
+
+ // Used to display CSS files on S5 skin CSS pages when they don't exist
+ static function ArticleFromTitle( $title, &$article ) {
+ if ( $title->getNamespace() === NS_MEDIAWIKI &&
+ preg_match(
+ '#^S5/([\w-]+)/((core|base|framing|pretty).css)$#s', $title->getText(), $m
+ )
+ ) {
+ $file = __DIR__ . '/' . str_replace( '$skin', $m[1], self::$styles[$m[2]] );
+ if ( file_exists( $file ) ) {
+ $article = new MWArticle( $title, $m[1], $file );
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // Used to display CSS files on S5 skin CSS pages in edit mode
+ static function AlternateEdit( $editpage ) {
+ if ( $editpage->mArticle instanceof MWArticle && !$editpage->mArticle->exists() ) {
+ $editpage->mPreloadText = $editpage->mArticle->getPage()->getContent();
+ }
+ return true;
+ }
+}
diff --git a/src/Skin.php b/src/Skin.php
new file mode 100644
index 0000000..0b92981
--- /dev/null
+++ b/src/Skin.php
@@ -0,0 +1,44 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+namespace S5SlideShow;
+
+/**
+ * @author Vitaliy Filippov
+ * @package MediaWiki
+ * @subpackage Extensions
+ */
+
+use SkinApi;
+use SkinTemplate;
+
+/**
+ * see https://doc.wikimedia.org/mediawiki-core/master/php/classSkinApi.html
+ *
+ */
+class Skin extends SkinApi {
+ /**
+ * set up the skin user css
+ * @param OutputPage $out
+ */
+ public function setupSkinUserCss( $out ) {
+ SkinTemplate::setupSkinUserCss( $out );
+ }
+}
diff --git a/src/Special.php b/src/Special.php
new file mode 100644
index 0000000..8aadc60
--- /dev/null
+++ b/src/Special.php
@@ -0,0 +1,51 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * s5SlideShow SpecialPage for S5SlideShow extension
+ *
+ * @file
+ * @ingroup Extensions
+ */
+namespace S5SlideShow;
+
+use SpecialPage;
+
+class SpecialS5SlideShow extends SpecialPage {
+ public function __construct() {
+ parent::__construct( 's5SlideShow' );
+ }
+
+ /**
+ * Show the page to the user
+ *
+ * @param string $sub The subpage string argument (if any).
+ */
+ public function execute( $sub ) {
+ $out = $this->getOutput();
+ $out->setPageTitle( $this->msg( 'special-s5SlideShow-title' ) );
+ $out->addHelpLink( 'S5SlideShow' );
+ $out->addWikiMsg( 'special-s5SlideShow-intro' );
+ }
+
+ protected function getGroupName() {
+ return 'other';
+ }
+}
diff --git a/yatil/bullet.gif b/yatil/bullet.gif
new file mode 100644
index 0000000..b43de48
Binary files /dev/null and b/yatil/bullet.gif differ