jenkins-bot has submitted this change and it was merged.

Change subject: Make error in transcode one big link to the error details.
......................................................................


Make error in transcode one big link to the error details.

Also make it only a link if you have js (Its rather confusing
otherwise if something goes wrong with the js). Removes period
from entry in table for consistency.

Change-Id: I120fda14f7478866d7e5903c81cda29dc1bfd9a8
---
M TimedMediaHandler.i18n.php
M TranscodeStatusTable.php
M resources/ext.tmh.transcodetable.js
3 files changed, 26 insertions(+), 21 deletions(-)

Approvals:
  J: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TimedMediaHandler.i18n.php b/TimedMediaHandler.i18n.php
index 46f337a..9174a7e 100644
--- a/TimedMediaHandler.i18n.php
+++ b/TimedMediaHandler.i18n.php
@@ -47,7 +47,7 @@
        'timedmedia-direct-link' => 'Download derivative',
        'timedmedia-not-ready' => 'Not ready',
        'timedmedia-completed-on' => 'Completed transcode $1',
-       'timedmedia-error-on' => 'Error in transcode on $1.',
+       'timedmedia-error-on' => 'Error in transcode on $1',
        'timedmedia-started-transcode' => 'Transcode started $1 ago. $2',
        'timedmedia-percent-done' => 'About $1% done',
        'timedmedia-in-job-queue' => 'Added to Job queue $1 ago',
@@ -56,7 +56,6 @@
        'timedmedia-hours' => '{{PLURAL:$1|1 hour|$1 hours}}',
        'timedmedia-minutes' => '{{PLURAL:$1|1 minute|$1 minutes}}',
        'timedmedia-seconds' => '{{PLURAL:$1|1 second|$1 seconds}}',
-       'timedmedia-show-error' => 'Show error',
        'timedmedia-reset' => 'Reset transcode',
        'timedmedia-reset-confirm' => 'Resetting this transcode will remove any 
existing file (if present), and it will re-add the transcode to the job queue. 
It will take some time to re-transcode. <br /><br />
 Are you sure you want to proceed?',
diff --git a/TranscodeStatusTable.php b/TranscodeStatusTable.php
index f3722ed..429b662 100644
--- a/TranscodeStatusTable.php
+++ b/TranscodeStatusTable.php
@@ -112,26 +112,18 @@
                }
                // Check for error:
                if( !is_null( $state['time_error'] ) ){
+                       $attribs = array();
                        if( !is_null( $state['error'] ) ){
-                               $showErrorLink = Linker::link(
-                                       $file->getTitle(),
-                                       
wfMessage('timedmedia-show-error')->escaped(),
-                                       array(
-                                               'title' => wfMessage(
-                                                       'timedmedia-error-on',
-                                                       
$wgContLang->timeAndDate( $state[ 'time_error' ] )
-                                               )->escaped(),
-                                       'class' => 'errorlink',
-                                       'data-error' => $state['error']
-                                       )
+                               $attribs = array(
+                                       'class' => 'mw-tmh-pseudo-error-link',
+                                       'data-error' => $state['error'],
                                );
-                       } else {
-                               $showErrorLink = '';
                        }
 
-                       return wfMessage( 'timedmedia-error-on',
-                               $wgContLang->timeAndDate( $state['time_error'] 
) )->escaped() .
-                               $showErrorLink;
+                       return Html::rawElement( 'span', $attribs,
+                               wfMessage( 'timedmedia-error-on',
+                                       $wgContLang->timeAndDate( 
$state['time_error'] ) )->escaped()
+                       );
                }
 
                //$db = wfGetDB( DB_SLAVE );
diff --git a/resources/ext.tmh.transcodetable.js 
b/resources/ext.tmh.transcodetable.js
index 83ae082..4bfebdd 100644
--- a/resources/ext.tmh.transcodetable.js
+++ b/resources/ext.tmh.transcodetable.js
@@ -2,8 +2,9 @@
 * Javascript to support transcode table on image page
 */
 $(document).ready(function(){
-       // Error link popup:
-       $('.mw-filepage-transcodestatus .errorlink').click(function(){
+       var errorPopup, $errorLink;
+
+       errorPopup = function () {
                // pop up dialog
                mw.addDialog({
                        'width' : '640',
@@ -18,7 +19,20 @@
                })
                .css('overflow', 'hidden');
                return false;
-       })
+       }
+
+       // Old version. Need to keep for a little while in case of cached pages.
+       $( '.mw-filepage-transcodestatus .errorlink' ).click( errorPopup );
+       // New version.
+       $errorLink = $( '.mw-filepage-transcodestatus 
.mw-tmh-pseudo-error-link' );
+       $errorLink.wrapInner(
+               $( '<a />' ).attr( {
+                       href: '#',
+                       title: $errorLink.text(),
+                       'data-error': $errorLink.attr('data-error')
+               } ).click( errorPopup )
+       );
+
        // Reset transcode action:
        $('.mw-filepage-transcodereset a').click( function(){
                var tKey = $(this).attr('data-transcodekey');

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I120fda14f7478866d7e5903c81cda29dc1bfd9a8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: J <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to