Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/TimedText/resources/mw.TimedText.js |
— | — | @@ -659,7 +659,7 @@ |
660 | 660 | ); |
661 | 661 | } else { |
662 | 662 | // Add a link to request timed text for this clip: |
663 | | - if( mw.getConfig('TimedText.ShowRequestTranscript') ){ |
| 663 | + if( mw.getConfig( 'TimedText.ShowRequestTranscript' ) ){ |
664 | 664 | $menu.append( |
665 | 665 | $.getLineItem( gM( 'mwe-timedtext-request-subs'), 'comment', function(){ |
666 | 666 | _this.getAddSubRequest(); |
— | — | @@ -709,16 +709,18 @@ |
710 | 710 | $dialog.dialog( 'option', 'buttons', null ); |
711 | 711 | |
712 | 712 | // Check if the category does not already exist: |
713 | | - mw.getJSON( apiUrl, {'titles': videoTitle, 'prop': 'categories'}, function( data ){ |
| 713 | + mw.getJSON( apiUrl, { 'titles': videoTitle, 'prop': 'categories' }, function( data ){ |
714 | 714 | if( data && data.query && data.query.pages ){ |
715 | | - for( var i in data.query.pages ){ |
| 715 | + for( var i in data.query.pages ){ |
716 | 716 | // we only request a single page: |
717 | | - var categories = data.query.pages[i].categories; |
718 | | - for(var j =0; j < categories.length; j++){ |
719 | | - if( categories[j].title.indexOf( catName ) != -1 ){ |
720 | | - $dialog.html( gM('mwe-timedtext-request-already-done', subRequestCategoryUrl ) ); |
721 | | - $dialog.dialog( 'option', 'buttons', buttonOk); |
722 | | - return ; |
| 717 | + if( data.query.pages[i].categories ){ |
| 718 | + var categories = data.query.pages[i].categories; |
| 719 | + for(var j =0; j < categories.length; j++){ |
| 720 | + if( categories[j].title.indexOf( catName ) != -1 ){ |
| 721 | + $dialog.html( gM('mwe-timedtext-request-already-done', subRequestCategoryUrl ) ); |
| 722 | + $dialog.dialog( 'option', 'buttons', buttonOk); |
| 723 | + return ; |
| 724 | + } |
723 | 725 | } |
724 | 726 | } |
725 | 727 | } |