瀏覽代碼

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

pull/24/head
Ben Kurtovic 12 年之前
父節點
當前提交
0e53bf5a11
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      static/js/potd.js

+ 2
- 1
static/js/potd.js 查看文件

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

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]);
}
var filename = filenames[Math.floor(Math.random() * filenames.length)];


Loading…
取消
儲存