r74721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74720‎ | r74721 | r74722 >
Date:17:03, 13 October 2010
Author:dale
Status:deferred
Tags:
Comment:
added a check for user being logged in
Modified paths:
  • /branches/MwEmbedStandAlone/modules/MiroSubs/MiroSubs.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/MiroSubs/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/MiroSubs/mw.MiroSubsConfig.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/MiroSubs/loader.js
@@ -10,8 +10,7 @@
1111 });
1212 // add as loader dependency 'mw.style.mirosubsMenu'
1313
14 - mw.addResourcePaths( {
15 - "goog" : "mirosubs/base.min.js",
 14+ mw.addResourcePaths( {
1615 "mirosubs" : "mirosubs/mirosubs-api.min.js",
1716 "mw.MiroSubsConfig" : "mw.MiroSubsConfig.js",
1817 "mw.style.mirosubsMenu" : "css/mw.style.mirosubsMenu.css"
@@ -42,7 +41,10 @@
4342
4443 // Load miro subs:
4544 mw.load( 'MiroSubs', function(){
46 - mw.MiroSubsConfig.getConfig( embedPlayer , function( config ){
 45+ mw.MiroSubsConfig.getConfig( embedPlayer , function( config ){
 46+ if( !config ){
 47+ return ;
 48+ }
4749 // xxx NOTE there are some weird async display issues
4850 // that only seem to be resolvable with timeouts for DOM actions
4951 setTimeout(function(){
Index: branches/MwEmbedStandAlone/modules/MiroSubs/mw.MiroSubsConfig.js
@@ -22,14 +22,18 @@
2323 this.embedPlayer = embedPlayer;
2424
2525 // Set initial config
26 - this.config = this.getDefaultConfig();
 26+ this.config = this.getDefaultConfig();
2727
2828 // Make sure we are logged in::
2929 mw.getUserName( function( userName ){
3030 mw.log( "MiroSubsConfig::getUserName: " + userName );
3131 if( !userName ){
32 - mw.log("Error: MiroSubsConfig user not logged in");
33 - callback( { 'status':'error', 'error': gM('mwe-mirosubs-not-loggedin') } );
 32+ mw.addDialog({
 33+ 'title' : gM('mwe-mirosubs-subs-please-login'),
 34+ 'content' : gM('mwe-mirosubs-subs-please-login-desc')
 35+ });
 36+ callback( false );
 37+ return false;
3438 } else {
3539 _this.config.username = userName;
3640 if( _this.isConfigReady( callback ) ){
Index: branches/MwEmbedStandAlone/modules/MiroSubs/MiroSubs.i18n.php
@@ -9,8 +9,7 @@
1010 $messages = array();
1111
1212 $messages['en'] = array(
13 - 'mwe-mirosubs-add-universal-subtitles' => 'Universal subtitles editor',
14 - 'mwe-mirosubs-not-loggedin' => 'Please login to edit subtitles with universal subtitles',
 13+ 'mwe-mirosubs-add-universal-subtitles' => 'Universal subtitles editor',
1514 'mwe-mirosubs-loading-universal-subtitles' => 'Loading universal subtitles editor',
1615 'mwe-mirosubs-save-summary' => 'Summary of subtitle edits',
1716 'mwe-mirosubs-save-default' => 'Edited subtitles',
@@ -19,4 +18,6 @@
2019 'mwe-mirosubs-subs-saved' => 'Subtitles saved',
2120 'mwe-mirosubs-thankyou-contribution' => 'Thank you for your subtitle contribution',
2221 'mwe-mirosubs-subs-saved-error' => 'Error in saving subtitles',
 22+ 'mwe-mirosubs-subs-please-login' => 'Please login',
 23+ 'mwe-mirosubs-subs-please-login-desc' => 'Please login, to use the universal subtitles editor'
2324 );
\ No newline at end of file

Status & tagging log