TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289323

Change subject: [WIP] Use styles to hide player controls
......................................................................

[WIP] Use styles to hide player controls

Remove usage of disablecontrols, since it makes much more sense to do
that with styling.

Still working on getting mwembed to pass along a class.

Change-Id: Ifb98b8cc7eb1f0cce41b55684043069a4f1d6df6
Depends-On: I4d14b6e7111db3c412b24e7e1faeb0b031fdc14f
Bug: T135537
---
M Score.body.php
M extension.json
A modules/ext.score.styles.less
3 files changed, 31 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/23/289323/1

diff --git a/Score.body.php b/Score.body.php
index 8b70c7d..5972795 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -321,6 +321,8 @@
                // to track all those pages.
                $parser->getOutput()->setProperty( 'score' , true );
 
+               $parser->getOutput()->addModuleStyles( 'ext.score.styles' );
+
                return $html;
        }
 
@@ -440,6 +442,7 @@
                        if ( isset( $existingFiles[$imageFileName] ) ) {
                                list( $width, $height ) = 
$metaData[$imageFileName]['size'];
                                $link = Html::rawElement( 'img', array(
+                                       'class' => 'mw-score',
                                        'src' => 
"{$options['dest_url']}/$imageFileName",
                                        'width' => $width,
                                        'height' => $height,
@@ -459,6 +462,7 @@
                                        list( $width, $height ) = 
$metaData[$fileName]['size'];
                                        $link .= Html::rawElement( 'img', array(
                                                'src' => 
"{$options['dest_url']}/$fileName",
+                                               'class' => 'mw-score',
                                                'width' => $width,
                                                'height' => $height,
                                                'alt' => $pageNumb,
@@ -481,6 +485,7 @@
                                $length = 
$metaData[basename($oggPath)]['length'];
                                if ( class_exists( 'TimedMediaTransformOutput' 
) ){
                                        $player = new 
TimedMediaTransformOutput( array(
+                                               'playerClass' => 
'mw-score-player',
                                                'length' => $length,
                                                'sources' => array(
                                                        array(
@@ -488,7 +493,6 @@
                                                                'type' => 
'audio/ogg; codecs="vorbis"'
                                                        )
                                                ),
-                                               'disablecontrols' => 
'options,timedText',
                                                'width' => 
self::DEFAULT_PLAYER_WIDTH
                                        ) );
                                } else /* class_exists( 'OggAudioDisplay' ) */ {
diff --git a/extension.json b/extension.json
index 9cb53b4..c83880f 100644
--- a/extension.json
+++ b/extension.json
@@ -17,6 +17,15 @@
                "ScoreHooks": "Score.hooks.php"
        },
        "ResourceModules": {
+               "ext.score.styles": {
+                       "styles": [
+                               "ext.score.styles.less"
+                       ],
+                       "targets" : [
+                               "desktop",
+                               "mobile"
+                       ]
+               },
                "ext.score.visualEditor": {
                        "scripts": [
                                "ve-score/ve.dm.MWScoreNode.js",
diff --git a/modules/ext.score.styles.less b/modules/ext.score.styles.less
new file mode 100644
index 0000000..b4b04c2
--- /dev/null
+++ b/modules/ext.score.styles.less
@@ -0,0 +1,17 @@
+.video-js.mw-score-player {
+       display: block !important;
+
+       .mw-info-button {
+               display: none;
+       }
+}
+
+.k-player.mw-score-player {
+       .k-options,
+       .timed-text {
+               display: none;
+       }
+       .play_head {
+               right: 85px !important;
+       }
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/289323
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb98b8cc7eb1f0cce41b55684043069a4f1d6df6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: TheDJ <hartman.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to