patternfly-sass 3.13.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/javascripts/patternfly-functions.js +1137 -0
- data/assets/javascripts/patternfly-functions.min.js +1 -0
- data/assets/javascripts/patternfly-settings.js +506 -0
- data/assets/javascripts/patternfly-settings.min.js +1 -0
- data/assets/javascripts/patternfly.dataTables.pfEmpty.js +244 -0
- data/assets/javascripts/patternfly.dataTables.pfEmpty.min.js +1 -0
- data/assets/javascripts/patternfly.dataTables.pfFilter.js +421 -0
- data/assets/javascripts/patternfly.dataTables.pfFilter.min.js +1 -0
- data/assets/javascripts/patternfly.dataTables.pfResize.js +214 -0
- data/assets/javascripts/patternfly.dataTables.pfResize.min.js +1 -0
- data/assets/javascripts/patternfly.dataTables.pfSelect.js +281 -0
- data/assets/javascripts/patternfly.dataTables.pfSelect.min.js +1 -0
- data/assets/javascripts/patternfly.js +692 -652
- data/assets/javascripts/patternfly.min.js +2 -2
- data/assets/stylesheets/_patternfly.scss +1 -0
- data/assets/stylesheets/patternfly/_datatables.scss +17 -49
- data/assets/stylesheets/patternfly/_table-view.scss +170 -0
- data/bower.json +1 -1
- data/lib/patternfly-sass/version.rb +2 -2
- data/package.json +70 -0
- data/spec/html/about-modal.html +1 -0
- data/spec/html/accordions.html +1 -0
- data/spec/html/alerts.html +1 -0
- data/spec/html/area-charts.html +1 -0
- data/spec/html/badges.html +1 -0
- data/spec/html/bar-charts.html +1 -0
- data/spec/html/basic.html +368 -418
- data/spec/html/blank-slate.html +2 -1
- data/spec/html/bootstrap-combobox.html +1 -0
- data/spec/html/bootstrap-datepicker.html +1 -0
- data/spec/html/bootstrap-select.html +1 -0
- data/spec/html/bootstrap-switch.html +1 -0
- data/spec/html/bootstrap-touchspin.html +1 -0
- data/spec/html/bootstrap-treeview-2.html +1 -0
- data/spec/html/bootstrap-treeview.html +1 -0
- data/spec/html/breadcrumbs.html +1 -0
- data/spec/html/buttons.html +1 -0
- data/spec/html/card-view-card-variations.html +1 -0
- data/spec/html/card-view-multi-select.html +1 -0
- data/spec/html/card-view-single-select.html +1 -0
- data/spec/html/cards.html +1 -0
- data/spec/html/code.html +1 -0
- data/spec/html/dashboard.html +1 -0
- data/spec/html/dist/css/patternfly-additions.css +143 -52
- data/spec/html/dist/css/patternfly-additions.css.map +1 -1
- data/spec/html/dist/css/patternfly-additions.min.css +1 -1
- data/spec/html/dist/css/patternfly-additions.min.css.map +1 -1
- data/spec/html/dist/css/patternfly.min.css +2 -2
- data/spec/html/dist/css/patternfly.min.css.map +1 -1
- data/spec/html/donut-charts.html +1 -0
- data/spec/html/dropdowns.html +1 -0
- data/spec/html/form.html +1 -0
- data/spec/html/forms.html +1 -0
- data/spec/html/horizontal-navigation.html +1 -0
- data/spec/html/icons.html +1 -0
- data/spec/html/index.html +10 -6
- data/spec/html/infotip.html +1 -0
- data/spec/html/labels.html +1 -0
- data/spec/html/line-charts.html +1 -0
- data/spec/html/list-group.html +1 -0
- data/spec/html/list-view-compound-expansion.html +1 -0
- data/spec/html/list-view-rows.html +1 -0
- data/spec/html/list-view-simple-expansion.html +1 -0
- data/spec/html/list-view.html +1 -0
- data/spec/html/login.html +1 -0
- data/spec/html/modals.html +1 -0
- data/spec/html/navbar.html +1 -0
- data/spec/html/notification-drawer-horizontal-nav.html +1 -0
- data/spec/html/notification-drawer-vertical-nav.html +1 -0
- data/spec/html/pagination.html +1 -0
- data/spec/html/panels.html +1 -0
- data/spec/html/pie-charts.html +1 -0
- data/spec/html/popovers.html +1 -0
- data/spec/html/progress-bars.html +1 -0
- data/spec/html/search.html +1 -0
- data/spec/html/spinner.html +1 -0
- data/spec/html/tab.html +373 -420
- data/spec/html/{datatables-columns.html → table-view-columns.html} +9 -7
- data/spec/html/table-view-navbar.html +532 -0
- data/spec/html/table-view.html +422 -0
- data/spec/html/tables.html +1 -0
- data/spec/html/tabs.html +1 -0
- data/spec/html/time-picker.html +1 -0
- data/spec/html/toast.html +1 -0
- data/spec/html/toolbar.html +1 -0
- data/spec/html/tooltip.html +1 -0
- data/spec/html/typography-2.html +1 -1
- data/spec/html/typography.html +1 -0
- data/spec/html/utilization-bar-charts.html +1 -0
- data/spec/html/vertical-navigation-primary-only.html +1 -0
- data/spec/html/vertical-navigation-with-badges.html +1 -0
- data/spec/html/vertical-navigation-with-secondary.html +1 -0
- data/spec/html/vertical-navigation-with-tertiary-no-icons.html +1 -0
- data/spec/html/vertical-navigation-with-tertiary-pins.html +1 -0
- data/spec/html/wizard.html +1 -0
- metadata +22 -6
- data/spec/html/datatables.html +0 -472
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function($){return factory($,window,document)}):"object"==typeof exports?module.exports=function(root,$){return root||(root=window),$&&$.fn.dataTable||($=require("datatables.net")(root,$).$),factory($,root,root.document)}:factory(jQuery,window,document)}(function($,window,document,undefined){"use strict";function selectAllRows(dt,select){var ctx=dt.settings()[0],filteredRows=dt.rows({page:"current",search:"applied"});if("single"===dt.select.style())throw new Error("Cannot select all rows with selection style 'single'");select?filteredRows.select():filteredRows.deselect(),$(ctx._pfSelect.selector,dt.table().container()).prop("checked",select),syncSelectAllCheckbox(dt)}function syncSelectAllCheckbox(dt){var ctx=dt.settings()[0],filteredRows=dt.rows({page:"current",search:"applied"}).flatten().length,selectedFilteredRows=dt.rows({page:"current",search:"applied",selected:!0}).flatten().length,selectAll=$(ctx._pfSelect.selectAllSelector,dt.table().container())[0];selectAll&&(selectAll.checked=filteredRows===selectedFilteredRows),updateSelectedRowsText(dt)}function syncSelectCheckboxes(dt){var ctx=dt.settings()[0];$(ctx._pfSelect.selector,dt.table().container()).prop("checked",!1),dt.rows({page:"current",search:"applied",selected:!0}).every(function(index){$(ctx._pfSelect.selector,dt.table().row(index).node()).prop("checked",!0)}),syncSelectAllCheckbox(dt)}function updateSelectedRowsText(dt){var ctx=dt.settings()[0],selectedRows=dt.rows({selected:!0}).flatten().length,totalRows=dt.rows().flatten().length;ctx._pfSelect.results!==undefined&&0!==ctx._pfSelect.results.length&&$(ctx._pfSelect.results).html("<strong>"+selectedRows+"</strong> of <strong>"+totalRows+"</strong> selected")}var DataTable=$.fn.dataTable,RESULTS_SELECTOR=".table-view-pf-select-results",SELECT_ALL_SELECTOR='th:first-child input[type="checkbox"]',SELECT_SELECTOR='td:first-child input[type="checkbox"]';return DataTable.pfSelect={},DataTable.pfSelect.init=function(dt){var ctx=dt.settings()[0],opts=ctx.oInit.pfConfig?ctx.oInit.pfConfig:{},select=ctx.oInit.select?ctx.oInit.select:{},style=dt.select.style();ctx._pfSelect={},ctx._pfSelect.selectAllSelector=opts.selectAllSelector!==undefined?opts.selectAllSelector:SELECT_ALL_SELECTOR,ctx._pfSelect.selector=select.selector!==undefined?select.selector:SELECT_SELECTOR,ctx._pfSelect.results=$(RESULTS_SELECTOR,opts.toolbarSelector),"api"===style?($(dt.table().container()).on("click",ctx._pfSelect.selectAllSelector,function(evt){evt.preventDefault()}),$(dt.table().container()).on("click",ctx._pfSelect.selector,function(evt){evt.preventDefault()}),dt.table().on("select.dt",function(){syncSelectCheckboxes(dt)})):($(dt.table().container()).on("click",ctx._pfSelect.selectAllSelector,function(evt){selectAllRows(dt,evt.target.checked)}),$(dt.table().container()).on("click",ctx._pfSelect.selector,function(evt){"multi"!==style||"multi+shift"!==style?syncSelectCheckboxes(dt):syncSelectAllCheckbox(dt)})),dt.table().on("draw.dt",function(){syncSelectCheckboxes(dt)}),updateSelectedRowsText(dt)},DataTable.Api.register("pfSelect.selectAllRows()",function(select){return this.iterator("table",function(ctx){selectAllRows(new DataTable.Api(ctx),select)})}),$(document).on("preInit.dt.dtSelect",function(e,ctx){"dt"===e.namespace&&DataTable.pfSelect.init(new DataTable.Api(ctx))}),DataTable.pfSelect});
|
|
@@ -1,601 +1,197 @@
|
|
|
1
|
-
|
|
2
|
-
// Set height of sidebar-pf to height of document minus height of navbar-pf if not mobile
|
|
3
|
-
(function ($) {
|
|
1
|
+
(function (window) {
|
|
4
2
|
'use strict';
|
|
5
|
-
$.fn.sidebar = function () {
|
|
6
|
-
var documentHeight = 0,
|
|
7
|
-
navbarpfHeight = 0,
|
|
8
|
-
colHeight = 0;
|
|
9
3
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
navbarpfHeight = $('.navbar-pf').outerHeight();
|
|
13
|
-
colHeight = documentHeight - navbarpfHeight;
|
|
14
|
-
}
|
|
15
|
-
$('.sidebar-pf').parent('.row').children('[class*="col-"]').css({"min-height" : colHeight});
|
|
4
|
+
var patternfly = {
|
|
5
|
+
version: "3.13.0"
|
|
16
6
|
};
|
|
17
7
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
8
|
+
// Util: PatternFly Palette colors
|
|
9
|
+
patternfly.pfPaletteColors = {
|
|
10
|
+
black: '#030303',
|
|
11
|
+
black100: '#fafafa',
|
|
12
|
+
black200: '#ededed',
|
|
13
|
+
black300: '#d1d1d1',
|
|
14
|
+
black400: '#bbbbbb',
|
|
15
|
+
black500: '#8b8d8f',
|
|
16
|
+
black600: '#72767b',
|
|
17
|
+
black700: '#4d5258',
|
|
18
|
+
black800: '#393f44',
|
|
19
|
+
black900: '#292e34',
|
|
20
|
+
blue: '#0088ce',
|
|
21
|
+
blue100: '#bee1f4',
|
|
22
|
+
blue200: '#7dc3e8',
|
|
23
|
+
blue300: '#39a5dc',
|
|
24
|
+
blue400: '#0088ce',
|
|
25
|
+
blue500: '#00659c',
|
|
26
|
+
blue600: '#004368',
|
|
27
|
+
blue700: '#002235',
|
|
28
|
+
gold: '#f0ab00',
|
|
29
|
+
gold100: '#fbeabc',
|
|
30
|
+
gold200: '#f9d67a',
|
|
31
|
+
gold300: '#f5c12e',
|
|
32
|
+
gold400: '#f0ab00',
|
|
33
|
+
gold500: '#b58100',
|
|
34
|
+
gold600: '#795600',
|
|
35
|
+
gold700: '#3d2c00',
|
|
36
|
+
orange: '#ec7a08',
|
|
37
|
+
orange100: '#fbdebf',
|
|
38
|
+
orange200: '#f7bd7f',
|
|
39
|
+
orange300: '#f39d3c',
|
|
40
|
+
orange400: '#ec7a08',
|
|
41
|
+
orange500: '#b35c00',
|
|
42
|
+
orange600: '#773d00',
|
|
43
|
+
orange700: '#3b1f00',
|
|
44
|
+
lightBlue: '#00b9e4',
|
|
45
|
+
lightBlue100: '#beedf9',
|
|
46
|
+
lightBlue200: '#7cdbf3',
|
|
47
|
+
lightBlue300: '#35caed',
|
|
48
|
+
lightBlue400: '#00b9e4',
|
|
49
|
+
lightBlue500: '#008bad',
|
|
50
|
+
lightBlue600: '#005c73',
|
|
51
|
+
lightBlue700: '#002d39',
|
|
52
|
+
green: '#3f9c35',
|
|
53
|
+
green100: '#cfe7cd',
|
|
54
|
+
green200: '#9ecf99',
|
|
55
|
+
green300: '#6ec664',
|
|
56
|
+
green400: '#3f9c35',
|
|
57
|
+
green500: '#2d7623',
|
|
58
|
+
green600: '#1e4f18',
|
|
59
|
+
green700: '#0f280d',
|
|
60
|
+
lightGreen: '#92d400',
|
|
61
|
+
lightGreen100: '#e4f5bc',
|
|
62
|
+
lightGreen200: '#c8eb79',
|
|
63
|
+
lightGreen300: '#ace12e',
|
|
64
|
+
lightGreen400: '#92d400',
|
|
65
|
+
lightGreen500: '#6ca100',
|
|
66
|
+
lightGreen600: '#486b00',
|
|
67
|
+
lightGreen700: '#253600',
|
|
68
|
+
cyan: '#007a87',
|
|
69
|
+
cyan100: '#bedee1',
|
|
70
|
+
cyan200: '#7dbdc3',
|
|
71
|
+
cyan300: '#3a9ca6',
|
|
72
|
+
cyan400: '#007a87',
|
|
73
|
+
cyan500: '#005c66',
|
|
74
|
+
cyan600: '#003d44',
|
|
75
|
+
cyan700: '#001f22',
|
|
76
|
+
purple: '#703fec',
|
|
77
|
+
purple100: '#c7bfff',
|
|
78
|
+
purple200: '#a18fff',
|
|
79
|
+
purple300: '#8461f7',
|
|
80
|
+
purple400: '#703fec',
|
|
81
|
+
purple500: '#582fc0',
|
|
82
|
+
purple600: '#40199a',
|
|
83
|
+
purple700: '#1f0066',
|
|
84
|
+
red: '#cc0000',
|
|
85
|
+
red100: '#cc0000',
|
|
86
|
+
red200: '#a30000',
|
|
87
|
+
red300: '#8b0000',
|
|
88
|
+
red400: '#470000',
|
|
89
|
+
red500: '#2c0000'
|
|
90
|
+
};
|
|
66
91
|
|
|
67
|
-
|
|
92
|
+
// Util: PatternFly C3 Chart Defaults
|
|
93
|
+
patternfly.pfSetDonutChartTitle = function (selector, primary, secondary) {
|
|
94
|
+
var donutChartRightTitle = window.d3.select(selector).select('text.c3-chart-arcs-title');
|
|
95
|
+
donutChartRightTitle.text("");
|
|
96
|
+
donutChartRightTitle.insert('tspan').text(primary).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
|
|
97
|
+
donutChartRightTitle.insert('tspan').text(secondary).classed('donut-title-small-pf', true).attr('dy', 20).attr('x', 0);
|
|
68
98
|
};
|
|
69
|
-
}(jQuery));
|
|
70
99
|
|
|
100
|
+
patternfly.pfDonutTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
101
|
+
return '<table class="c3-tooltip">' +
|
|
102
|
+
' <tr>' +
|
|
103
|
+
' <td><span style="background-color:' + color(d[0].id) + '"></span>' + '<strong>' + d[0].value + '</strong> ' + d[0].name + '</td>' +
|
|
104
|
+
' <td>' + (Math.round(d[0].ratio * 1000) / 10) + '%</td>' +
|
|
105
|
+
' </tr>' +
|
|
106
|
+
'</table>';
|
|
107
|
+
};
|
|
71
108
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"bAutoWidth": false,
|
|
80
|
-
"iDisplayLength": 20,
|
|
81
|
-
"sDom":
|
|
82
|
-
"<'dataTables_header' f i r >" +
|
|
83
|
-
"<'table-responsive' t >" +
|
|
84
|
-
"<'dataTables_footer' p >",
|
|
85
|
-
"oLanguage": {
|
|
86
|
-
"sInfo": "Showing <b>_START_</b> to <b>_END_</b> of <b>_TOTAL_</b> Items",
|
|
87
|
-
"sInfoFiltered" : "(of <b>_MAX_</b>)",
|
|
88
|
-
"sInfoEmpty" : "Showing <b>0</b> Results",
|
|
89
|
-
"sZeroRecords":
|
|
90
|
-
"<p>Suggestions</p>" +
|
|
91
|
-
"<ul>" +
|
|
92
|
-
"<li>Check the javascript regular expression syntax of the search term.</li>" +
|
|
93
|
-
"<li>Check that the correct menu option is chosen (token ID vs. user ID).</li>" +
|
|
94
|
-
"<li>Use wildcards (* to match 0 or more characters, + to match 1 or more characters, ? to match 0 or 1 character).</li>" +
|
|
95
|
-
"<li>Clear the search field, then click Search to return to the 20 most recent records.</li>" +
|
|
96
|
-
"</ul>",
|
|
97
|
-
"sSearch": ""
|
|
98
|
-
},
|
|
99
|
-
"sPaginationType": "bootstrap_input",
|
|
100
|
-
"oSearch": {
|
|
101
|
-
"sSearch": "",
|
|
102
|
-
"bRegex": true,
|
|
103
|
-
"bSmart": false
|
|
104
|
-
}
|
|
105
|
-
});
|
|
109
|
+
patternfly.pfGetUtilizationDonutTooltipContentsFn = function (units) {
|
|
110
|
+
return function (d) {
|
|
111
|
+
return '<span class="donut-tooltip-pf" style="white-space: nowrap;">' +
|
|
112
|
+
(Math.round(d[0].ratio * 1000) / 10) + '%' + ' ' + units + ' ' + d[0].name +
|
|
113
|
+
'</span>';
|
|
114
|
+
};
|
|
115
|
+
};
|
|
106
116
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
patternfly.pfGetBarChartTooltipContentsFn = function (categories) {
|
|
118
|
+
return function (d) {
|
|
119
|
+
var name = categories ? categories[d[0].index] : d[0].index;
|
|
120
|
+
return '<table class="c3-tooltip">' +
|
|
121
|
+
' <tr>' +
|
|
122
|
+
' <td><strong>' + name + ':</td>' +
|
|
123
|
+
' <td>' + d[0].value + '</td>' +
|
|
124
|
+
' </tr>' +
|
|
125
|
+
'</table>';
|
|
126
|
+
};
|
|
127
|
+
};
|
|
111
128
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
|
|
122
|
-
};
|
|
129
|
+
patternfly.pfSingleLineChartTooltipContentsFn = function (categories) {
|
|
130
|
+
return function (d) {
|
|
131
|
+
var name = categories ? categories[d[0].index] : d[0].index;
|
|
132
|
+
return '<table class="c3-tooltip">' +
|
|
133
|
+
' <tr>' +
|
|
134
|
+
' <td><strong>' + name + ':</td>' +
|
|
135
|
+
' <td>' + d[0].value + '</td>' +
|
|
136
|
+
' </tr>' +
|
|
137
|
+
'</table>';
|
|
123
138
|
};
|
|
139
|
+
};
|
|
124
140
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"fnInit": function (oSettings, nPaging, fnDraw) {
|
|
129
|
-
var fnClickHandler = function (e) {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
|
|
132
|
-
fnDraw(oSettings);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
els,
|
|
136
|
-
nInput;
|
|
141
|
+
patternfly.pfPieTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
142
|
+
return patternfly.pfDonutTooltipContents(d, defaultTitleFormat, defaultValueFormat, color);
|
|
143
|
+
};
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
$(els[1]).bind('click.DT', { action: "previous" }, fnClickHandler);
|
|
156
|
-
$(els[2]).bind('click.DT', { action: "next" }, fnClickHandler);
|
|
157
|
-
$(els[3]).bind('click.DT', { action: "last" }, fnClickHandler);
|
|
158
|
-
|
|
159
|
-
nInput = $('input', nPaging);
|
|
160
|
-
$(nInput).keyup(function (e) {
|
|
161
|
-
var iNewStart;
|
|
162
|
-
if (e.which === 38 || e.which === 39) {
|
|
163
|
-
this.value += 1;
|
|
164
|
-
} else if ((e.which === 37 || e.which === 40) && this.value > 1) {
|
|
165
|
-
this.value -= 1;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (this.value === "" || !this.value.match(/[0-9]/)) {
|
|
169
|
-
/* Nothing entered or non-numeric character */
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
iNewStart = oSettings._iDisplayLength * (this.value - 1);
|
|
174
|
-
if (iNewStart >= oSettings.fnRecordsDisplay()) {
|
|
175
|
-
/* Display overrun */
|
|
176
|
-
oSettings._iDisplayStart = (Math.ceil((oSettings.fnRecordsDisplay() - 1) /
|
|
177
|
-
oSettings._iDisplayLength) - 1) * oSettings._iDisplayLength;
|
|
178
|
-
fnDraw(oSettings);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
oSettings._iDisplayStart = iNewStart;
|
|
183
|
-
fnDraw(oSettings);
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
"fnUpdate": function (oSettings, fnDraw) {
|
|
188
|
-
var oPaging = oSettings.oInstance.fnPagingInfo(),
|
|
189
|
-
an = oSettings.aanFeatures.p,
|
|
190
|
-
ien = an.length,
|
|
191
|
-
iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength),
|
|
192
|
-
iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1,
|
|
193
|
-
i;
|
|
194
|
-
|
|
195
|
-
for (i = 0; i < ien; i += 1) {
|
|
196
|
-
$('.paginate_input', an[i]).val(iCurrentPage)
|
|
197
|
-
.siblings('.paginate_of').find('b').html(iPages);
|
|
198
|
-
|
|
199
|
-
// Add / remove disabled classes from the static elements
|
|
200
|
-
if (oPaging.iPage === 0) {
|
|
201
|
-
$('li.first', an[i]).addClass('disabled');
|
|
202
|
-
$('li.prev', an[i]).addClass('disabled');
|
|
203
|
-
} else {
|
|
204
|
-
$('li.first', an[i]).removeClass('disabled');
|
|
205
|
-
$('li.prev', an[i]).removeClass('disabled');
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
|
|
209
|
-
$('li.next', an[i]).addClass('disabled');
|
|
210
|
-
$('li.last', an[i]).addClass('disabled');
|
|
211
|
-
} else {
|
|
212
|
-
$('li.next', an[i]).removeClass('disabled');
|
|
213
|
-
$('li.last', an[i]).removeClass('disabled');
|
|
214
|
-
}
|
|
145
|
+
patternfly.c3ChartDefaults = function () {
|
|
146
|
+
var
|
|
147
|
+
getDefaultColors = function () {
|
|
148
|
+
return {
|
|
149
|
+
pattern: [
|
|
150
|
+
patternfly.pfPaletteColors.blue,
|
|
151
|
+
patternfly.pfPaletteColors.blue300,
|
|
152
|
+
patternfly.pfPaletteColors.green,
|
|
153
|
+
patternfly.pfPaletteColors.orange,
|
|
154
|
+
patternfly.pfPaletteColors.red
|
|
155
|
+
]
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
getDefaultBarGrid = function () {
|
|
159
|
+
return {
|
|
160
|
+
y: {
|
|
161
|
+
show: true
|
|
215
162
|
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}(jQuery));
|
|
221
|
-
|
|
222
|
-
// Util: definition of breakpoint sizes for tablet and desktop modes
|
|
223
|
-
(function ($) {
|
|
224
|
-
'use strict';
|
|
225
|
-
$.pfBreakpoints = {
|
|
226
|
-
'tablet': 768,
|
|
227
|
-
'desktop': 1200
|
|
228
|
-
};
|
|
229
|
-
}(jQuery));
|
|
230
|
-
|
|
231
|
-
// Util: PatternFly Collapsible Left Hand Navigation
|
|
232
|
-
// Must have navbar-toggle in navbar-pf-alt for expand/collapse
|
|
233
|
-
(function ($) {
|
|
234
|
-
|
|
235
|
-
'use strict';
|
|
236
|
-
|
|
237
|
-
$.fn.navigation = function () {
|
|
238
|
-
|
|
239
|
-
var navElement = $('.layout-pf-alt-fixed .nav-pf-vertical-alt'),
|
|
240
|
-
bodyContentElement = $('.container-pf-alt-nav-pf-vertical-alt'),
|
|
241
|
-
toggleNavBarButton = $('.navbar-toggle'),
|
|
242
|
-
explicitCollapse = false,
|
|
243
|
-
checkNavState = function () {
|
|
244
|
-
var width = $(window).width();
|
|
245
|
-
|
|
246
|
-
//Always remove the hidden & peek class
|
|
247
|
-
navElement.removeClass('hidden show-mobile-nav collapsed');
|
|
248
|
-
|
|
249
|
-
//Set the body class back to the default
|
|
250
|
-
bodyContentElement.removeClass('collapsed-nav hidden-nav');
|
|
251
|
-
|
|
252
|
-
// Check to see if the nav needs to collapse
|
|
253
|
-
if (width < $.pfBreakpoints.desktop || explicitCollapse) {
|
|
254
|
-
navElement.addClass('collapsed');
|
|
255
|
-
bodyContentElement.addClass('collapsed-nav');
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Check to see if we need to move down to the mobile state
|
|
259
|
-
if (width < $.pfBreakpoints.tablet) {
|
|
260
|
-
//Set the nav to being hidden
|
|
261
|
-
navElement.addClass('hidden');
|
|
262
|
-
|
|
263
|
-
//Make sure this is expanded
|
|
264
|
-
navElement.removeClass('collapsed');
|
|
265
|
-
|
|
266
|
-
//Set the body class to the correct state
|
|
267
|
-
bodyContentElement.removeClass('collapsed-nav');
|
|
268
|
-
bodyContentElement.addClass('hidden-nav');
|
|
269
|
-
}
|
|
163
|
+
};
|
|
270
164
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
bodyContentElement.addClass('collapsed-nav');
|
|
276
|
-
|
|
277
|
-
explicitCollapse = true;
|
|
165
|
+
getDefaultBarTooltip = function (categories) {
|
|
166
|
+
return {
|
|
167
|
+
contents: patternfly.pfGetBarChartTooltipContentsFn(categories)
|
|
168
|
+
};
|
|
278
169
|
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
170
|
+
getDefaultBarLegend = function () {
|
|
171
|
+
return {
|
|
172
|
+
show: false
|
|
173
|
+
};
|
|
282
174
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
175
|
+
getDefaultBarConfig = function (categories) {
|
|
176
|
+
return {
|
|
177
|
+
color: this.getDefaultColors(),
|
|
178
|
+
grid: this.getDefaultBarGrid(),
|
|
179
|
+
tooltip: this.getDefaultBarTooltip(categories),
|
|
180
|
+
legend: this.getDefaultBarLegend()
|
|
181
|
+
};
|
|
290
182
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (inMobileState && navElement.hasClass('show-mobile-nav')) {
|
|
297
|
-
//In mobile state just need to hide the nav
|
|
298
|
-
navElement.removeClass('show-mobile-nav');
|
|
299
|
-
} else if (inMobileState) {
|
|
300
|
-
navElement.addClass('show-mobile-nav');
|
|
301
|
-
} else if (navElement.hasClass('collapsed')) {
|
|
302
|
-
expandMenu();
|
|
303
|
-
} else {
|
|
304
|
-
collapseMenu();
|
|
183
|
+
getDefaultGroupedBarGrid = function () {
|
|
184
|
+
return {
|
|
185
|
+
y: {
|
|
186
|
+
show: true
|
|
305
187
|
}
|
|
306
|
-
}
|
|
188
|
+
};
|
|
307
189
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
},
|
|
316
|
-
init = function () {
|
|
317
|
-
//Set correct state on load
|
|
318
|
-
checkNavState();
|
|
319
|
-
|
|
320
|
-
// Bind Top level hamburger menu with menu behavior;
|
|
321
|
-
bindMenuBehavior();
|
|
322
|
-
|
|
323
|
-
//Set tooltips
|
|
324
|
-
setTooltips();
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
//Listen for the window resize event and collapse/hide as needed
|
|
328
|
-
$(window).on('resize', function () {
|
|
329
|
-
checkNavState();
|
|
330
|
-
enableTransitions();
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
init();
|
|
334
|
-
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
$(document).ready(function () {
|
|
338
|
-
if ($('.nav-pf-vertical-alt').length > 0) {
|
|
339
|
-
$.fn.navigation();
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
}(jQuery));
|
|
344
|
-
|
|
345
|
-
// Count and Display Remaining Characters
|
|
346
|
-
(function ($) {
|
|
347
|
-
|
|
348
|
-
'use strict';
|
|
349
|
-
|
|
350
|
-
$.fn.countRemainingChars = function (options) {
|
|
351
|
-
|
|
352
|
-
var settings = $.extend({
|
|
353
|
-
// These are the defaults.
|
|
354
|
-
charsMaxLimit: 100,
|
|
355
|
-
charsWarnRemaining: 5,
|
|
356
|
-
blockInputAtMaxLimit: false
|
|
357
|
-
}, options),
|
|
358
|
-
$taFld = this,
|
|
359
|
-
$countFld = $('#' + settings.countFld).text(settings.charsMaxLimit),
|
|
360
|
-
charsRemainingFn = function (charsLength) {
|
|
361
|
-
var charsRemaining = settings.charsMaxLimit - charsLength;
|
|
362
|
-
$countFld.text(charsRemaining);
|
|
363
|
-
$countFld.toggleClass('chars-warn-remaining-pf', charsRemaining <= settings.charsWarnRemaining);
|
|
364
|
-
if (charsRemaining < 0) {
|
|
365
|
-
$taFld.trigger("overCharsMaxLimitEvent", $taFld.attr('id'));
|
|
366
|
-
} else {
|
|
367
|
-
$taFld.trigger("underCharsMaxLimitEvent", $taFld.attr('id'));
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
this.on('paste', function (event) {
|
|
372
|
-
setTimeout(function () {
|
|
373
|
-
var charsLength = $taFld.val().length, maxTxt;
|
|
374
|
-
|
|
375
|
-
if (settings.blockInputAtMaxLimit && charsLength > settings.charsMaxLimit) {
|
|
376
|
-
maxTxt = $taFld.val();
|
|
377
|
-
maxTxt = maxTxt.substring(0, settings.charsMaxLimit);
|
|
378
|
-
$taFld.val(maxTxt);
|
|
379
|
-
charsLength = $taFld.val().length;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
charsRemainingFn(charsLength);
|
|
383
|
-
}, 100);
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
this.keyup(function (event) {
|
|
387
|
-
charsRemainingFn($taFld.val().length);
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
this.keydown(function (event) {
|
|
391
|
-
var charsLength = $taFld.val().length;
|
|
392
|
-
|
|
393
|
-
if (settings.blockInputAtMaxLimit && charsLength >= settings.charsMaxLimit) {
|
|
394
|
-
// Except backspace
|
|
395
|
-
if (event.keyCode !== 8) {
|
|
396
|
-
event.preventDefault();
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
return this;
|
|
402
|
-
};
|
|
403
|
-
}(jQuery));
|
|
404
|
-
|
|
405
|
-
// Util: PatternFly Palette colors
|
|
406
|
-
(function ($) {
|
|
407
|
-
'use strict';
|
|
408
|
-
|
|
409
|
-
$.pfPaletteColors = {
|
|
410
|
-
black: '#030303',
|
|
411
|
-
black100: '#fafafa',
|
|
412
|
-
black200: '#ededed',
|
|
413
|
-
black300: '#d1d1d1',
|
|
414
|
-
black400: '#bbbbbb',
|
|
415
|
-
black500: '#8b8d8f',
|
|
416
|
-
black600: '#72767b',
|
|
417
|
-
black700: '#4d5258',
|
|
418
|
-
black800: '#393f44',
|
|
419
|
-
black900: '#292e34',
|
|
420
|
-
blue: '#0088ce',
|
|
421
|
-
blue100: '#bee1f4',
|
|
422
|
-
blue200: '#7dc3e8',
|
|
423
|
-
blue300: '#39a5dc',
|
|
424
|
-
blue400: '#0088ce',
|
|
425
|
-
blue500: '#00659c',
|
|
426
|
-
blue600: '#004368',
|
|
427
|
-
blue700: '#002235',
|
|
428
|
-
gold: '#f0ab00',
|
|
429
|
-
gold100: '#fbeabc',
|
|
430
|
-
gold200: '#f9d67a',
|
|
431
|
-
gold300: '#f5c12e',
|
|
432
|
-
gold400: '#f0ab00',
|
|
433
|
-
gold500: '#b58100',
|
|
434
|
-
gold600: '#795600',
|
|
435
|
-
gold700: '#3d2c00',
|
|
436
|
-
orange: '#ec7a08',
|
|
437
|
-
orange100: '#fbdebf',
|
|
438
|
-
orange200: '#f7bd7f',
|
|
439
|
-
orange300: '#f39d3c',
|
|
440
|
-
orange400: '#ec7a08',
|
|
441
|
-
orange500: '#b35c00',
|
|
442
|
-
orange600: '#773d00',
|
|
443
|
-
orange700: '#3b1f00',
|
|
444
|
-
lightBlue: '#00b9e4',
|
|
445
|
-
lightBlue100: '#beedf9',
|
|
446
|
-
lightBlue200: '#7cdbf3',
|
|
447
|
-
lightBlue300: '#35caed',
|
|
448
|
-
lightBlue400: '#00b9e4',
|
|
449
|
-
lightBlue500: '#008bad',
|
|
450
|
-
lightBlue600: '#005c73',
|
|
451
|
-
lightBlue700: '#002d39',
|
|
452
|
-
green: '#3f9c35',
|
|
453
|
-
green100: '#cfe7cd',
|
|
454
|
-
green200: '#9ecf99',
|
|
455
|
-
green300: '#6ec664',
|
|
456
|
-
green400: '#3f9c35',
|
|
457
|
-
green500: '#2d7623',
|
|
458
|
-
green600: '#1e4f18',
|
|
459
|
-
green700: '#0f280d',
|
|
460
|
-
lightGreen: '#92d400',
|
|
461
|
-
lightGreen100: '#e4f5bc',
|
|
462
|
-
lightGreen200: '#c8eb79',
|
|
463
|
-
lightGreen300: '#ace12e',
|
|
464
|
-
lightGreen400: '#92d400',
|
|
465
|
-
lightGreen500: '#6ca100',
|
|
466
|
-
lightGreen600: '#486b00',
|
|
467
|
-
lightGreen700: '#253600',
|
|
468
|
-
cyan: '#007a87',
|
|
469
|
-
cyan100: '#bedee1',
|
|
470
|
-
cyan200: '#7dbdc3',
|
|
471
|
-
cyan300: '#3a9ca6',
|
|
472
|
-
cyan400: '#007a87',
|
|
473
|
-
cyan500: '#005c66',
|
|
474
|
-
cyan600: '#003d44',
|
|
475
|
-
cyan700: '#001f22',
|
|
476
|
-
purple: '#703fec',
|
|
477
|
-
purple100: '#c7bfff',
|
|
478
|
-
purple200: '#a18fff',
|
|
479
|
-
purple300: '#8461f7',
|
|
480
|
-
purple400: '#703fec',
|
|
481
|
-
purple500: '#582fc0',
|
|
482
|
-
purple600: '#40199a',
|
|
483
|
-
purple700: '#1f0066',
|
|
484
|
-
red: '#cc0000',
|
|
485
|
-
red100: '#cc0000',
|
|
486
|
-
red200: '#a30000',
|
|
487
|
-
red300: '#8b0000',
|
|
488
|
-
red400: '#470000',
|
|
489
|
-
red500: '#2c0000'
|
|
490
|
-
};
|
|
491
|
-
}(jQuery));
|
|
492
|
-
|
|
493
|
-
// Util: PatternFly C3 Chart Defaults
|
|
494
|
-
(function ($) {
|
|
495
|
-
'use strict';
|
|
496
|
-
|
|
497
|
-
$.fn.pfSetDonutChartTitle = function (selector, primary, secondary) {
|
|
498
|
-
var donutChartRightTitle = window.d3.select(selector).select('text.c3-chart-arcs-title');
|
|
499
|
-
donutChartRightTitle.text("");
|
|
500
|
-
donutChartRightTitle.insert('tspan').text(primary).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
|
|
501
|
-
donutChartRightTitle.insert('tspan').text(secondary).classed('donut-title-small-pf', true).attr('dy', 20).attr('x', 0);
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
$.fn.pfDonutTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
505
|
-
return '<table class="c3-tooltip">' +
|
|
506
|
-
' <tr>' +
|
|
507
|
-
' <td><span style="background-color:' + color(d[0].id) + '"></span>' + '<strong>' + d[0].value + '</strong> ' + d[0].name + '</td>' +
|
|
508
|
-
' <td>' + (Math.round(d[0].ratio * 1000) / 10) + '%</td>' +
|
|
509
|
-
' </tr>' +
|
|
510
|
-
'</table>';
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
$.fn.pfGetUtilizationDonutTooltipContentsFn = function (units) {
|
|
514
|
-
return function (d) {
|
|
515
|
-
return '<span class="donut-tooltip-pf" style="white-space: nowrap;">' +
|
|
516
|
-
(Math.round(d[0].ratio * 1000) / 10) + '%' + ' ' + units + ' ' + d[0].name +
|
|
517
|
-
'</span>';
|
|
518
|
-
};
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
$.fn.pfGetBarChartTooltipContentsFn = function (categories) {
|
|
522
|
-
return function (d) {
|
|
523
|
-
var name = categories ? categories[d[0].index] : d[0].index;
|
|
524
|
-
return '<table class="c3-tooltip">' +
|
|
525
|
-
' <tr>' +
|
|
526
|
-
' <td><strong>' + name + ':</td>' +
|
|
527
|
-
' <td>' + d[0].value + '</td>' +
|
|
528
|
-
' </tr>' +
|
|
529
|
-
'</table>';
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
$.fn.pfSingleLineChartTooltipContentsFn = function (categories) {
|
|
534
|
-
return function (d) {
|
|
535
|
-
var name = categories ? categories[d[0].index] : d[0].index;
|
|
536
|
-
return '<table class="c3-tooltip">' +
|
|
537
|
-
' <tr>' +
|
|
538
|
-
' <td><strong>' + name + ':</td>' +
|
|
539
|
-
' <td>' + d[0].value + '</td>' +
|
|
540
|
-
' </tr>' +
|
|
541
|
-
'</table>';
|
|
542
|
-
};
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
$.fn.pfPieTooltipContents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
546
|
-
return $().pfDonutTooltipContents(d, defaultTitleFormat, defaultValueFormat, color);
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
$.fn.c3ChartDefaults = function () {
|
|
550
|
-
var
|
|
551
|
-
getDefaultColors = function () {
|
|
552
|
-
return {
|
|
553
|
-
pattern: [
|
|
554
|
-
$.pfPaletteColors.blue,
|
|
555
|
-
$.pfPaletteColors.blue300,
|
|
556
|
-
$.pfPaletteColors.green,
|
|
557
|
-
$.pfPaletteColors.orange,
|
|
558
|
-
$.pfPaletteColors.red
|
|
559
|
-
]
|
|
560
|
-
};
|
|
561
|
-
},
|
|
562
|
-
getDefaultBarGrid = function () {
|
|
563
|
-
return {
|
|
564
|
-
y: {
|
|
565
|
-
show: true
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
},
|
|
569
|
-
getDefaultBarTooltip = function (categories) {
|
|
570
|
-
return {
|
|
571
|
-
contents: $().pfGetBarChartTooltipContentsFn(categories)
|
|
572
|
-
};
|
|
573
|
-
},
|
|
574
|
-
getDefaultBarLegend = function () {
|
|
575
|
-
return {
|
|
576
|
-
show: false
|
|
577
|
-
};
|
|
578
|
-
},
|
|
579
|
-
getDefaultBarConfig = function (categories) {
|
|
580
|
-
return {
|
|
581
|
-
color: this.getDefaultColors(),
|
|
582
|
-
grid: this.getDefaultBarGrid(),
|
|
583
|
-
tooltip: this.getDefaultBarTooltip(categories),
|
|
584
|
-
legend: this.getDefaultBarLegend()
|
|
585
|
-
};
|
|
586
|
-
},
|
|
587
|
-
getDefaultGroupedBarGrid = function () {
|
|
588
|
-
return {
|
|
589
|
-
y: {
|
|
590
|
-
show: true
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
},
|
|
594
|
-
getDefaultGroupedBarLegend = function () {
|
|
595
|
-
return {
|
|
596
|
-
show: true,
|
|
597
|
-
position: 'bottom'
|
|
598
|
-
};
|
|
190
|
+
getDefaultGroupedBarLegend = function () {
|
|
191
|
+
return {
|
|
192
|
+
show: true,
|
|
193
|
+
position: 'bottom'
|
|
194
|
+
};
|
|
599
195
|
},
|
|
600
196
|
getDefaultGroupedBarConfig = function () {
|
|
601
197
|
return {
|
|
@@ -622,8 +218,8 @@
|
|
|
622
218
|
getDefaultDonutColors = function () {
|
|
623
219
|
return {
|
|
624
220
|
pattern: [
|
|
625
|
-
|
|
626
|
-
|
|
221
|
+
patternfly.pfPaletteColors.blue,
|
|
222
|
+
patternfly.pfPaletteColors.black300
|
|
627
223
|
]
|
|
628
224
|
};
|
|
629
225
|
},
|
|
@@ -663,8 +259,8 @@
|
|
|
663
259
|
getDefaultPieColors = function () {
|
|
664
260
|
return {
|
|
665
261
|
pattern: [
|
|
666
|
-
|
|
667
|
-
|
|
262
|
+
patternfly.pfPaletteColors.blue,
|
|
263
|
+
patternfly.pfPaletteColors.black300
|
|
668
264
|
]
|
|
669
265
|
};
|
|
670
266
|
},
|
|
@@ -812,85 +408,529 @@
|
|
|
812
408
|
getDefaultAreaGrid = function () {
|
|
813
409
|
return getDefaultLineGrid();
|
|
814
410
|
},
|
|
815
|
-
getDefaultAreaLegend = function () {
|
|
816
|
-
return getDefaultLineLegend();
|
|
411
|
+
getDefaultAreaLegend = function () {
|
|
412
|
+
return getDefaultLineLegend();
|
|
413
|
+
},
|
|
414
|
+
getDefaultAreaPoint = function () {
|
|
415
|
+
return getDefaultLinePoint();
|
|
416
|
+
},
|
|
417
|
+
getDefaultAreaConfig = function () {
|
|
418
|
+
return {
|
|
419
|
+
axis: getDefaultAreaAxis(),
|
|
420
|
+
grid: getDefaultAreaGrid(),
|
|
421
|
+
color: getDefaultColors(),
|
|
422
|
+
legend: getDefaultAreaLegend(),
|
|
423
|
+
point: getDefaultAreaPoint()
|
|
424
|
+
};
|
|
425
|
+
},
|
|
426
|
+
getDefaultSingleAreaTooltip = function () {
|
|
427
|
+
return {
|
|
428
|
+
contents: $().pfGetBarChartTooltipContentsFn()
|
|
429
|
+
};
|
|
430
|
+
},
|
|
431
|
+
getDefaultSingleAreaLegend = function () {
|
|
432
|
+
return getDefaultSingleLineLegend();
|
|
433
|
+
},
|
|
434
|
+
getDefaultSingleAreaConfig = function () {
|
|
435
|
+
return {
|
|
436
|
+
axis: getDefaultAreaAxis(),
|
|
437
|
+
grid: getDefaultAreaGrid(),
|
|
438
|
+
color: getDefaultColors(),
|
|
439
|
+
legend: getDefaultSingleAreaLegend(),
|
|
440
|
+
point: getDefaultAreaPoint(),
|
|
441
|
+
tooltip: getDefaultSingleAreaTooltip()
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
return {
|
|
445
|
+
getDefaultColors: getDefaultColors,
|
|
446
|
+
getDefaultBarGrid: getDefaultBarGrid,
|
|
447
|
+
getDefaultBarTooltip: getDefaultBarTooltip,
|
|
448
|
+
getDefaultBarLegend: getDefaultBarLegend,
|
|
449
|
+
getDefaultBarConfig: getDefaultBarConfig,
|
|
450
|
+
getDefaultGroupedBarGrid: getDefaultGroupedBarGrid,
|
|
451
|
+
getDefaultGroupedBarLegend: getDefaultGroupedBarLegend,
|
|
452
|
+
getDefaultGroupedBarConfig: getDefaultGroupedBarConfig,
|
|
453
|
+
getDefaultDonut: getDefaultDonut,
|
|
454
|
+
getDefaultDonutSize: getDefaultDonutSize,
|
|
455
|
+
getDefaultDonutColors: getDefaultDonutColors,
|
|
456
|
+
getDefaultDonutTooltip: getDefaultDonutTooltip,
|
|
457
|
+
getDefaultDonutLegend: getDefaultDonutLegend,
|
|
458
|
+
getDefaultDonutConfig: getDefaultDonutConfig,
|
|
459
|
+
getDefaultPie: getDefaultPie,
|
|
460
|
+
getDefaultPieSize: getDefaultPieSize,
|
|
461
|
+
getDefaultPieColors: getDefaultPieColors,
|
|
462
|
+
getDefaultPieTooltip: getDefaultPieTooltip,
|
|
463
|
+
getDefaultPieLegend: getDefaultPieLegend,
|
|
464
|
+
getDefaultPieConfig: getDefaultPieConfig,
|
|
465
|
+
getDefaultSparklineArea: getDefaultSparklineArea,
|
|
466
|
+
getDefaultSparklineSize: getDefaultSparklineSize,
|
|
467
|
+
getDefaultSparklineAxis: getDefaultSparklineAxis,
|
|
468
|
+
getDefaultSparklineLegend: getDefaultSparklineLegend,
|
|
469
|
+
getDefaultSparklinePoint: getDefaultSparklinePoint,
|
|
470
|
+
getDefaultSparklineTooltip: getDefaultSparklineTooltip,
|
|
471
|
+
getDefaultSparklineConfig: getDefaultSparklineConfig,
|
|
472
|
+
getDefaultLineAxis: getDefaultLineAxis,
|
|
473
|
+
getDefaultLineGrid: getDefaultLineGrid,
|
|
474
|
+
getDefaultLineLegend: getDefaultLineLegend,
|
|
475
|
+
getDefaultLinePoint: getDefaultLinePoint,
|
|
476
|
+
getDefaultLineConfig: getDefaultLineConfig,
|
|
477
|
+
getDefaultSingleLineTooltip: getDefaultSingleLineTooltip,
|
|
478
|
+
getDefaultSingleLineConfig: getDefaultSingleLineConfig,
|
|
479
|
+
getDefaultAreaAxis: getDefaultAreaAxis,
|
|
480
|
+
getDefaultAreaGrid: getDefaultAreaGrid,
|
|
481
|
+
getDefaultAreaLegend: getDefaultAreaLegend,
|
|
482
|
+
getDefaultAreaPoint: getDefaultAreaPoint,
|
|
483
|
+
getDefaultAreaConfig: getDefaultAreaConfig,
|
|
484
|
+
getDefaultSingleAreaTooltip: getDefaultSingleAreaTooltip,
|
|
485
|
+
getDefaultSingleAreaConfig: getDefaultSingleAreaConfig
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
// definition of breakpoint sizes for tablet and desktop modes
|
|
490
|
+
patternfly.pfBreakpoints = {
|
|
491
|
+
'tablet': 768,
|
|
492
|
+
'desktop': 1200
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
if (typeof define === 'function' && define.amd) {
|
|
496
|
+
define("patternfly", function () {
|
|
497
|
+
return patternfly;
|
|
498
|
+
});
|
|
499
|
+
} else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
|
|
500
|
+
module.exports = patternfly;
|
|
501
|
+
} else {
|
|
502
|
+
window.patternfly = patternfly;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
})(window);
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
// Util: PatternFly Sidebar
|
|
509
|
+
// Set height of sidebar-pf to height of document minus height of navbar-pf if not mobile
|
|
510
|
+
(function ($) {
|
|
511
|
+
'use strict';
|
|
512
|
+
$.fn.sidebar = function () {
|
|
513
|
+
var documentHeight = 0,
|
|
514
|
+
navbarpfHeight = 0,
|
|
515
|
+
colHeight = 0;
|
|
516
|
+
|
|
517
|
+
if ($('.navbar-pf .navbar-toggle').is(':hidden')) {
|
|
518
|
+
documentHeight = $(document).height();
|
|
519
|
+
navbarpfHeight = $('.navbar-pf').outerHeight();
|
|
520
|
+
colHeight = documentHeight - navbarpfHeight;
|
|
521
|
+
}
|
|
522
|
+
$('.sidebar-pf').parent('.row').children('[class*="col-"]').css({"min-height" : colHeight});
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
$(document).ready(function () {
|
|
526
|
+
// Call sidebar() on ready if .sidebar-pf exists and .datatable does not exist
|
|
527
|
+
if ($('.sidebar-pf').length > 0 && $('.datatable').length === 0) {
|
|
528
|
+
$.fn.sidebar();
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
$(window).resize(function () {
|
|
533
|
+
// Call sidebar() on resize if .sidebar-pf exists
|
|
534
|
+
if ($('.sidebar-pf').length > 0) {
|
|
535
|
+
$.fn.sidebar();
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}(jQuery));
|
|
539
|
+
|
|
540
|
+
// Util: PatternFly Popovers
|
|
541
|
+
// Add data-close="true" to insert close X icon
|
|
542
|
+
(function ($) {
|
|
543
|
+
'use strict';
|
|
544
|
+
|
|
545
|
+
$.fn.popovers = function () {
|
|
546
|
+
// Initialize
|
|
547
|
+
this.popover();
|
|
548
|
+
|
|
549
|
+
// Add close icons
|
|
550
|
+
this.filter('[data-close=true]').each(function (index, element) {
|
|
551
|
+
var $this = $(element),
|
|
552
|
+
title = $this.attr('data-original-title') + '<button type="button" class="close" aria-hidden="true"><span class="pficon pficon-close"></span></button>';
|
|
553
|
+
|
|
554
|
+
$this.attr('data-original-title', title);
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// Bind Close Icon to Toggle Display
|
|
558
|
+
this.on('click', function (e) {
|
|
559
|
+
var $this = $(this),
|
|
560
|
+
$title = $this.next('.popover').find('.popover-title');
|
|
561
|
+
|
|
562
|
+
// Only if data-close is true add class "x" to title for right padding
|
|
563
|
+
$title.find('.close').parent('.popover-title').addClass('closable');
|
|
564
|
+
|
|
565
|
+
// Bind x icon to close popover
|
|
566
|
+
$title.find('.close').on('click', function () {
|
|
567
|
+
$this.popover('hide');
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
// Prevent href="#" page scroll to top
|
|
571
|
+
e.preventDefault();
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
return this;
|
|
575
|
+
};
|
|
576
|
+
}(jQuery));
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
// Util: DataTables Settings
|
|
580
|
+
(function ($) {
|
|
581
|
+
'use strict';
|
|
582
|
+
if ($.fn.dataTableExt) {
|
|
583
|
+
/* Set the defaults for DataTables initialisation */
|
|
584
|
+
$.extend(true, $.fn.dataTable.defaults, {
|
|
585
|
+
"bDestroy": true,
|
|
586
|
+
"bAutoWidth": false,
|
|
587
|
+
"iDisplayLength": 20,
|
|
588
|
+
"sDom":
|
|
589
|
+
"<'dataTables_header' f i r >" +
|
|
590
|
+
"<'table-responsive' t >" +
|
|
591
|
+
"<'dataTables_footer' p >",
|
|
592
|
+
"oLanguage": {
|
|
593
|
+
"sInfo": "Showing <b>_START_</b> to <b>_END_</b> of <b>_TOTAL_</b> Items",
|
|
594
|
+
"sInfoFiltered" : "(of <b>_MAX_</b>)",
|
|
595
|
+
"sInfoEmpty" : "Showing <b>0</b> Results",
|
|
596
|
+
"sZeroRecords":
|
|
597
|
+
"<p>Suggestions</p>" +
|
|
598
|
+
"<ul>" +
|
|
599
|
+
"<li>Check the javascript regular expression syntax of the search term.</li>" +
|
|
600
|
+
"<li>Check that the correct menu option is chosen (token ID vs. user ID).</li>" +
|
|
601
|
+
"<li>Use wildcards (* to match 0 or more characters, + to match 1 or more characters, ? to match 0 or 1 character).</li>" +
|
|
602
|
+
"<li>Clear the search field, then click Search to return to the 20 most recent records.</li>" +
|
|
603
|
+
"</ul>",
|
|
604
|
+
"sSearch": ""
|
|
605
|
+
},
|
|
606
|
+
"sPaginationType": "bootstrap_input",
|
|
607
|
+
"oSearch": {
|
|
608
|
+
"sSearch": "",
|
|
609
|
+
"bRegex": true,
|
|
610
|
+
"bSmart": false
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
/* Default class modification */
|
|
615
|
+
$.extend($.fn.dataTableExt.oStdClasses, {
|
|
616
|
+
"sWrapper": "dataTables_wrapper"
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
/* API method to get paging information */
|
|
620
|
+
$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
|
|
621
|
+
return {
|
|
622
|
+
"iStart": oSettings._iDisplayStart,
|
|
623
|
+
"iEnd": oSettings.fnDisplayEnd(),
|
|
624
|
+
"iLength": oSettings._iDisplayLength,
|
|
625
|
+
"iTotal": oSettings.fnRecordsTotal(),
|
|
626
|
+
"iFilteredTotal": oSettings.fnRecordsDisplay(),
|
|
627
|
+
"iPage": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
|
|
628
|
+
"iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
/* Combination of Bootstrap + Input Text style pagination control */
|
|
633
|
+
$.extend($.fn.dataTableExt.oPagination, {
|
|
634
|
+
"bootstrap_input": {
|
|
635
|
+
"fnInit": function (oSettings, nPaging, fnDraw) {
|
|
636
|
+
var fnClickHandler = function (e) {
|
|
637
|
+
e.preventDefault();
|
|
638
|
+
if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
|
|
639
|
+
fnDraw(oSettings);
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
els,
|
|
643
|
+
nInput;
|
|
644
|
+
|
|
645
|
+
$(nPaging).append(
|
|
646
|
+
'<ul class="pagination">' +
|
|
647
|
+
' <li class="first disabled"><span class="i fa fa-angle-double-left"></span></li>' +
|
|
648
|
+
' <li class="prev disabled"><span class="i fa fa-angle-left"></span></li>' +
|
|
649
|
+
'</ul>' +
|
|
650
|
+
'<div class="pagination-input">' +
|
|
651
|
+
' <input type="text" class="paginate_input">' +
|
|
652
|
+
' <span class="paginate_of">of <b>3</b></span>' +
|
|
653
|
+
'</div>' +
|
|
654
|
+
'<ul class="pagination">' +
|
|
655
|
+
' <li class="next disabled"><span class="i fa fa-angle-right"></span></li>' +
|
|
656
|
+
' <li class="last disabled"><span class="i fa fa-angle-double-right"></span></li>' +
|
|
657
|
+
'</ul>'
|
|
658
|
+
);
|
|
659
|
+
|
|
660
|
+
els = $('li', nPaging);
|
|
661
|
+
$(els[0]).bind('click.DT', { action: "first" }, fnClickHandler);
|
|
662
|
+
$(els[1]).bind('click.DT', { action: "previous" }, fnClickHandler);
|
|
663
|
+
$(els[2]).bind('click.DT', { action: "next" }, fnClickHandler);
|
|
664
|
+
$(els[3]).bind('click.DT', { action: "last" }, fnClickHandler);
|
|
665
|
+
|
|
666
|
+
nInput = $('input', nPaging);
|
|
667
|
+
$(nInput).keyup(function (e) {
|
|
668
|
+
var iNewStart;
|
|
669
|
+
if (e.which === 38 || e.which === 39) {
|
|
670
|
+
this.value += 1;
|
|
671
|
+
} else if ((e.which === 37 || e.which === 40) && this.value > 1) {
|
|
672
|
+
this.value -= 1;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (this.value === "" || !this.value.match(/[0-9]/)) {
|
|
676
|
+
/* Nothing entered or non-numeric character */
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
iNewStart = oSettings._iDisplayLength * (this.value - 1);
|
|
681
|
+
if (iNewStart >= oSettings.fnRecordsDisplay()) {
|
|
682
|
+
/* Display overrun */
|
|
683
|
+
oSettings._iDisplayStart = (Math.ceil((oSettings.fnRecordsDisplay() - 1) /
|
|
684
|
+
oSettings._iDisplayLength) - 1) * oSettings._iDisplayLength;
|
|
685
|
+
fnDraw(oSettings);
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
oSettings._iDisplayStart = iNewStart;
|
|
690
|
+
fnDraw(oSettings);
|
|
691
|
+
});
|
|
692
|
+
},
|
|
693
|
+
|
|
694
|
+
"fnUpdate": function (oSettings, fnDraw) {
|
|
695
|
+
var oPaging = oSettings.oInstance.fnPagingInfo(),
|
|
696
|
+
an = oSettings.aanFeatures.p,
|
|
697
|
+
ien = an.length,
|
|
698
|
+
iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength),
|
|
699
|
+
iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1,
|
|
700
|
+
i;
|
|
701
|
+
|
|
702
|
+
for (i = 0; i < ien; i += 1) {
|
|
703
|
+
$('.paginate_input', an[i]).val(iCurrentPage)
|
|
704
|
+
.siblings('.paginate_of').find('b').html(iPages);
|
|
705
|
+
|
|
706
|
+
// Add / remove disabled classes from the static elements
|
|
707
|
+
if (oPaging.iPage === 0) {
|
|
708
|
+
$('li.first', an[i]).addClass('disabled');
|
|
709
|
+
$('li.prev', an[i]).addClass('disabled');
|
|
710
|
+
} else {
|
|
711
|
+
$('li.first', an[i]).removeClass('disabled');
|
|
712
|
+
$('li.prev', an[i]).removeClass('disabled');
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
|
|
716
|
+
$('li.next', an[i]).addClass('disabled');
|
|
717
|
+
$('li.last', an[i]).addClass('disabled');
|
|
718
|
+
} else {
|
|
719
|
+
$('li.next', an[i]).removeClass('disabled');
|
|
720
|
+
$('li.last', an[i]).removeClass('disabled');
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
}(jQuery));
|
|
728
|
+
|
|
729
|
+
// Util: definition of breakpoint sizes for tablet and desktop modes
|
|
730
|
+
(function ($) {
|
|
731
|
+
'use strict';
|
|
732
|
+
if (patternfly !== undefined) {
|
|
733
|
+
$.pfBreakpoints = patternfly.pfBreakpoints;
|
|
734
|
+
}
|
|
735
|
+
}(jQuery));
|
|
736
|
+
|
|
737
|
+
// Util: PatternFly Collapsible Left Hand Navigation
|
|
738
|
+
// Must have navbar-toggle in navbar-pf-alt for expand/collapse
|
|
739
|
+
(function ($) {
|
|
740
|
+
|
|
741
|
+
'use strict';
|
|
742
|
+
|
|
743
|
+
$.fn.navigation = function () {
|
|
744
|
+
|
|
745
|
+
var navElement = $('.layout-pf-alt-fixed .nav-pf-vertical-alt'),
|
|
746
|
+
bodyContentElement = $('.container-pf-alt-nav-pf-vertical-alt'),
|
|
747
|
+
toggleNavBarButton = $('.navbar-toggle'),
|
|
748
|
+
explicitCollapse = false,
|
|
749
|
+
checkNavState = function () {
|
|
750
|
+
var width = $(window).width();
|
|
751
|
+
|
|
752
|
+
//Always remove the hidden & peek class
|
|
753
|
+
navElement.removeClass('hidden show-mobile-nav collapsed');
|
|
754
|
+
|
|
755
|
+
//Set the body class back to the default
|
|
756
|
+
bodyContentElement.removeClass('collapsed-nav hidden-nav');
|
|
757
|
+
|
|
758
|
+
// Check to see if the nav needs to collapse
|
|
759
|
+
if (width < $.pfBreakpoints.desktop || explicitCollapse) {
|
|
760
|
+
navElement.addClass('collapsed');
|
|
761
|
+
bodyContentElement.addClass('collapsed-nav');
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// Check to see if we need to move down to the mobile state
|
|
765
|
+
if (width < $.pfBreakpoints.tablet) {
|
|
766
|
+
//Set the nav to being hidden
|
|
767
|
+
navElement.addClass('hidden');
|
|
768
|
+
|
|
769
|
+
//Make sure this is expanded
|
|
770
|
+
navElement.removeClass('collapsed');
|
|
771
|
+
|
|
772
|
+
//Set the body class to the correct state
|
|
773
|
+
bodyContentElement.removeClass('collapsed-nav');
|
|
774
|
+
bodyContentElement.addClass('hidden-nav');
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
collapseMenu = function () {
|
|
778
|
+
//Make sure this is expanded
|
|
779
|
+
navElement.addClass('collapsed');
|
|
780
|
+
//Set the body class to the correct state
|
|
781
|
+
bodyContentElement.addClass('collapsed-nav');
|
|
782
|
+
|
|
783
|
+
explicitCollapse = true;
|
|
817
784
|
},
|
|
818
|
-
|
|
819
|
-
|
|
785
|
+
enableTransitions = function () {
|
|
786
|
+
// enable transitions only when toggleNavBarButton is clicked or window is resized
|
|
787
|
+
$('html').addClass('transitions');
|
|
820
788
|
},
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
};
|
|
789
|
+
expandMenu = function () {
|
|
790
|
+
//Make sure this is expanded
|
|
791
|
+
navElement.removeClass('collapsed');
|
|
792
|
+
//Set the body class to the correct state
|
|
793
|
+
bodyContentElement.removeClass('collapsed-nav');
|
|
794
|
+
|
|
795
|
+
explicitCollapse = false;
|
|
829
796
|
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
797
|
+
bindMenuBehavior = function () {
|
|
798
|
+
toggleNavBarButton.on('click', function (e) {
|
|
799
|
+
var inMobileState = bodyContentElement.hasClass('hidden-nav');
|
|
800
|
+
enableTransitions();
|
|
801
|
+
|
|
802
|
+
if (inMobileState && navElement.hasClass('show-mobile-nav')) {
|
|
803
|
+
//In mobile state just need to hide the nav
|
|
804
|
+
navElement.removeClass('show-mobile-nav');
|
|
805
|
+
} else if (inMobileState) {
|
|
806
|
+
navElement.addClass('show-mobile-nav');
|
|
807
|
+
} else if (navElement.hasClass('collapsed')) {
|
|
808
|
+
expandMenu();
|
|
809
|
+
} else {
|
|
810
|
+
collapseMenu();
|
|
811
|
+
}
|
|
812
|
+
});
|
|
834
813
|
},
|
|
835
|
-
|
|
836
|
-
|
|
814
|
+
setTooltips = function () {
|
|
815
|
+
$('.nav-pf-vertical-alt [data-toggle="tooltip"]').tooltip({'container': 'body', 'delay': { 'show': '500', 'hide': '200' }});
|
|
816
|
+
|
|
817
|
+
$(".nav-pf-vertical-alt").on("show.bs.tooltip", function (e) {
|
|
818
|
+
return $(this).hasClass("collapsed");
|
|
819
|
+
});
|
|
820
|
+
|
|
837
821
|
},
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
822
|
+
init = function () {
|
|
823
|
+
//Set correct state on load
|
|
824
|
+
checkNavState();
|
|
825
|
+
|
|
826
|
+
// Bind Top level hamburger menu with menu behavior;
|
|
827
|
+
bindMenuBehavior();
|
|
828
|
+
|
|
829
|
+
//Set tooltips
|
|
830
|
+
setTooltips();
|
|
847
831
|
};
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
832
|
+
|
|
833
|
+
//Listen for the window resize event and collapse/hide as needed
|
|
834
|
+
$(window).on('resize', function () {
|
|
835
|
+
checkNavState();
|
|
836
|
+
enableTransitions();
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
init();
|
|
840
|
+
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
$(document).ready(function () {
|
|
844
|
+
if ($('.nav-pf-vertical-alt').length > 0) {
|
|
845
|
+
$.fn.navigation();
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
}(jQuery));
|
|
850
|
+
|
|
851
|
+
// Count and Display Remaining Characters
|
|
852
|
+
(function ($) {
|
|
853
|
+
|
|
854
|
+
'use strict';
|
|
855
|
+
|
|
856
|
+
$.fn.countRemainingChars = function (options) {
|
|
857
|
+
|
|
858
|
+
var settings = $.extend({
|
|
859
|
+
// These are the defaults.
|
|
860
|
+
charsMaxLimit: 100,
|
|
861
|
+
charsWarnRemaining: 5,
|
|
862
|
+
blockInputAtMaxLimit: false
|
|
863
|
+
}, options),
|
|
864
|
+
$taFld = this,
|
|
865
|
+
$countFld = $('#' + settings.countFld).text(settings.charsMaxLimit),
|
|
866
|
+
charsRemainingFn = function (charsLength) {
|
|
867
|
+
var charsRemaining = settings.charsMaxLimit - charsLength;
|
|
868
|
+
$countFld.text(charsRemaining);
|
|
869
|
+
$countFld.toggleClass('chars-warn-remaining-pf', charsRemaining <= settings.charsWarnRemaining);
|
|
870
|
+
if (charsRemaining < 0) {
|
|
871
|
+
$taFld.trigger("overCharsMaxLimitEvent", $taFld.attr('id'));
|
|
872
|
+
} else {
|
|
873
|
+
$taFld.trigger("underCharsMaxLimitEvent", $taFld.attr('id'));
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
this.on('paste', function (event) {
|
|
878
|
+
setTimeout(function () {
|
|
879
|
+
var charsLength = $taFld.val().length, maxTxt;
|
|
880
|
+
|
|
881
|
+
if (settings.blockInputAtMaxLimit && charsLength > settings.charsMaxLimit) {
|
|
882
|
+
maxTxt = $taFld.val();
|
|
883
|
+
maxTxt = maxTxt.substring(0, settings.charsMaxLimit);
|
|
884
|
+
$taFld.val(maxTxt);
|
|
885
|
+
charsLength = $taFld.val().length;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
charsRemainingFn(charsLength);
|
|
889
|
+
}, 100);
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
this.keyup(function (event) {
|
|
893
|
+
charsRemainingFn($taFld.val().length);
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
this.keydown(function (event) {
|
|
897
|
+
var charsLength = $taFld.val().length;
|
|
898
|
+
|
|
899
|
+
if (settings.blockInputAtMaxLimit && charsLength >= settings.charsMaxLimit) {
|
|
900
|
+
// Except backspace
|
|
901
|
+
if (event.keyCode !== 8) {
|
|
902
|
+
event.preventDefault();
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
return this;
|
|
891
908
|
};
|
|
892
909
|
}(jQuery));
|
|
893
910
|
|
|
911
|
+
// Util: PatternFly Palette colors
|
|
912
|
+
(function ($) {
|
|
913
|
+
'use strict';
|
|
914
|
+
|
|
915
|
+
if (patternfly !== undefined) {
|
|
916
|
+
$.pfPaletteColors = patternfly.pfPaletteColors;
|
|
917
|
+
}
|
|
918
|
+
}(jQuery));
|
|
919
|
+
|
|
920
|
+
// Util: PatternFly C3 Chart Defaults
|
|
921
|
+
(function ($) {
|
|
922
|
+
'use strict';
|
|
923
|
+
if (patternfly !== undefined) {
|
|
924
|
+
$.fn.pfSetDonutChartTitle = patternfly.pfSetDonutChartTitle;
|
|
925
|
+
$.fn.pfDonutTooltipContents = patternfly.pfDonutTooltipContents;
|
|
926
|
+
$.fn.pfGetUtilizationDonutTooltipContentsFn = patternfly.pfGetUtilizationDonutTooltipContentsFn;
|
|
927
|
+
$.fn.pfGetBarChartTooltipContentsFn = patternfly.pfGetBarChartTooltipContentsFn;
|
|
928
|
+
$.fn.pfSingleLineChartTooltipContentsFn = patternfly.pfSingleLineChartTooltipContentsFn;
|
|
929
|
+
$.fn.pfPieTooltipContents = patternfly.pfPieTooltipContents;
|
|
930
|
+
$.fn.c3ChartDefaults = patternfly.c3ChartDefaults;
|
|
931
|
+
}
|
|
932
|
+
}(jQuery));
|
|
933
|
+
|
|
894
934
|
// Util: PatternFly Collapse with fixed heights
|
|
895
935
|
// Update the max-height of collapse elements based on the parent container's height.
|
|
896
936
|
(function ($) {
|