r58748 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58747‎ | r58748 | r58749 >
Date:09:47, 8 November 2009
Author:j
Status:deferred
Tags:
Comment:
add link to video on subtitle edit page
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libTimedText/mvTimeTextEdit.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libTimedText/mvTimeTextEdit.js
@@ -11,7 +11,8 @@
1212 loadGM({
1313 "mwe-add-subs-file" : "Add/Replace Subtitle",
1414 "mwe-add-subs-file-title": "Select Subtitle to upload",
15 - "mwe-error-only-srt" : "Only srt files can be uploaded right now."
 15+ "mwe-error-only-srt" : "Only srt files can be uploaded right now.",
 16+ "mwe-watch-video" : "Watch video"
1617 })
1718
1819
@@ -22,6 +23,13 @@
2324 srtData = srtData.replace('\r\n', '\n');
2425 return srtData;
2526 }
 27+ function getVideoTitle() {
 28+ var videoTitle = wgTitle.split('.');
 29+ videoTitle.pop();
 30+ videoTitle.pop();
 31+ videoTitle = videoTitle.join('.').replace('TimedText:', 'File:');
 32+ return videoTitle;
 33+ }
2634 function uploadSubtitles() {
2735 do_api_req({
2836 'data': {
@@ -105,5 +113,14 @@
106114 button.click(uploadSubtitles)
107115 button.text(gM("mwe-add-subs-file"));
108116 ttoolbar.append(button);
 117+ ttoolbar.append(' ');
 118+
 119+ var button = $j('<button>');
 120+ button.click(function() { document.location.href = wgArticlePath.replace('$1', getVideoTitle()); })
 121+ button.text(gM("mwe-watch-video"));
 122+ ttoolbar.append(button);
 123+
 124+ alert();
 125+
109126 });
110127

Status & tagging log