|
From: Chris S. <too...@ph...> - 2009-08-15 20:45:45
|
Author: toonarmy
Date: Sat Aug 15 21:44:53 2009
New Revision: 9994
Log:
Prevent style switcher from blocking the tab key. #49335
Tested under FF 3.0/3.5/Opera/Chrome on Linux
Modified:
branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
branches/phpBB-3_0_0/phpBB/styles/prosilver/template/overall_header.html
branches/phpBB-3_0_0/phpBB/styles/prosilver/template/styleswitcher.js
Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original)
--- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Sat Aug 15 21:44:53 2009
***************
*** 194,199 ****
--- 194,200 ----
<li>[Fix] Update search index if only post subject changed. (Bug #49435)</li>
<li>[Fix] Fix who is online displaying incorrect data. (Bug #49485, thanks Brainy)</li>
<li>[Fix] Fixed incorrect "topic does not exist" when unapproved posts were visited without global moderator permissions. (Bug #47795)</li>
+ <li>[Fix] Prevent style switcher from blocking the tab key. (Bug #49335)</li>
<li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/overall_header.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/overall_header.html (original)
--- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/overall_header.html Sat Aug 15 21:44:53 2009
***************
*** 136,142 ****
<ul class="linklist navlinks">
<li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
! <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="fontsizeup(); return false;" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
<!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
--- 136,142 ----
<ul class="linklist navlinks">
<li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
! <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
<!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/styleswitcher.js
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/styleswitcher.js (original)
--- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/styleswitcher.js Sat Aug 15 21:44:53 2009
***************
*** 1,6 ****
! function fontsizeup()
{
var active = getActiveStyleSheet();
switch (active)
--- 1,12 ----
! function fontsizeup(event)
{
+ // Skip tabs
+ if (event && getKeyCode(event) == 9)
+ {
+ return true;
+ }
+
var active = getActiveStyleSheet();
switch (active)
***************
*** 29,39 ****
setActiveStyleSheet('A');
break;
}
}
! function fontsizedown()
{
! active = getActiveStyleSheet();
switch (active)
{
--- 35,53 ----
setActiveStyleSheet('A');
break;
}
+
+ return false;
}
! function fontsizedown(event)
{
! // Skip tabs
! if (event && getKeyCode(event) == 9)
! {
! return true;
! }
!
! var active = getActiveStyleSheet();
switch (active)
{
***************
*** 60,65 ****
--- 74,97 ----
setActiveStyleSheet('A--');
break;
}
+
+ return false;
+ }
+
+ function getKeyCode(event)
+ {
+ // IE doesn't fire the onkeypress event for tabs
+ // Reference: http://www.quirksmode.org/js/keys.html
+
+ var code = (event.keyCode) ? event.keyCode : 0;
+
+ // Probably using FF
+ if (!code && event.charCode)
+ {
+ code = event.charCode;
+ }
+
+ return code;
}
function setActiveStyleSheet(title)
|