[wiki-lenny] ctrl+u charge le source de la page && ctrl+e edite la page
Oui, j'ai honte darcs-hash:20081214013011-bd074-6c68a0e2e0b8c8a1f8759e19e986c103f03dd359.gz
This commit is contained in:
parent
f89d6633a5
commit
be34c886ba
1 changed files with 22 additions and 0 deletions
|
@ -131,6 +131,28 @@ class ThemeCrans(ThemeBase):
|
|||
href = '%s/%s.js' % (csshref, basename)
|
||||
html.append(link % href )
|
||||
|
||||
if not self.request.query_string:
|
||||
html.append('''
|
||||
<script language="JavaScript">
|
||||
function keyHandler(e)
|
||||
{
|
||||
e = e || window.event;
|
||||
kCode = e.keyCode || e.which; // gets the keycode in ie or ns
|
||||
if ( e.ctrlKey && kCode == 117) // ctrl+u
|
||||
{
|
||||
document.location.href = document.location.href+'?action=raw';
|
||||
return false; // make it so the browser ignores key combo
|
||||
}
|
||||
if ( e.ctrlKey && kCode == 101) // ctrl+e
|
||||
{
|
||||
document.location.href = document.location.href+'?action=edit';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
document.onkeypress = keyHandler;
|
||||
</script>
|
||||
''')
|
||||
|
||||
return ThemeBase.headscript(self, d) + u"\n".join(html)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue