Completed initial prototype supporting Javascript for Web Assembly IDE

This commit is contained in:
Jeremiah Orians 2016-07-20 20:34:01 -04:00
parent 222b7bcca3
commit a8b228c61e
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
2 changed files with 9558 additions and 0 deletions

9472
public/jquery-1.8.3.js vendored Normal file

File diff suppressed because it is too large Load Diff

86
public/script.js Normal file
View File

@ -0,0 +1,86 @@
$(document).ready(function () {
if(window.location.href.indexOf("RUN") > -1) {
setTimeout("location.reload(true);",500);
}
});
$(function (){
$(".Memory td").dblclick(function () {
var OriginalContent = $(this).text();
var row_index = $(this).parent().index('tr');
var col_index = $(this).index('tr:eq('+ row_index + ') td');
$(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus();
$(this).children().first().keypress(function (e) {
if (e.which == 13) {
var newContent = $(this).val();
$(this).parent().text(newContent);
$(this).parent().removeClass("cellEditing");
window.location.href = "Memory?row=" + (row_index - 1) + ";col=" + (col_index - 1) + ";value=" + newContent;}
});
$(this).children().first().blur(function(){
$(this).parent().text(OriginalContent);
$(this).parent().removeClass("cellEditing");
});
});
});
$(function (){
$(".Registers td").dblclick(function () {
var OriginalContent = $(this).text();
var UsefulContent = $(this).parent().find("td:nth-child(1)").text();
$(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus();
$(this).children().first().keypress(function (e) {
if (e.which == 13) {
var newContent = $(this).val();
$(this).parent().text(newContent);
$(this).parent().removeClass("cellEditing");
window.location.href = "Register?Reg=" + UsefulContent + ";value=" + newContent;}
});
$(this).children().first().blur(function(){
$(this).parent().text(OriginalContent);
$(this).parent().removeClass("cellEditing");
});
});
});
$(function (){
$(".Debug td").dblclick(function () {
var UsefulContent = $(this).parent().find("td:nth-child(1)").text();
window.location.href = "DEBUG?Inst=" + UsefulContent;
});
});
$(window).bind('keydown', function(event) {
if (event.ctrlKey || event.metaKey) {
switch (String.fromCharCode(event.which).toLowerCase()) {
case 's':
event.preventDefault();
alert('ctrl-s');
break;
case 'f':
event.preventDefault();
alert('ctrl-f');
break;
case 'g':
event.preventDefault();
alert('ctrl-g');
break;
case 'd':
event.preventDefault();
alert('ctrol-d');
break;
}
}
});