#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
/* Scaled-down Backbone.js demonstration | |
* By Jacob Oscarson (http://twitter.com/jacob414), 2010 | |
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */ | |
$(function() { | |
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); } | |
// Faking a little bit of Backbone.sync functionallity | |
Backbone.sync = function(method, model, succeeded) { | |
ulog('<strong>'+method + ":</strong> " + model.get('label')); | |
if(typeof model.cid != 'undefined') { |
<?php | |
require __DIR__.'/vendor/facebook/src/facebook.php'; | |
$app_id = '1234567890'; | |
$secret = '0123456789abcdef0123456789abcdef0123456789abcdef'; | |
$fb = new Facebook(array( | |
'appId' => $app_id, | |
'secret' => $secret, |
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
//Example | |
//======= | |
ini_set("display_errors", true); | |
error_reporting(E_ALL|E_STRICT & ~E_NOTICE); | |
set_error_handler(function($errno, $errstr, $errfile, $errline){ | |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); | |
}); | |
$db = MySQLiDB::getInstance(); |
the request ... | |
================ | |
{ | |
"method":"foobar", | |
"params":["foo", "bar", "baz"] | |
} | |
JS Client using jquery ajax and json2.js | |
======================================== | |
App.invokeRpc = function(method, params, callback) | |
{ | |
var rpc = { | |
method:method, | |
params:params | |
}; |
package com.application.rpc | |
{ | |
/** | |
* ... | |
* @author seb | |
*/ | |
public dynamic class CallbackVO extends Object | |
{ | |
/*! | |
ICanHaz.js version 0.9 -- by @HenrikJoreteg | |
More info at: http://icanhazjs.com | |
*/ | |
(function($) { | |
/* | |
mustache.js — Logic-less templates in JavaScript | |
See http://mustache.github.com/ for more info. | |
*/ |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |