FLOABN Page Link Manager
Filed Under:
When a media player is engaged (the playhead is at a particular point, play is pause-able, other typical options are present within that player, etc…), it will toss a callback function at the PLM which springs into action then by applying a class to all links outside the media container on the same page based on wether or not they are localhost/domain links or external (not within local name space).
Class Allocation
What The So-Called “Page Link Manager” Does
Applies one of two classes onLoad to all links within a page:
- .plm-internal
- .plm-external
.plm-internal
This class will be most useful for links which have an immediate function within the page where the media is currently engaged and will not likely be interrupted for other available functions on that page.
Examples include; but are obviously not limited to: file downloads, rss links, email addresses, and other links which normally come with the pre-knowledge from the user that that link itself performs a function outside basic navigation of ‘web pages’, or ‘document/site views’. That function, is one that updates their calendars, adds a feed to their preferred reader, launches their email client, etc…
All things, which while happening at a moments notice, do not always offer uninterrupted availability whereby they are often abandoned. That often abandoned circumstance is what promted this PLM approach.
*Note: A rule sheet can be written to manage lower tiers in internal linking groups/facets/etc…
.plm-external
This class requires less attention as at this point because it merely checks for outbound links and applies the class without discrimination. One could write rules per external name space or other imagined criteria of course but that is for custom applications and might/could be dealt with as needed.
Feedback in the form of use-cases much appreciated on this. My email address is human findable. – Josh
Swappable callto: and tel: for Skype & iPhone
Filed Under:
Marking up a telephone number to use Skype’s callto: except when User Agent is iPhone uses tel:.
Javascript
<script language="javascript"> window.onload = function () { if (navigator.userAgent.match (/iPhone/i)) { var a = document.getElementsByTagName ("a"); for (var i = 0; i < a.length; i++) { if (a[i].getAttribute ('href').search (/callto:/i) === 0) { a[i].setAttribute ('href', a[i].getAttribute ('href').replace (/^callto:/, "tel:")); } } } }; </script>
The precending chunk of Javascript in the head of a document will swap out callto: for tel: in the following HTML.
HTML
<a href="callto:15035555555">+1 (503) 555 5555</a>
This leaves you with a hyper-linked phone number which depends on the user to have Skype installed on their machine so if you’d prefer to not confuse those without Skype by tempting them to click the number then you might stick a Skype icon along side the link.
User Agents other than iPhone will recognize the tel: protocol so the Javascript above could be expanded to involve more User Agents.


