View unanswered posts | View active topics It is currently Tue May 21, 2013 12:41 pm



Reply to topic  [ 2 posts ] 
 Browser, device detect web server plugin? 
Author Message

Joined: Nov 01, 2003
Posts: 117
Post Browser, device detect web server plugin?
I suspect like a lot of you, I have multiple client devices I wish to use with my control pages: iPod Touch, iPhone (retina resolution), Droid phone, iPad...

I have optimized my control pages for each of my devices and effectively replicated each control page set. At the moment, I have bookmarked the appropriate root page for each device so it can have the proper control pages that look best for it. But this seems silly.

I see two ways to solve this, there are probably more:

Server side Javascript:
Code: Select all
<script type="text/javascript">
if ((screen.width<=800) && (screen.height<=600)) {
 window.location.replace('http://127.0.0.1/controlpage?name=highResCP&useJS=True);
}
else {
   window.location.replace('http://127.0.0.1/controlpage?name=lowResCP&useJS=True');
}
</script>

Downside is going in to the appropriate file in /IndigoWebServer and hacking in the above code would only last until it gets written over the first time Matt and Jay push out an update.

Web Server Plugin
A plugin that would allow the user to define all parameters (screen resolution to target, control page to pull, etc). This seems far more elegant and what's more, would (I hope) survive through regular updates Matt and Jay do to Indigo itself.

Anyone have thoughts on this? Anyone wanna write a web plugin? :)


Sat Dec 17, 2011 1:02 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11689
Location: Texas
Post Re: Browser, device detect web server plugin?
I like the idea of an auto-redirect Web Server Plugin. Ideally, this functionality would be built into the main Web server but since it isn't yet I think a Web Server Plugin would be a good interim solution.

It seems like it would be pretty straight forward to implement. Want to give it a shot? :-)

Note you could forgo the end user selectable parameters and instead just have hard code it for common device screen sizes. So that when the screen width < 600 the suffix "_300to600" is added to the Control Page name and it is redirected, when width is between 600 and 800 "_600to800" is added to CP name, etc. Not as flexible, but seems like it might cover the common cases and offer 2 or 3 different screen sizes.

_________________
Image


Sun Dec 18, 2011 10:58 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.