Browse Source

Hmm, I guess we have to preserve the regexp object between execs.

pull/24/head
Ben Kurtovic 12 years ago
parent
commit
0e53bf5a11
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      static/js/potd.js

+ 2
- 1
static/js/potd.js View File

@@ -88,7 +88,8 @@ function parse_list_file_name(data) {
} }


var filenames = []; var filenames = [];
while ((match = /\*\s*\[\[:File:(.*?)\]\]/g.exec(content)) !== null) {
var regexp = /\*\s*\[\[:File:(.*?)\]\]/g;
while ((match = regexp.exec(content)) !== null) {
filenames.push(match[1]); filenames.push(match[1]);
} }
var filename = filenames[Math.floor(Math.random() * filenames.length)]; var filename = filenames[Math.floor(Math.random() * filenames.length)];


Loading…
Cancel
Save