Skip to content

Commit

Permalink
Merge pull request #4 from nolach/master
Browse files Browse the repository at this point in the history
Solve issue #2 ('save' button issue, etc.)
  • Loading branch information
winteram committed May 10, 2013
2 parents 3ddc03b + 970ec6d commit 17f49e0
Show file tree
Hide file tree
Showing 5 changed files with 1,025 additions and 1,023 deletions.
14 changes: 7 additions & 7 deletions core/fileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ function writeoutput($output)
}
else {
$errors = "";
// template name is set, has only alphanumeric characters, and is < 30 characters
// template name is set and is < 30 characters
if(!isset($form["template-name"]) ||
strlen($form["template-name"]) > 30 ||
$form["template-name"] != preg_replace('/[^A-Za-z0-9]+/','',$form["template-name"]))
strlen($form["template-name"]) > 30 /*||
$form["template-name"] != preg_replace('/[^A-Za-z0-9]+/','',$form["template-name"])*/)
{
$errors .= "<li class='error-item'>";
$errors .= "Please input a valid template name (less than 30 alphanumeric characters only) ";
$errors .= " </li>";
$errors .= "Please input a valid template name (less than 30 characters)";
$errors .= "</li>";
}
else
{
Expand Down Expand Up @@ -358,10 +358,10 @@ function writeoutput($output)
// else if template name has changed
else if ($_REQUEST['oldname'] != $form["template-name"])
{
// check for template-name conflict happened earlier, so this is safe
// checked for template-name conflict happened earlier, so this is safe
rename("../templates/".$_REQUEST['oldname'],"../templates/".$form["template-name"]);

// check if old name is currently active, if so, change?
// check if old name is currently active, if so, change
// also need to rename in active.txt
$optArr = array('oldName' => $_REQUEST['oldname'],
'newName' => $form['template-name'],
Expand Down
2 changes: 1 addition & 1 deletion core/instruct0.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<br><br>
<div> Please enter a unique subject identifier; No more than 30 characters, alphanumeric only. </div>
<br>
<input type="submit" value="Submit Subject ID" onclick='console.log("test");loadInstructions("one");'>
<input type="submit" value="Submit Subject ID" onclick='loadInstructions("one");'>
2 changes: 1 addition & 1 deletion core/js/IAT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sub = '';
function randomString(length) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];
for (var i = length; i > 0; --i) result += chars.charAt(Math.floor(Math.random() * (chars.length - 1)));
return result;
}

Expand Down
Loading

0 comments on commit 17f49e0

Please sign in to comment.