You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@warble.apache.org by hu...@apache.org on 2018/06/26 23:46:24 UTC

[incubator-warble-server] 02/02: regen js

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-warble-server.git

commit 08e962286d719cdd70ba3d6546e19d9cdc8fef82
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jun 26 18:46:17 2018 -0500

    regen js
---
 ui/js/warble.v1.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 47 insertions(+), 2 deletions(-)

diff --git a/ui/js/warble.v1.js b/ui/js/warble.v1.js
index 8d55b91..ef5c9fa 100644
--- a/ui/js/warble.v1.js
+++ b/ui/js/warble.v1.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.9.3
-var API, APIVERSION, Chart, HTML, Row, WarbleLogin, WarbleLoginCallback, Widget, aSourceTypes, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, clientTypes, clientlist, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, da [...]
+var API, APIVERSION, Chart, HTML, Row, WarbleLogin, WarbleLoginCallback, Widget, aSourceTypes, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, clientTypes, clientlist, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, da [...]
   indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
 signup = function(form) {
@@ -4634,6 +4634,48 @@ deleteNode = function(id, stats) {
   }, {}, location.reload());
 };
 
+nodeLocation = function(id, obj) {
+  var ip, loc;
+  if (!document.getElementById("tnodeloc_" + id)) {
+    loc = obj.innerText;
+    obj.innerHTML = "";
+    ip = mk('input', {
+      data: loc,
+      id: "tnodeloc_" + id,
+      type: 'text',
+      onkeydown: "saveNodeLocation(" + id + ", this, event);"
+    });
+    app(obj, ip);
+    return ip.focus();
+  }
+};
+
+saveNodeLocation = function(id, obj, e) {
+  var nloc;
+  if (e.key === 'Enter') {
+    nloc = obj.value;
+    return post('node/modify', {
+      id: id,
+      location: nloc
+    }, {
+      id: id,
+      location: nloc
+    }, savedNodeLocation);
+  } else if (e.key === 'Escape') {
+    return savedNodeLocation({}, {
+      id: id,
+      location: obj.getAttribute('data')
+    });
+  }
+};
+
+savedNodeLocation = function(json, state) {
+  var obj;
+  obj = document.getElementById("nodeloc_" + state.id);
+  obj.innerHTML = "";
+  return app(obj, txt(state.location));
+};
+
 clientlist = function(json, state) {
   var act, d, dbtn, fp, len, q, retval, slist, source, sources, t, tbody, ts, vlist;
   slist = mk('div');
@@ -4678,7 +4720,10 @@ clientlist = function(json, state) {
       fp.style.boxShadow = 'none';
       app(t, fp);
       app(d, t);
-      t = mk('td');
+      t = mk('td', {
+        id: "nodeloc_" + source.id,
+        onclick: "nodeLocation(" + source.id + ", this, event);"
+      });
       app(t, txt(source.location || "(unknown)"));
       app(d, t);
       t = mk('td');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@warble.apache.org
For additional commands, e-mail: commits-help@warble.apache.org