diff --git a/gradio/interface.py b/gradio/interface.py index 783ece5b27..5023cf63c0 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -41,7 +41,7 @@ class Interface: live=False, show_input=True, show_output=True, capture_session=False, title=None, description=None, thumbnail=None, server_port=None, server_name=networking.LOCALHOST_NAME, - allow_screenshot=True): + allow_screenshot=True, allow_flagging=True): """ Parameters: fn (Callable): the function to wrap an interface around. @@ -101,6 +101,7 @@ class Interface: self.server_port = server_port self.simple_server = None self.allow_screenshot = allow_screenshot + self.allow_flagging = allow_flagging Interface.instances.add(self) data = {'fn': fn, diff --git a/gradio/static/css/gradio.css b/gradio/static/css/gradio.css index 06293cc3d1..6ba5e84a7a 100644 --- a/gradio/static/css/gradio.css +++ b/gradio/static/css/gradio.css @@ -75,7 +75,9 @@ input.submit { input.submit:hover { background-color: #f39c12; } - +.flag { + visibility: hidden; +} .flag.flagged { background-color: pink; } diff --git a/gradio/static/js/gradio.js b/gradio/static/js/gradio.js index eb4061343c..7d3f1962ab 100644 --- a/gradio/static/js/gradio.js +++ b/gradio/static/js/gradio.js @@ -128,6 +128,9 @@ function gradio(config, fn, target) { if (config["allow_screenshot"]) { target.find(".screenshot").css("visibility", "visible"); } + if(config["allow_flagging"]){ + target.find(".flag").css("visibility", "visible"); + } target.find(".screenshot").click(function() { $(".screenshot").hide(); $(".screenshot_logo").show();