Skip to content

Commit ac013a1

Browse files
Riya KhandelwalRiya Khandelwal
authored andcommitted
fixed accordion arrow and checkstyle
1 parent c16f2ec commit ac013a1

File tree

14 files changed

+83
-83
lines changed

14 files changed

+83
-83
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@
278278
<exclude>src/main/resources/webapps/static/dt-1.11.5/css/jui-dt.css</exclude>
279279
<exclude>src/main/resources/webapps/static/dt-1.11.5/css/demo_table.css</exclude>
280280
<exclude>src/main/resources/webapps/static/dt-1.11.5/images/Sorting icons.psd</exclude>
281-
<!-- <exclude>src/main/resources/webapps/static/dt-1.11.5/js/jquery.dataTables.min.js</exclude>-->
282281
<exclude>src/main/resources/webapps/static/jt/jquery.jstree.js</exclude>
283-
<!-- <exclude>src/main/resources/webapps/static/jquery/jquery-ui-1.13.2.custom.min.js</exclude>-->
284-
<!-- <exclude>src/main/resources/webapps/static/jquery/jquery-3.6.0.min.js</exclude>-->
285282
<exclude>src/main/resources/webapps/static/jquery/themes-1.9.1/base/jquery-ui.css</exclude>
286283
<exclude>src/test/resources/application_1440536969523_0001.har/_index</exclude>
287284
<exclude>src/test/resources/application_1440536969523_0001.har/part-0</exclude>

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/hamlet2/Hamlet.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8456,11 +8456,6 @@ public LI<UL<T>> li() {
84568456
return li_(this, false);
84578457
}
84588458

8459-
// public UL<LI<UL<DIV<Hamlet>>>> selectorLi(String selector) {
8460-
// closeAttrs();
8461-
// return setSelector(li_(this, false), selector);
8462-
// }
8463-
84648459
@Override
84658460
public UL<T> li(String cdata) {
84668461
return li().__(cdata).__();

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/JQueryUI.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ protected void render(Block html) {
6868
.link(root_url("static/dt-1.11.5/css/jquery.dataTables.css"))
6969
.link(root_url("static/dt-1.11.5/css/jui-dt.css"))
7070
.link(root_url("static/dt-1.11.5/css/custom_datatable.css"))
71-
.link("https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js")
7271
.script(root_url("static/yarn.dt.plugins.js"))
7372
.script(root_url("static/customjs/Accordion.js"))
7473
.script(root_url("static/customjs/DataTable.js"))
@@ -85,12 +84,11 @@ protected void render(Block html) {
8584
.__(initDataTables()).__();
8685
}
8786

88-
8987
public static void jsnotice(HTML html) {
9088
html.
9189
div("#jsnotice.ui-state-error").
9290
__("This page will not function without javascript enabled."
93-
+ " Please enable javascript on your browser.").__();
91+
+ " Please enable javascript on your browser.").__();
9492
html.
9593
script().$type("text/javascript").
9694
__("document.getElementById('jsnotice').style.display = 'none'").__();
@@ -151,7 +149,6 @@ protected String initDataTables() {
151149
", true);");
152150

153151
}
154-
155152
return dtJS;
156153
}
157154

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/customjs/Accordion.js

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
/*
220
* Implementation of Accordion in Vanilla JS
321
* Based on the implementation of Jquery-UI Accordion
@@ -37,31 +55,35 @@ var Accordion = function (element, options, selector) {
3755
item.addEventListener('mouseout', onMouseOut);
3856
})
3957

40-
//start with all closed tabs
58+
// start with all closed tabs
4159
closeAll();
4260
if (openTab) {
4361
open(openTab);
4462
}
4563
}
4664

4765
function onClick(e) {
48-
//do nothing if not clickable element
49-
if (e.target.className.indexOf(titleClasses[0]) === -1) {
66+
// do nothing if not clickable element
67+
let currElement = e.target;
68+
if (e.target.className.split(' ').indexOf(titleClasses[0]+'-icon') !== -1) {
69+
currElement = e.target.parentNode;
70+
}
71+
if (currElement.className.indexOf(titleClasses[0]) === -1) {
5072
return;
5173
}
5274

53-
if (e.target.className.indexOf("ui-state-active") !== -1) {
75+
if (currElement.className.indexOf("ui-state-active") !== -1) {
5476
return;
5577
}
5678

57-
let nextContent = e.target.nextElementSibling;
58-
e.target.classList.toggle('ui-state-active');
59-
e.target.children[0].classList.toggle("ui-icon-triangle-1-e");
60-
e.target.children[0].classList.toggle("ui-icon-triangle-1-s");
79+
let nextContent = currElement.nextElementSibling;
80+
currElement.classList.toggle('ui-state-active');
81+
currElement.children[0].classList.toggle("ui-icon-triangle-1-e");
82+
currElement.children[0].classList.toggle("ui-icon-triangle-1-s");
6183

6284
if (nextContent.style.display !== 'none') {
6385
// toggle current element if open
64-
e.target.nextElementSibling.style.display = "none";
86+
currElement.nextElementSibling.style.display = "none";
6587
}
6688

6789
if (oneOpen) {
@@ -72,7 +94,9 @@ var Accordion = function (element, options, selector) {
7294

7395
function onMouseOver(e) {
7496
if (e.target.classList &&
75-
e.target.className.indexOf('ui-state-hover') === -1){
97+
e.target.className.indexOf('ui-state-hover') === -1 &&
98+
e.target.children.length !== 0){
99+
// add hover state to the parent and not the icon
76100
e.target.classList.add('ui-state-hover');
77101
}
78102
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/customjs/DataTable.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
/*
2-
* Implementation of DataTables on VanillaJS
3-
* Based on the implementation by Karl Saunders
4-
*/
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// Implementation of DataTables on VanillaJS
520

