Skip to content

Instantly share code, notes, and snippets.

@webuniverseio
Created October 17, 2013 15:22
Show Gist options
  • Save webuniverseio/7026880 to your computer and use it in GitHub Desktop.
Save webuniverseio/7026880 to your computer and use it in GitHub Desktop.
Stripped down version of my starting template
<!DOCTYPE HTML>
<!--[if lt IE 7]> <html lang="en-us" class="no-js lt-ie9 lt-ie8 lt-ie7 ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js lt-ie9 lt-ie8 ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js lt-ie9 ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta property="og:url" content="http://sitedomain/">
<meta property="og:title" content="Site">
<meta property="og:type" content="website">
<title>Site title</title>
<script>
document.documentElement.className = document.documentElement.className.replace('no-js', '');
</script>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div id="main-box" class="center-box">
<header id="header">
<span ng-bind="text"></span>
</header>
<div id="content-box">
</div>
<div id="padder"></div>
</div>
<footer id="footer">
</footer>
<!--[if lte IE 8]>
<div class="noscript">
You are using an <b>outdated</b> browser. To be able to use all of the site's functions, please <a href="http://browsehappy.com/" target="_blank" class="a browsehappy">consider</a> installing a newer version.
</div>
<![endif]-->
<noscript>
<div class="noscript">
Javascript is disabled for this site in your browser. Please enable it if you want to see site in more interactive mode. To learn how click <a class="a" href="http://www.youtube.com/watch?v=0w8wr8a0r2M" target="_blank">here</a> or <a class="a" href="http://www.google.ca/search?q=how+to+enable+javascript&amp;tbs=vid:1" target="_blank">here</a>.
</div>
</noscript>
<script>
(function () {
'use strict';
window._cmsmode = (function () {
//if document loaded as iframe, it should have a referrer, right?
try {
return (window.self !== window.top) && ~document.referrer.split('/')[2].search('/cmsdesk/');
} catch (ex) {
return false;
}
}());
if (!window._cmsmode && ~document.location.host.search(/(sitemane\.com)$/g)) {
window._gaq = window._gaq || [];
window._gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
window._gaq.push(['_trackPageview']);
(function () {
var ga, s;
if (!isDevMode) {
ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
}
if (typeof window.onerror === 'function') {
window._onerror0 = window.onerror;
}
window.onerror = function handleGlobalError(msg, url, line) {
var errorLabelType,
host = document.location.host;
//mark as js error if url not empty and url doesn't contain chrome errors
if (url && !~url.search(/chrome:/i)) {
errorLabelType = 'JS Error';
//otherwise count it as browser error
} else {
errorLabelType = 'User Browser Error';
}
if (~url.search(host)) {
window._gaq.push([
'_trackEvent',
errorLabelType,
'\nSeverity level 0',
'\n ' + msg + ' | Useragent: ' + navigator.userAgent + ' | \n' +
'Script url: ' + url + ' | \n' +
'Line number: ' + line,
0,
true
]);
}
if (typeof window._onerror0 === 'function') {
window._onerror0();
}
if (~document.documentElement.className.search('lt-ie8')) {
return true;
}
return false;
};
}());
}
}());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment