Skip to content

Commit

Permalink
removed remaining items from truck inspection plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
john-chrosniak committed Jun 12, 2024
1 parent 0fd5dc8 commit 0f83429
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 56 deletions.
2 changes: 0 additions & 2 deletions carma-messenger-ui/website/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@
</div>
</div>

<div id="divWidgetArea" ></div>

<!-- widget area for geofence management -->
<div id="divWidgetAreaEventManagement"></div>

Expand Down
45 changes: 0 additions & 45 deletions carma-messenger-ui/website/scripts/carma.widgetfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,49 +30,6 @@ CarmaJS.WidgetFramework = (function () {
}
};

/*
loads the widgets onto the Driver View.Part
*/
var loadWidgets = function(){
$.ajax({
url: jsFilePath,
type:'HEAD',
error: function()
{
//file not exists
//TODO: In chrome, even with statusCode or error handling, the HTTP 404 (Failed to Load) error still shows separately
console.log('loadWidgets: Widget file does NOT exist: ' + jsFilePath );
return false;
},
success: function()
{
//console.log('cssFilePath: ' + cssFilePath);
//1) Load css
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', cssFilePath);
document.getElementsByTagName('head')[0].appendChild(link);

//2) Load JS
//console.log('jsFilePath1: ' + jsFilePath);
scriptLoader([jsFilePath],function()
{
// now you can use the code from loaded script files.
// eval(widgetNamespace + '.loadCustomWidget($("#divWidgetArea"));');saftyLogList
eval('CarmaJS.WidgetFramework.truckInspection' + '.loadCustomWidget($("#divWidgetArea"));');
});

return true;
}
});
};

var closeWidgets = function () {
$('#divWidgetArea').empty();
console.log("closeWidgets is called");
};

var loadEventManagementWidgets = function(){
var cssFilePath = 'widgets/eventManagement/widget.css';
var jsFilePath = 'widgets/eventManagement/widget.js';
Expand Down Expand Up @@ -153,10 +110,8 @@ CarmaJS.WidgetFramework = (function () {

//Public API
return {
loadWidgets: loadWidgets,
loadEventManagementWidgets: loadEventManagementWidgets,
loadEmergencyResponseWidgets: loadEmergencyResponseWidgets,
closeWidgets: closeWidgets,
closeEventManagementWidgets: closeEventManagementWidgets,
closeEmergencyResponseWidgets: closeEmergencyResponseWidgets
};
Expand Down
2 changes: 0 additions & 2 deletions carma-messenger-ui/website/scripts/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,6 @@ function closeModal(action) {
document.getElementById('divCapabilitiesMessage').innerHTML = 'Please select a route.';
clearTable('tblSecondA');

CarmaJS.WidgetFramework.closeWidgets();

// Get the element with id="defaultOpen" and click on it
// This needs to be outside a funtion to work.
document.getElementById('defaultOpen').click();
Expand Down
2 changes: 0 additions & 2 deletions carma-messenger-ui/website/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $(document).ready(function () {

$('#card-event-management').click(function(){
$('#divCarmaMessengerView').css('display','');
$('#divWidgetArea').css('display','none');
$('#divWidgetAreaEventManagement').css('display','');
$('#divWidgetAreaEmergencyResponse').css('display','none');
$('#Messenger_back_arrow').css('display','inline-block');
Expand All @@ -23,7 +22,6 @@ $(document).ready(function () {

$('#card-emergency-response').click(function(){
$('#divCarmaMessengerView').css('display','');
$('#divWidgetArea').css('display','none');
$('#divWidgetAreaEventManagement').css('display','none');
$('#divWidgetAreaEmergencyResponse').css('display','');
$('#Messenger_back_arrow').css('display','inline-block');
Expand Down
3 changes: 0 additions & 3 deletions carma-messenger-ui/website/scripts/rosbridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ function connectToROS() {
document.getElementById('closed').style.display = 'none';
document.getElementById('connected').style.display = 'inline';
console.log("ROS is connected");
//load widget
// CarmaJS.WidgetFramework.closeWidgets();
//CarmaJS.WidgetFramework.loadWidgets();
});

ros.on('close', function () {
Expand Down
2 changes: 1 addition & 1 deletion carma-messenger-ui/website/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ div.card,div.card-body{
#divMenuArea{
width: 100%;
}
#divWidgetArea, #divWidgetAreaEventManagement, #divWidgetAreaEmergencyResponse{
#divWidgetAreaEventManagement, #divWidgetAreaEmergencyResponse{
width: 100%;
}
.event-management-title-div{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ var goToEventManagement = () => {

document.getElementById('audioAlert3').pause();
$('#divCarmaMessengerView').css('display', '');
$('#divWidgetArea').css('display', 'none');
$('#divWidgetAreaEventManagement').css('display', '');
$('#divWidgetAreaEmergencyResponse').css('display', 'none');
$('#Messenger_back_arrow').css('display', 'inline-block');
Expand Down

0 comments on commit 0f83429

Please sign in to comment.