The lightbox feature has 4 hot-keys (that I know of):
(N) Next - (P) Previous - (X) Close - (C) Close
Is there a way to disable these hot-keys? If so, is it possible to limit the changes to one instance of a lightbox?
The lightbox feature has 4 hot-keys (that I know of):
(N) Next - (P) Previous - (X) Close - (C) Close
Is there a way to disable these hot-keys? If so, is it possible to limit the changes to one instance of a lightbox?
:cry:
Have you tried smashing them with a hammer. This sometimes works.Is there a way to disable these hot-keys?
10 tries and $400 later... hotkeys still work
The reason I want to disable them is to use lightboxes for small forms. If the user hits X or C while typing in a form field, it closes the lightbox :? . So if I had newsletter signups and I used a lightbox for the form... every Chris and Catherine in the world will think I'm racist
Is it mediabox?
In plugins/mediabox/js there are 2 files mediabox.js and mediabox_src.js
Changing alpha:true to alpha:false in both of these may work.
Probably not update safe, but I don't know if theres another way that is.alpha: true, // Adds 'x', 'c', 'p', and 'n' when keyboard control is also set to true
i'm goin in coach............
Nope it didn't do anything...
I checked the module I'm using the iframes through and it references rel="lightbox" ... are lightbox and mediabox the same?
Not sure.
In your page layout, under Mootools Templates is mediabox, slimbox or both selected?
Also javascripts have a terrible habit of remaining cached... try deleting browser cache etc
If its slimbox being used go to plugins/slimbox/js and alter slimbox.js and slimbox_src.js
change to closeKeys: [27]closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67)
ahhh it's mediabox-white... the .tpl file calls for mediabox.js so that is the correct file... one sec.
*sigh* no good. It seems as though the changes to the .js file has no effect on it. Tested the regular mediabox as well as mediabox-white turning alpha to false as well as keyboard to false without any luck. Caching is turned off... but just in case I purposely broke the javascript once and it updated instantly... so it's not caching the script.
This is very perplexing :?
post a link if you can and i'll check if its caching or not.
its on a private server =/
i wonder though... since I'm using the mediabox via Popup_Content module... I've been wondering if there was a specially made .js file for it. I've changed every reference of x, c, n, p, and every instance of stopKey and alpha in the .js files in ...plugins/mediabox/js. For good measure, i restarted the server, cleared my firefox browser cache and cookies... and still no go. So there has to be something else controlling it from another directory... but which one
That modules moo_mediabox-white.tpl template calls on plugins/mediabox/js/mediabox.js
It does have this in the function
which would appear to allow you to add custom options - which is much better than my idea of hacking the plugin files.Code:$$(links).mediabox({/* Put custom options here */}, null, function(el) {
The only thing you need to do is make "alpha" false.At a guess (i'm a js dummy)....
restore all your original plugin js
tryin the templateCode:$$(links).mediabox({alpha:false}, null, function(el) {
you were right on the money with that one.
only problem is... it looks as if "alpha" is not the correct command...
i used stopKey: true and it worked (doesn't allow the user to type anything within the iFrame... but hotkeys still work)
alpha doesn't do anything... tried Alpha as well. I know the mediabox_src.js file states as a comment that 'alpha' controls the x,c,n,p keys... but iono it may be wrong.
may need a space? alpha: false
also keyboard must be true.
mediaboxAdvanced v1.2.5 - The ultimate extension of Slimbox and Mediabox; an all-media script
updated 2010.08.11
(c) 2007-2010 John Einselen <http://iaian7.com>
http://iaian7.com/webcode/mediaboxAdvanced
and support
http://groups.google.com/group/mediaboxsupport
:? sorry for my ignorance, thought this was a unique extension to Contao. Sent the moderators a ticket to request information on hotkeys for mediabox.
ZOMG I FIGURED IT OUT!!!
Notice in the template for mediabox, it points to the mediabox.js. In essence, both the mediabox.js and mediabox_src.js files are identical, but mediabox.js calls different functions because it has predefined values. So the option for "alpha" was plugged in differently (looks to be hard coded into the script).
I had to remove the two instances of the 'case' that the 2 hotkeys represented in mediabox.js (case 88, case 67), and it ceased the 'c' and 'x' input.
In mediabox.js
in mediabox_src.jsCode:function u(X){switch(X.code)[case 27:case 88:case67:N();break;
one thing I noticed from the original code mediabox code found atCode:function keyDown(event){switch(event.code)[case 27:case 88:case 67:close();break;
http://codepaste.net/setr6j
there is a string missing in between each of those
but even if I plug these into the script, it doesn't do anything. So unfortunately, the only way to remove the X and C hotkeys is to delete case 88 and case 67 from the mediabox.js file. What I find strange is that options.alpha isn't represented anywhere else in the code besides those two instances. So I wonder if alpha is a broken call function?Code:// In .js if (A.alpha){ // In _src.js if (options.alpha){
EDIT: *Pats himself on the back for figuring it out* lol
i've never figured out why there is usually a .js and a _src.js file.
I assumed they would be identical (except one has spaces removed). I don't know if the _src one is ever called, and figured it is just there to provide a more readable version for reference.
I'm also not sure if Leo modifies them for inclusion in Contao, but it may be worth pointing out in a ticket your findings to Leo, as it obviously affects usability .... and more importantly Scarlett Johanssen could never join your site! :D
the thing that confuzzles me is that they look exactly the same, but they created variables for all of the functions, and smashed it all up... I attempted to force the _src.js file to be the referenced file, but all it did was break mediabox. So there is definitely something unique hidden in all that mesh of code... but why go through all the trouble of screwing with it so much to make it unreadable :?: :?: :? :?: :?:
19 kb as opposed to 39 kb... rapid delivery i think
Bookmarks