Hoppa till huvudinnehållet

Force a tablet to use desktop config?

Kommentarer

10 kommentarer

  • Permanently deleted user

    Hi Rebecca, 

    Unfortunately detecting whether a user is on a tablet or a desktop client is a tricky problem. In our testing we found that regardless of how we decided which shell to use, we always missed a couple platforms. The surface and other similar platforms seemed to be the most inconsistent in deciding whether we wanted a tablet or desktop style shell.

    The easiest way we found was to assume that all touch devices wanted the tablet shell (there is extra logic for determining the handheld shell). Obviously this isn't as catch-all as we wanted and misses a bunch of use cases, but luckily you can change that on your server to force the desktop shell instead.

    The file you want to modify is called loader.js which is stored at this location by default: C:\inetpub\wwwroot\Html5Viewer\Resources\Compiled\loader.js

    This file is an obfuscated javascript file, so it is going to be pretty much impossible to manually look through. I am going to be asking you to make a small edit to the file, but due to the nature of obfuscated javascript I am going to strongly suggest that you make a copy of the file before modifying it.

    With the loader.js file open, perform a search for the following: ||b("Touch") and remove it from the file.

    That portion of the code looks for the Touch parameter in the browser's userAgentString. This is what we use as a catch all to default touch devices to use the tablet shell instead of desktop. With that Touch parameter gone, your surface users should now default to the desktop configuration instead.

    That method should work to automatically default to the desktop config on those devices. I understand that is a tricky edit but it is the most efficient way to make the change. 

    The only other option I can think of right now is to manually edit the launch link each time a user opens the viewer on their device. By changing the index.html in the url to desktop.html, it will choose to use the desktop configuration instead of whatever the default is. You can use this for any of the 3 shell types (desktop.html, tablet.html and handheld.html) in case you want to use a different shell on a specific device.

    A quick example of that would be the following:

    You have a GVH url loaded into your browser like this: http://cpurnell-gel.latitudeqa.com/Html5Viewer/index.html?viewer=Offline_Replicas.Offline_Replicas 

    and you change it to be this instead: http://cpurnell-gel.latitudeqa.com/Html5Viewer/desktop.html?viewer=Offline_Replicas.Offline_Replicas

     

    Hopefully this was helpful, sorry there isn't an easier solution at this time.

     

    Cory Purnell

     

    Latitude Geographics Quality Assurance Team
    0
  • Chris Roberts
    Hi Rebecca

     

    We were having the exact same issue in our Dept as you are. The workaround that Cory has suggested about editing the loader.js file is exactly what I implemented, and it has work very well in our case. I have been doing this for the last 12 months or so, and there haven't been any adverse effects reports.

     

    Chris
    0
  • Permanently deleted user
    Does making that change mean that handheld devices will also default to the desktop shell?
    0
  • Permanently deleted user
    It shouldn't. The shell selection logic looks like this:

     

    If user agent contains any of the following:
    • "Android" and "mobile"
    • "Windows" and "Phone"
    • "iPhone"
    • "iPod"
    • "Blackberry"
    ...load the handheld shell. If user agent contains:
    • "Android"
    • "iPad"
    • "Playbook"
    • "Touch"
    ...load the tablet shell. If none of these apply, load the desktop shell. So handheld devices -- and non-Windows tablets -- will continue to behave as they did before.
    0
  • Permanently deleted user
    Thanks Cory and Jordan!  I didn't think I'd be able to do this. Glad I asked!
    0
  • Deep Bhari
    Dear all,

     

    This ( deleting ||b ("Touch in the loader.js file)saved us a lot of headache when we decided to roll out HTML5 based viewer. Thanks much for all the parties above. However I'd like to note that replacing 'index.html'  with 'desktop.html' was causing more problem than solving anything for us. So if confident I'd suggest making the change in the loader file!

     

    Deep B.

     

     
    0
  • Deep Bhari
    Folks,

     

    So following up my above comment, the fix suggested by Cory Purnell and Jordan worked (removing ||b("Touch") from loader.js in inetpub) UNTIL  we upgraded the Viewer to the latest one. Unfortunately, it is not possible to make suggesed changes as above in  this new loader.js document. Bummer, so what is the new fix for the issue with the upgraded HTML5 viewer Latitude Geographics??

     

    Hope the fix is as easy as it was with the old version.

     

    regards,

     

    Deep Bhari

     

     
    0
  • Stefan Schweigert

    Hi Deep,

    After checking with our development team, the changes that were made previously should still be functional in the latest release. The only different is that the line is now: ||ua(“Touch”).

    It was also mentioned that when using a Surface device, it usually will automatically load the desktop shell.

    Thanks, Stefan

    0
  • Ethan Granger
    I have a few Microsoft Surface Pros in the organization and we would like the ability to pan with finger and Surface Pen and pinch to zoom as well as identify and draw with Surface Pen. I've attempted to edit the url with "tablet.html" and the viewer will load, but gestures and pen do not work. I don't see any touch settings in GCE manager if they exist.

     

    I'm using Chrome with HTML5 viewer 2.11.1 and GCE 4.10.3.23.
    0
  • Ethan Granger
    BTW, the above gestures and features work fine on an IPad with pencil.
    0

Du måste logga in om du vill lämna en kommentar.