Skip to content

Commit

Permalink
new example
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Møller committed Aug 14, 2014
1 parent 664f5ea commit d7e6c9e
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions ios/example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ NappJockey.appendUserAgent("my custom string");
// webview
var webview = NappJockey.createWebView({
top: 70,
url: "http://yourwebsite.com/jockeyjs/index.html",
url: "http://yourwebsite.com",
debug: true
});

webview.addEventListener('load', function(e) {
Ti.API.info('load');
});

webview.addEventListener('beforeload', function(e) {
Ti.API.info('beforeload');
});

webview.addEventListener('toggle-fullscreen', function(e) {
Ti.API.info('toggle-fullscreen');
Expand All @@ -36,6 +44,7 @@ win.add(webview);
var btn = Ti.UI.createButton({
title: "Send event to webpage",
top: "20dp",
right: "6dp",
height: "40dp"
});
btn.addEventListener("click", function() {
Expand All @@ -45,4 +54,16 @@ btn.addEventListener("click", function() {
color: "#CB4437"
});
});
win.add(btn);
win.add(btn);


var btnReload = Ti.UI.createButton({
title: "reload",
top: "20dp",
left: "6dp",
height: "40dp"
});
btnReload.addEventListener("click", function() {
webview.reload();
});
win.add(btnReload);

0 comments on commit d7e6c9e

Please sign in to comment.