oxidized-web 0.13.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oxidized-web might be problematic. Click here for more details.

Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +12 -0
  3. data/.github/dependabot.yml +25 -0
  4. data/.github/workflows/codeql.yml +76 -0
  5. data/.github/workflows/ruby.yml +42 -0
  6. data/.github/workflows/stale.yml +18 -0
  7. data/.gitignore +3 -0
  8. data/.rubocop.yml +38 -3
  9. data/.rubocop_todo.yml +28 -207
  10. data/CHANGELOG.md +28 -0
  11. data/README.md +8 -5
  12. data/Rakefile +48 -5
  13. data/docs/development.md +170 -0
  14. data/lib/oxidized/web/mig.rb +37 -47
  15. data/lib/oxidized/web/public/css/oxidized.css +59 -0
  16. data/lib/oxidized/web/public/scripts/oxidized.js +1 -12
  17. data/lib/oxidized/web/public/weblibs/bootstrap-icons.css +2078 -0
  18. data/lib/oxidized/web/public/weblibs/bootstrap.bundle.js +6314 -0
  19. data/lib/oxidized/web/public/weblibs/bootstrap.bundle.js.map +1 -0
  20. data/lib/oxidized/web/public/weblibs/bootstrap.css +12057 -0
  21. data/lib/oxidized/web/public/weblibs/bootstrap.css.map +1 -0
  22. data/lib/oxidized/web/public/weblibs/bootstrap.js +4494 -0
  23. data/lib/oxidized/web/public/weblibs/bootstrap.js.map +1 -0
  24. data/lib/oxidized/web/public/weblibs/buttons.bootstrap5.css +398 -0
  25. data/lib/oxidized/web/public/weblibs/buttons.bootstrap5.js +117 -0
  26. data/lib/oxidized/web/public/weblibs/buttons.colVis.js +256 -0
  27. data/lib/oxidized/web/public/weblibs/dataTables.bootstrap5.css +487 -0
  28. data/lib/oxidized/web/public/weblibs/dataTables.bootstrap5.js +147 -0
  29. data/lib/oxidized/web/public/weblibs/dataTables.buttons.js +2820 -0
  30. data/lib/oxidized/web/public/weblibs/dataTables.js +13171 -0
  31. data/lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff +0 -0
  32. data/lib/oxidized/web/public/weblibs/fonts/bootstrap-icons.woff2 +0 -0
  33. data/lib/oxidized/web/public/weblibs/jquery.js +10716 -0
  34. data/lib/oxidized/web/version.rb +7 -0
  35. data/lib/oxidized/web/views/conf_search.haml +14 -13
  36. data/lib/oxidized/web/views/diffs.haml +5 -5
  37. data/lib/oxidized/web/views/footer.haml +5 -4
  38. data/lib/oxidized/web/views/head.haml +21 -7
  39. data/lib/oxidized/web/views/layout.haml +29 -34
  40. data/lib/oxidized/web/views/migration.haml +7 -0
  41. data/lib/oxidized/web/views/node.haml +10 -8
  42. data/lib/oxidized/web/views/nodes.haml +45 -35
  43. data/lib/oxidized/web/views/stats.haml +32 -24
  44. data/lib/oxidized/web/views/version.haml +8 -6
  45. data/lib/oxidized/web/views/versions.haml +23 -24
  46. data/lib/oxidized/web/webapp.rb +106 -87
  47. data/lib/oxidized/web.rb +10 -7
  48. data/oxidized-web.gemspec +27 -14
  49. data/package-lock.json +104 -0
  50. data/package.json +21 -0
  51. data/spec/node_spec.rb +143 -0
  52. data/spec/root_spec.rb +18 -0
  53. data/spec/spec_helper.rb +8 -0
  54. data/spec/webapp_spec.rb +28 -0
  55. metadata +187 -73
  56. data/lib/oxidized/web/public/css/bootstrap.min.css +0 -5
  57. data/lib/oxidized/web/public/css/buttons.bootstrap.min.css +0 -1
  58. data/lib/oxidized/web/public/css/dataTables.bootstrap.css +0 -299
  59. data/lib/oxidized/web/public/css/dataTables.colVis.css +0 -171
  60. data/lib/oxidized/web/public/css/oxidized_custom.css +0 -19
  61. data/lib/oxidized/web/public/fonts/glyphicons-halflings-regular.eot +0 -0
  62. data/lib/oxidized/web/public/fonts/glyphicons-halflings-regular.svg +0 -229
  63. data/lib/oxidized/web/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  64. data/lib/oxidized/web/public/fonts/glyphicons-halflings-regular.woff +0 -0
  65. data/lib/oxidized/web/public/images/diff_15x17.png +0 -0
  66. data/lib/oxidized/web/public/images/sort_asc.png +0 -0
  67. data/lib/oxidized/web/public/images/sort_asc_disabled.png +0 -0
  68. data/lib/oxidized/web/public/images/sort_both.png +0 -0
  69. data/lib/oxidized/web/public/images/sort_desc.png +0 -0
  70. data/lib/oxidized/web/public/images/sort_desc_disabled.png +0 -0
  71. data/lib/oxidized/web/public/images/versioning_18px.png +0 -0
  72. data/lib/oxidized/web/public/scripts/bootstrap.min.js +0 -6
  73. data/lib/oxidized/web/public/scripts/dataTables.bootstrap.js +0 -186
  74. data/lib/oxidized/web/public/scripts/dataTables.colVis.js +0 -1123
  75. data/lib/oxidized/web/public/scripts/jquery-2.1.1.min.js +0 -4
  76. data/lib/oxidized/web/public/scripts/jquery.dataTables.min.js +0 -157
  77. data/lib/oxidized/web/public/scripts/jquery.min.js +0 -6
  78. data/lib/oxidized/web/views/sass/oxidized.sass +0 -113
