Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created February 2, 2011 02:42
Show Gist options
  • Save erichocean/807152 to your computer and use it in GitHub Desktop.
Save erichocean/807152 to your computer and use it in GitHub Desktop.
Default index.html for a SproutCore application.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="apple-touch-icon" href="images/sproutcore-logo.png" />
<link rel="apple-touch-startup-image" media="screen and (orientation:portrait)" href="images/sproutcore-startup-portrait.png" />
<link rel="apple-touch-startup-image" media="screen and (orientation:landscape)" href="images/sproutcore-startup-landscape.png" />
<link rel="shortcut icon" href="" type="image/x-icon" />
<title>Your App</title>
<script type="text/javascript">
var SC = SC || { BUNDLE_INFO: {}, LAZY_INSTANTIATION: {} };
SC.browser = (function() {
var userAgent = navigator.userAgent.toLowerCase(),
version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ;
var browser = {
version: version,
safari: (/webkit/).test( userAgent ) ? version : 0,
opera: (/opera/).test( userAgent ) ? version : 0,
msie: (/msie/).test( userAgent ) && !(/opera/).test( userAgent ) ? version : 0,
mozilla: (/mozilla/).test( userAgent ) && !(/(compatible|webkit)/).test( userAgent ) ? version : 0,
mobileSafari: (/apple.*mobile.*safari/).test(userAgent) ? version : 0,
chrome: (/chrome/).test( userAgent ) ? version : 0,
windows: !!(/(windows)/).test(userAgent),
mac: !!((/(macintosh)/).test(userAgent) || (/(mac os x)/).test(userAgent)),
language: (navigator.language || navigator.browserLanguage).split('-', 1)[0]
};
browser.current = browser.msie ? 'msie' : browser.mozilla ? 'mozilla' : browser.safari ? 'safari' : browser.opera ? 'opera' : 'unknown' ;
return browser ;
})();
SC.bundleDidLoad = function(bundle) {
var info = this.BUNDLE_INFO[bundle] ;
if (!info) info = this.BUNDLE_INFO[bundle] = {} ;
info.loaded = true ;
};
SC.bundleIsLoaded = function(bundle) {
var info = this.BUNDLE_INFO[bundle] ;
return info ? !!info.loaded : false ;
};
SC.loadBundle = function() { throw "SC.loadBundle(): SproutCore is not loaded."; };
SC.setupBodyClassNames = function() {
var el = document.body ;
if (!el) return ;
var browser, platform, shadows, borderRad, classNames, style;
browser = SC.browser.current ;
platform = SC.browser.windows ? 'windows' : SC.browser.mac ? 'mac' : 'other-platform' ;
style = document.documentElement.style;
shadows = (style.MozBoxShadow !== undefined) ||
(style.webkitBoxShadow !== undefined) ||
(style.oBoxShadow !== undefined) ||
(style.boxShadow !== undefined);
borderRad = (style.MozBorderRadius !== undefined) ||
(style.webkitBorderRadius !== undefined) ||
(style.oBorderRadius !== undefined) ||
(style.borderRadius !== undefined);
classNames = el.className ? el.className.split(' ') : [] ;
if(shadows) classNames.push('box-shadow');
if(borderRad) classNames.push('border-rad');
classNames.push(browser) ;
classNames.push(platform) ;
if (parseInt(SC.browser.msie,0)==7) classNames.push('ie7') ;
if (SC.browser.mobileSafari) classNames.push('mobile-safari') ;
if ('createTouch' in document) classNames.push('touch');
el.className = classNames.join(' ') ;
};
if ((typeof SC !== 'undefined') && SC && SC.bundleDidLoad) SC.bundleDidLoad('sproutcore/bootstrap');
SC.buildMode = "production";
</script>
<link href="css/sproutcore-1.4.4-min.css" rel="stylesheet" type="text/css" />
<link href="css/sproutcore-theme-1.4.4-min.css" rel="stylesheet" type="text/css" />
</head>
<body class="sc-theme focus">
<script type="text/javascript">
if (SC.setupBodyClassNames) SC.setupBodyClassNames() ;
</script>
<div id="loading">
<p class="loading">Loading...<p>
</div>
<script type="text/javascript" src="javascript/sproutcore-1.4.4-min.js"></script>
<script type="text/javascript">String.preferredLanguage = "en";</script>
<script type="text/javascript">
// YOUR CODE GOES HERE
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment