Difference between revisions of "User:Fbstj/gadget/history-test.js"
Jump to navigation
Jump to search
m (extract) |
m (smaller links) |
||
Line 6: | Line 6: | ||
v = v.replace(/\.(\d+)/, "%$1"); |
v = v.replace(/\.(\d+)/, "%$1"); |
||
var a = "<a href='/edit/Template:" + v +"'>edit</a>"; |
var a = "<a href='/edit/Template:" + v +"'>edit</a>"; |
||
− | $('.title', this).append("<span style= |
+ | $('.title', this).append("<span class="mw-editsection" style="float: right;" >[" + a + "]</span>"); |
} |
} |
||
Revision as of 09:43, 26 January 2015
/* Add edit buttons to templates */ $(function () { function edit_button(i, v) { if (!v) return v; v = v.replace(/\.(\d+)/, "%$1"); var a = "<a href='/edit/Template:" + v +"'>edit</a>"; $('.title', this).append("<span class="mw-editsection" style="float: right;" >[" + a + "]</span>"); } $('.navbar').attr('id', edit_button); $('.infobox').attr('id', edit_button); });