summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/cve/_new.js.erb')
-rw-r--r--app/views/cve/_new.js.erb75
1 files changed, 0 insertions, 75 deletions
diff --git a/app/views/cve/_new.js.erb b/app/views/cve/_new.js.erb
deleted file mode 100644
index 7f8c49b..0000000
--- a/app/views/cve/_new.js.erb
+++ /dev/null
@@ -1,75 +0,0 @@
-/** New CVE **/
-uki(
- { view: 'Popup', rect: '650 300', anchors: 'left top', id: 'new-popup', hideOnClick: false, relativeTo: uki('#popup'), childViews: [
- { view: 'Label', rect: '10 10 630 20', anchors: 'top', text: '', id: 'cve-new-title' },
- { view: 'ScrollPane', rect: '10 30 635 220', anchors: 'top left right bottom', id: 'cve-new-scroll', scrollableV: true, scrollableH: false, childViews: [
- { view: 'Label', rect: '10 20 600 100', anchors: 'top', text: '', id: 'cve-new-text', textSelectable: true, multiline: true },
- ] },
- { view: 'Button', rect: '495 265 70 24', anchors: 'bottom right', id: 'cve-new-cancel', text: 'Cancel' },
- { view: 'Button', rect: '570 265 70 24', anchors: 'bottom right', id: 'cve-new-go', text: 'Create' }
- ]
- }
-);
-
-uki("#cve-new").click(
- function() {
- var popup = uki('#new-popup');
-
- new Ajax.Request('/cve/new_preview', {
- onSuccess: function(response) {
- uki('#cve-new-text').html(response.responseText);
- uki('#cve-new-text').resizeToContents('height');
-
- uki('#cve-new-title').html("<strong>Please provide the following CVE information:</strong>");
- popup.show();
- uki('#cve-new-go').disabled(false);
- uki('#cve-new-go').focus();
- },
- onFailure: function(response) {
- alert("Could not process your request:\n\n" + response.response.Text);
- return false;
- }
- });
- }
-);
-
-uki('#cve-new-cancel').click(
- function() {
- uki('#new-popup').hide();
- enableMainView();
- }
-);
-
-uki('#cve-new-go').click(
- function() {
- if ($('cve_id').value.length < 13) {
- alert("Please enter a valid 13 digit CVE identifier.");
- return false;
- }
- if ($('summary').value.length < 1) {
- alert("Please enter a CVE summary.");
- return false;
- }
-
- uki('#cve-new-go').disabled(true);
- var params = {
- cve_id: $('cve_id').value,
- summary: $('summary').value
- };
-
- new Ajax.Request('new', {
- parameters: params,
- onSuccess: function(message) {
- uki('#new-popup').hide();
- uki('#cve-new-go').disabled(false);
- reloadTable();
- },
- onFailure: function(request, textStatus, errorThrown) {
- var message = (request.status == 403) ? request.responseText : "Filing the CVE failed. Is this a duplicate?";
- alert(message);
- uki('#cve-new-go').disabled(false);
- }
- });
- }
-);
-/** New CVE end **/