More actions
No edit summary |
No edit summary |
||
| Line 38: | Line 38: | ||
result = ''; | result = ''; | ||
for (var i = 0; i < tokens.length; i++) { | for (var i = 0; i < tokens.length; i++) { | ||
orig_token = tokens[i]; | |||
if (tokens[i].trim() === '') { | if (tokens[i].trim() === '') { | ||
result += orig_token; | |||
continue; | continue; | ||
} | } | ||
const shouldAddStyle = ratio > Math.random(); | const shouldAddStyle = ratio > Math.random(); | ||
if (shouldAddStyle) { | if (shouldAddStyle) { | ||
tokens[i] = `<span class="${className}" data-timestamp="${Date.now()}">${tokens[i]}</span>` | addStyle = '<span class="' + className + '" data-timestamp=' + Date.now() + '>' + tokens[i] + '</span>'; | ||
tokens[i] = addStyle; | |||
//tokens[i] = `<span class="${className}" data-timestamp="${Date.now()}">${tokens[i]}</span>` | |||
} | } | ||
result += | //result += tokens[i]; | ||
} | } | ||
result = tokens.join(' '); | |||
return result; | return result; | ||
} | } | ||