Hi,
Is there a way to disable the shortcuts x+x+x+h and x+x+x+a on the entire wiki? I don’t want users to be able to enable viewing hidden info for themselves.
Alan
Hi,
Is there a way to disable the shortcuts x+x+x+h and x+x+x+a on the entire wiki? I don’t want users to be able to enable viewing hidden info for themselves.
Alan
Thanks
Where would I put that to have it affect the whole wiki?
Hi,
It seems like both shortcut.remove("x+x+x+a");
shortcut.remove("x x x a");
does not work when I added it to a page. Still not sure how these sequence combos are registered and how to remove them.
Alan
Could you show or describe exactly what you did?
I tried adding this to a page:
{{html clean="false"}}
//<![CDATA[
<script type="text/javascript">
shortcut.remove("x+x+x+a");
shortcut.remove("x x x a");
</script>
//]]>
{{/html}}
I could still do x x x a after on that page so it doesn’t seem to work even at a page level. Also tried to put the javascript in Look & Feel > Presentation >HTTP META INFO
to try to have it on every page but it does not seem to work either:
<script type='text/javascript'>
//<![CDATA[
setTimeout(function(){
shortcut.remove("x x x a");
shortcut.remove("x+x+x+a");
},100);
//]]>
</script>
I can still do the command even after doing this so that doesn’t seem to work. I even put it inside a timeout just to make sure it isn’t trying to remove it before the shortcuts are bound.
Alan
I’ve tried with a JavaScriptExtension (https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SkinExtensionsTutorial/) and it worked fine for me with:
shortcut.remove("x+x+x+a");
Hi, getting back to old topic. Do you know how to disable global shortcuts like Alt-S (save). I’ve tried all methods mentioned but it won’t work. Or rather they still work
I’m Polish and on my mac Alt-S is used to obtain “ś” polish diacritic character in example.
TIA
Darek
I tried this too but it never worked. I also tried the “Hello World” example from here:
and it worked at the whole wiki. Has there something changed since your last post.
If want to disable them only on one page so I used this code in a jsx at this page as described on /Documentation/UserGuide/Features/KeyboardShortcuts#HRemovingkeyboardshortcuts:
// Removing all shortcuts at once
for (binding in shortcut.all_shortcuts()) {
shortcut.remove(binding.keys.join(' '));
}
But developer console says:
TypeError: Cannot read properties of undefined (reading 'join')
Any idea?
Simpel
PS: Removing all shortcuts explicit not working too. example:
shortcut.remove("a");
shortcut.remove("c");
shortcut.remove("d");
shortcut.remove("e");
shortcut.remove("f");
shortcut.remove("g");
shortcut.remove("h");
shortcut.remove("i");
shortcut.remove("k");
shortcut.remove("o");
shortcut.remove("r");
shortcut.remove("s");