Another Greymatter Bug in the 1.3.1 upgrade
When i upgraded Greymatter to 1.3.1 on my main Oracle Security blog I also found a second bug. This is when you are writing an entry in the "Add A New Entry" screen there are usually some useful keystroke shortcuts. For instance CRTL-SHIFT-A to add a link. I investigated and found the problem - I reported this on the Greymatter forums as well. Here is what i had to say on the subject:
Hi everyone,
I upgraded to 1.3.1 from 1.3 and started to use it to add a new entry. I am used to adding links with CTRL-SHIFT-A and bold with CTRL-SHIFT-B etc but when i tried to add a link in 1.3.1 it did not work. I delved into the code (old version - 1.3) in gm-library.cgi and found that these short cuts are implemented with the Javascript function gmshortcutkeys. In the 1.3.1 version of gm-library.cgi this function has been removed.
I am not totaly certain but I do not think that this is intentional. The change log for 1.3.1 mentions removing autolinking being removed due to a number of complaints. I found the change made for this. Also I saw in the change log that "easy formatting" for the entry subject has been removed - this is not the same. Therefore I think that the removal of the function is a bug. The accompanying text to tell users which key combinations to press is still in the form.
I have modified my gm-library.cgi to put the function back in. I have tested this and it works fine. The changes I made to the 1.3.1 version of gm-library.cgi are as follows:
# Pete Finnigan - 27/06/05 the above lines in fixDate were
# }
# //-->
#
# #;
# end Pete Finnigan - 27/06/05
$gmheadtagtwo = $gmheadtag;
$gmheadtag .= qq#
//-->
#;
# start Pete Finnigan - 27/06/05 - the above was:-
# $gmheadtag .= qq#
#
#
#
# #;
# end Pete Finnigan - 27/06/05
# start Pete Finnigan 27/06/05 - add back gmshortcutkeys - deleted in 1.3.1 - also added onKeyPress to body tag
$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 = '' + gmselection + '';
return;
}
if (window.event.keyCode == 2) {
document.selection.createRange().text = '' + gmselection + '';
return;
}
if (window.event.keyCode == 9) {
document.selection.createRange().text = '' + gmselection + '';
return;
}
if (window.event.keyCode == 21) {
document.selection.createRange().text = '' + gmselection + '';
return;
}
}
}
//-->
#;
# end Pete Finnigan - 27/06/05
kind regards
Pete
Hmmmm. No matter how hard I try I cannot get GM to display the HTML code in the above excerts. I have tried to use ampresand representations of the HTML but GM just gets rid of them and returns even the original text back to its correct format. To see the exact HTML please have a look at the Greymatter Forums post I made.
Pete on 07.16.05 @ 08:48 PM GMT [link]