Skip to content

Commit

Permalink
Merge pull request #29 from jneilliii/bugfix/octoprint_1.9.0
Browse files Browse the repository at this point in the history
0.1.10
  • Loading branch information
jneilliii authored May 24, 2023
2 parents 260d437 + 092f343 commit ba04d5b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ $(function() {
self.touchui = parameters[3];
self.dragonorder = parameters[4];
self.webcamtab = parameters[5];
self.uicsutomizer = parameters[6];
self.uicustomizer = parameters[6];
self.classicWebcamViewModel = parameters[7];
self.tab_order_selector = ko.pureComputed(function(){
var tabs = ko.utils.arrayMap(self.settings.settings.plugins.consolidate_temp_control.tab_order(), function(tab) {
return tab.selector();
Expand Down Expand Up @@ -53,12 +54,16 @@ $(function() {

// tabs adjustments
$('#tab_plugin_consolidate_temp_control > div.row-fluid > div').addClass('span6');
if($('div#settings_plugin_themeify').length == 0 && !self.dragonorder && !self.uicsutomizer){
if($('div#settings_plugin_themeify').length == 0 && !self.dragonorder && !self.uicustomizer){
$('div.container.octoprint-container > div.row > div.tabbable.span8').removeClass('span8').addClass('span10');
$('div#tabs_content div.tab-pane:not("#tab_plugin_consolidate_temp_control")').wrapInner('<div class="span6"></div>');
$('div#tabs_content div.tab-pane:not("#tab_plugin_consolidate_temp_control") div.span6').wrap('<div class="row-fluid"></div>');
}

if(self.classicWebcamViewModel){
$('#webcam_plugin_classicwebcam_real > div > div').removeClass('span6');
}

// footer adjustments
$('div.container.octoprint-container > div.footer').css({'padding-left':'20px','padding-right':'20px'});
} else {
Expand All @@ -84,13 +89,19 @@ $(function() {
if (self.webcamtab) {
OctoPrint.coreui.selectedTab = "#tab_plugin_webcamtab";
self.controlViewModel.onTabChange("#tab_plugin_webcamtab", previous);
} else {
} else if (!self.classicWebcamViewModel) {
OctoPrint.coreui.selectedTab = "#control";
self.controlViewModel.onTabChange("#control", previous);
}
} else if (self.classicWebcamViewModel) {
self.classicWebcamViewModel._enableWebcam();
}
OctoPrint.coreui.selectedTab = selected;
} else if (previous === "#tab_plugin_consolidate_temp_control") {
self.controlViewModel.onTabChange(current, "#control");
if(!self.classicWebcamViewModel) {
self.controlViewModel.onTabChange(current, "#control");
} else {
self.classicWebcamViewModel._disableWebcam();
}
}
};

Expand All @@ -108,20 +119,22 @@ $(function() {
}
};

self.controlViewModel.onBrowserTabVisibilityChange = function(status) {
if (status) {
var selected = OctoPrint.coreui.selectedTab;
if (self.webcamtab) {
OctoPrint.coreui.selectedTab = "#tab_plugin_webcamtab";
} else {
OctoPrint.coreui.selectedTab = "#control";
}
self.controlViewModel._enableWebcam();
OctoPrint.coreui.selectedTab = selected;
} else {
self.controlViewModel._disableWebcam();
}
};
if(!self.classicWebcamViewModel) {
self.controlViewModel.onBrowserTabVisibilityChange = function (status) {
if (status) {
var selected = OctoPrint.coreui.selectedTab;
if (self.webcamtab) {
OctoPrint.coreui.selectedTab = "#tab_plugin_webcamtab";
} else {
OctoPrint.coreui.selectedTab = "#control";
}
self.controlViewModel._enableWebcam();
OctoPrint.coreui.selectedTab = selected;
} else {
self.controlViewModel._disableWebcam();
}
};
}

// fix temperature tab
self.onAfterTabChange = function(current, previous) {
Expand All @@ -138,8 +151,8 @@ $(function() {

OCTOPRINT_VIEWMODELS.push({
construct: ConsolidateTempControlViewModel,
dependencies: ["controlViewModel", "temperatureViewModel", "settingsViewModel", "touchUIViewModel", "dragon_orderViewModel", "WebcamTabViewModel", "UICustomizerViewModel"],
optional: ["touchUIViewModel", "dragon_orderViewModel", "WebcamTabViewModel", "UICustomizerViewModel"],
dependencies: ["controlViewModel", "temperatureViewModel", "settingsViewModel", "touchUIViewModel", "dragon_orderViewModel", "WebcamTabViewModel", "UICustomizerViewModel", "classicWebcamViewModel"],
optional: ["touchUIViewModel", "dragon_orderViewModel", "WebcamTabViewModel", "UICustomizerViewModel", "classicWebcamViewModel"],
elements: ["#consolidate_temp_control_settings_form"]
});
});
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "Consolidate Temp Control"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.1.9"
plugin_version = "0.1.10"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit ba04d5b

Please sign in to comment.