Error:
Fix, in adminfunctions_template.php
Change
To
At glance, it seems document.cpform.string.value isn't defined in other browsers, the conditional is added for find and search but not view quickref. The above adds the conditional for the latter and solves the js issue.
Of course having all 3 functions compatible and not wrapped in a conditional should be the goal. However, I didn't have time to look further. This fixes it for now. Plus, not sure why someone would use that feature for search instead of just using CTR/CMD F anyway lol.
Uncaught TypeError: Cannot set property 'onkeypress' of undefined
Change
PHP Code:
print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($vbulletin->GPC['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />
') .
'<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
<script type="text/javascript">document.cpform.string.onkeypress = findInPageKeyPress;</script>
');
To
PHP Code:
print_label_row(iif(is_browser('ie') OR is_browser('mozilla', '20040707'), $vbphrase['search_in_template'], $vbphrase['additional_functions']), iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '
<input type="text" class="bginput" name="string" accesskey="t" value="' . htmlspecialchars_uni($vbulletin->GPC['searchstring']) . '" size="20" onChange="n=0;" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" onClick="findInPage(document.cpform.string.value);" tabindex="1" />
') .
'<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
' .
iif(is_browser('ie') OR is_browser('mozilla', '1.7'), '<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
<input type="button" class="button" style="font-weight:normal" value="' . $vbphrase['view_quickref'] . '" accesskey="v" onclick="js_open_phrase_ref(0, 0);" tabindex="1" />
<script type="text/javascript">document.cpform.string.onkeypress = findInPageKeyPress;</script>
'));
At glance, it seems document.cpform.string.value isn't defined in other browsers, the conditional is added for find and search but not view quickref. The above adds the conditional for the latter and solves the js issue.
Of course having all 3 functions compatible and not wrapped in a conditional should be the goal. However, I didn't have time to look further. This fixes it for now. Plus, not sure why someone would use that feature for search instead of just using CTR/CMD F anyway lol.
Comment