Skip to content

Commit

Permalink
Trying to force external links to open in an external webkit.
Browse files Browse the repository at this point in the history
  • Loading branch information
stungeye committed Mar 2, 2012
1 parent 519ed23 commit bac6491
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -45,7 +45,7 @@ <h2>About Meow Reader</h2>

<div class="screen hidden" id="about_app">
<h2>About this App</h2>
<p>This mobile application was written by <a href="http://stungeye.com" target="_blank">Kyle Geske</a> using HTML5 and <a href="http://phonegap.com" target="_blank">Phonegap</a>.</p>
<p>This mobile application was written by <a href="http://stungeye.com" target="_blank">Kyle Geske</a> using HTML5 and <a href="http://phonegap.com" target="_blank" rel="external">Phonegap</a>.</p>
<ul>
<li><a href="mobilehtml5.stungeye.com" target="_blank" rel="external">How This App was Written</a></li>
<li><a href="https://github.com/stungeye/HTML5-Tumblr-Mobile-App" target="_blank" rel="external">App Source Code on Github</a></li>
Expand Down
10 changes: 10 additions & 0 deletions js/main.js
Expand Up @@ -17,6 +17,16 @@ document.addEventListener("DOMContentLoaded", function() {

});

document.addEventListener("deviceready", phonegap_init, false);

function phonegap_init() {
[].forEach.call(document.querySelectorAll("a[target=_blank][rel=external]"), function(el) {
set_click(el, function(e) {
navigator.app.loadUrl(e.getAttribute('href'));
});
}
}

// This callback function is called by the JSONP response of the Tumblr API
// request made in the script element below this one.
function load_images(json) {
Expand Down

0 comments on commit bac6491

Please sign in to comment.