Skip to content

Commit

Permalink
Merge pull request #240 from LazeMSS/develop
Browse files Browse the repository at this point in the history
0.1.8.9 - release
  • Loading branch information
LazeMSS authored Mar 5, 2022
2 parents 01b43ed + 35ffc1c commit e8d077a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 17 deletions.
88 changes: 78 additions & 10 deletions octoprint_uicustomizer/static/css/uicustomizer.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* UICustomizer START */
:root {
--background: #36393f;
--uicmainwidth: 230px;
:root {
--background: #36393f;
--uicmainwidth: 230px;
}

/* big screens */
@media (min-width: 980px){
body.UICfixedHeader{
Expand Down Expand Up @@ -268,23 +269,23 @@
}
#temperature-table .btn button.btn, #temperature-table input[type="submit"].btn {
*padding-top: 1px;
*padding-bottom: 1px
*padding-bottom: 1px;
}
#temperature-table .btn-group>.btn {
font-size: 10.5px
font-size: 10.5px;
}
#temperature-table .btn-group>.btn+.dropdown-toggle {
*padding-top: 2px;
padding-right: 5px;
*padding-bottom: 2px;
padding-left: 5px
padding-left: 5px;
}

#temperature-table .btn .caret {
margin-top: 6px
margin-top: 6px;
}
#temperature-table .btn .label,#temperature-table .btn .badge {
top: 0
top: 0;
}

/* ------------------------- small temp tables end -------------------------*/
Expand Down Expand Up @@ -1022,6 +1023,7 @@ body.inlineFullscreen .UICWebCamClick{
border: 3px solid var(--background);
border-radius: 4px;
background-color: var(--background);
padding-bottom: 62px;
}

#UICWebCamFull.FloatCam div.UICwebcamLoading{
Expand Down Expand Up @@ -1119,6 +1121,7 @@ body.inlineFullscreen .UICWebCamClick{
line-height: 80px;
z-index: -5;
user-select: none;
display: none;
}

#IUCWebcamContainer div.accordion-inner{
Expand All @@ -1137,7 +1140,7 @@ body.inlineFullscreen .UICWebCamClick{
}

/*hide zoom click if only*/
#IUCWebcamContainerSrc > div:only-child{
#IUCWebcamContainerSrc > div.UICWebCamClick:only-child{
display:none;
}

Expand Down Expand Up @@ -1385,4 +1388,69 @@ html.themeify #UICsetMenuShow{
margin-bottom: 5px;
}

/* UICustomizer END */
/*webcam rotator handling*/

.UIC_webcam_container_clone {
width: 100%;
position: relative;
outline: 0;
background-color: #000;
}

.UIC_webcam_container_clone .webcam_rotated {
position: relative;
width: 100%;
padding-bottom: 100%;
pointer-events: none;
}

.UIC_webcam_container_clone .webcam_rotated .webcam_fixed_ratio {
position: absolute;
transform: rotate(-90deg);
top: 0;
bottom: 0;
pointer-events: none;
}

.UIC_webcam_container_clone .webcam_rotated .webcam_fixed_ratio .webcam_fixed_ratio_inner {
width: 100%;
height: 100%;
pointer-events: none;
}

.UIC_webcam_container_clone .webcam_unrotated .webcam_fixed_ratio {
width: 100%;
pointer-events: none;
padding-bottom: 100%;
position: relative;
}

.UIC_webcam_container_clone .webcam_unrotated .webcam_fixed_ratio.ratio43 {
padding-bottom: 75%;
}

.UIC_webcam_container_clone .webcam_unrotated .webcam_fixed_ratio.ratio169 {
padding-bottom: 56.25%;
}

.UIC_webcam_container_clone .webcam_unrotated .webcam_fixed_ratio.ratio1610 {
padding-bottom: 62.5%;
}

.UIC_webcam_container_clone .webcam_unrotated .webcam_fixed_ratio .webcam_fixed_ratio_inner {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
pointer-events: none;
}

.UIC_webcam_container_clone img {
width: 100%;
height: 100%;
object-fit: contain;
}


