Grey Matter Forums
« GM 1.7.1 - gmshortcutkeys missing »

Welcome Guest. Please Login or Register.
May 18, 2013, 4:27am



Greymatter: Free Personal Blogging Software

About Greymatter (including System Requirements)

Greymatter on FreshMeat

Download current version from:

News: Greymatter 1.8.2 is released! Read the announcement.

Got a minute? We want to know what's your preferred site navigation?

Please read the security announcement regarding author passwords.

Next Greymatter release will be 1.8.3


Grey Matter Forums :: Development :: Bug Reports :: GM 1.7.1 - gmshortcutkeys missing
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: GM 1.7.1 - gmshortcutkeys missing (Read 4,171 times)
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 GM 1.7.1 - gmshortcutkeys missing
« Thread Started on Jan 4, 2007, 5:11pm »

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 http://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 :-[br]
Code:
date.setTime(date.getTime() - skew);
}
//-->
</SCRIPT>
#;

$gmheadtagtwo = $gmheadtag;

$gmheadtag .= qq#
</HEAD>

<body>#;

$gmheadtagtwo .= qq#
</HEAD>

<body>#;


change these lines to:

Code:
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
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #1 on Jan 4, 2007, 6:23pm »

My apologies on this Pete. I know you had mentioned this before 1.6.1 came out, and it fell off my plate. I will make sure this is in 1.7.2.

Btw, I was thinking of using 'thumbs up' icon for fixed issues, and 'thumbs down' for open, I just wanted an easy way to see if an issue was fixed or not.

Plus, I wonder if this could be made to work for all platforms, I'll have to experiment a little.
« Last Edit: Jan 4, 2007, 6:27pm by coldstone »Link to Post - Back to Top  IP: Logged
aguardx
New Member
*
member is offline





Joined: Nov 2006
Posts: 16
Karma: 0
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #2 on Jan 4, 2007, 11:40pm »

Hi guys,

I've modified the gm-library.cgi with the new lines on GM v1.3.1 but no success nothing happen when I try the shortkeys... I also put the cookies fonction ON in the config.
Any idea why isn't work?
Link to Post - Back to Top  IP: Logged
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #3 on Jan 5, 2007, 10:50am »

What platform are you using? Windows, Mac, Linux? and what browser are you using?
Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #4 on Jan 5, 2007, 5:12pm »

Hi,

have a look at http://web.petefinnigan.com/greymatter_mods.htm - this page includes my gm-library.cgi saved as dot txt, download this file and replace your gm-library.cgi with it. Save your own file first.

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
aguardx
New Member
*
member is offline





Joined: Nov 2006
Posts: 16
Karma: 0
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #5 on Jan 5, 2007, 10:52pm »

Hi there,

Thanks for replying
I'm on windows XP and I use IE v6
I modified the lines with your codes on your file, nothing work
I upload your file to replace mine, nothing change still not working

Any idea?
Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #6 on Jan 6, 2007, 3:54am »

The only thing I can think of is to check if javascript is disabled in your browser as this is a javascript mod

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #7 on Feb 20, 2007, 12:09am »

FYI Pete,

I finally checked in your changes to CVS, thanks for your patience.

I did some research and it looks like javascript keystroke compatibility between browsers and OS is a thorny issue. I am hoping to play with the code and get a universal feature going, but for now, the old functionality has been restored for all you IE users.
« Last Edit: Mar 2, 2007, 1:43pm by coldstone »Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #8 on Feb 20, 2007, 5:18am »

Thanks Coldstone,

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #9 on Feb 21, 2007, 12:05am »

While I was porting this to be generic for both Windows/Mac/All Browsers, I ran across discussions about changing the key mappings like this. Some people really don't like it. I am wondering if this should be an option that is enabled, or if buttons (such as on this forum) would work?

I can see the appeal of just using key shortcuts, but if they interfere with someone's existing key mappings, I am concerned. I wonder if that is why it was removed initially?

On a side note, I found that with accesskey attribute, you can do key assignments almost universally. However, IE is being difficult.
« Last Edit: Feb 21, 2007, 12:07am by coldstone »Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #10 on Mar 8, 2007, 3:59pm »

Hi Coldstone,

Yes I agree with you, just because I like these hotkeys doesnt mean that everyone should have them if they dont want them. Maybe the best option is as you suggest that they are controlled by a parameter?

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #11 on Mar 8, 2007, 4:23pm »

What do people think of buttons, similar to on the forums? The issue with doing shortcuts, is it will be tricky to support all browsers/platform and I hate to have OS specific stuff. Otherwise, if we hunt around on the net, I am sure there is some js that handles this already (I just haven't found it yet).
Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #12 on Mar 8, 2007, 4:38pm »

Hi Coldstone,

Yes buttons are also fine. I think on reflection they are probably better as the same solution works on all platforms. If we can get rid of IE specifics its much better..:-)

what about a drop in editor? - are there any free ones available that are not GPL so that there would not be a conflict with the GM license?

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
coldstone
Global Moderator
*****
member is offline

[avatar]


[homepage]

Joined: Aug 2006
Posts: 816
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #13 on Mar 9, 2007, 12:50pm »

A drop in editor is a good idea. They seem to be everywhere, so I bet there is something out there.
Link to Post - Back to Top  IP: Logged
petefinnigan
Global Moderator
*****
member is offline




[homepage]

Joined: Aug 2006
Gender: Male
Posts: 219
Location: York, England
Karma: 18
 Re: GM 1.7.1 - gmshortcutkeys missing
« Reply #14 on Mar 10, 2007, 4:15pm »

On reflection, if we use a drop in editor we would likely get the same IE issues as it would likely be Javascript based..:-(

cheers

Pete
Link to Post - Back to Top  IP: Logged

--
Pete Finnigan (email:pete_at_petefinnigan_dot_com)
Oracle Security Web Site: http://www.petefinnigan.com
Oracle Security Forum: http://www.petefinnigan.com/forum/yabb/YaBB.cgi
Oracle security blog: http://www.petefinnigan.com/weblog/entries/index.html
Book:Oracle security step-by-step Guide
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile