Skip to content

Commit

Permalink
Adjust loginpage example to remove a11y settings
Browse files Browse the repository at this point in the history
  • Loading branch information
drlippman committed Apr 4, 2017
1 parent 4e10007 commit df84aa0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 51 deletions.
1 change: 1 addition & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
if (!isset($sessiondata['mathdisp'])) {
echo '<script type="text/javascript">var AMnoMathML = true;var ASnoSVG = true;var AMisGecko = 0;var AMnoTeX = false;</script>';
//echo '<script type="text/javascript" src="'.$imasroot.'/mathjax/MathJax.js?config=AM_CHTML&rev=2.6.1"></script>';
//we can probably remove these next to lines
echo '<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_CHTML-full"></script>';
echo "<script src=\"$imasroot/javascript/mathgraphcheck.js?v=021215\" type=\"text/javascript\"></script>\n";
} else if ($sessiondata['mathdisp']==1 || $sessiondata['mathdisp']==3) {
Expand Down
62 changes: 11 additions & 51 deletions loginpage.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ if (!isset($imasroot)) { //don't allow direct access to loginpage.php
$pagetitle = "About Us";
include("infoheader.php");

$pref = 0;
if (isset($_COOKIE['mathgraphprefs'])) {
$prefparts = explode('-',$_COOKIE['mathgraphprefs']);
if ($prefparts[0]==2 && $prefparts[1]==2) { //img all
$pref = 3;
} else if ($prefparts[0]==2) { //img math
$pref = 4;
} else if ($prefparts[1]==2) { //img graph
$pref = 2;
}

}
?>


Expand All @@ -55,60 +43,32 @@ if (!isset($imasroot)) { //don't allow direct access to loginpage.php
}
?>
<b>Login</b>

<div><noscript>JavaScript is not enabled. JavaScript is required for <?php echo $installname; ?>. Please enable JavaScript and reload this page</noscript></div>

<table>
<tr><td><label for="username"><?php echo $loginprompt;?></label>:</td><td><input type="text" size="15" id="username" name="username" /></td></tr>
<tr><td><label for="password">Password</label>:</td><td><input type="password" size="15" id="password" name="password" /></td></tr>
</table>
<div id="settings">JavaScript is not enabled. JavaScript is required for <?php echo $installname; ?>. Please enable JavaScript and reload this page</div>
<div class=textright><input type="submit" value="Login"></div>

<div class="textright"><a href="<?php echo $imasroot; ?>/forms.php?action=newuser">Register as a new student</a></div>
<div class="textright"><a href="<?php echo $imasroot; ?>/forms.php?action=resetpw">Forgot Password</a><br/>
<a href="<?php echo $imasroot; ?>/forms.php?action=lookupusername">Forgot Username</a></div>
<div class="textright"><a href="<?php echo $imasroot; ?>/checkbrowser.php">Browser check</a></div>

<input type="hidden" id="tzoffset" name="tzoffset" value="">
<input type="hidden" id="tzname" name="tzname" value="">
<input type="hidden" id="challenge" name="challenge" value="<?php echo $challenge; ?>" />
<script type="text/javascript">
<script type="text/javascript">
$(function() {
var thedate = new Date();
document.getElementById("tzoffset").value = thedate.getTimezoneOffset();
var tz = jstz.determine();
document.getElementById("tzname").value = tz.name();
</script>

$("#username").focus();
});
</script>

<script type="text/javascript">
function updateloginarea() {
setnode = document.getElementById("settings");
var html = "";
html += 'Accessibility: ';
html += "<a href='#' onClick=\"window.open('<?php echo $imasroot;?>/help.php?section=loggingin','help','top=0,width=400,height=500,scrollbars=1,left='+(screen.width-420))\">Help</a>";
html += '<div style="margin-top: 0px;margin-right:0px;text-align:right;padding:0px"><select name="access"><option value="0">Use defaults</option>';
html += '<option value="3">Force image-based display</option>';
html += '<option value="1">Use text-based display</option></select></div>';

if (!MathJaxCompatible) {
html += '<input type=hidden name="mathdisp" value="0">';
} else {
html += '<input type=hidden name="mathdisp" value="1">';
}
if (ASnoSVG) {
html += '<input type=hidden name="graphdisp" value="2">';
} else {
html += '<input type=hidden name="graphdisp" value="1">';
}
if (MathJaxCompatible && !ASnoSVG) {
html += '<input type=hidden name="isok" value=1>';
}
html += '<div class=textright><input type="submit" value="Login"></div>';
setnode.innerHTML = html;
document.getElementById("username").focus();
}
var existingonload = window.onload;
if (existingonload) {
window.onload = function() {existingonload(); updateloginarea();}
} else {
window.onload = updateloginarea;
}
</script>
</form>
</div>
<div class="text">
Expand Down

0 comments on commit df84aa0

Please sign in to comment.