ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: ahrasis on January 13, 2015, 01:08:23 pm

Title: Mobile Device Detect
Post by: ahrasis on January 13, 2015, 01:08:23 pm
This mod (http://custom.simplemachines.org/mods/index.php?mod=3349) might be a good addon if it is converted to ElkArte. I thought, despite the fact that we are using responsive theme, we might want to disable certain unnecessary things as well.

At the same time, I am looking for a good javascript that can response to the screen size as an option. May be javascript is better to do that? What do you think?
Title: Re: Mobile Device Detect
Post by: meetdilip on January 13, 2015, 01:09:19 pm
You are really good at spotting things @ahrasis
Title: Re: Mobile Device Detect
Post by: Spuds on January 13, 2015, 04:03:48 pm
I'm sure that mod could be ported, looks like the MobileESP project is still going.

What type of things were you looking to disable for mobile?  I'm sure we are still sending a full payload of JS that could be reduced to be more data friendly.  Of course a pure mobile theme would also be more data friendly as well.

One cool thing about using JS is that you can use media querys in the JS with window.matchMedia() I used that in one of my demo themes to keep an element in the viewport.  anyway https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia it is ie10+ compatible so some small issues around that.  But you could prevent loading or execution with simple querys like that.
Title: Re: Mobile Device Detect
Post by: emanuele on February 11, 2015, 04:19:50 pm
The "core" idea and code of the mod can be used in Elk just by copying the file and require_once'ing it, the functions do not use any SMF-specific code, so they should Just WorkTM. Theory. :P

Quote from: ahrasis – At the same time, I am looking for a good javascript that can response to the screen size as an option. May be javascript is better to do that? What do you think?
Use what Spuds suggested I think it's the best way, but of course if you want to disable something, depending on what you want to disable, javascript may not be enough.