summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/cve/list.html.erb')
-rw-r--r--app/views/cve/list.html.erb135
1 files changed, 0 insertions, 135 deletions
diff --git a/app/views/cve/list.html.erb b/app/views/cve/list.html.erb
deleted file mode 100644
index 9a5fad6..0000000
--- a/app/views/cve/list.html.erb
+++ /dev/null
@@ -1,135 +0,0 @@
-<h1>CVE List</h1>
-
-<script language="JavaScript" type="text/javascript">
-
-var view = 1; // NEW by default
-
-// formatter for highlighted strings
-var hlt = '';
-function formatHlted (t) {
- return hlt ? (t || '').replace(hlt, '<strong>' + hlt + '</strong>') : t;
-}
-
-<%= render :partial => 'toolbar.js' %>
-
-uki(
- { view: 'HSplitPane', rect: '1000 1000', anchors: 'left top right bottom', handleWidth: 1, handlePosition: 199, leftMin: 199, rightMin: 400,
- leftPane: { background: '#D3CFE5', childViews: toolbar() },
- rightChildViews: [
- { view: 'Table', rect: '0 0 800 1000', minSize: '0 200', anchors: 'left top right bottom', columns: [
- { view: 'table.NumberColumn', label: 'ID', width: 50 },
- { view: 'table.CustomColumn', label: 'CVE ID', width: 125, formatter: formatHlted, sort: 'DESC' },
- { view: 'table.CustomColumn', label: 'Summary', resizable: true, minWidth: 300, width: (window.innerWidth - 200 - 50 - 125 - 80 - 15), formatter: formatHlted },
- { view: 'table.CustomColumn', label: 'State', width: 80, formatter: formatHlted },
- ], multiselect: true, style: {fontSize: '12px', lineHeight: '12px'} }
- ]
- }
-).attachTo(window, '1000 1000');
-
-uki(
- { view: 'Popup', rect: '100 20', id: 'loading', anchors: '', relativeTo: uki('#logo'), hideOnClick: false, childViews: [
- { view: 'Label', rect: '20 2 98 18', anchors: 'top', text: 'LOADING...', textAlign: 'center', id: 'loading-text'},
- ]
- }
-).show();
-
-<%= render :partial => 'key_events.js' %>
-
-<%= render :partial => 'ui_misc.js' %>
-
-<%= render :partial => 'filing.js' %>
-
-<%= render :partial => 'assigning.js' %>
-
-<%= render :partial => 'new.js' %>
-
-<%= render :partial => 'nfu.js' %>
-
-<%= render :partial => 'later.js' %>
-
-<%= render :partial => 'invalidate.js' %>
-
-// searchable model
-window.DummyModel = uki.newClass(Searchable, new function() {
- this.init = function(data) {
- this.items = data;
- uki.each(this.items, function(i, row) {
- row.searchIndex = escapeHTML(row[1].toLowerCase()) + ' ' + row[2].toLowerCase();
- })
- };
-
- this.matchRow = function(row, iterator) {
- return row.searchIndex.indexOf(iterator.query) > -1;
- };
-});
-
-// dinamicly load library json
-initCVETable = function(data) {
- uki('#loading').visible(false);
- var model = new DummyModel(data),
- lastQuery = '',
- table = uki('Table');
-
- model.bind('search.foundInChunk', function(chunk) {
- table.data(table.data().concat(chunk)).layout();
- });
-
- table.find('Header').bind('columnClick', function(e) {
- var header = this;
-
- if (e.column.sort() == 'ASC') e.column.sort('DESC');
- else e.column.sort('ASC');
-
- header.redrawColumn(e.columnIndex);
- uki.each(header.columns(), function(i, col) {
- if (col != e.column && col.sort()) {
- col.sort('');
- header.redrawColumn(i);
- }
- });
- model.items = e.column.sortData(model.items);
- table.data(model.items);
- });
-
- table.data(model.items);
-
- uki('#quicksearch').unbind('keyup click');
-
- uki('#quicksearch').bind('keyup click', function() {
- if (this.value().toLowerCase() == lastQuery) return;
- lastQuery = this.value().toLowerCase();
- if (lastQuery.match(/\S/)) {
- hlt = lastQuery;
- table.data([]);
- model.search(lastQuery);
- } else {
- hlt = '';
- table.data(model.items);
- }
- });
- document.body.className += '';
-};
-
-function reloadTable() {
- uki('#loading').visible(true);
- new Ajax.Request('/cve/list.json', {
- parameters: { view_map: view, year: uki('#year-select').value() },
- onSuccess: function(response) {
- initCVETable(response.responseJSON);
- },
- onFailure: function(response) {
- alert("Could not load CVE data.");
- uki('#loading').text("Loading CVE data failed. Please try again later.");
- }
- });
- uki('#quicksearch').click();
-}
-
-function disableMainView() {
-}
-
-function enableMainView() {
-}
-
-reloadTable();
-</script>