[Hastymail-cvs] SF.net SVN: hastymail:[2116] trunk/hastymail2/plugins/accesskey/work.php
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2012-11-09 20:03:18
|
Revision: 2116 http://hastymail.svn.sourceforge.net/hastymail/?rev=2116&view=rev Author: sailfrog Date: 2012-11-09 20:03:12 +0000 (Fri, 09 Nov 2012) Log Message: ----------- some more progress on an access keys plugin Modified Paths: -------------- trunk/hastymail2/plugins/accesskey/work.php Modified: trunk/hastymail2/plugins/accesskey/work.php =================================================================== --- trunk/hastymail2/plugins/accesskey/work.php 2012-11-09 20:02:25 UTC (rev 2115) +++ trunk/hastymail2/plugins/accesskey/work.php 2012-11-09 20:03:12 UTC (rev 2116) @@ -26,7 +26,13 @@ function accesskey_init($tools) { $tools->add_js_event_handler('document', 'onkeyup', 'access_keys_check'); $tools->disable_xhtml_http_header(); - $tools->add_inline_js(' + if ($tools->get_setting('compose_window')) { + $new_window = true; + } + else { + $new_window = false; + } + $js_code = ' function access_keys_check(event) { var compose_page = function() {document.location.href = "?page=compose";}; var options_page = function() {document.location.href = "?page=options";}; @@ -50,6 +56,22 @@ document.location.href = href; } }; + var forward = function() {'; + if ($new_window) { + $js_code .= 'document.getElementById("forward").onclick();'; + + } + else { + $js_code .= 'document.location.href = document.getElementById("forward").href;'; + } + $js_code .= '}; var reply = function() {'; + if ($new_window) { + $js_code .= 'document.getElementById("reply").onclick();'; + } + else { + $js_code .= 'document.location.href = document.getElementById("reply").href;'; + } + $js_code .= '}; var actions = { "C" : compose_page, "O" : options_page, @@ -57,10 +79,12 @@ "N" : new_page, "messageN": next_msg, "messageP": prev_msg, - "messageU": up_to_folder + "messageU": up_to_folder, + "messageR": reply, + "messageF": forward }; var elType = document.activeElement.type; - if (elType != "text" && elType != "textarea") { + if (elType != "text" && elType != "textarea" && elType != "select") { var page = "'.$tools->get_page().'"; var code = 0; if (event.keyCode) { @@ -82,7 +106,7 @@ } } } - } - '); + }'; + $tools->add_inline_js($js_code); } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |