Sha256: a78d9da3340471602ebc0e6ac9325888b84d6cc335e1433b90aee7325540765f

Contents?: true

Size: 969 Bytes

Versions: 3

Compression:

Stored size: 969 Bytes

Contents

//FIXME: grr... bug if you run once, cancel, and try to run on another watch (hate js..)
function submitCommand(action, watch) {
  var comm;
  var act;
  var s;

  if (document.getElementById("toggle_" + action)) {
    act = document.getElementById("toggle_" + action);
    s = act.getAttribute("toggled");

    if(action == "power") {
      comm =  (s == "true") ? "start" : "stop";
    } else {
      comm =  (s == "true") ? "monitor" : "unmonitor";
    }
  } else {
    comm = action;
  }

//  if (confirm("God will " + comm + " " + watch + "..")) {
  //var results =  document.getElementById("results");
  var divTag = document.createElement("div");
  divTag.id = "cresult";
  document.body.appendChild(divTag);
  var res =  document.getElementById("cresult");

 // res.innerHTML = "";
    iui.showPageByHref("/w/" + watch + "/" + comm, null, null, res, null);
//  } else {
//act.setAttribute("toggled",  (s == "true") ? "false" : "true");
//  }
  return false;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
subduino-0.2.1 webapp/public/app.js
subduino-0.2.0 webapp/public/app.js
subduino-0.1.0 webapp/public/app.js