Created
September 12, 2013 16:19
-
-
Save tylerkidd/6540218 to your computer and use it in GitHub Desktop.
SilverStripe: Utilize x-cms-edit-link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
/** | |
enable the use of the x-cms-edit-link with | |
use: ctrl+e | |
use: alt+e | |
*/ | |
function doc_keyUp(e) { | |
//console.log(e.keyCode); | |
// ctl + e //if (e.ctrlKey && e.keyCode == 69 || | |
if(e.altKey && e.keyCode == 69) { // alt + e | |
var m = $("meta[name=x-cms-edit-link]"); | |
if(m.length > 0){ | |
var link = m.attr('content'); | |
window.open(link); | |
} | |
} | |
} | |
if (document.addEventListener) { | |
document.addEventListener('keyup', doc_keyUp, false); | |
} else if (document.attachEvent) { | |
document.attachEvent('keyup', doc_keyUp); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment