PDA

View Full Version : [FIXED] A bug with HTML Links



jonathansimmons
24 Apr 2012, 8:12 AM
So I've been having an issues that I think may be a bug.

I am trying to user the following link



'<a target="_blank" href="http://maps.google.com/maps?q=19202 Highland Rd Baton Rouge, LA 70809">Show me the map</a>'



in an app. This is a simple google Maps html query as stated to be user by apple https://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks.html.

You can put this link ANYWHERE in the app and load the app in safari mobile and it will work fine. The moment you add the mobile app to the homescreen this link no longer works.

The interesting this is that if you change the q= to anything else (i.e. test=, a=, anythingyouwant=) the link again works. It is only broken when you use q=. This is unfortunate as the link requires the user fo q for google to process the query.

Someone want to take a look at this an let me know if I'm crazy. I have been testing this inside the Sencha touch getting started example using ST 2.0.1-rc

Jamie Avins
24 Apr 2012, 8:23 AM
Have you tried turning off the preventZooming flag in the Viewport? This may have an effect on it.

Ihttp://docs.sencha.com/touch/2-0/#!/api/Ext.viewport.Default-cfg-preventZooming

jonathansimmons
24 Apr 2012, 8:26 AM
I've not tried that as I was unaware of the relations and likely would have ignored it as it was private.

For give me if this is a newb question but is this value I can just set directly on the panel I'm creating or is there a specific way to define it on the Ext.Viewport.

I have already tried putting it on the panel as below:



Ext.Viewport.add({
xtype: 'tabpanel',
fullscreen: true,
tabBarPosition: 'bottom',
preventZooming: false,
items: [
// This is the home page, just some simple html
{
title: 'Home',
iconCls: 'home',
cls: 'home',
scrollable: true,
html: [
'<img height=260 src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Welcome to Sencha Touch</h1>',
"<p>Building the Getting Started app</p>",
'<a target="_blank" href="http://maps.google.com/maps?q=19202 Highland Rd Baton Rouge, LA 70809">Show me the map</a>',
'<h2>Sencha Touch (2.0.0)</h2>'
].join("")
},
......


Which had no effect but I feel this might be the wrong way to implement

jonathansimmons
26 Apr 2012, 10:00 PM
REQUIRED INFORMATIONExt version tested:

Sencha Touch 2.0.1 (commercial)
Browser versions tested against:

Safari Mobile
DOCTYPE tested against:

<!DOCTYPE HTML>
Description:

Simple put google maps links stop working once an app is added to home-screen.
Steps to reproduce the problem:


Create a stock app using sencha command
Add an html link that looks like the folowing: <a href="http://maps.google.com/maps?q=19202 Blubonnet Ave Baton Rouge, LA 70810 United States">maps link</a>
Test link in mobile browser. to confirm working
Add to Homescreen and test again.
-Link does not work once app is added to homescreen.

The result that was expected:

The link to follow the link by either redirecting the browser page or opening the native maps app
The result that occurs instead:

The link is Dead
Test Case:
THIS ONE IS BROKEN


//<debug>Ext.Loader.setPath({
'Ext': '../../src'
});
//</debug>


Ext.application({
name: 'Sencha',
launch: function() {
Ext.Viewport.add({
xtype: 'tabpanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [
// This is the home page, just some simple html
{
title: 'Home',
iconCls: 'home',
cls: 'home',
scrollable: true,
html: [
'<img height=260 src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Test maps link</h1>',
'<a target="_blank" href="http://maps.google.com/maps?q=19202 Highland Rd Baton Rouge, LA 70809">Show me the map</a>',
'<h2>Sencha Touch (2.0.1)</h2>'
].join("")
},
]
});
}
});





THIS ONE WILL WORK (aka the link will work but the query doesn't as it's not using "q=" like the google maps search expects.


//<debug>Ext.Loader.setPath({
'Ext': '../../src'
});
//</debug>


Ext.application({
name: 'Sencha',
launch: function() {
Ext.Viewport.add({
xtype: 'tabpanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [
// This is the home page, just some simple html
{
title: 'Home',
iconCls: 'home',
cls: 'home',
scrollable: true,
html: [
'<img height=260 src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Test maps link</h1>',
'<a target="_blank" href="http://maps.google.com/maps?a=19202 Highland Rd Baton Rouge, LA 70809">Show me the map</a>',
'<h2>Sencha Touch (2.0.1)</h2>'
].join("")
},
]
});
}
});



HELPFUL INFORMATION
Debugging already done:

Ash shown above in the samples, I noticed that the link if only broken if you use q=. Change that to anything else and the link will follow through without and issue. However this obviously is an issue as google maps search expects q=
Tried url encoding the link to no avail.
Possible fix:

not provided
Operating System:

Mac OSX 10.7.3

Jamie Avins
27 Apr 2012, 6:48 AM
Thank you for the detailed test case.

jonathansimmons
6 Jun 2012, 7:29 AM
I see this wasn't able to be fixed for the 2.0.1.1 release. We are hoping to use google maps links in our app that will be releasing in the next 4-6 weeks. Any hope that this may be fixed?