Skip to content

Commit

Permalink
Merge pull request #108 from aestoltm/replace_jquery
Browse files Browse the repository at this point in the history
Replacing jQuery with native JS
  • Loading branch information
aestoltm authored May 14, 2024
2 parents fe20eb6 + 2508ea5 commit 04a7393
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
3 changes: 1 addition & 2 deletions html/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"env": {
"browser": true,
"es6": true,
"jquery": true
"es2018": true
},
"globals": {
"AppKernel": false,
Expand Down
5 changes: 2 additions & 3 deletions html/gui/js/modules/app_kernels/AppKernelViewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global XDMoD, CCR, Ext, document, jQuery */
/* global XDMoD, CCR, Ext, document */
/**
* This class contains functionality for the App Kernels tab.
*
Expand Down Expand Up @@ -555,14 +555,13 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
height: height,
appkernels: true
},
data: [],
credits: {
enabled: true
}
};

var chartOptions = r.get('hc_jsonstore');
jQuery.extend(true, chartOptions, baseChartOptions);
chartOptions = XDMoD.utils.deepExtend({}, chartOptions, baseChartOptions);

if (isMenu) {
chartOptions.layout.thumbnail = true;
Expand Down
3 changes: 1 addition & 2 deletions html/internal_dashboard/js/Arr/ControlRegionsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,14 +734,13 @@ XDMoD.Arr.ControlRegionsPanel=Ext.extend(XDMoD.PortalModule,
width: isMenu ? CCR.xdmod.ui.thumbWidth * this.chartThumbScale : this.chartWidth * this.chartScale,
height: isMenu ? CCR.xdmod.ui.thumbHeight * this.chartThumbScale : this.chartHeight * this.chartScale
},
data: [],
credits: {
enabled: true
}
}; //baseChartOptions

var chartOptions = r.get('hc_jsonstore');
jQuery.extend(true, chartOptions, baseChartOptions);
chartOptions = XDMoD.utils.deepExtend({}, chartOptions, baseChartOptions);

chartOptions.layout.hovermode = chartOptions.swapXY ? 'y unified' : 'x unified';
if (chartOptions.data && chartOptions.data.length !== 0) {
Expand Down
27 changes: 13 additions & 14 deletions html/internal_dashboard/js/Arr/SchedulePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,24 @@ XDMoD.Arr.SchedulePanel = Ext.extend(Ext.FormPanel, {
scope: this,
handler: function () {
if (self.getForm().active_record) {

var url = XDMoD.REST.url + '/akrr/tasks/scheduled/' +
self.getForm().active_record.data.task_id +
'?token=' + XDMoD.REST.token;

jQuery.ajax({
method: 'DELETE',
url: url,
success: function (data, textStatus, jqXHR) {
self.fireEvent('task_removed', self.getForm().active_record);
},
error: function (jqXHR, textStatus, errorThrown) {
console.log('An Exception has occurred: ' + textStatus + ' ' + errorThrown);
fetch(`${XDMoD.REST.url}/akrr/tasks/scheduled/${self.getForm().active_record.data.task_id}?token=${XDMoD.REST.token}`, {
method: 'DELETE'
})
.then((response) => {
if (!response.ok) {
throw new Error(`An Exception has occurred: [${response.status}] ${response.statusText}`);
}
return response.json();
})
.then((data) => {
self.fireEvent('task_removed', self.getForm().active_record);
})
.catch((error) => {
console.log(error);
});
} else {
console.log("No record selected for deletion.");
}

}
},
{
Expand Down

0 comments on commit 04a7393

Please sign in to comment.