diff --git a/assets/webconfig/js/content_grabber.js b/assets/webconfig/js/content_grabber.js index 5b556352..984a3cac 100755 --- a/assets/webconfig/js/content_grabber.js +++ b/assets/webconfig/js/content_grabber.js @@ -277,13 +277,13 @@ $(document).ready(function () { fps = parseInt(framerates); } - //Show Frameskipping only when more than 2 fps - if (fps > 2 && storedAccess === "expert") { - showInputOptions("framegrabber", ["fpsSoftwareDecimation"], true); - } - else { - showInputOptions("framegrabber", ["fpsSoftwareDecimation"], false); - } + ////Show Frameskipping only when more than 2 fps + //if (fps > 2) { + // showInputOptionForItem(conf_editor_screen, "framegrabber", "fpsSoftwareDecimation", true); + //} + //else { + // showInputOptionForItem(conf_editor_screen, "framegrabber", "fpsSoftwareDecimation", false); + //} conf_editor_screen.getEditor("root.framegrabber.fps").setValue(fps); }); @@ -317,9 +317,9 @@ $(document).ready(function () { true); if (jQuery.isEmptyObject(properties)) { - showInputOptions("grabberV4L2", [key], false); + showInputOptionForItem(conf_editor_video, "grabberV4L2", key, false); } else { - showInputOptions("grabberV4L2", [key], true); + showInputOptionForItem(conf_editor_video, "grabberV4L2", key, true); } } @@ -620,13 +620,12 @@ $(document).ready(function () { if (framerates !== "NONE") { fps = parseInt(framerates); } - //Show Frameskipping only when more than 2 fps - if (fps > 2 && storedAccess === "expert") { - showInputOptions("grabberV4L2", ["fpsSoftwareDecimation"], true); + if (fps > 2) { + showInputOptionForItem(conf_editor_video, "grabberV4L2", "fpsSoftwareDecimation", true); } else { - showInputOptions("grabberV4L2", ["fpsSoftwareDecimation"], false); + showInputOptionForItem(conf_editor_video, "grabberV4L2", "fpsSoftwareDecimation", false); } conf_editor_video.getEditor("root.grabberV4L2.fps").setValue(fps); }); diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index e7cafe73..16e53d06 100755 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -1155,6 +1155,14 @@ function showInputOptions(path, elements, state) { } } +function showInputOptionForItem(editor, path, item, state) { + var accessLevel = editor.schema.properties[path].properties[item].access; + // Enable element only, if access level compliant + if (!state || isAccessLevelCompliant(accessLevel)) { + showInputOptions(path, [item], state); + } +} + function showInputOptionsForKey(editor, item, showForKeys, state) { var elements = []; var keysToshow = [];