/* UICustomizer END */
23 changes: 17 additions & 6 deletions octoprint_uicustomizer/static/js/uicustomizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ $('body').append('<link class="UICBSResp" rel="stylesheet" href="./plugin/uicust

// Now we start
$(function() {
$('#webcam_container > #webcam_rotator').attr('data-webcamorg','true');
function UICustomizerViewModel(parameters) {
var self = this;
// Run in debug/verbose mode
Expand Down Expand Up @@ -146,6 +147,7 @@ $(function() {
// ------------------------------------------------------------------------------------------------------------------------
// Initial bound and init the custom layout
self.onAllBound = function(){

self.settings = self.coreSettings.settings;
self.UICsettings = self.coreSettings.settings.plugins.uicustomizer;

Expand Down Expand Up @@ -303,6 +305,10 @@ $(function() {
if (previous == "#control"){
self.webcamAttachHandler();
}
if (OctoPrint.coreui.viewmodels.controlViewModel.webcamDisableTimeout != undefined) {
clearTimeout(OctoPrint.coreui.viewmodels.controlViewModel.webcamDisableTimeout);
OctoPrint.coreui.viewmodels.controlViewModel.webcamDisableTimeout = undefined;
}
return;
}
}
Expand Down Expand Up @@ -473,6 +479,11 @@ $(function() {


self.handleOtherPlugins = function(){
// Remove all broken webcam duplicates
$('[id="webcam_rotator"]').parent().addClass('UIC_webcam_container_clone');
$('[id="webcam_rotator"]').not('[data-webcamorg="true"]').removeAttr('id');
$('#webcam_rotator').removeAttr('data-webcamorg');

var IgnoredConflictPlugins = self.getStorage('IgnoredConflictPlugins',true);
if (IgnoredConflictPlugins == undefined){
IgnoredConflictPlugins = {};
Expand Down Expand Up @@ -531,7 +542,7 @@ $(function() {
}

// Check for any issues with installed plugins
var genericPluginsWarning = ['widescreen','taborder','statefulsidebar','fullscreen','themeify','octoflat','webcam_iframe'];
var genericPluginsWarning = ['widescreen','taborder','statefulsidebar','fullscreen','themeify','octoflat','webcam_iframe','floatingnavbar'];
$.each(genericPluginsWarning,function(key,plugKeyName){
if (IgnoredConflictPlugins.hasOwnProperty(plugKeyName) && IgnoredConflictPlugins[plugKeyName] == true){
self.logToConsole("Plugin issues for " + plugKeyName + " ignored.");
Expand Down Expand Up @@ -1292,7 +1303,7 @@ $(function() {
<a href="#"><i class="fas fa-compress"></i></a>
</div>
<div class="UICwebcamLoading text-center UIC-pulsate text-info"><i class="fas fa-spinner fa-spin"></i> Loading webcam&hellip;</div>
<div id="UICWebCamTarget"></div>
<div id="UICWebCamTarget" class="UIC_webcam_container_clone"></div>
<div class="navbar navbar-fixed-bottom" id="UICWebCamFullProgress">
<div title="Printer state" class="label"><i class="fas fa-info"></i>${OctoPrint.coreui.viewmodels.printerStateViewModel.stateString()}</div>
</div>
Expand Down Expand Up @@ -1362,7 +1373,6 @@ $(function() {
document.exitFullscreen();
return;
}

$('#UICWebCamFull').off('dragstart.UICCam');
$('body').off('dragover.UICCam');
$('body').off('drop.UICCam');
Expand Down Expand Up @@ -2015,7 +2025,6 @@ $(function() {
var widths = $('#UICSortCols input.uiccolwidth').map(function(){totalw += $(this).val()*1; return $(this).val();}).get();
// Fallback if something went wrong
if (totalw > self.maxCWidth){
alert("Total collumn Width is " + totalw + " max allowed" + self.maxCWidth);
var indexpos = widths.indexOf(Math.max(...widths)+'');
var diff = totalw-self.maxCWidth;
widths[indexpos] -= diff;
Expand Down Expand Up @@ -3448,6 +3457,8 @@ $(function() {

// Disable event listners
$('#settings_plugin_uicustomizer input').off('input.uicus change.uicus click.uicus');
// Fix webcam
self.webcamAttachHandler();
}

// ------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -3566,13 +3577,13 @@ $(function() {
setLabelFSWC('bed','Bed temperature','fas fa-window-minimize', calcVal,false);
}
}else{
if(self.tempModel.hasTools() && self.tempModel.temperatures['tool0'].actual[self.tempModel.temperatures['tool0'].actual.length-1][1] != undefined){
if(self.tempModel.hasTools() && self.tempModel.temperatures['tool0'].actual.length > 0 && self.tempModel.temperatures['tool0'].actual[self.tempModel.temperatures['tool0'].actual.length-1][1] != undefined){
var tempAct = self.tempModel.temperatures['tool0'].actual[self.tempModel.temperatures['tool0'].actual.length-1][1];
var tempTrg = self.tempModel.temperatures['tool0'].target[self.tempModel.temperatures['tool0'].target.length-1][1];
var calcVal = formatTemperature(tempAct,false)+" / "+formatTemperature(tempTrg,false);
setLabelFSWC('t0','Tool temperature','fas fa-fire', calcVal,false);
}
if(self.tempModel.hasBed() && self.tempModel.temperatures['bed'].actual[self.tempModel.temperatures['bed'].actual.length-1][1] != undefined){
if(self.tempModel.hasBed() && self.tempModel.temperatures['bed'].actual.length > 0 && self.tempModel.temperatures['bed'].actual[self.tempModel.temperatures['bed'].actual.length-1][1] != undefined){
var tempAct = self.tempModel.temperatures['bed'].actual[self.tempModel.temperatures['bed'].actual.length-1][1];
var tempTrg = self.tempModel.temperatures['bed'].target[self.tempModel.temperatures['bed'].target.length-1][1];
var calcVal = formatTemperature(tempAct,false)+" / "+formatTemperature(tempTrg,false);
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 = "UI Customizer"

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

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

Please sign in to comment.