Rahul21 has uploaded a new change for review.

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


Change subject: Provide the link to the File page after the successfully 
uploading the pronunciation
......................................................................

Provide the link to the File page after the successfully uploading the 
pronunciation

Bug: 54418
Change-Id: I21b89a0f3c07b6bfb4f6e45ad40c404c9a23426d
---
M SpecialPronunciationRecording.php
M resources/ext.pronunciationRecording.specialPage.js
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PronunciationRecording 
refs/changes/43/85643/1

diff --git a/SpecialPronunciationRecording.php 
b/SpecialPronunciationRecording.php
index e4c3e33..ee09ae1 100644
--- a/SpecialPronunciationRecording.php
+++ b/SpecialPronunciationRecording.php
@@ -22,6 +22,7 @@
 
                        $output->addModules( 
'ext.pronunciationRecording.specialPage' );
                        $output->addHTML( '<div 
class="mw-pronunciationrecording-message" 
id="mw-pronunciationrecording-message"></div>' );
+                       $output->addHTML( '<div 
class="mw-pronunciationrecording-filelink" 
id="mw-pronunciationrecording-filelink"></div>' );
                        $output->addHTML( '<div 
class="mw-pronunciationrecording-toolbar" 
id="mw-pronunciationrecording-toolbar" >' );
                        $output->addHTML( '<button 
class="mw-pronunciationrecording-record" id="mw-pronunciationrecording-record" 
disabled>' .wfMessage( 'pronunciationrecording-toolbar-record-label' 
)->escaped().'</button>' );
                        $output->addHTML( '<button 
class="mw-pronunciationrecording-stop" id="mw-pronunciationrecording-stop" 
disabled >' .wfMessage( 'pronunciationrecording-toolbar-stop-label' 
)->escaped().'</button>' );
diff --git a/resources/ext.pronunciationRecording.specialPage.js 
b/resources/ext.pronunciationRecording.specialPage.js
index 98088dd..7637834 100644
--- a/resources/ext.pronunciationRecording.specialPage.js
+++ b/resources/ext.pronunciationRecording.specialPage.js
@@ -23,7 +23,7 @@
                                $( ".mw-pronunciationrecording-message" 
).empty();
                        });
                        $( document ).on( "click", 
".mw-pronunciationrecording-upload", function() {
-                               var wikiText, pronunciationRecorderFileDetails, 
word, username, lang_code;
+                               var wikiText, pronunciationRecorderFileDetails, 
word, username, lang_code, file_url;
                                word = $( 
".mw-pronunciationrecording-information-word" ).val();
                                lang_code = $( 
".mw-pronunciationrecording-information-language" ).val();
                                username = mw.user.getName();
@@ -31,7 +31,9 @@
                                wikiText = 
pronunciationRecorderFileDetails.generateWikiText();
                                $( ".mw-pronunciationrecording-upload" 
).attr('disabled','disabled');
                                pronunciationRecorder.startUploading( 
function() {
+                                       name = mw.config.get( 'wgServer' ) + 
'/wiki/File:' + lang_code + '-' + word + '.wav' ;
                                        $( ".mw-pronunciationrecording-message" 
).text( mw.message( 'pronunciationrecording-upload-publish-succeeded' ).text() 
);
+                                       $( 
".mw-pronunciationrecording-filelink" ).html( '<a href="' + name + '">' +name+ 
'</a>' );
                                }, function() {
                                        $( ".mw-pronunciationrecording-message" 
).text( mw.message( 'pronunciationrecording-upload-publish-failed' ).text() );
                                }, wikiText );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21b89a0f3c07b6bfb4f6e45ad40c404c9a23426d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PronunciationRecording
Gerrit-Branch: master
Gerrit-Owner: Rahul21 <[email protected]>

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

Reply via email to