[Pro] phone number within a graphic box

Hello all

I have a phone number within a graphic box, how do I get the phone number to display in an iOS device as a hyperlink showing the phone number to call without converting the number into an html file?

Tony


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try wrapping it in a tel: url. Select your graphic box so its handles are showing, then open the Hyperlink dialog. In the External tab, enter

tel:1234567890

as the entire URL. (Substitute your actual number.) Test this out in your iPhone. I have not tried this – my iOS simulator just decided it’s not going to work again – but it might be all you need.

Walter

On May 31, 2012, at 7:10 AM, Tony wrote:

Hello all

I have a phone number within a graphic box, how do I get the phone number to display in an iOS device as a hyperlink showing the phone number to call without converting the number into an html file?

Tony


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Just after I posted that I tried doing that and it worked :slight_smile: However, when on viewing this on a Mac (and presumably PC) the browser gives an error message when the link is clicked.

For example:

Safari says ’ … cant open the specified address’ is this a normal response when clicking on a number from a web browser?

Firefox say ‘don’t know how to open this address …’

Thanks again in advance

Tony.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That sounds correct. I am sure you could hide it from those browsers with JavaScript, or enable it only for browsers that can use it. Are you using any other JavaScript on the same page? Have you enabled any of the FX Actions?

Walter

On May 31, 2012, at 10:09 AM, Tony wrote:

Hi Walter

Just after I posted that I tried doing that and it worked :slight_smile: However, when on viewing this on a Mac (and presumably PC) the browser gives an error message when the link is clicked.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

JavaScript is running on two pages with PHP feedback forms and Validate. But the error is on all the pages when clicked.

Tony


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you only want this to apply to iPhone (not mobile in general), then try this technique.

  1. Remove the link from the graphic.
  2. Use the Item / Extended dialog to add a class attribute to the phone graphic, make it ‘phone’.
  3. Apply Protaculous to the page, set the Library picker to prototype-packed.
  4. Paste in the following code:
if(Prototype.Browser.MobileSafari){
	$$('.phone').invoke('wrap', 'a', {
		href:'tel:1234567890'
	});
}

Obviously, substitute your real phone number in there.

If you don’t want to load the whole Prototype library to do this one thing, I am sure it could be rewritten to work without it – with the caveat that it might be a whole lot more code for you to write. That’s why I asked if you had any other JavaScript running on the page – in case you were already loading Prototype (so it wouldn’t be any big thing to use it).

Walter

On May 31, 2012, at 11:02 AM, Tony wrote:

JavaScript is running on two pages with PHP feedback forms and Validate. But the error is on all the pages when clicked.

Tony


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It would need to apply to all mobile devices so maybe that would not be appropriate for me to do :slight_smile:

mmm what to do …


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, there’s other ways to skin that cat. Let’s say you wanted to get any browser that included the strings ‘MobileSafari’, ‘Blackberry’, ‘Android’ and ‘WebOS’ in their name. Maybe ‘Mobile’ to grab Windows Mobile 7 Phone Edition Plus Walkie-Talkie or whatever they call it today. You could replace:

if(Prototype.Browser.MobileSafari){

with this:

var n = navigator.userAgent;
if($w('mobile blackberry android webos').find(
	function(w){ return n.include(w); }
)){

That should get you a test that works on any mobile browser without giving you false truthiness on desktops.

Walter

On May 31, 2012, at 1:54 PM, Tony wrote:

It would need to apply to all mobile devices so maybe that would not be appropriate for me to do :slight_smile:

mmm what to do …


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In any case I’ll give it a go as soon as I can.

Thanks Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options