Bugzilla – Attachment 106797 Details for
Bug 6815
Capture member photo via webcam
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6815: Detect Webcam to show or not button
Bug-6815-Detect-Webcam-to-show-or-not-button.patch (text/plain), 2.93 KB, created by
ByWater Sandboxes
on 2020-07-12 01:09:13 UTC
(
hide
)
Description:
Bug 6815: Detect Webcam to show or not button
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-07-12 01:09:13 UTC
Size:
2.93 KB
patch
obsolete
>From 6082a56def12731fe1359921142b3b6293820926 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 5 Jul 2019 16:23:48 +0000 >Subject: [PATCH] Bug 6815: Detect Webcam to show or not button > >It's hard to test on a laptop with a webcam built it. >So, please attempt with: >The system preference patronimage set to allow. >And in any given patron detail page, see if the 'Take' >button appears/disappears with a refresh while >plugging and unplugging a webcam. > >Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> > >Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> >--- > .../intranet-tmpl/prog/en/includes/intranet-bottom.inc | 18 ++++++++++++++++++ > .../prog/en/modules/members/moremember.tt | 2 +- > 2 files changed, 19 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >index e0bce02522..b363800134 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc >@@ -68,6 +68,24 @@ > [% END %] > [% END %] > <span id="audio-alert"></span> >+ >+ <script> >+ function detectWebcam(callback) { >+ let md = navigator.mediaDevices; >+ if (!md || !md.enumerateDevices) return callback(false); >+ md.enumerateDevices().then(devices => { >+ callback(devices.some(device => 'videoinput' === device.kind)); >+ }) >+ } >+ >+ detectWebcam(function(hasWebcam) { >+ let div_take_image = document.getElementById('take_patron_image'); >+ if (div_take_image) { >+ div_take_image.style.display = hasWebcam ? "block" : "none"; >+ } >+ }); >+ </script> >+ > [% IF ( footerjs ) %] > [% INCLUDE js_includes.inc %] > [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 85d5828da6..1c65cfabdb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -332,7 +332,7 @@ > <a href="#" id="cancel-picture-upload" class="cancel">Cancel</a> > </div> > </form> >- <div class="patroninfo-heading"> >+ <div class="patroninfo-heading" id="take_patron_image"> > <h3>Take patron image</h3> > <a class="btn btn-default btn-xs" id="trigger-webcam" href="/cgi-bin/koha/members/webcam.pl" target="_blank"><i class="fa fa-camera"></i> Take</a> > </div> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6815
:
22623
|
29613
|
38518
|
91302
|
91303
|
91335
|
99015
|
99016
|
99757
|
106774
|
106775
|
106776
|
106777
|
106782
|
106783
|
106787
|
106788
|
106789
|
106790
|
106791
|
106792
|
106793
|
106794
|
106795
|
106796
|
106797
|
106798
|
106799
|
106800
|
106801
|
106802
|
106803
|
106804
|
106938
|
106939
|
106940
|
131174
|
131554
|
131985
|
131987
|
131988
|
131999
|
132000
|
132001