-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#48 form editor, not yet integrated into the app
- Loading branch information
Showing
3 changed files
with
9,257 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Editor</title> | ||
<script src="jquery.js"></script> | ||
<script src="formeditor.js"></script> | ||
</head> | ||
<body> | ||
<p id="original" hidden></p> | ||
<div> | ||
<textarea id="new"></textarea> | ||
<button onclick="addNew();">Add</button> | ||
</div> | ||
<div> | ||
<ol id="cells"> | ||
</ol> | ||
</div> | ||
<div> | ||
<button onclick="submit();">submit</button> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var lines = ""; | ||
var count = 0; | ||
|
||
function recordAll() { | ||
lines = ""; | ||
$('#cells').children().each(function(){lines += $(this).find('span').text()+"|#|";}); | ||
} | ||
|
||
function submit() { //edit | ||
recordAll(); | ||
// var request = new XMLHttpRequest() | ||
alert(lines.toString()); | ||
} | ||
|
||
function addNew() { | ||
if ($('#new').val()) { | ||
$('#cells').append('<li id="q'+count+'"><button onclick="deletethis(q'+count+');"> x</button><span>'+$('#new').val()+'</span></li>'); | ||
$('#new').val(""); | ||
count++; | ||
} | ||
} | ||
|
||
function deletethis(x) { | ||
$(x).remove(); | ||
} | ||
|
||
function init() { | ||
var original = $('#original').text().split('|#|'); | ||
original.pop(); | ||
} |
Oops, something went wrong.