1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-18 00:56:42 +01:00

Don't do anything if a mod link is middle-clicked.

This lets Chrome users open mod actions in a new tab by middle-clicking,
as Chrome still calls the onclick event when middle-clicking unlike
Firefox.
This commit is contained in:
Macil Tech 2013-01-16 16:32:24 -06:00
parent 6b3d02e4fa
commit 97ae4dd6bc

View File

@ -216,7 +216,7 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
function secure_link_confirm($text, $title, $confirm_message, $href) {
global $config;
return '<a onclick="if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlentities(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>';
return '<a onclick="if (event.which==2) return true;if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlentities(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>';
}
function secure_link($href) {
return $href . '/' . make_secure_link_token($href);