2013-10-21 12:22:47 -07:00
|
|
|
'use strict';
|
|
|
|
|
2011-11-06 07:14:33 -08:00
|
|
|
var snipt = {
|
2014-04-30 09:35:20 -07:00
|
|
|
module: function() {
|
|
|
|
var modules = {};
|
2011-11-06 07:14:33 -08:00
|
|
|
|
2014-04-30 09:35:20 -07:00
|
|
|
return function(name) {
|
|
|
|
if (modules[name]) {
|
|
|
|
return modules[name];
|
|
|
|
}
|
2011-11-06 07:14:33 -08:00
|
|
|
|
2014-04-30 09:35:20 -07:00
|
|
|
return modules[name] = {};
|
|
|
|
};
|
|
|
|
}()
|
2011-11-06 07:14:33 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
jQuery(function($) {
|
2014-04-30 09:35:20 -07:00
|
|
|
var SiteView = snipt.module('site').SiteView;
|
|
|
|
window.site = new SiteView();
|
2015-10-25 05:42:47 -07:00
|
|
|
|
|
|
|
var $pres = $('td.code pre');
|
|
|
|
$pres.each(function(i) {
|
|
|
|
var pre = $pres.eq(i);
|
2015-10-25 18:07:19 -07:00
|
|
|
pre.width(pre.parents('section.code').width() - 30);
|
2015-10-25 05:42:47 -07:00
|
|
|
});
|
2011-11-06 07:14:33 -08:00
|
|
|
});
|
2013-05-08 21:38:24 -07:00
|
|
|
|
|
|
|
// Angular app init.
|
|
|
|
(function() {
|
|
|
|
|
2014-04-30 09:35:20 -07:00
|
|
|
var root = this;
|
|
|
|
|
|
|
|
// App definition.
|
|
|
|
var app = angular.module('Snipt', ['ngRoute'], function($locationProvider) {
|
|
|
|
$locationProvider.html5Mode(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Use non-Django-style interpolation.
|
|
|
|
app.config(function($interpolateProvider) {
|
|
|
|
$interpolateProvider.startSymbol('{[{');
|
|
|
|
$interpolateProvider.endSymbol('}]}');
|
|
|
|
});
|
|
|
|
|
|
|
|
root.app = app;
|
|
|
|
|
2015-08-16 18:08:11 -07:00
|
|
|
if (root.ll) {
|
|
|
|
if (root.location.pathname === '/account/stats/') {
|
|
|
|
root.ll('tagEvent', 'Viewed stats page');
|
|
|
|
}
|
2015-07-17 09:59:52 -07:00
|
|
|
}
|
|
|
|
|
2014-04-30 09:35:20 -07:00
|
|
|
app.controller('AppController', function($scope) {
|
|
|
|
$scope.ads = [
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://showroom.is/?from=snipt',
|
2014-10-20 17:35:59 -07:00
|
|
|
image: 'https://snipt.s3.amazonaws.com/img/logo-showroom.png',
|
2014-04-30 09:35:20 -07:00
|
|
|
company: 'Showroom.is',
|
|
|
|
title: 'New-car research for the modern web.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://bruce-springsteen-the-e-street-band.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/bruce-springsteen-bf99a8/4275/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Bruce Springsteen & The E Street Band on tour.'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://beyonce.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/beyonce-b28ec9/37/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Beyonce on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://paul-mccartney.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/paul-mccartney-0ab8df/1408/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Paul McCartney on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://rolling-stones.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/rolling-stones-73ab94/2597/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Rolling Stones on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://justin-timberlake.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/justin-timberlake-c30b82/1019/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Justin Timberlake on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://billy-joel.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/billy-joel-254023/303/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Billy Joel on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://taylor-swift.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/taylor-swift-1cdf83/35/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Taylor Swift on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://one-direction.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/one-direction-a22937/12586/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'One Direction on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://george-strait.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/george-strait-92a4b8/780/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'George Strait on tour. View current tour dates on:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: 'http://pearl-jam.gigs.is/?from=snipt',
|
|
|
|
image: 'http://cdn.chairnerd.com/images/performers-landscape/pearl-jam-fb4480/1416/huge.jpg',
|
|
|
|
company: 'Gigs.is',
|
|
|
|
title: 'Pearl Jam on tour. View current tour dates on:'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
var randomIndex = Math.floor(Math.random() * (($scope.ads.length - 1) - 0 + 1)) + 0;
|
|
|
|
$scope.randomAd = $scope.ads[randomIndex];
|
|
|
|
});
|
2014-03-25 11:27:21 -07:00
|
|
|
|
2013-05-08 21:38:24 -07:00
|
|
|
}).call(this);
|