r80276 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80275‎ | r80276 | r80277 >
Date:16:12, 14 January 2011
Author:dale
Status:deferred
Tags:
Comment:
bug 26721 better handle user newlines in subtitle text
Modified paths:
  • /branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
@@ -1285,12 +1285,12 @@
12861286 // Optimize: we could use javascript strings functions instead of jQuery XML parsing:
12871287 $j( '<div>' + data + '</div>' ).find('p').each( function() {
12881288 currentPtext = $j(this).html();
1289 - //mw.log( 'pText: ' + currentPtext );
 1289+ mw.log( 'pText: ' + currentPtext );
12901290
12911291 //Check if the p matches the "all in one line" match:
12921292 var m = currentPtext
12931293 .replace('--&gt;', '-->')
1294 - .match(/\d+\s([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\s*--?>\s*([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\n?(.*)/);
 1294+ .match(/\d+\s([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\s*--?>\s*([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\n?(.*\n?.*)/);
12951295
12961296 if (m) {
12971297 var startMs = (m[4])? (parseInt(m[4], 10) / 1000):0;
@@ -1307,9 +1307,11 @@
13081308 (parseInt(m[7], 10)) +
13091309 endMs,
13101310 'content': $j.trim( m[9] )
1311 - });
 1311+ });
 1312+ mw.log( $j.trim( m[9] ) );
13121313 return true;
1313 - }
 1314+ }
 1315+
13141316 // Else check for multi-line match:
13151317 if( parseInt( currentPtext ) == currentPtext ) {
13161318 if( curentCap.length != 0) {

Status & tagging log