You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/02/16 18:56:20 UTC

[kibble] 05/05: 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/kibble.git

commit 0817d31df2799b1e8c94193c5af30c57f204ee13
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Fri Feb 16 19:56:07 2018 +0100

    regen JS
---
 ui/js/kibble.v1.js | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 98 insertions(+), 1 deletion(-)

diff --git a/ui/js/kibble.v1.js b/ui/js/kibble.v1.js
index ec194a2..1720360 100644
--- a/ui/js/kibble.v1.js
+++ b/ui/js/kibble.v1.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.10.0
-var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, 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, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource, doResetPas [...]
+var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, 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, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource [...]
   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) {
@@ -2178,6 +2178,97 @@ imexplorer = function(json, state) {
   return $('select').chosen();
 };
 
+ciexplorer = function(json, state) {
+  var ID, ezURL, h, item, len, len1, list, m, n, opt, org, q, ref, ref1, ref2, ref3, slen, u;
+  org = json.organisation;
+  if (json.tag) {
+    org.name += " (Filter: " + json.tag + ")";
+  }
+  h = document.createElement('h4');
+  h.appendChild(document.createTextNode("Exploring " + org.name + ":"));
+  state.widget.inject(h, true);
+  list = document.createElement('select');
+  state.widget.inject(list);
+  opt = document.createElement('option');
+  opt.value = "";
+  slen = 0;
+  ref = json.sources;
+  for (q = 0, len = ref.length; q < len; q++) {
+    item = ref[q];
+    if ((ref1 = item.type) === 'jenkins' || ref1 === 'travis' || ref1 === 'buildbot') {
+      slen++;
+    }
+  }
+  opt.text = "All " + slen + " CI Services";
+  list.appendChild(opt);
+  json.sources.sort(function(a, b) {
+    if (a.sourceURL === b.sourceURL) {
+      return 0;
+    } else {
+      if (a.sourceURL > b.sourceURL) {
+        return 1;
+      } else {
+        return -1;
+      }
+    }
+  });
+  ref2 = json.sources;
+  for (u = 0, len1 = ref2.length; u < len1; u++) {
+    item = ref2[u];
+    if ((ref3 = item.type) === 'jenkins' || ref3 === 'travis' || ref3 === 'buildbot') {
+      opt = document.createElement('option');
+      opt.value = item.sourceID;
+      ezURL = null;
+      n = item.sourceURL.match(/^([a-z]+:\/\/.+?)\/([#\S+]+)$/i);
+      m = item.sourceURL.match(/^([a-z]+:\/\/.+?)\s(.+)$/i);
+      if (n && n.length === 3) {
+        ezURL = n[2] + " - (" + n[1] + ")";
+      } else if (m && m.length === 3) {
+        ezURL = m[2] + " - (" + m[1] + ")";
+      }
+      opt.text = ezURL ? ezURL : item.sourceURL;
+      if (globArgs.source && globArgs.source === item.sourceID) {
+        opt.selected = 'selected';
+      }
+      list.appendChild(opt);
+    }
+  }
+  ID = Math.floor(Math.random() * 987654321).toString(16);
+  list.setAttribute('id', ID);
+  return $("#" + ID).chosen().change(function() {
+    var source;
+    source = this.value;
+    if (source === "") {
+      source = null;
+    }
+    globArgs.source = source;
+    updateWidgets('donut', null, {
+      source: source
+    });
+    updateWidgets('gauge', null, {
+      source: source
+    });
+    updateWidgets('line', null, {
+      source: source
+    });
+    updateWidgets('contacts', null, {
+      source: source
+    });
+    updateWidgets('top5', null, {
+      source: source
+    });
+    updateWidgets('factors', null, {
+      source: source
+    });
+    updateWidgets('trends', null, {
+      source: source
+    });
+    return updateWidgets('relationship', null, {
+      source: source
+    });
+  });
+};
+
 multiviewexplorer = function(json, state) {
   var ID, h, item, k, list, opt, org, q, results, tName;
   org = json.organisation;
@@ -3599,6 +3690,9 @@ setupPage = function(json, state) {
           case 'logpicker':
             results1.push(widget.load(logexplorer));
             break;
+          case 'cipicker':
+            results1.push(widget.load(ciexplorer));
+            break;
           case 'widgetpicker':
             results1.push(widget.load(widgetexplorer));
             break;
@@ -5051,6 +5145,9 @@ updateWidgets = function(type, target, eargs) {
         case 'mailpicker':
           results.push(widget.load(mailexplorer));
           break;
+        case 'cipicker':
+          results.push(widget.load(ciexplorer));
+          break;
         case 'logpicker':
           results.push(widget.load(logexplorer));
           break;

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.