From dbebdbee423f9c64a14632ce1d08f8c3642b27fb Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Fri, 24 Apr 2009 15:52:17 +0000 Subject: [PATCH] shortcut with command for opera/mac git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@485 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/libs/chat.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index 05014f24..9cb6e085 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -250,6 +250,11 @@ function is_agent_opera95() { return false; } +function is_mac_opera() { + $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); + return strstr($useragent,"opera") && strstr($useragent, "mac"); +} + function needsFramesrc() { $useragent = strtolower($_SERVER['HTTP_USER_AGENT']); return strstr($useragent,"safari/"); @@ -308,7 +313,7 @@ function setup_chatview_for_user($thread,$level) { $page['send_shortcut'] = "Enter"; $page['ignorectrl'] = 1; } else { - $page['send_shortcut'] = "Ctrl-Enter"; + $page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter"; $page['ignorectrl'] = 0; } @@ -364,7 +369,7 @@ function setup_chatview_for_operator($thread,$operator) { $page['send_shortcut'] = "Enter"; $page['ignorectrl'] = 1; } else { - $page['send_shortcut'] = "Ctrl-Enter"; + $page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter"; $page['ignorectrl'] = 0; }