Post by petefinnigan on Jan 4, 2007 17:11:44 GMT -5
I enjoy using the shortcut keys provided by a simple Javascript addition to gm when using IE to allow me to do CTRL-SHIFT-A to add links quickly and also the same commands can be used to quickly bold or italic text. This features was in 1.3.0 and was deleted from 1.3.1 by accident by the previous maintainers. I posted a blog entry web.petefinnigan.com/weblog/archives/00000008.htm at the time about it.
The same code is still missing in 1.7.1 but the text describing how to use it is still there. To add this back go to gm-library.cgi lines 244 to 260 :-
change these lines to:
cheers
Pete
The same code is still missing in 1.7.1 but the text describing how to use it is still there. To add this back go to gm-library.cgi lines 244 to 260 :-
date.setTime(date.getTime() - skew);
}
//-->
</SCRIPT>
#;
$gmheadtagtwo = $gmheadtag;
$gmheadtag .= qq#
</HEAD>
<body>#;
$gmheadtagtwo .= qq#
</HEAD>
<body>#;
change these lines to:
date.setTime(date.getTime() - skew);
}
#;
$gmheadtagtwo = $gmheadtag;
$gmheadtag .= qq#
//-->
</SCRIPT>
</HEAD>
<body>#;
$gmheadtagtwo .= qq#
function gmshortcutkeys() {
if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
if (event.ctrlKey != true) return;
gmselection = document.selection.createRange().text;
if (window.event.keyCode == 1) {
gminsertlink = prompt("What do you want to link to?", "http://")
if (gminsertlink == null) return;
document.selection.createRange().text = '<a href="' + gminsertlink + '">' + gmselection + '</a>';
return;
}
if (window.event.keyCode == 2) {
document.selection.createRange().text = '<span style="font-weight:bold;">' + gmselection + '</span>';
return;
}
if (window.event.keyCode == 9) {
document.selection.createRange().text = '<span style="font-style:italic;">' + gmselection + '</span>';
return;
}
if (window.event.keyCode == 21) {
document.selection.createRange().text = '<span style="text-decoration:underline;">' + gmselection + '</span>';
return;
}
}
}
//-->
</SCRIPT>
</HEAD>
<body onKeyPress="gmshortcutkeys();">#;
cheers
Pete