diff options
author | 2010-09-27 22:12:22 +0200 | |
---|---|---|
committer | 2010-09-27 22:12:22 +0200 | |
commit | 9f884d62aea511cc65532323e60de12764cb1b14 (patch) | |
tree | f11395995ab1dad77d5921870573150bad9bf81d /app/views/cve | |
parent | lib/glsamaker/xml: Allow passing of options in GLSAMAKER_XMLINDENT (diff) | |
download | glsamaker-9f884d62aea511cc65532323e60de12764cb1b14.tar.gz glsamaker-9f884d62aea511cc65532323e60de12764cb1b14.tar.bz2 glsamaker-9f884d62aea511cc65532323e60de12764cb1b14.zip |
CVETool: Implement LATER
Diffstat (limited to 'app/views/cve')
-rw-r--r-- | app/views/cve/_later.js.erb | 65 | ||||
-rw-r--r-- | app/views/cve/list.html.erb | 2 |
2 files changed, 67 insertions, 0 deletions
diff --git a/app/views/cve/_later.js.erb b/app/views/cve/_later.js.erb new file mode 100644 index 0000000..0be1726 --- /dev/null +++ b/app/views/cve/_later.js.erb @@ -0,0 +1,65 @@ +/** Latering **/ +uki( + { view: 'Popup', rect: '500 300', anchors: 'left top', id: 'later-popup', hideOnClick: false, relativeTo: uki('#popup'), childViews: [ + { view: 'Label', rect: '10 10 480 20', anchors: 'top', html: '<strong>The following CVEs will be marked as LATER:</strong>', id: 'cve-later-title'}, + { view: 'ScrollableList', rect: '10 35 480 190', anchors: 'top left right bottom', id: 'cve-later-list' }, + { view: 'TextField', rect: '10 235 480 22', anchors: 'left top right', placeholder: 'Add a (public) comment', id: 'later-comment' }, + { view: 'Button', rect: '345 265 70 24', anchors: 'bottom right', id: 'cve-later-cancel', text: 'Cancel' }, + { view: 'Button', rect: '420 265 70 24', anchors: 'bottom right', id: 'cve-later-go', text: 'Commit' } + ] + } +); + +uki("#cve-mark-later").click( + function() { + var sel = uki('Table').selectedRows(); + + if (sel.length < 1) { + alert("Please select at least one CVE."); + return false; + } + + var data = new Array(); + cve_later_data = new Array(); + + for (var i = 0; i < sel.length; i++) { + data.push("(" + sel[i][1] + ") " + sel[i][2]); + cve_later_data.push(sel[i][0]); + } + + uki('#cve-later-list').data(data); + + uki('#later-comment').value(''); + uki('#later-popup').show(); + + uki('#cve-later-go').focus(); + } +); + +uki('#cve-later-go').click( + function() { + if (cve_later_data < 1) { + alert("Error. Internal CVE list empty."); + return; + uki('#later-popup').hide(); + } + + new Ajax.Request('/cve/later', { + parameters: { cves: cve_later_data.join(','), reason: uki('#later-comment').value() }, + onSuccess: function(response) { + uki('#later-popup').hide(); + reloadTable(); + }, + onFailure: function(response) { + alert("Could not process your request:\n\n" + response.responseText); + } + }); + } +); + +uki('#cve-later-cancel').click( + function() { + uki('#later-popup').hide(); + } +); +/** Latering end **/
\ No newline at end of file diff --git a/app/views/cve/list.html.erb b/app/views/cve/list.html.erb index 46955a4..d5df191 100644 --- a/app/views/cve/list.html.erb +++ b/app/views/cve/list.html.erb @@ -43,6 +43,8 @@ uki( <%= render :partial => 'nfu.js' %> +<%= render :partial => 'later.js' %> + // searchable model window.DummyModel = uki.newClass(Searchable, new function() { this.init = function(data) { |