621
(function(root, factory) {
722
var plugin = "DataTable";
@@ -96,7 +111,7 @@
96111
};
97112

98113
/**
99-
* Merge objects (reccursive)
114+
* Merge objects (recursive)
100115
* @param {Object} r
101116
* @param {Object} t
102117
* @return {Object}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/customjs/UtilsUI.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
function accordionJS(parent, selector){
220
window.addEventListener("DOMContentLoaded", () => {
321
window.removeEventListener("DOMContentLoaded", arguments.callee, false);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/jquery/themes-1.9.1/base/jquery-ui.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@
3030
----------------------------------*/
3131
/* Sets the width for the accordion. Sets the margin to 90px on the top and bottom and auto to the left and right */
3232

33-
.accordion-parent {
34-
/* width: 800px;
35-
margin: 90px auto;
36-
color: black;
37-
background-color: white;
38-
padding: 45px 45px;*/
39-
}
40-
4133
.accordion-parent + .container {
4234
display: none;
4335
}
@@ -46,7 +38,6 @@
4638
display: block;
4739
}
4840

49-
5041
/* Overlays */
5142
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
5243

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ var yarnDt = function (dtObject) {
4141
// don't filter on hidden html elements for an sType of title-numeric
4242
dtObject.ofnSearch={}
4343
dtObject.oSort={}
44-
// var dtObject.oApi.fnSetFilteringDelay={}
4544
dtObject.ofnSearch['title-numeric'] = function (sData) {
4645
return sData.replace(/\n/g, " ").replace(/<.*?>/g, "");
4746
}
@@ -94,38 +93,6 @@ var yarnDt = function (dtObject) {
9493
return naturalSort(a,b) * -1;
9594
}
9695

97-
// dtObject.oApi.fnSetFilteringDelay = function (oSettings, iDelay) {
98-
// var
99-
// _that = this,
100-
// iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
101-
//
102-
// this.each(function (i) {
103-
// $.fn.dataTableExt.iApiIndex = i;
104-
// var
105-
// $this = this,
106-
// oTimerId = null,
107-
// sPreviousSearch = null,
108-
// anControl = $('input', _that.fnSettings().aanFeatures.f);
109-
//
110-
// anControl.unbind('keyup').bind('keyup', function () {
111-
// var $$this = $this;
112-
//
113-
// if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
114-
// window.clearTimeout(oTimerId);
115-
// sPreviousSearch = anControl.val();
116-
// oSettings.oApi._fnProcessingDisplay(oSettings, true);
117-
// oTimerId = window.setTimeout(function () {
118-
// $.fn.dataTableExt.iApiIndex = i;
119-
// _that.fnFilter(anControl.val());
120-
// oSettings.oApi._fnProcessingDisplay(oSettings, false);
121-
// }, iDelay);
122-
// }
123-
// });
124-
// return this;
125-
// });
126-
// return this;
127-
// }
128-
12996
return dtObject
13097
}
13198

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/AppAttemptBlock.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,10 @@ public Collection<ContainerReport> run() throws Exception {
188188
containersTableData.length() - 1);
189189
}
190190
containersTableData.append("]");
191-
// html.script().$type("text/javascript")
192-
// .__("var containersTableData=" + containersTableData).__();
193191
String containersTableScript = "var containersTableData= " + containersTableData +
194192
";\nconst containersDataTable = DataTableHelper('#containers', { data: { data: containersTableData } }, false)";
195193
html.script().$type("text/javascript")
196-
.__(containersTableScript).__();
194+
.__(containersTableScript).__();
197195

198196
tbody.__().__();
199197
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/FairSchedulerAppsBlock.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ private static String printAppInfo(long value) {
229229
}
230230
appsTableData.append("]");
231231
html.script().$type("text/javascript").
232-
__("appsTableData=" + appsTableData + "\nopts.data = {data: appsTableData}" +
233-
"\nappsDataTable = DataTableHelper(elId, opts, true)").__();
234-
232+
__("appsTableData=" + appsTableData + "\nopts.data = {data: appsTableData}" +
233+
"\nappsDataTable = DataTableHelper(elId, opts, true)").__();
235234

236235
tbody.__().__();
237236
}

0 commit comments

Comments
 (0)