Advertisement
rdsedmundo

conv_srt.js

Feb 2nd, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. linhas = data.split(/^[0-9]{1}\n/m);
  2. linhas.shift(); // linha vazia
  3.  
  4. index = 0;
  5. resp = "";
  6.  
  7. linhas.forEach (function (linha) {
  8.   linha_atual = linha.split("\n");
  9.    
  10.   resp += index.toString() + "\n";
  11.   resp += linha_atual[0] + "\n";
  12.  
  13.   linha_atual.shift(); // tempo
  14.  
  15.   resp += '<font color="yellow">' + "\n";
  16.  
  17.   linha_atual.forEach (function (parte) {
  18.     if(parte !== "")
  19.       resp += parte + "\n";
  20.   });
  21.    
  22.   resp += "</font>\n\n";
  23.  
  24.   index++;
  25. });
  26.  
  27. console.info(resp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement