Skip to content

Commit

Permalink
version update, webcam fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCLSC committed Jul 24, 2023
1 parent 9e0d1c4 commit ac45a84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion octoprint_BLOCKS/python3wifi/iwlibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import array
import math
import errno
# import fcntl
import fcntl
import os
import socket
import time
Expand Down
19 changes: 5 additions & 14 deletions octoprint_BLOCKS/static/js/BLOCKS_WebCam.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ $(function () {

if (self.classicWebcam.webcamError()) {
console.log("There was an error on the webcam");
OctoPrint.coreui.viewmodels.controlViewModel.onBrowserTabVisibilityChange(self.webcamStatus());
}
};

Expand Down Expand Up @@ -116,6 +117,7 @@ $(function () {

self.fullScreenState = ko.observable(false);
self.fullScreenButton = ko.observable(undefined);

self._webcamFixedRatio = document.querySelector(".webcam_fixed_ratio");
self._webcamFixedRatioStyle =
this._webcamFixedRatio.style.paddingBottom;
Expand All @@ -126,17 +128,9 @@ $(function () {
if (self.fullScreenState() === false) {
self.fullScreenOperations(true);
self.fullScreenState(true);
// var _webcam = document.getElementsByClassName("webcam_fixed_ratio");
self._webcamFixedRatio.style.cssText =
"padding-bottom: 49.5%;";
// .css("padding-bottom: 49%");
// console.log(_webcam)
console.log(_webcamFixedRatio);
} else if (self.fullScreenState() === true) {
self.fullScreenState(false);
self.fullScreenOperations(false);
self._webcamFixedRatio.style.paddingBottom =
self._webcamFixedRatioStyle;
}
} catch (e) {
console.log(e);
Expand All @@ -152,8 +146,7 @@ $(function () {
self.fullScreenStyles.ROTATOR_ON
);
$("#webcam_img_container").css(self.fullScreenStyles.ON);
// $("#webcam_plugins_container").css(self.fullScreenStyles.ON);
// $("#classicwebcam_container").css(self.fullScreenStyles.ON);
self._webcamFixedRatio.style.cssText = "padding-bottom: 49.5%;";
} else {
$("#webcam_rotator.webcam_rotated").css(
self.fullScreenStyles.ROTATOR_OFF_PAD
Expand All @@ -162,8 +155,8 @@ $(function () {
self.fullScreenStyles.ROTATOR_OFF
);
$("#webcam_img_container").css(self.fullScreenStyles.OFF);
// $("#webcam_plugins_container").css(self.fullScreenStyles.OFF);
// $("#classicwebcam_container").css(self.fullScreenStyles.OFF);
self._webcamFixedRatio.style.paddingBottom =
self._webcamFixedRatioStyle;
}
};
// This event listener serves for the full screen video player
Expand All @@ -176,8 +169,6 @@ $(function () {
) {
self.fullScreenState(false);
self.fullScreenOperations(false);
self._webcamFixedRatio.style.paddingBottom =
self._webcamFixedRatioStyle;
}
});
}
Expand Down
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 = "OctoPrint-BLOCKS"

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

# 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 ac45a84

Please sign in to comment.