summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/memory.js
diff options
context:
space:
mode:
authorMrYummy <elemental428@gmail.com>2017-07-04 22:24:50 +0200
committerMrYummy <elemental428@gmail.com>2017-07-04 22:27:07 +0200
commit0aad3bb71afbb6419b90f499118f18676452b095 (patch)
treee6af19ca1fe67f2edfa1f2fef47089a97b1f9eeb /app/assets/javascripts/memory.js
parent0f74795159ba65432aa1a6a25367dfdcffd4bb12 (diff)
Added choice of project, r/w perms, and fixed up some cssmemory
Diffstat (limited to 'app/assets/javascripts/memory.js')
-rw-r--r--app/assets/javascripts/memory.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/memory.js b/app/assets/javascripts/memory.js
index 4dac5a0..a614e91 100644
--- a/app/assets/javascripts/memory.js
+++ b/app/assets/javascripts/memory.js
@@ -1,10 +1,17 @@
$(function() {
+ $('td').focus(function() {
+ if (this.id.split("-")[0] == "memory") {
+ $(this).css("background-color", "lightblue")
+ }
+ });
var data = [];
$('td').keydown(function() {
data.push(this.id, $(this).html().substr(0, 2)); //position, value
})
$('td').blur(function() {
+ $(this).css("background", "none");
if ((id_i = data.indexOf(this.id) != -1) && data[id_i+1] != $(this).html().substr(0, 2)) {
+ $(this).css("color", "darkgreen");
var int_id = this.id.split("-")[1]
$.post("/memory/update_memory?project="+$(this).closest("table").data("project")+"&file="+Math.floor((int_id/2048)+1)+"&mem_id="+int_id%2048+"&value="+$(this).html().substr(0, 2));
data.splice(id_i, 2);