Skip to content

Commit

Permalink
Dart: Updated base.js
Browse files Browse the repository at this point in the history
  • Loading branch information
passy committed Mar 29, 2013
1 parent adeabde commit 0359289
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions architecture-examples/dart/web/assets/base.js
@@ -1,7 +1,40 @@
(function( window ) {
(function () {
'use strict';

if ( location.hostname === 'todomvc.com' ) {
if (location.hostname === 'todomvc.com') {
var _gaq=[['_setAccount','UA-31081062-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'));
}
})( window );

function getSourcePath() {
// If accessed via addyosmani.github.com/todomvc/, strip the project
// path.
if (location.hostname.indexOf('github.com') > 0) {
return location.pathname.replace(/todomvc\//, '');
}
return location.pathname;
}

function appendSourceLink() {
var sourceLink = document.createElement('a');
var paragraph = document.createElement('p');
var footer = document.getElementById('info');
var urlBase = 'https://github.com/addyosmani/todomvc/tree/gh-pages';

if (footer) {
sourceLink.href = urlBase + getSourcePath();
sourceLink.appendChild(document.createTextNode('Check out the source'));
paragraph.appendChild(sourceLink);
footer.appendChild(paragraph);
}
}

function redirect() {
if (location.hostname === 'addyosmani.github.com') {
location.href = location.href.replace('addyosmani.github.com/todomvc',
'todomvc.com');
}
}

appendSourceLink();
redirect();
})();

0 comments on commit 0359289

Please sign in to comment.