X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FResources%2Fstatic%2Fthemes%2F_global%2Findex.js;h=66ac063bc97961ad4bac4d9629b62ad41a372979;hb=66fa0c26ab74467645e2cc63a4f48ef82e3f5748;hp=bb3e95b6d4bceec69e6e208298a38553d7de9352;hpb=5419a8368ebb4b4d57f481b842f1fcc576c9149d;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index bb3e95b6..66ac063b 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -4,6 +4,8 @@ import $ from 'jquery'; /* Annotations */ import annotator from 'annotator'; +import ClipboardJS from 'clipboard'; + /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; import 'lato-font/css/lato-font.css'; @@ -89,4 +91,30 @@ $(document).ready(() => { } }; }); + + // mimic radio button because emailTwoFactor is a boolean + $('#update_user_googleTwoFactor').on('change', () => { + $('#update_user_emailTwoFactor').prop('checked', false); + }); + + $('#update_user_emailTwoFactor').on('change', () => { + $('#update_user_googleTwoFactor').prop('checked', false); + }); + + // same mimic for super admin + $('#user_googleTwoFactor').on('change', () => { + $('#user_emailTwoFactor').prop('checked', false); + }); + + $('#user_emailTwoFactor').on('change', () => { + $('#user_googleTwoFactor').prop('checked', false); + }); + + // handle copy to clipboard for developer stuff + const clipboard = new ClipboardJS('.btn'); + clipboard.on('success', (e) => { + console.info(e.text); + + e.clearSelection(); + }); });