Post by SubDevo on Oct 7, 2009 13:05:11 GMT -8
Hotkeys to Code Areas by SubDevo
Tested in IE, FF, Opera, Safari and Chrome
This code sets up for the Admin (and selected staff), hotkeys (6 of them!) for instant access to Global, Main or Board code areas. And also two diagnostic hotkeys in case you mess up your code and can't login or access your code areas to make changes.
Also, added a hot key to go to your "Search Members" page. Very handy!
If you are viewing a board when you use the "board" hot key, you will go to that board's header/footer.
If you are NOT in a board when you use the "board" hot key, you will get the "Select Board" page.
I selected the hotkey combinations to NOT interfere with the hotkeys already in use by most major browsers (the ones I tested this with).
Here are the hotkeys.
Ctrl+Alt+G = Global Header/Footers
Ctrl+Alt+M = Main Header/Footers
Ctrl+Alt+B = Board Header/Footers
Ctrl+Alt+N = No Header/Footers (diagnostic)
Ctrl+Alt+L = Logon No Header/Footers (diagnostic)
Ctrl+Alt+S = Search Members page
NOTE: The "G,M,B,N,L,S" above are capitalized for clarity. Input as lowercase.
Example: Ctrl+Alt+g (lowercase)
Only one variable. Edit the Maroon portions.
var fStaff=/^(admin|staff1)$/; // Staff with H/F access or can search members.
Put the usernames (not display names) of the Staff that have header/footer access or power to Search Members and that are allowed to use this code. Separate the names with a "|". Do NOT put a | after the last name in the list.
Enjoy!!!
SubDevo
Location: Global Header (near TOP)
<script type="text/javascript">
/* Hotkeys to Code Areas by SubDevo */
/* Global Header - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
/* Ctrl+Alt+G =Global, Ctrl+Alt+M =Main, Ctrl+Alt+S =Search Members
Ctrl+Alt+B =Board, Ctrl+Alt+N =No H/F, Ctrl+Alt+L =Logon No H/F */
var fStaff=/^(admin|staff1)$/i // Forum staff user names.
function hotK(a){ var a=a||window.event,n,m;
var nH="headersfooters",lno="&NOHEADERS=1",b="2&id=",kc;
m=(/board=(.+?)(&|$)/i.test(location.href))?RegExp.$1:"";
if(a.ctrlKey&&a.altKey){ kc=a.keyCode;
if(kc==71){n=nH+b+"*";} if(kc==76){n="login"+lno;}
if(kc==77){n=nH+b+"-";} if(kc==66){n=(m)?nH+b+m:nH;}
if(kc==78){n=nH+lno;} if(kc==83){n="searchmembers";}
} if(n){window.location="/index.cgi?action="+n;}
}
if(fStaff.test(pb_username)){ var n=document;
(n.attachEvent)?n.attachEvent("onkeydown",hotK): n.addEventListener("keydown",hotK,false);
}
</script>
CODE EDIT: 8/12/2011
Added two hot keys. "Search Members" and Board header/footer keys.
CODE EDIT: 8/17/2011
Fixed code to NOT interfere with the PB Report Ad feature by using attachEvent/addEventListener.
Tested in IE, FF, Opera, Safari and Chrome
This code sets up for the Admin (and selected staff), hotkeys (6 of them!) for instant access to Global, Main or Board code areas. And also two diagnostic hotkeys in case you mess up your code and can't login or access your code areas to make changes.
Also, added a hot key to go to your "Search Members" page. Very handy!
If you are viewing a board when you use the "board" hot key, you will go to that board's header/footer.
If you are NOT in a board when you use the "board" hot key, you will get the "Select Board" page.
I selected the hotkey combinations to NOT interfere with the hotkeys already in use by most major browsers (the ones I tested this with).
Here are the hotkeys.
Ctrl+Alt+G = Global Header/Footers
Ctrl+Alt+M = Main Header/Footers
Ctrl+Alt+B = Board Header/Footers
Ctrl+Alt+N = No Header/Footers (diagnostic)
Ctrl+Alt+L = Logon No Header/Footers (diagnostic)
Ctrl+Alt+S = Search Members page
NOTE: The "G,M,B,N,L,S" above are capitalized for clarity. Input as lowercase.
Example: Ctrl+Alt+g (lowercase)
Only one variable. Edit the Maroon portions.
var fStaff=/^(admin|staff1)$/; // Staff with H/F access or can search members.
Put the usernames (not display names) of the Staff that have header/footer access or power to Search Members and that are allowed to use this code. Separate the names with a "|". Do NOT put a | after the last name in the list.
Enjoy!!!
SubDevo
Location: Global Header (near TOP)
<script type="text/javascript">
/* Hotkeys to Code Areas by SubDevo */
/* Global Header - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
/* Ctrl+Alt+G =Global, Ctrl+Alt+M =Main, Ctrl+Alt+S =Search Members
Ctrl+Alt+B =Board, Ctrl+Alt+N =No H/F, Ctrl+Alt+L =Logon No H/F */
var fStaff=/^(admin|staff1)$/i // Forum staff user names.
function hotK(a){ var a=a||window.event,n,m;
var nH="headersfooters",lno="&NOHEADERS=1",b="2&id=",kc;
m=(/board=(.+?)(&|$)/i.test(location.href))?RegExp.$1:"";
if(a.ctrlKey&&a.altKey){ kc=a.keyCode;
if(kc==71){n=nH+b+"*";} if(kc==76){n="login"+lno;}
if(kc==77){n=nH+b+"-";} if(kc==66){n=(m)?nH+b+m:nH;}
if(kc==78){n=nH+lno;} if(kc==83){n="searchmembers";}
} if(n){window.location="/index.cgi?action="+n;}
}
if(fStaff.test(pb_username)){ var n=document;
(n.attachEvent)?n.attachEvent("onkeydown",hotK): n.addEventListener("keydown",hotK,false);
}
</script>
CODE EDIT: 8/12/2011
Added two hot keys. "Search Members" and Board header/footer keys.
CODE EDIT: 8/17/2011
Fixed code to NOT interfere with the PB Report Ad feature by using attachEvent/addEventListener.