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
|
|
|
}
|
|
|
|
|
2019-07-29 07:13:58 -07:00
|
|
|
app.controller('AppController', function($scope) {});
|
2014-03-25 11:27:21 -07:00
|
|
|
|
2013-05-08 21:38:24 -07:00
|
|
|
}).call(this);
|