wiki: Move state variables out of inline JS.

This commit is contained in:
Max Goodman
2012-09-12 11:09:33 -07:00
committed by Neil Williams
parent 511ca3e56d
commit f858121086
3 changed files with 7 additions and 3 deletions

View File

@@ -150,6 +150,10 @@ def js_config():
"uitracker_url": g.uitracker_url,
"static_root": static(''),
}
if c.page:
config["wiki_page"] = c.page
return config

View File

@@ -98,10 +98,10 @@ r.wiki = {
})
},
goCompare: function(page, base) {
goCompare: function() {
v1 = $('input:radio[name=v1]:checked').val()
v2 = $('input:radio[name=v2]:checked').val()
url = base + '/' + page + '?v=' + v1
url = r.wiki.baseUrl() + '/' + r.config.wiki_page + '?v=' + v1
if (v2 != v1) {
url += '&v2=' + v2
}

View File

@@ -22,6 +22,6 @@
${thing.revisions}
%if c.page and thing.revisions.things:
<button onclick="r.wiki.goCompare('${c.page}', '${c.wiki_base_url}')">${_("compare selected")}</button>
<button onclick="r.wiki.goCompare()">${_("compare selected")}</button>
%endif
<br/>