Skip to main content
Topic: Mobile Device Detect (Read 2611 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Mobile Device Detect

This mod 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?

Re: Mobile Device Detect

Reply #1

You are really good at spotting things @ahrasis

Re: Mobile Device Detect

Reply #2

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.

Re: Mobile Device Detect

Reply #3

Quote from: ahrasis – This mod 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.
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.
Bugs creator.
Features destroyer.
Template killer.