From 89b8c540c45c72461032137330c7c668c73dfb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Thu, 21 Apr 2011 12:19:29 +0200 Subject: [PATCH] Show a jenkins view. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François de Metz --- index.html | 12 ++++++++++++ jenkins.js | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..4aa5e07 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + + diff --git a/jenkins.js b/jenkins.js index 1dc10cc..bcee336 100644 --- a/jenkins.js +++ b/jenkins.js @@ -39,4 +39,24 @@ // ask the state to jenkins. query(); } + + /** + * Use to watch a view state on jenkins + */ + win.JenkinsViewState = function(options) { + $.ajax({ + url: "http://" + options.host + "/view//" + options.view + "/api/json", + dataType: "jsonp", + jsonp: 'jsonp', + success: function(data) { + $(data.jobs).each(function(i, job) { + new JenkinsState({ + project: job.name, + host: options.host + }); + }); + } + }) + } + })(window, jQuery);