Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove scrollback.io and other cruft #96

Merged
merged 1 commit into from
Sep 11, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 9 additions & 101 deletions templates/_footer.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,117 +5,25 @@
<p>Source: <a href=https://github.com/hackerspacesg/hackerspace.sg>On Github</a></p>
</footer>


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/davis.min.js"></script>
<script src="/js/moment.min.js"></script>

<script>
var app;
var formatTimes = function(){
$(document).ready(function() {
$('time').each(function(index){
d = moment($(this).attr('datetime'));
$(this).text(d.fromNow() + ' at ' + d.format('h:mma'));
});
}
var updateHeader = function(path)
{
var class_name = (path == '/') ? 'home' : 'sub-page';
$('body').removeClass().addClass(class_name);
}
var scrollToPosition = function(pos){
$('body').animate({scrollTop:pos},200);
}
var scrollToElement = function(el){
var pos = $(el).offset().top;
scrollToPosition(parseInt(pos) - 56);
}
var fetchPage = function(path){
updateHeader(path);
var hasCallback = false;
if (arguments.length > 1){
hasCallback = true;
var callback = arguments[1];
}
$('div.content-wrapper').load(path + " div.container", function(){
formatTimes();
_gaq.push(['_trackPageview', path]);
if (hasCallback){
callback();
} else {
scrollToPosition(0);
}
});
return false;
}
$(document).ready(function(){
app = Davis(function () {
this.before(function (req) {
if ($('button.navbar-toggle').css('display') != 'none')
{
$('#subpages-navbar').collapse('hide');
}
})
this.get('/', function (req) {
fetchPage("/");
return false;
})
this.get('/?', function (req) {
return false;
})
this.get('/:path', function (req) {
var pathStr = req.location();
if (pathStr.indexOf('#') > 0)
{
var parts = pathStr.split('#');
elem = '#' + parts[1];
var callback = function(){
scrollToElement(elem);
}
if (parts[0] == window.location.pathname){
callback();
} else {
fetchPage(pathStr, callback);
}
}
else
{
fetchPage(pathStr);
}
return false;
})
})
app.start();
formatTimes();
updateHeader(window.location.pathname);
});
</script>

<script>
window.scrollback = {
streams:["hackerspacesg"],
theme: 'light',
ticker: true,
minimize: true
};

/***** don't edit below *****/
(function(d,s,h,e){e=d.createElement(s);e.async=1;
e.src=h+'/client.min.js';scrollback.host=h;
d.getElementsByTagName(s)[0].parentNode.appendChild(e);}
(document,'script',location.protocol+'//scrollback.io'));
</script>

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-11667249-1']);
_gaq.push(['_trackPageview']);
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

(function() {
var 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';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
ga('create', 'UA-11667249-1', 'auto');
ga('send', 'pageview');
</script>

</body>
Expand Down