@@ -0,0 +1,256 @@
1
+ /*!
2
+ * Column visibility buttons for Buttons and DataTables.
3
+ * © SpryMedia Ltd - datatables.net/license
4
+ */
5
+
6
+ (function( factory ){
7
+ if ( typeof define === 'function' && define.amd ) {
8
+ // AMD
9
+ define( ['jquery', 'datatables.net', 'datatables.net-buttons'], function ( $ ) {
10
+ return factory( $, window, document );
11
+ } );
12
+ }
13
+ else if ( typeof exports === 'object' ) {
14
+ // CommonJS
15
+ var jq = require('jquery');
16
+ var cjsRequires = function (root, $) {
17
+ if ( ! $.fn.dataTable ) {
18
+ require('datatables.net')(root, $);
19
+ }
20
+
21
+ if ( ! $.fn.dataTable.Buttons ) {
22
+ require('datatables.net-buttons')(root, $);
23
+ }
24
+ };
25
+
26
+ if (typeof window === 'undefined') {
27
+ module.exports = function (root, $) {
28
+ if ( ! root ) {
29
+ // CommonJS environments without a window global must pass a
30
+ // root. This will give an error otherwise
31
+ root = window;
32
+ }
33
+
34
+ if ( ! $ ) {
35
+ $ = jq( root );
36
+ }
37
+
38
+ cjsRequires( root, $ );
39
+ return factory( $, root, root.document );
40
+ };
41
+ }
42
+ else {
43
+ cjsRequires( window, jq );
44
+ module.exports = factory( jq, window, window.document );
45
+ }
46
+ }
47
+ else {
48
+ // Browser
49
+ factory( jQuery, window, document );
50
+ }
51
+ }(function( $, window, document ) {
52
+ 'use strict';
53
+ var DataTable = $.fn.dataTable;
54
+
55
+
56
+
57
+ $.extend(DataTable.ext.buttons, {
58
+ // A collection of column visibility buttons
59
+ colvis: function (dt, conf) {
60
+ var node = null;
61
+ var buttonConf = {
62
+ extend: 'collection',
63
+ init: function (dt, n) {
64
+ node = n;
65
+ },
66
+ text: function (dt) {
67
+ return dt.i18n('buttons.colvis', 'Column visibility');
68
+ },
69
+ className: 'buttons-colvis',
70
+ closeButton: false,
71
+ buttons: [
72
+ {
73
+ extend: 'columnsToggle',
74
+ columns: conf.columns,
75
+ columnText: conf.columnText
76
+ }
77
+ ]
78
+ };
79
+
80
+ // Rebuild the collection with the new column structure if columns are reordered
81
+ dt.on('column-reorder.dt' + conf.namespace, function () {
82
+ dt.button(null, dt.button(null, node).node()).collectionRebuild([
83
+ {
84
+ extend: 'columnsToggle',
85
+ columns: conf.columns,
86
+ columnText: conf.columnText
87
+ }
88
+ ]);
89
+ });
90
+
91
+ return buttonConf;
92
+ },
93
+
94
+ // Selected columns with individual buttons - toggle column visibility
95
+ columnsToggle: function (dt, conf) {
96
+ var columns = dt
97
+ .columns(conf.columns)
98
+ .indexes()
99
+ .map(function (idx) {
100
+ return {
101
+ extend: 'columnToggle',
102
+ columns: idx,
103
+ columnText: conf.columnText
104
+ };
105
+ })
106
+ .toArray();
107
+
108
+ return columns;
109
+ },
110
+
111
+ // Single button to toggle column visibility
112
+ columnToggle: function (dt, conf) {
113
+ return {
114
+ extend: 'columnVisibility',
115
+ columns: conf.columns,
116
+ columnText: conf.columnText
117
+ };
118
+ },
119
+
120
+ // Selected columns with individual buttons - set column visibility
121
+ columnsVisibility: function (dt, conf) {
122
+ var columns = dt
123
+ .columns(conf.columns)
124
+ .indexes()
125
+ .map(function (idx) {
126
+ return {
127
+ extend: 'columnVisibility',
128
+ columns: idx,
129
+ visibility: conf.visibility,
130
+ columnText: conf.columnText
131
+ };
132
+ })
133
+ .toArray();
134
+
135
+ return columns;
136
+ },
137
+
138
+ // Single button to set column visibility
139
+ columnVisibility: {
140
+ columns: undefined, // column selector
141
+ text: function (dt, button, conf) {
142
+ return conf._columnText(dt, conf);
143
+ },
144
+ className: 'buttons-columnVisibility',
145
+ action: function (e, dt, button, conf) {
146
+ var col = dt.columns(conf.columns);
147
+ var curr = col.visible();
148
+
149
+ col.visible(
150
+ conf.visibility !== undefined ? conf.visibility : !(curr.length ? curr[0] : false)
151
+ );
152
+ },
153
+ init: function (dt, button, conf) {
154
+ var that = this;
155
+ button.attr('data-cv-idx', conf.columns);
156
+
157
+ dt.on('column-visibility.dt' + conf.namespace, function (e, settings) {
158
+ if (!settings.bDestroying && settings.nTable == dt.settings()[0].nTable) {
159
+ that.active(dt.column(conf.columns).visible());
160
+ }
161
+ }).on('column-reorder.dt' + conf.namespace, function () {
162
+ // Button has been removed from the DOM
163
+ if (conf.destroying) {
164
+ return;
165
+ }
166
+
167
+ if (dt.columns(conf.columns).count() !== 1) {
168
+ return;
169
+ }
170
+
171
+ // This button controls the same column index but the text for the column has
172
+ // changed
173
+ that.text(conf._columnText(dt, conf));
174
+
175
+ // Since its a different column, we need to check its visibility
176
+ that.active(dt.column(conf.columns).visible());
177
+ });
178
+
179
+ this.active(dt.column(conf.columns).visible());
180
+ },
181
+ destroy: function (dt, button, conf) {
182
+ dt.off('column-visibility.dt' + conf.namespace).off(
183
+ 'column-reorder.dt' + conf.namespace
184
+ );
185
+ },
186
+
187
+ _columnText: function (dt, conf) {
188
+ if (typeof conf.text === 'string') {
189
+ return conf.text;
190
+ }
191
+
192
+ var title = dt.column(conf.columns).title();
193
+ var idx = dt.column(conf.columns).index();
194
+
195
+ title = title
196
+ .replace(/\n/g, ' ') // remove new lines
197
+ .replace(/<br\s*\/?>/gi, ' ') // replace line breaks with spaces
198
+ .replace(/<select(.*?)<\/select\s*>/gi, ''); // remove select tags, including options text
199
+
200
+ // Strip HTML comments
201
+ title = DataTable.Buttons.stripHtmlComments(title);
202
+
203
+ // Use whatever HTML stripper DataTables is configured for
204
+ title = DataTable.util.stripHtml(title).trim();
205
+
206
+ return conf.columnText ? conf.columnText(dt, idx, title) : title;
207
+ }
208
+ },
209
+
210
+ colvisRestore: {
211
+ className: 'buttons-colvisRestore',
212
+
213
+ text: function (dt) {
214
+ return dt.i18n('buttons.colvisRestore', 'Restore visibility');
215
+ },
216
+
217
+ init: function (dt, button, conf) {
218
+ // Use a private parameter on the column. This gets moved around with the
219
+ // column if ColReorder changes the order
220
+ dt.columns().every(function () {
221
+ var init = this.init();
222
+
223
+ if (init.__visOriginal === undefined) {
224
+ init.__visOriginal = this.visible();
225
+ }
226
+ });
227
+ },
228
+
229
+ action: function (e, dt, button, conf) {
230
+ dt.columns().every(function (i) {
231
+ var init = this.init();
232
+
233
+ this.visible(init.__visOriginal);
234
+ });
235
+ }
236
+ },
237
+
238
+ colvisGroup: {
239
+ className: 'buttons-colvisGroup',
240
+
241
+ action: function (e, dt, button, conf) {
242
+ dt.columns(conf.show).visible(true, false);
243
+ dt.columns(conf.hide).visible(false, false);
244
+
245
+ dt.columns.adjust();
246
+ },
247
+
248
+ show: [],
249
+
250
+ hide: []
251
+ }
252
+ });
253
+
254
+
255
+ return DataTable;
256
+ }));