Patch (to be ported)
Project:
DrupalChat
Version:
6.x-2.0-beta19
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
16 Feb 2012 at 17:53 UTC
Updated:
23 Apr 2024 at 13:35 UTC
Jump to comment: Most recent file
Comments
Comment #1
darklrd commentedThanks for your patch!
I have a query. Will this work for all mobile devices? Is there a more generic function for this (maybe a Drupal function)?
Comment #2
thermador commentedCan this get added as a feature for the next version? Like just a checkbox in the DrupalChat settings "disable DrupalChat on mobile devices". Please???
(Try using DrupalChat on a mobile device... it's not possible to fully use the functionality, and it wrecks the site theme.)
The code is already here in this patch; it would be easy to implement.
(I am using the D7 version but it should be added to both.)
Thank you!
Comment #3
darklrd commentedThe question still remains, is this function generic?
You can use visibility control to stop drupalchat on mobile specific URLs.
Comment #4
thermador commentedProbably not generic enough: It only includes user agents for iphone, ipad, and android:
if(stripos($_SERVER['HTTP_USER_AGENT'],"iPod") || stripos($_SERVER['HTTP_USER_AGENT'],"iPhone") || stripos($_SERVER['HTTP_USER_AGENT'],"iPad") || stripos($_SERVER['HTTP_USER_AGENT'],"Android")) {There are a LOT of other mobile user agents out there. These would have to be added to the function, and then be updated every time there was a new mobile device.
So... I did some research on my own.
This is what I did to solve the problem. Maybe it can be worked into a DrupalChat option?
I added this code to the main CSS for my site. This solution is tested and working for me.
Based on what I've read here: http://www.javascriptkit.com/dhtmltutors/cssmediaqueries2.shtml
Comment #5
Exploratus commentedMuch needed!
Comment #6
darklrd commentedYou can now use URL visibility control (present on DrupalChat configuration page). Thanks.
Comment #7
andrea.failli commentedThank you for the URL visibility control feature. But on my website, the mobile version is on a different domain: the page paths are the same for the PC version and mobile version, so I can't disable the chat on the mobile version.
I've patched the module...with this patch you can configure under which domain enable/disable the chat.
Hope this help!
Andrea