Skip to content

Commit 36f7662

Browse files
Merge pull request #4246 from IgorA100/patch-344340
Chore: Removed unused code, added a few little things. (skin.js)
2 parents b5e692a + 4a80679 commit 36f7662

File tree

1 file changed

+10
-37
lines changed

1 file changed

+10
-37
lines changed

web/skins/classic/js/skin.js

+10-37
Original file line numberDiff line numberDiff line change
@@ -375,24 +375,6 @@ if ( currentView != 'none' && currentView != 'login' ) {
375375
}
376376
});
377377

378-
// Manage the web console filter bar minimize chevron
379-
/*$j("#mfbflip").click(function() {
380-
$j("#mfbpanel").slideToggle("slow", function() {
381-
if ($j.isFunction('changeScale')) {
382-
changeScale();
383-
}
384-
});
385-
var mfbflip = $j("#mfbflip");
386-
if ( mfbflip.html() == 'keyboard_arrow_up' ) {
387-
mfbflip.html('keyboard_arrow_down');
388-
setCookie('zmMonitorFilterBarFlip', 'up');
389-
} else {
390-
mfbflip.html('keyboard_arrow_up');
391-
setCookie('zmMonitorFilterBarFlip', 'down');
392-
$j('.chosen').chosen("destroy");
393-
$j('.chosen').chosen();
394-
}
395-
});*/
396378
// Autoclose the hamburger button if the end user clicks outside the button
397379
$j(document).click(function(event) {
398380
var target = $j(event.target);
@@ -514,7 +496,12 @@ function checkStreamForErrors(funcName, streamObj) {
514496
Error(funcName+': stream object was null');
515497
return true;
516498
}
517-
if ( streamObj.result == "Error" ) {
499+
if ( streamObj.responseJSON ) {
500+
if (streamObj.responseJSON.result == "Error") {
501+
Error(funcName+' stream error: '+streamObj.responseJSON.message);
502+
return true;
503+
}
504+
} else if ( streamObj.result == "Error" ) {
518505
Error(funcName+' stream error: '+streamObj.message);
519506
return true;
520507
}
@@ -727,22 +714,6 @@ function scaleToFit(baseWidth, baseHeight, scaleEl, bottomEl, container, panZoom
727714
newHeight = newWidth / ratio;
728715
}
729716
let autoScale = Math.round(newWidth / baseWidth * SCALE_BASE * panZoomScale);
730-
/* IgorA100 not required due to new "Scale" algorithm & new PanZoom (may 2024)
731-
const scales = $j('#scale option').map(function() {
732-
return parseInt($j(this).val());
733-
}).get();
734-
scales.shift(); // pop off Scale To Fit
735-
let closest = null;
736-
$j(scales).each(function() { //Set zms scale to nearest regular scale. Zoom does not like arbitrary scale values.
737-
if (closest == null || Math.abs(this - autoScale) < Math.abs(closest - autoScale)) {
738-
closest = this.valueOf();
739-
}
740-
});
741-
if (closest) {
742-
console.log("Setting to closest: " + closest + " instead of " + autoScale);
743-
autoScale = closest;
744-
}
745-
*/
746717
// Floor to nearest value % 5. THe 5 is somewhat arbitrary. The point is that scaling by 88% is not better than 85%. Perhaps it should be to the nearest 10. Or 25 even.
747718
autoScale = 5 * Math.floor(autoScale / 5);
748719
if (autoScale < 10) autoScale = 10;
@@ -1210,7 +1181,6 @@ function thisClickOnStreamObject(clickObj) {
12101181
return true;
12111182
} else if (clickObj.id.indexOf('monitorStatus') != -1) {
12121183
return document.getElementById('monitor'+stringToNumber(clickObj.id));
1213-
//return clickObj;
12141184
} else if (clickObj.id.indexOf('videoobj') != -1) {
12151185
return document.getElementById('eventVideo');
12161186
} else return false;
@@ -1233,7 +1203,10 @@ var doubleTouchExecute = function(event, touchEvent) {
12331203
};
12341204

12351205
var doubleClickOnStream = function(event, touchEvent) {
1236-
if (shifted || ctrled || alted) return;
1206+
if (shifted || ctrled || alted) {
1207+
console.log("Shift or Ctrl or Alt button was pressed, double-click event was not processed.");
1208+
return;
1209+
}
12371210
let target = null;
12381211
if (event.target) {// Click NOT on touch screen, use THIS
12391212
//Process only double clicks directly on the image, excluding clicks,

0 commit comments

Comments
 (0)