├── views
├── index.ejs
├── error.ejs
├── sbindex.ejs
├── registrationError.ejs
├── _registration_status.ejs
├── admin_nav.ejs
├── registration.ejs
├── ads
│ └── show.ejs
├── history.ejs
├── auction.ejs
└── ai_auctions.ejs
├── Procfile
├── Procfile-dev
├── auctionTest
├── .gitignore
├── config.json
└── package.json
├── public
├── images
│ ├── favicon.ico
│ └── subtlenet2.png
├── css
│ └── bootstrap
│ │ └── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
└── scripts
│ └── codemirror
│ ├── theme
│ ├── ambiance-mobile.css
│ ├── neat.css
│ ├── elegant.css
│ ├── eclipse.css
│ ├── cobalt.css
│ ├── monokai.css
│ ├── night.css
│ ├── the-matrix.css
│ ├── rubyblue.css
│ ├── mbo.css
│ ├── blackboard.css
│ ├── 3024-day.css
│ ├── paraiso-dark.css
│ ├── 3024-night.css
│ ├── paraiso-light.css
│ ├── base16-dark.css
│ ├── vibrant-ink.css
│ ├── base16-light.css
│ ├── twilight.css
│ ├── midnight.css
│ ├── erlang-dark.css
│ ├── tomorrow-night-eighties.css
│ ├── pastel-on-dark.css
│ ├── xq-light.css
│ └── lesser-dark.css
│ ├── addon
│ ├── display
│ │ ├── fullscreen.css
│ │ ├── fullscreen.js
│ │ └── placeholder.js
│ ├── fold
│ │ ├── foldgutter.css
│ │ ├── indent-fold.js
│ │ └── comment-fold.js
│ ├── edit
│ │ ├── trailingspace.js
│ │ ├── continuelist.js
│ │ └── matchtags.js
│ ├── lint
│ │ ├── json-lint.js
│ │ ├── css-lint.js
│ │ └── coffeescript-lint.js
│ ├── dialog
│ │ └── dialog.css
│ ├── mode
│ │ ├── multiplex_test.js
│ │ ├── loadmode.js
│ │ └── overlay.js
│ ├── hint
│ │ ├── show-hint.css
│ │ ├── anyword-hint.js
│ │ └── css-hint.js
│ ├── runmode
│ │ ├── colorize.js
│ │ └── runmode.js
│ ├── scroll
│ │ └── scrollpastend.js
│ ├── tern
│ │ ├── worker.js
│ │ └── tern.css
│ ├── selection
│ │ └── active-line.js
│ └── comment
│ │ └── continuecomment.js
│ ├── mode
│ ├── rpm
│ │ ├── spec
│ │ │ └── spec.css
│ │ └── changes
│ │ │ ├── changes.js
│ │ │ └── index.html
│ ├── tiddlywiki
│ │ └── tiddlywiki.css
│ ├── tiki
│ │ ├── tiki.css
│ │ └── index.html
│ ├── diff
│ │ └── diff.js
│ ├── ntriples
│ │ └── index.html
│ ├── http
│ │ └── index.html
│ ├── jinja2
│ │ ├── index.html
│ │ └── jinja2.js
│ ├── z80
│ │ └── index.html
│ ├── ecl
│ │ └── index.html
│ ├── rust
│ │ └── index.html
│ ├── pascal
│ │ └── index.html
│ ├── pig
│ │ └── index.html
│ ├── turtle
│ │ └── index.html
│ ├── vbscript
│ │ └── index.html
│ ├── gherkin
│ │ └── index.html
│ ├── properties
│ │ ├── index.html
│ │ └── properties.js
│ ├── javascript
│ │ └── typescript.html
│ ├── sparql
│ │ └── index.html
│ ├── sass
│ │ └── index.html
│ ├── perl
│ │ └── index.html
│ ├── css
│ │ ├── less_test.js
│ │ └── index.html
│ ├── shell
│ │ └── index.html
│ ├── gas
│ │ └── index.html
│ ├── toml
│ │ └── index.html
│ ├── pegjs
│ │ └── index.html
│ ├── smalltalk
│ │ └── index.html
│ ├── xml
│ │ └── index.html
│ ├── php
│ │ └── index.html
│ ├── octave
│ │ └── index.html
│ ├── htmlembedded
│ │ └── index.html
│ ├── apl
│ │ └── index.html
│ ├── haml
│ │ └── index.html
│ ├── yaml
│ │ └── index.html
│ ├── lua
│ │ └── index.html
│ ├── erlang
│ │ └── index.html
│ ├── haskell
│ │ └── index.html
│ └── go
│ │ └── index.html
│ └── keymap
│ └── extra.js
├── start.sh
├── .gitignore
├── setupdb.js
├── resque
├── jobs.js
├── auction_closing.js
└── auction_recalculation.js
├── model
├── factoids.js
├── userAds.js
├── bid.js
├── ad.js
├── reservedAds.js
├── auctions.js
├── reservedAd.js
├── profileUser.js
├── ai_invoices.js
├── auction.js
├── bids.js
├── auctionUser.js
├── userBidsPerRegion.js
├── reviewAds.js
├── approvedAds.js
├── rejectedAds.js
├── randomFactoid.js
└── auctionsTimeRelative.js
├── middleware
├── browse-prefix.js
├── ensure-auth.js
├── model-loader.js
└── conditional-csrf.js
├── routes
├── api
│ ├── index.js
│ └── bids.js
├── rules.js
├── ad_upload.js
├── history.js
├── registration.js
├── bid.js
└── factoids.js
├── repl.js
├── deployment
└── adness-api.service
├── .travis.yml
├── deploy.conf
├── Dockerfile
├── test
├── smf-migration.js
└── biddingAlgorithmTest.js
├── email-templates
├── reg-admin-paid.ejs
├── invalid-bid.ejs
├── user-invalidated.ejs
├── winner-admin-paid.ejs
├── reg-user-paid.ejs
├── notify-bidders.ejs
├── winner-user-paid.ejs
├── notify-winners.ejs
├── notify-winners-modified.ejs
└── registration.ejs
├── index.js
├── model.js
├── package.json
└── passport.js
/views/index.ejs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: node index.js
2 |
--------------------------------------------------------------------------------
/Procfile-dev:
--------------------------------------------------------------------------------
1 | web: nodemon index.js
2 |
--------------------------------------------------------------------------------
/auctionTest/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/public/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slickage/adness/HEAD/public/images/favicon.ico
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | export DB_URL=http://couchdb:5984
3 |
4 | cd /src
5 | node index
6 |
7 |
--------------------------------------------------------------------------------
/public/images/subtlenet2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slickage/adness/HEAD/public/images/subtlenet2.png
--------------------------------------------------------------------------------
/views/error.ejs:
--------------------------------------------------------------------------------
1 | <% layout('sblayout') %>
2 |
3 |
<%= errorMsg %>
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | tmp/*
4 | .npm-debug.log
5 | public/assets
6 | .vagrant
7 | .env
8 | /id_deploy
9 |
--------------------------------------------------------------------------------
/public/css/bootstrap/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slickage/adness/HEAD/public/css/bootstrap/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/css/bootstrap/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slickage/adness/HEAD/public/css/bootstrap/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/css/bootstrap/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/slickage/adness/HEAD/public/css/bootstrap/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/auctionTest/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "numberOfUsers" : 4,
3 | "numberOfSlots" : 10,
4 | "timeLength" : 1,
5 | "btcStep" : 0.25,
6 | "timeInterval" : 1000
7 | }
8 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/ambiance-mobile.css:
--------------------------------------------------------------------------------
1 | .cm-s-ambiance.CodeMirror {
2 | -webkit-box-shadow: none;
3 | -moz-box-shadow: none;
4 | box-shadow: none;
5 | }
6 |
--------------------------------------------------------------------------------
/setupdb.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var dbinit = require('./db-init');
5 |
6 | // Setup Database without running adness
7 | dbinit.validateDBExist(function() {});
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/display/fullscreen.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-fullscreen {
2 | position: fixed;
3 | top: 0; left: 0; right: 0; bottom: 0;
4 | height: auto;
5 | z-index: 9;
6 | }
7 |
--------------------------------------------------------------------------------
/resque/jobs.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | module.exports = {
5 | 'auction_closing': { perform: require('./auction_closing') },
6 | 'recalculation': { perform: require('./auction_recalculation') }
7 | };
8 |
--------------------------------------------------------------------------------
/model/factoids.js:
--------------------------------------------------------------------------------
1 | var db = require(__dirname + '/../db');
2 | module.exports = function(req, cb) {
3 | db.getFactoids(function(err, facts) {
4 | if (err) { return cb(err, undefined); }
5 | if (facts) { return cb(null, facts); }
6 | });
7 | };
--------------------------------------------------------------------------------
/middleware/browse-prefix.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var config = require(__dirname + '/../config');
5 |
6 | module.exports = function(req, res, next) {
7 | req.browsePrefix = config.sbPrefix;
8 | return next();
9 | };
10 |
--------------------------------------------------------------------------------
/model/userAds.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | db.getUserAds(req.params.userId, function(err, ads) {
7 | if (!err) { cb(null, ads); }
8 | else { cb(err, []); }
9 | });
10 | };
--------------------------------------------------------------------------------
/model/bid.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | db.getBid(req.params.bidId, function(err, auction) {
7 | if (!err) { cb(null, auction); }
8 | else { cb(err, undefined); }
9 | });
10 | };
--------------------------------------------------------------------------------
/middleware/ensure-auth.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var config = require(__dirname + '/../config');
5 |
6 | module.exports = function(req, res, next) {
7 | if (req.isAuthenticated()) {
8 | return next();
9 | }
10 | res.redirect(config.sbPrefix + '/');
11 | };
12 |
--------------------------------------------------------------------------------
/routes/api/index.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var express = require('express');
5 | var api = express.Router();
6 |
7 | require(__dirname + '/auctions')(api);
8 | require(__dirname + '/bids')(api);
9 | require(__dirname + '/ads')(api);
10 |
11 | module.exports = api;
12 |
--------------------------------------------------------------------------------
/model/ad.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // database call
7 | db.getAd(req.params.adId, function(err, ad) {
8 | if (!err) { cb(null, ad); }
9 | else { cb(err, undefined); }
10 | });
11 | };
--------------------------------------------------------------------------------
/model/reservedAds.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | db.getReservedAds(function(err, ads) {
7 | if (err) { return cb(err, undefined); }
8 | if (ads) { return cb(null, ads); }
9 | });
10 | };
--------------------------------------------------------------------------------
/repl.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /* jshint node: true */
3 | 'use strict';
4 |
5 | var repl = require('repl');
6 | var db = require('./db');
7 | var closing = require('./events/auction-close');
8 |
9 | var local = repl.start('adness> ');
10 | local.context.db = db;
11 | local.context.closing = closing;
12 |
--------------------------------------------------------------------------------
/middleware/model-loader.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | //'use strict';
3 | // FIXME: need jshint config to exclude modelLoader
4 |
5 | var MC = require(__dirname + '/../model');
6 |
7 | module.exports = modelLoader = function(req, res, next) {
8 | req.model = res.model = new MC();
9 | next();
10 | };
11 |
--------------------------------------------------------------------------------
/deployment/adness-api.service:
--------------------------------------------------------------------------------
1 | [Service]
2 | ExecStart=/usr/bin/node /home/deploy/adness-api/current/index.js
3 | Restart=always
4 | StandardOutput=syslog
5 | SyslogIdentifier=adness-api
6 | User=deploy
7 | Group=deploy
8 | Environment=PATH=/usr/bin:/usr/local/bin
9 |
10 | [Install]
11 | WantedBy=multi-user.target
12 |
--------------------------------------------------------------------------------
/model/auctions.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // database call
7 | db.allAuctions(function(err, auctions) {
8 | if (!err) { cb(null, auctions); }
9 | else { cb(err, undefined); }
10 | });
11 | };
12 |
--------------------------------------------------------------------------------
/model/reservedAd.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | db.getReservedAd(req.params.reservedAdId, function(err, ad) {
7 | if (err) { return cb(err, undefined); }
8 | if (ad) { return cb(null, ad); }
9 | });
10 | };
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/rpm/spec/spec.css:
--------------------------------------------------------------------------------
1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;}
2 | .cm-s-default span.cm-macro {color: #b218b2;}
3 | .cm-s-default span.cm-section {color: green; font-weight: bold;}
4 | .cm-s-default span.cm-script {color: red;}
5 | .cm-s-default span.cm-issue {color: yellow;}
6 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | before_install:
2 | - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
3 | language: node_js
4 | node_js:
5 | - 0.10
6 | notifications:
7 | email:
8 | - jw@slickage.com
9 | - ed@slickage.com
10 | - julie@slickage.com
11 | - anthony@slickage.com
12 | - warren@slickage.com
13 |
14 |
--------------------------------------------------------------------------------
/model/profileUser.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | var userId = req.params.userId;
7 | db.getAuctionUser(userId, function(err, user) {
8 | if (!err) { cb(null, user); }
9 | else { cb(null, undefined); }
10 | });
11 | };
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/tiddlywiki/tiddlywiki.css:
--------------------------------------------------------------------------------
1 | span.cm-underlined {
2 | text-decoration: underline;
3 | }
4 | span.cm-strikethrough {
5 | text-decoration: line-through;
6 | }
7 | span.cm-brace {
8 | color: #170;
9 | font-weight: bold;
10 | }
11 | span.cm-table {
12 | color: blue;
13 | font-weight: bold;
14 | }
15 |
--------------------------------------------------------------------------------
/model/ai_invoices.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // database call
7 | db.getAuctionInvoices(req.params.auctionId, function(err, invoices) {
8 | if (!err) { cb(null, invoices); }
9 | else { cb(err, undefined); }
10 | });
11 | };
12 |
--------------------------------------------------------------------------------
/model/auction.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // database call
7 | db.getAuction(req.params.auctionId, function(err, auction) {
8 | if (!err) { db.appendBidsToAuction(auction, cb); }
9 | else { cb(err, undefined); }
10 | });
11 | };
--------------------------------------------------------------------------------
/model/bids.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // database call
7 | db.getBidsPerAuction(req.params.auctionId, function(err, auction) {
8 | if (!err) { cb(null, auction); }
9 | else { cb(err, undefined); }
10 | });
11 | };
12 |
13 |
--------------------------------------------------------------------------------
/deploy.conf:
--------------------------------------------------------------------------------
1 | [staging]
2 | key ./id_deploy
3 | user deploy
4 | host staging.bitcointalk.org
5 | repo git://github.com/slickage/adness.git
6 | path /home/deploy/adness
7 | ref origin/master
8 |
9 | [prod]
10 | key ./id_deploy
11 | user deploy
12 | host adnessprod
13 | repo git://github.com/slickage/adness.git
14 | path /home/deploy/adness
15 | ref origin/master
16 |
17 |
--------------------------------------------------------------------------------
/model/auctionUser.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | module.exports = function(req, cb) {
6 | // always return something
7 | if (!req.user) { return cb(null, undefined); }
8 | db.getAuctionUser(req.user.userId, function(err, user) {
9 | if (!err) { cb(null, user); }
10 | else { cb(null, undefined); }
11 | });
12 | };
--------------------------------------------------------------------------------
/routes/rules.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var moment = require('moment');
5 |
6 | module.exports = function(req, res) {
7 |
8 | // serverTime
9 | var serverTime = moment().utc().format('YYYY MMMM D, h:mm:ss A ZZ');
10 |
11 | res.render('rules', {
12 | serverTime: serverTime,
13 | browsePrefix: req.browsePrefix,
14 | user: req.user
15 | });
16 | };
17 |
18 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM centos:6.4
2 |
3 | # Enable EPEL for Node.js
4 | RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
5 | # Install Node.js and npm
6 | RUN yum install -y npm
7 | RUN yum install git -y
8 |
9 | # Bundle app source
10 | ADD . /src
11 | # Install app dependencies
12 | RUN cd /src; npm install
13 | EXPOSE 8080
14 |
15 | CMD ["/bin/bash", "/src/start.sh"]
16 |
--------------------------------------------------------------------------------
/views/sbindex.ejs:
--------------------------------------------------------------------------------
1 | <% layout('sblayout') %>
2 |
3 |
4 | <% include _registration_status %>
5 | <% if (auctionsOpen.length > 0) { %>
6 |
7 | <% auctionsOpen.forEach(function(auction) { %>
8 | <% include auctions/index_show %>
9 | <% }) %>
10 | <% } else { %>
11 |
12 |
13 | There are no open auctions today. Check back later.
14 |
15 |
16 |
17 | <% } %>
18 |
--------------------------------------------------------------------------------
/model/userBidsPerRegion.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 |
6 | module.exports = function(req, cb) {
7 | var userId = req.user.userId;
8 | var auctionId = req.body.auctionId;
9 | var region = req.body.region;
10 | db.getUserBidsPerRegion(auctionId, region, userId, function(err, bids) {
11 | if (err) { return cb(err, []); }
12 | else { return cb(null, bids); }
13 | });
14 | };
15 |
16 |
--------------------------------------------------------------------------------
/middleware/conditional-csrf.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var csrf = require('csurf');
5 |
6 | module.exports = function(req, res, next) {
7 | // don't generate CSRF if api route
8 | if ( null !== req.path.match(/^\/api/) ) {
9 | return next();
10 | }
11 | else if ( null !== req.path.match(/^\/hooks/) ) {
12 | return next();
13 | }
14 | else {
15 | (csrf())(req, res, function(err) {
16 | res.locals.csrftoken = req.csrfToken();
17 | return next(err);
18 | });
19 | }
20 | };
21 |
--------------------------------------------------------------------------------
/test/smf-migration.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var test = require('tap').test;
5 | require(__dirname + '/../integration/smf-auth.js');
6 |
7 | test('Auth via PHP\'s CRYPT_SHA256', function (t) {
8 | var shacrypt = require('shacrypt');
9 | var password = 'slickage1234';
10 | var hash = '$5$rounds=7500$HYtR7tBVVIhaEOG3$aTD.SlfiUow2KcGJJ0fABo3y7GLGS.pr3vlZLCW8Cj1';
11 | var result = shacrypt.sha256crypt(password, hash);
12 | t.ok(true, hash === result);
13 | t.end(); // but it must match the plan!
14 | });
15 |
--------------------------------------------------------------------------------
/routes/ad_upload.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var _ = require('lodash');
5 | var config = require('../config');
6 |
7 | exports = module.exports = function(req, res) {
8 | req.model.load('ad', req);
9 | req.model.end(function(err, models) {
10 | if (err) { console.log(err); }
11 |
12 | // cull regions
13 | var regions = _.pluck(config.regions, 'name');
14 | res.render('ad_upload', {
15 | ad: models.ad,
16 | regions: regions,
17 | browsePrefix: req.browsePrefix,
18 | user: req.user
19 | });
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/fold/foldgutter.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-foldmarker {
2 | color: blue;
3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
4 | font-family: arial;
5 | line-height: .3;
6 | cursor: pointer;
7 | }
8 | .CodeMirror-foldgutter {
9 | width: .7em;
10 | }
11 | .CodeMirror-foldgutter-open,
12 | .CodeMirror-foldgutter-folded {
13 | color: #555;
14 | cursor: pointer;
15 | }
16 | .CodeMirror-foldgutter-open:after {
17 | content: "\25BE";
18 | }
19 | .CodeMirror-foldgutter-folded:after {
20 | content: "\25B8";
21 | }
22 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/tiki/tiki.css:
--------------------------------------------------------------------------------
1 | .cm-tw-syntaxerror {
2 | color: #FFF;
3 | background-color: #900;
4 | }
5 |
6 | .cm-tw-deleted {
7 | text-decoration: line-through;
8 | }
9 |
10 | .cm-tw-header5 {
11 | font-weight: bold;
12 | }
13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/
14 | padding-left: 10px;
15 | }
16 |
17 | .cm-tw-box {
18 | border-top-width: 0px ! important;
19 | border-style: solid;
20 | border-width: 1px;
21 | border-color: inherit;
22 | }
23 |
24 | .cm-tw-underline {
25 | text-decoration: underline;
26 | }
--------------------------------------------------------------------------------
/resque/auction_closing.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | var timer = require('../events/event-timer');
6 |
7 | module.exports = function(callback) {
8 | // get all auctions in full (with trueEnd property)
9 | db.fullAuctions(function(err, auctions) {
10 | if (err) { console.log(err); callback(null, false); }
11 | else {
12 | // for each auction
13 | auctions.forEach(function(auction) {
14 | timer.addAuction(auction);
15 | });
16 | callback(null, true);
17 | }
18 | });
19 | };
20 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/edit/trailingspace.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
2 | if (prev == CodeMirror.Init) prev = false;
3 | if (prev && !val)
4 | cm.removeOverlay("trailingspace");
5 | else if (!prev && val)
6 | cm.addOverlay({
7 | token: function(stream) {
8 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
9 | if (i > stream.pos) { stream.pos = i; return null; }
10 | stream.pos = l;
11 | return "trailingspace";
12 | },
13 | name: "trailingspace"
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/views/registrationError.ejs:
--------------------------------------------------------------------------------
1 | <% layout('sblayout') %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Auction Registration Error
11 |
12 |
13 |
14 | We were not able to register you!
15 |
16 | Here's something to email to an administrator:
17 |
18 | <%= err %>
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/email-templates/reg-admin-paid.ejs:
--------------------------------------------------------------------------------
1 | Registration Fee Paid for <%= username %>
2 |
3 |
4 |
5 |
6 | The auction system has been notified that the registration fee for <%= username %> has been paid. Here is the URL to the original invoice:
7 |
8 |
9 | Click here to view the invoice.
10 |
11 |
12 | Once they have put an advertisement into rotation (if they haven't done so already), they will be allowed to bid on auctions.
13 |
14 |
15 |
16 |
17 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/lint/json-lint.js:
--------------------------------------------------------------------------------
1 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint
2 |
3 | // declare global: jsonlint
4 |
5 | CodeMirror.registerHelper("lint", "json", function(text) {
6 | var found = [];
7 | jsonlint.parseError = function(str, hash) {
8 | var loc = hash.loc;
9 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
10 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
11 | message: str});
12 | };
13 | try { jsonlint.parse(text); }
14 | catch(e) {}
15 | return found;
16 | });
17 | CodeMirror.jsonValidator = CodeMirror.lint.json; // deprecated
18 |
--------------------------------------------------------------------------------
/views/_registration_status.ejs:
--------------------------------------------------------------------------------
1 | <% if (user) { %>
2 | style="padding-bottom: 15px;" <% } %>>
3 | <% if (userMessage) { %>
4 | Current Account Status:
5 |
6 | <%- userMessage %>
7 |
8 | <% } else if (!registered) { %>
9 |
15 | <% } %>
16 |
17 | <% } %>
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/dialog/dialog.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-dialog {
2 | position: absolute;
3 | left: 0; right: 0;
4 | background: white;
5 | z-index: 15;
6 | padding: .1em .8em;
7 | overflow: hidden;
8 | color: #333;
9 | }
10 |
11 | .CodeMirror-dialog-top {
12 | border-bottom: 1px solid #eee;
13 | top: 0;
14 | }
15 |
16 | .CodeMirror-dialog-bottom {
17 | border-top: 1px solid #eee;
18 | bottom: 0;
19 | }
20 |
21 | .CodeMirror-dialog input {
22 | border: none;
23 | outline: none;
24 | background: transparent;
25 | width: 20em;
26 | color: inherit;
27 | font-family: monospace;
28 | }
29 |
30 | .CodeMirror-dialog button {
31 | font-size: 70%;
32 | }
33 |
--------------------------------------------------------------------------------
/auctionTest/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auctionTest",
3 | "version": "0.0.1",
4 | "description": "A test case for the auction bid system",
5 | "main": "app.js",
6 | "dependencies": {
7 | "charlatan": "~0.1.9",
8 | "request": "~2.33.0"
9 | },
10 | "devDependencies": {},
11 | "scripts": {
12 | "test": "echo \"Error: no test specified\" && exit 1"
13 | },
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/slickage/smf"
17 | },
18 | "keywords": [
19 | "auction"
20 | ],
21 | "author": "Edward Kim",
22 | "license": "ISC",
23 | "bugs": {
24 | "url": "https://github.com/slickage/smf/issues"
25 | },
26 | "homepage": "https://github.com/slickage/smf"
27 | }
28 |
--------------------------------------------------------------------------------
/views/admin_nav.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 | Ads
4 |
5 |
23 |
24 |
25 | Auction Invoices
26 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/rpm/changes/changes.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineMode("changes", function() {
2 | var headerSeperator = /^-+$/;
3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/;
5 |
6 | return {
7 | token: function(stream) {
8 | if (stream.sol()) {
9 | if (stream.match(headerSeperator)) { return 'tag'; }
10 | if (stream.match(headerLine)) { return 'tag'; }
11 | }
12 | if (stream.match(simpleEmail)) { return 'string'; }
13 | stream.next();
14 | return null;
15 | }
16 | };
17 | });
18 |
19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes");
20 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/lint/css-lint.js:
--------------------------------------------------------------------------------
1 | // Depends on csslint.js from https://github.com/stubbornella/csslint
2 |
3 | // declare global: CSSLint
4 |
5 | CodeMirror.registerHelper("lint", "css", function(text) {
6 | var found = [];
7 | var results = CSSLint.verify(text), messages = results.messages, message = null;
8 | for ( var i = 0; i < messages.length; i++) {
9 | message = messages[i];
10 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
11 | found.push({
12 | from: CodeMirror.Pos(startLine, startCol),
13 | to: CodeMirror.Pos(endLine, endCol),
14 | message: message.message,
15 | severity : message.type
16 | });
17 | }
18 | return found;
19 | });
20 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/neat.css:
--------------------------------------------------------------------------------
1 | .cm-s-neat span.cm-comment { color: #a86; }
2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }
3 | .cm-s-neat span.cm-string { color: #a22; }
4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; }
5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; }
6 | .cm-s-neat span.cm-variable { color: black; }
7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
8 | .cm-s-neat span.cm-meta {color: #555;}
9 | .cm-s-neat span.cm-link { color: #3a3; }
10 |
11 | .cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;}
12 | .cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
13 |
--------------------------------------------------------------------------------
/model/reviewAds.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | var _ = require('lodash');
6 |
7 | module.exports = function(req, cb) {
8 | db.getReviewAds(function(err, adsAndUsers) {
9 | if (err) { return cb(err, []); }
10 | else {
11 | // since we're using linked documents
12 | // we have a combination of ads and users
13 |
14 | // separate out users
15 | var users = [];
16 | users = _.remove(adsAndUsers, function(item) {
17 | return item.type === 'auctionUser';
18 | });
19 |
20 | // the rest is ads
21 | var ads = adsAndUsers;
22 |
23 | var results = { ads: ads, users: users };
24 | return cb(null, results);
25 | }
26 | });
27 | };
28 |
--------------------------------------------------------------------------------
/model/approvedAds.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | var _ = require('lodash');
6 |
7 | module.exports = function(req, cb) {
8 | db.getApprovedAds(function(err, adsAndUsers) {
9 | if (err) { return cb(err, []); }
10 | else {
11 | // since we're using linked documents
12 | // we have a combination of ads and users
13 |
14 | // separate out users
15 | var users = [];
16 | users = _.remove(adsAndUsers, function(item) {
17 | return item.type === 'auctionUser';
18 | });
19 |
20 | // the rest is ads
21 | var ads = adsAndUsers;
22 |
23 | var results = { ads: ads, users: users };
24 | return cb(null, results);
25 | }
26 | });
27 | };
28 |
--------------------------------------------------------------------------------
/model/rejectedAds.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | var _ = require('lodash');
6 |
7 | module.exports = function(req, cb) {
8 | db.getRejectedAds(function(err, adsAndUsers) {
9 | if (err) { return cb(err, []); }
10 | else {
11 | // since we're using linked documents
12 | // we have a combination of ads and users
13 |
14 | // separate out users
15 | var users = [];
16 | users = _.remove(adsAndUsers, function(item) {
17 | return item.type === 'auctionUser';
18 | });
19 |
20 | // the rest is ads
21 | var ads = adsAndUsers;
22 |
23 | var results = { ads: ads, users: users };
24 | return cb(null, results);
25 | }
26 | });
27 | };
28 |
--------------------------------------------------------------------------------
/email-templates/invalid-bid.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 | Your bid has been removed from auction <%= auctionId %>
4 |
5 | One or more of your bids has been removed by an administrator. If you didn't already know about this, then you should be contacted shortly with more info.
6 |
7 |
8 | <% if (invoices && invoices.length > 0) { %>
9 | Here is a list of invalidated invoices:
10 | <% invoices.forEach(function(invoice) { %>
11 | <%= invoice %>
12 | <% }) %>
13 | If you have already paid an invalidated invoice, contact an administator for a refund.
14 | <% } %>
15 |
16 |
17 |
18 | Thank you for participating in this auction.
19 |
20 |
21 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/email-templates/user-invalidated.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 | You have been removed from auction <%= auctionId %>
4 |
5 | An administrator has found your bids or your ads to be in violation of the terms of this auction. For this reason, all of your bids and invoices for this auction in region <%= region %> have been invalidated. If you have already paid an invoice, please contact an administator for a refund. We apologize for the inconvenience.
6 |
7 |
8 | Here is a list of invalidated bids and invoices:
9 | <% results.forEach(function(result) { %>
10 | <%= result %>
11 | <% }) %>
12 |
13 |
14 |
15 | Thank you for participating in this auction.
16 |
17 |
18 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/email-templates/winner-admin-paid.ejs:
--------------------------------------------------------------------------------
1 | Auction Invoice for <%= username %> has been paid
2 |
3 |
4 |
5 |
6 | <%= username %> has paid the invoice sent for winning the slot(s) in auction <%= auctionId %>. A link to the original invoice is include. Please double check that the payment was made. The invoice also includes the address the payment was sent to.
7 |
8 |
9 | Click here to view the invoice.
10 |
11 |
12 | A link to the <%= username %>'s ads can be found below:
13 |
14 | <%= username %>'s Ads
15 |
16 |
17 |
18 |
19 |
20 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/model/randomFactoid.js:
--------------------------------------------------------------------------------
1 | var db = require(__dirname + '/../db');
2 | var _ = require('lodash');
3 |
4 | module.exports = function(req, cb) {
5 | db.getFactoids(function(err, facts) {
6 | if (err) {
7 | console.log('There were no Factoids found. Returning error Factoid.');
8 | var emptyFact = {};
9 | emptyFact.css = '';
10 | emptyFact.html = 'There are no Factoids.
';
11 | return cb(null, emptyFact);
12 | }
13 |
14 | if (facts) {
15 | // pick a fact at random
16 | var randomFact = _.sample(facts.list);
17 |
18 | // edit html with fact
19 | facts.html = facts.html.replace('<%- text %>', randomFact.text);
20 |
21 | // return random fact
22 | delete facts.list;
23 | return cb(null, facts);
24 | }
25 | });
26 | };
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/elegant.css:
--------------------------------------------------------------------------------
1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
4 | .cm-s-elegant span.cm-variable {color: black;}
5 | .cm-s-elegant span.cm-variable-2 {color: #b11;}
6 | .cm-s-elegant span.cm-qualifier {color: #555;}
7 | .cm-s-elegant span.cm-keyword {color: #730;}
8 | .cm-s-elegant span.cm-builtin {color: #30a;}
9 | .cm-s-elegant span.cm-link {color: #762;}
10 | .cm-s-elegant span.cm-error {background-color: #fdd;}
11 |
12 | .cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;}
13 | .cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
14 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/diff/diff.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineMode("diff", function() {
2 |
3 | var TOKEN_NAMES = {
4 | '+': 'positive',
5 | '-': 'negative',
6 | '@': 'meta'
7 | };
8 |
9 | return {
10 | token: function(stream) {
11 | var tw_pos = stream.string.search(/[\t ]+?$/);
12 |
13 | if (!stream.sol() || tw_pos === 0) {
14 | stream.skipToEnd();
15 | return ("error " + (
16 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
17 | }
18 |
19 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
20 |
21 | if (tw_pos === -1) {
22 | stream.skipToEnd();
23 | } else {
24 | stream.pos = tw_pos;
25 | }
26 |
27 | return token_name;
28 | }
29 | };
30 | });
31 |
32 | CodeMirror.defineMIME("text/x-diff", "diff");
33 |
--------------------------------------------------------------------------------
/views/registration.ejs:
--------------------------------------------------------------------------------
1 | <% layout('sblayout') %>
2 |
3 |
4 |
5 |
6 |
7 |
8 | Auction Registration
9 |
10 |
11 |
12 | You have started the registration process!
13 |
14 | An email will be sent with instructions on paying the registration fee. Upon receiving your payment, your registration status will be updated.
15 |
16 | In order to bid on auctions, you must also create an advertisement (if you have not done so already), have it approved by an admin, and then put it into rotation from your profile page. If you have not already created an advertisement, please do so now from the profile page.
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/mode/multiplex_test.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | CodeMirror.defineMode("markdown_with_stex", function(){
3 | var inner = CodeMirror.getMode({}, "stex");
4 | var outer = CodeMirror.getMode({}, "markdown");
5 |
6 | var innerOptions = {
7 | open: '$',
8 | close: '$',
9 | mode: inner,
10 | delimStyle: 'delim',
11 | innerStyle: 'inner'
12 | };
13 |
14 | return CodeMirror.multiplexingMode(outer, innerOptions);
15 | });
16 |
17 | var mode = CodeMirror.getMode({}, "markdown_with_stex");
18 |
19 | function MT(name) {
20 | test.mode(
21 | name,
22 | mode,
23 | Array.prototype.slice.call(arguments, 1),
24 | 'multiplexing');
25 | }
26 |
27 | MT(
28 | "stexInsideMarkdown",
29 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
30 | })();
31 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/hint/show-hint.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-hints {
2 | position: absolute;
3 | z-index: 10;
4 | overflow: hidden;
5 | list-style: none;
6 |
7 | margin: 0;
8 | padding: 2px;
9 |
10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2);
13 | border-radius: 3px;
14 | border: 1px solid silver;
15 |
16 | background: white;
17 | font-size: 90%;
18 | font-family: monospace;
19 |
20 | max-height: 20em;
21 | overflow-y: auto;
22 | }
23 |
24 | .CodeMirror-hint {
25 | margin: 0;
26 | padding: 0 4px;
27 | border-radius: 2px;
28 | max-width: 19em;
29 | overflow: hidden;
30 | white-space: pre;
31 | color: black;
32 | cursor: pointer;
33 | }
34 |
35 | .CodeMirror-hint-active {
36 | background: #08f;
37 | color: white;
38 | }
39 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/edit/continuelist.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | 'use strict';
3 |
4 | var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
5 | unorderedBullets = '*+-';
6 |
7 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
8 | if (cm.getOption("disableInput")) return CodeMirror.Pass;
9 |
10 | var pos = cm.getCursor(),
11 | inList = cm.getStateAfter(pos.line).list !== false,
12 | match;
13 |
14 | if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
15 | cm.execCommand('newlineAndIndent');
16 | return;
17 | }
18 |
19 | var indent = match[1], after = match[4];
20 | var bullet = unorderedBullets.indexOf(match[2]) >= 0
21 | ? match[2]
22 | : (parseInt(match[3], 10) + 1) + '.';
23 |
24 | cm.replaceSelection('\n' + indent + bullet + after, 'end');
25 | };
26 |
27 | }());
28 |
--------------------------------------------------------------------------------
/email-templates/reg-user-paid.ejs:
--------------------------------------------------------------------------------
1 | Your Registration Fee has been Processed
2 |
3 |
4 |
5 |
6 | The auction system has received your registration fee.
7 | Here is the URL to the original invoice:
8 |
9 |
10 | Click here to view the invoice.
11 |
12 |
13 | Next Steps:
14 | - If you have not already done so, create and submit an advertisement via your profile page.
15 | - Once it's been approved, put the approved advertisement into rotation by clicking on the advertisement on your profile page and clicking the "Add to rotation" button.
16 | - Once you have an advertisement in rotation, you will be allowed to bid on auctions.
17 |
18 |
19 |
20 |
21 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/resque/auction_recalculation.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var db = require(__dirname + '/../db');
5 | var timer = require('../events/event-timer');
6 |
7 | module.exports = function(callback) {
8 | // get all recalculations
9 | db.getRecalculations(function(err, recalculations) {
10 | if (err) { console.log(err); callback(null, false); }
11 | else {
12 | // for each auction
13 | recalculations.forEach(function(recalculation) {
14 | if (!recalculation.finished) {
15 | // adjust time if already expired
16 | var now = new Date().getTime();
17 | if (recalculation.expiration < now) {
18 | recalculation.expiration = now + 1000 * 5;
19 | }
20 |
21 | timer.addRecalculation(recalculation);
22 | }
23 | });
24 |
25 | return callback(null, true);
26 | }
27 | });
28 | };
29 |
--------------------------------------------------------------------------------
/email-templates/notify-bidders.ejs:
--------------------------------------------------------------------------------
1 |
2 | The most recent bitcointalk.org ad auction has ended. Thanks for participating! If you've won any ad slots in the auction, a separate email will be sent to you with instructions on how to make your payment. Additionally, if you had a reasonably high bid when the auction ended, but not all of your bids were filled, then you should keep your eyes open for emails over the next 24 hours in case one of the winning advertisers doesn't pay and you are next in line to pick up these extra slots. Extra slots are discounted, sometimes substantially.
3 |
4 | <% if (nextAuction) { %>
5 | The next available auction will take place at <%= new Date(nextAuction.start).toUTCString() %>.
6 | <% } else { %>
7 | There are no auctions currently planned for the immediate future.
8 | <% } %>
9 |
10 |
11 |
12 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/email-templates/winner-user-paid.ejs:
--------------------------------------------------------------------------------
1 |
2 | Your payment for auction <%= auctionId %> has been received. A link to the original invoice is included. Note that additional payments may be required if you won slots in several regions or if you also won extra slots. (You'll have received additional emails if this is the case.)
3 |
4 |
5 | Click here to view the invoice.
6 |
7 |
8 | Now that you've won, please remember to review you advertisements and ensure the correct number of advertisements are set to your rotation on your profile page. If you have less advertisements then the number of slots you've won, random multiples of the same ad will be displayed. If you have more advertisements than the number of slots you've won, a random selection of ads will be used.
9 |
10 |
11 |
12 |
13 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/runmode/colorize.js:
--------------------------------------------------------------------------------
1 | CodeMirror.colorize = (function() {
2 |
3 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
4 |
5 | function textContent(node, out) {
6 | if (node.nodeType == 3) return out.push(node.nodeValue);
7 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
8 | textContent(ch, out);
9 | if (isBlock.test(node.nodeType)) out.push("\n");
10 | }
11 | }
12 |
13 | return function(collection, defaultMode) {
14 | if (!collection) collection = document.body.getElementsByTagName("pre");
15 |
16 | for (var i = 0; i < collection.length; ++i) {
17 | var node = collection[i];
18 | var mode = node.getAttribute("data-lang") || defaultMode;
19 | if (!mode) continue;
20 |
21 | var text = [];
22 | textContent(node, text);
23 | node.innerHTML = "";
24 | CodeMirror.runMode(text.join(""), mode, node);
25 |
26 | node.className += " cm-s-default";
27 | }
28 | };
29 | })();
30 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/lint/coffeescript-lint.js:
--------------------------------------------------------------------------------
1 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
2 |
3 | // declare global: coffeelint
4 |
5 | CodeMirror.registerHelper("lint", "coffeescript", function(text) {
6 | var found = [];
7 | var parseError = function(err) {
8 | var loc = err.lineNumber;
9 | found.push({from: CodeMirror.Pos(loc-1, 0),
10 | to: CodeMirror.Pos(loc, 0),
11 | severity: err.level,
12 | message: err.message});
13 | };
14 | try {
15 | var res = coffeelint.lint(text);
16 | for(var i = 0; i < res.length; i++) {
17 | parseError(res[i]);
18 | }
19 | } catch(e) {
20 | found.push({from: CodeMirror.Pos(e.location.first_line, 0),
21 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
22 | severity: 'error',
23 | message: e.message});
24 | }
25 | return found;
26 | });
27 | CodeMirror.coffeeValidator = CodeMirror.lint.coffeescript; // deprecated
28 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var config = require('./config');
5 | var async = require('async');
6 | var dbinit = require('./db-init');
7 |
8 | // Initialization Sanity Checks
9 | async.waterfall([
10 | validateSessionSecret,
11 | dbinit.validateDBExist,
12 | dbinit.checkDBVersion,
13 | ],
14 | function(err) {
15 | if (err) {
16 | console.log('Adness Init ' + err);
17 | process.exit(1);
18 | }
19 | else { buildSite(); }
20 | }
21 | );
22 |
23 | function validateSessionSecret(cb) {
24 | var secret = config.sessionSecret;
25 | var error = null;
26 |
27 | if (secret === 'secret string for adness 1234!') {
28 | var message = 'Do not use the default SESSION_SECRET';
29 | error = new Error(message);
30 | }
31 |
32 | return cb(error);
33 | }
34 |
35 | function buildSite() {
36 | var site = require('./site');
37 | if (config.debugMode) { console.log('Config: ' + JSON.stringify(config)); }
38 | site.listen(config.port);
39 | console.log('Listening at: http://0.0.0.0:' + config.port);
40 | }
--------------------------------------------------------------------------------
/views/ads/show.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 | <% if (user && user.admin === true) { %>
12 |
15 | <% } %>
16 |
17 |
18 | Regions:
19 | <%= ad.regions %>
20 |
21 |
22 |
23 |
24 | Ad HTML:
25 | <%=: ad.html | replace:/&/gi,'&' %>
26 |
27 | Ad CSS:
28 | <%= ad.css %>
29 |
30 |
31 |
32 |
33 |
34 | Ad Preview (without css applied):
35 | <%- ad.html %>
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/model.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var MC = module.exports = require('emcee');
5 | MC.model('auctions', require('./model/auctions'));
6 | MC.model('auction', require('./model/auction'));
7 | MC.model('auctionsTimeRelative', require('./model/auctionsTimeRelative'));
8 | MC.model('bids', require('./model/bids'));
9 | MC.model('bid', require('./model/bid'));
10 | MC.model('ad', require('./model/ad'));
11 | MC.model('userAds', require('./model/userAds'));
12 | MC.model('reviewAds', require('./model/reviewAds'));
13 | MC.model('approvedAds', require('./model/approvedAds'));
14 | MC.model('rejectedAds', require('./model/rejectedAds'));
15 | MC.model('auctionUser', require('./model/auctionUser'));
16 | MC.model('profileUser', require('./model/profileUser'));
17 | MC.model('auction_invoices', require('./model/ai_invoices'));
18 | MC.model('reservedAd', require('./model/reservedAd'));
19 | MC.model('reservedAds', require('./model/reservedAds'));
20 | MC.model('factoids', require('./model/factoids'));
21 | MC.model('randomFactoid', require('./model/randomFactoid'));
22 | MC.model('userBidsPerRegion', require('./model/userBidsPerRegion'));
23 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/scroll/scrollpastend.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | "use strict";
3 |
4 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) {
5 | if (old && old != CodeMirror.Init) {
6 | cm.off("change", onChange);
7 | cm.display.lineSpace.parentNode.style.paddingBottom = "";
8 | cm.state.scrollPastEndPadding = null;
9 | }
10 | if (val) {
11 | cm.on("change", onChange);
12 | updateBottomMargin(cm);
13 | }
14 | });
15 |
16 | function onChange(cm, change) {
17 | if (CodeMirror.changeEnd(change).line == cm.lastLine())
18 | updateBottomMargin(cm);
19 | }
20 |
21 | function updateBottomMargin(cm) {
22 | var padding = "";
23 | if (cm.lineCount() > 1) {
24 | var totalH = cm.display.scroller.clientHeight - 30,
25 | lastLineH = cm.getLineHandle(cm.lastLine()).height;
26 | padding = (totalH - lastLineH) + "px";
27 | }
28 | if (cm.state.scrollPastEndPadding != padding) {
29 | cm.state.scrollPastEndPadding = padding;
30 | cm.display.lineSpace.parentNode.style.paddingBottom = padding;
31 | cm.setSize();
32 | }
33 | }
34 | })();
35 |
--------------------------------------------------------------------------------
/views/history.ejs:
--------------------------------------------------------------------------------
1 | <% layout('sblayout') %>
2 |
3 |
4 |
5 | Auction History
6 |
7 |
8 |
Final Auction Results
9 |
(Sorted by Auction End Time)
10 |
11 |
12 | <% auctions.forEach(function(auction) { %>
13 |
14 |
15 |
21 |
22 |
23 | <%= auction.start %>
24 |
25 |
26 | <%= auction.end %>
27 | <% if (auction.regions) { %>
28 |
29 |
30 | <% auction.regions.forEach(function(region) { %>
31 | <%= region.name %>
32 | <% }) %>
33 | <% } %>
34 |
35 |
36 |
37 | <% }) %>
38 |
39 |
--------------------------------------------------------------------------------
/email-templates/notify-winners.ejs:
--------------------------------------------------------------------------------
1 | You've won <%= user.lineItems.length %> ad slot(s) in auction <%= auctionId %>!
2 |
3 |
4 |
5 |
6 | Now that the auction has ended, please promptly pay for the slot(s) you've won using the invoice link below. This invoice will expire on: <%= expiration %>. If you do not pay in time, you will lose your slots, and you may be banned from future ad auctions.
7 |
8 |
9 | Click here to view your invoice.
10 |
11 |
12 | Please ensure that the ads you want on the forum are in rotation. Ads submitted and approved but not marked "in rotation" will not be advertised. Once your payment clears and the ad period begins, ads marked "In Rotation" on your profile page will start being displayed in the forum's ad area. If you have more ads than slots, then the forum will randomly rotate between your ads. Your ads can be updated during the ad period, though modifications and new ads require approval.
13 |
14 |
15 |
16 | Thanks for participating in this auction!
17 |
18 |
19 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/display/fullscreen.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | "use strict";
3 |
4 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
5 | if (old == CodeMirror.Init) old = false;
6 | if (!old == !val) return;
7 | if (val) setFullscreen(cm);
8 | else setNormal(cm);
9 | });
10 |
11 | function setFullscreen(cm) {
12 | var wrap = cm.getWrapperElement();
13 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
14 | width: wrap.style.width, height: wrap.style.height};
15 | wrap.style.width = "";
16 | wrap.style.height = "auto";
17 | wrap.className += " CodeMirror-fullscreen";
18 | document.documentElement.style.overflow = "hidden";
19 | cm.refresh();
20 | }
21 |
22 | function setNormal(cm) {
23 | var wrap = cm.getWrapperElement();
24 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
25 | document.documentElement.style.overflow = "";
26 | var info = cm.state.fullScreenRestore;
27 | wrap.style.width = info.width; wrap.style.height = info.height;
28 | window.scrollTo(info.scrollLeft, info.scrollTop);
29 | cm.refresh();
30 | }
31 | })();
32 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/eclipse.css:
--------------------------------------------------------------------------------
1 | .cm-s-eclipse span.cm-meta {color: #FF1717;}
2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
3 | .cm-s-eclipse span.cm-atom {color: #219;}
4 | .cm-s-eclipse span.cm-number {color: #164;}
5 | .cm-s-eclipse span.cm-def {color: #00f;}
6 | .cm-s-eclipse span.cm-variable {color: black;}
7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
9 | .cm-s-eclipse span.cm-property {color: black;}
10 | .cm-s-eclipse span.cm-operator {color: black;}
11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;}
12 | .cm-s-eclipse span.cm-string {color: #2A00FF;}
13 | .cm-s-eclipse span.cm-string-2 {color: #f50;}
14 | .cm-s-eclipse span.cm-qualifier {color: #555;}
15 | .cm-s-eclipse span.cm-builtin {color: #30a;}
16 | .cm-s-eclipse span.cm-bracket {color: #cc7;}
17 | .cm-s-eclipse span.cm-tag {color: #170;}
18 | .cm-s-eclipse span.cm-attribute {color: #00c;}
19 | .cm-s-eclipse span.cm-link {color: #219;}
20 | .cm-s-eclipse span.cm-error {color: #f00;}
21 |
22 | .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;}
23 | .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
24 |
--------------------------------------------------------------------------------
/routes/history.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var _ = require('lodash');
5 | var moment = require('moment');
6 |
7 | module.exports = function(req, res) {
8 | req.model.load('auctionsTimeRelative', req);
9 | req.model.end(function(err, models) {
10 | if (err) { console.log('error: ' + JSON.stringify(err)); }
11 |
12 | var auctions = models.auctionsTimeRelative.past;
13 | var sortedPast = _.sortBy(auctions, function(auction) {
14 | return -auction.end;
15 | });
16 |
17 | sortedPast.forEach(function(auction) {
18 | var startTime = moment(auction.start).utc().format('YYYY MMMM D, h:mm:ss A ZZ');
19 | var endTime = moment(auction.end).utc().format('YYYY MMMM D, h:mm:ss A ZZ');
20 | startTime += ' (' + moment(auction.start).fromNow() +')';
21 | endTime += ' (' + moment(auction.end).fromNow() + ')';
22 | auction.start = startTime;
23 | auction.end = endTime;
24 | });
25 |
26 | // serverTime
27 | var serverTime = moment().utc().format('YYYY MMMM D, h:mm:ss A ZZ');
28 |
29 | res.render('history', {
30 | auctions: sortedPast,
31 | serverTime: serverTime,
32 | browsePrefix: req.browsePrefix,
33 | user: req.user
34 | });
35 | });
36 | };
37 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/tern/worker.js:
--------------------------------------------------------------------------------
1 | // declare global: tern, server
2 |
3 | var server;
4 |
5 | this.onmessage = function(e) {
6 | var data = e.data;
7 | switch (data.type) {
8 | case "init": return startServer(data.defs, data.plugins, data.scripts);
9 | case "add": return server.addFile(data.name, data.text);
10 | case "del": return server.delFile(data.name);
11 | case "req": return server.request(data.body, function(err, reqData) {
12 | postMessage({id: data.id, body: reqData, err: err && String(err)});
13 | });
14 | case "getFile":
15 | var c = pending[data.id];
16 | delete pending[data.id];
17 | return c(data.err, data.text);
18 | default: throw new Error("Unknown message type: " + data.type);
19 | }
20 | };
21 |
22 | var nextId = 0, pending = {};
23 | function getFile(file, c) {
24 | postMessage({type: "getFile", name: file, id: ++nextId});
25 | pending[nextId] = c;
26 | }
27 |
28 | function startServer(defs, plugins, scripts) {
29 | if (scripts) importScripts.apply(null, scripts);
30 |
31 | server = new tern.Server({
32 | getFile: getFile,
33 | async: true,
34 | defs: defs,
35 | plugins: plugins
36 | });
37 | }
38 |
39 | var console = {
40 | log: function(v) { postMessage({type: "debug", message: v}); }
41 | };
42 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/cobalt.css:
--------------------------------------------------------------------------------
1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; }
2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
3 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
4 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
5 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
6 |
7 | .cm-s-cobalt span.cm-comment { color: #08f; }
8 | .cm-s-cobalt span.cm-atom { color: #845dc4; }
9 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
10 | .cm-s-cobalt span.cm-keyword { color: #ffee80; }
11 | .cm-s-cobalt span.cm-string { color: #3ad900; }
12 | .cm-s-cobalt span.cm-meta { color: #ff9d00; }
13 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
14 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
15 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
16 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
17 | .cm-s-cobalt span.cm-link { color: #845dc4; }
18 | .cm-s-cobalt span.cm-error { color: #9d1e15; }
19 |
20 | .cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;}
21 | .cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}
22 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/monokai.css:
--------------------------------------------------------------------------------
1 | /* Based on Sublime Text's Monokai theme */
2 |
3 | .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
5 | .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
6 | .cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
7 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
8 |
9 | .cm-s-monokai span.cm-comment {color: #75715e;}
10 | .cm-s-monokai span.cm-atom {color: #ae81ff;}
11 | .cm-s-monokai span.cm-number {color: #ae81ff;}
12 |
13 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
14 | .cm-s-monokai span.cm-keyword {color: #f92672;}
15 | .cm-s-monokai span.cm-string {color: #e6db74;}
16 |
17 | .cm-s-monokai span.cm-variable {color: #a6e22e;}
18 | .cm-s-monokai span.cm-variable-2 {color: #9effff;}
19 | .cm-s-monokai span.cm-def {color: #fd971f;}
20 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;}
21 | .cm-s-monokai span.cm-tag {color: #f92672;}
22 | .cm-s-monokai span.cm-link {color: #ae81ff;}
23 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
24 |
25 | .cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;}
26 | .cm-s-monokai .CodeMirror-matchingbracket {
27 | text-decoration: underline;
28 | color: white !important;
29 | }
30 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/fold/indent-fold.js:
--------------------------------------------------------------------------------
1 | CodeMirror.registerHelper("fold", "indent", function(cm, start) {
2 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
3 | if (!/\S/.test(firstLine)) return;
4 | var getIndent = function(line) {
5 | return CodeMirror.countColumn(line, null, tabSize);
6 | };
7 | var myIndent = getIndent(firstLine);
8 | var lastLineInFold = null;
9 | // Go through lines until we find a line that definitely doesn't belong in
10 | // the block we're folding, or to the end.
11 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
12 | var curLine = cm.getLine(i);
13 | var curIndent = getIndent(curLine);
14 | if (curIndent > myIndent) {
15 | // Lines with a greater indent are considered part of the block.
16 | lastLineInFold = i;
17 | } else if (!/\S/.test(curLine)) {
18 | // Empty lines might be breaks within the block we're trying to fold.
19 | } else {
20 | // A non-empty line at an indent equal to or less than ours marks the
21 | // start of another block.
22 | break;
23 | }
24 | }
25 | if (lastLineInFold) return {
26 | from: CodeMirror.Pos(start.line, firstLine.length),
27 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
28 | };
29 | });
30 | CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated
31 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/night.css:
--------------------------------------------------------------------------------
1 | /* Loosely based on the Midnight Textmate theme */
2 |
3 | .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
4 | .cm-s-night div.CodeMirror-selected { background: #447 !important; }
5 | .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
6 | .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
7 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
8 |
9 | .cm-s-night span.cm-comment { color: #6900a1; }
10 | .cm-s-night span.cm-atom { color: #845dc4; }
11 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
12 | .cm-s-night span.cm-keyword { color: #599eff; }
13 | .cm-s-night span.cm-string { color: #37f14a; }
14 | .cm-s-night span.cm-meta { color: #7678e2; }
15 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
16 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
17 | .cm-s-night span.cm-bracket { color: #8da6ce; }
18 | .cm-s-night span.cm-comment { color: #6900a1; }
19 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
20 | .cm-s-night span.cm-link { color: #845dc4; }
21 | .cm-s-night span.cm-error { color: #9d1e15; }
22 |
23 | .cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;}
24 | .cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
25 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/hint/anyword-hint.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | "use strict";
3 |
4 | var WORD = /[\w$]+/, RANGE = 500;
5 |
6 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
7 | var word = options && options.word || WORD;
8 | var range = options && options.range || RANGE;
9 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
10 | var start = cur.ch, end = start;
11 | while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
12 | while (start && word.test(curLine.charAt(start - 1))) --start;
13 | var curWord = start != end && curLine.slice(start, end);
14 |
15 | var list = [], seen = {};
16 | var re = new RegExp(word.source, "g");
17 | for (var dir = -1; dir <= 1; dir += 2) {
18 | var line = cur.line, end = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
19 | for (; line != end; line += dir) {
20 | var text = editor.getLine(line), m;
21 | while (m = re.exec(text)) {
22 | if (line == cur.line && m[0] === curWord) continue;
23 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
24 | seen[m[0]] = true;
25 | list.push(m[0]);
26 | }
27 | }
28 | }
29 | }
30 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
31 | });
32 | })();
33 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/the-matrix.css:
--------------------------------------------------------------------------------
1 | .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }
2 | .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; }
3 | .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }
4 | .cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; }
5 | .cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; }
6 |
7 | .cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;}
8 | .cm-s-the-matrix span.cm-atom {color: #3FF;}
9 | .cm-s-the-matrix span.cm-number {color: #FFB94F;}
10 | .cm-s-the-matrix span.cm-def {color: #99C;}
11 | .cm-s-the-matrix span.cm-variable {color: #F6C;}
12 | .cm-s-the-matrix span.cm-variable-2 {color: #C6F;}
13 | .cm-s-the-matrix span.cm-variable-3 {color: #96F;}
14 | .cm-s-the-matrix span.cm-property {color: #62FFA0;}
15 | .cm-s-the-matrix span.cm-operator {color: #999}
16 | .cm-s-the-matrix span.cm-comment {color: #CCCCCC;}
17 | .cm-s-the-matrix span.cm-string {color: #39C;}
18 | .cm-s-the-matrix span.cm-meta {color: #C9F;}
19 | .cm-s-the-matrix span.cm-qualifier {color: #FFF700;}
20 | .cm-s-the-matrix span.cm-builtin {color: #30a;}
21 | .cm-s-the-matrix span.cm-bracket {color: #cc7;}
22 | .cm-s-the-matrix span.cm-tag {color: #FFBD40;}
23 | .cm-s-the-matrix span.cm-attribute {color: #FFF700;}
24 | .cm-s-the-matrix span.cm-error {color: #FF0000;}
25 |
26 | .cm-s-the-matrix .CodeMirror-activeline-background {background: #040;}
27 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/rubyblue.css:
--------------------------------------------------------------------------------
1 | .cm-s-rubyblue { font-family: Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
2 |
3 | .cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
4 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
5 | .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
6 | .cm-s-rubyblue .CodeMirror-linenumber { color: white; }
7 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
8 |
9 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
10 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; }
11 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
12 | .cm-s-rubyblue span.cm-keyword { color: #F0F; }
13 | .cm-s-rubyblue span.cm-string { color: #F08047; }
14 | .cm-s-rubyblue span.cm-meta { color: #F0F; }
15 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
16 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
17 | .cm-s-rubyblue span.cm-bracket { color: #F0F; }
18 | .cm-s-rubyblue span.cm-link { color: #F4C20B; }
19 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
20 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
21 | .cm-s-rubyblue span.cm-error { color: #AF2018; }
22 |
23 | .cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;}
24 |
--------------------------------------------------------------------------------
/routes/registration.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var registration = require('../registration');
5 | var moment = require('moment');
6 |
7 | exports = module.exports = function(req, res) {
8 | req.model.load('auctionUser', req);
9 | req.model.end(function(err, models) {
10 | var view = 'registration';
11 | var error = '';
12 |
13 | // serverTime
14 | var serverTime = moment().utc().format('YYYY MMMM D, h:mm:ss A ZZ');
15 |
16 | if (err) {
17 | console.log(err);
18 | view = 'registrationError';
19 | error = err.message;
20 | return res.render(view, {
21 | err: error,
22 | serverTime: serverTime,
23 | browsePrefix: req.browsePrefix,
24 | user: req.user
25 | });
26 | }
27 |
28 | if (models.auctionUser) {
29 | view = 'registrationError';
30 | error = 'This user has already been registered';
31 | return res.render(view, {
32 | err: error,
33 | serverTime: serverTime,
34 | browsePrefix: req.browsePrefix,
35 | user: req.user
36 | });
37 | }
38 |
39 | registration.addUser(req.user, function(err) {
40 | if (err) {
41 | console.log(err);
42 | view = 'registrationError';
43 | error = err.message;
44 | }
45 |
46 | return res.render(view, {
47 | err: error,
48 | serverTime: serverTime,
49 | browsePrefix: req.browsePrefix,
50 | user: req.user
51 | });
52 | });
53 | });
54 | };
55 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/mbo.css:
--------------------------------------------------------------------------------
1 | /* Based on mbonaci's Brackets mbo theme */
2 |
3 | .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffe9;}
4 | .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}
5 | .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}
6 | .cm-s-mbo .CodeMirror-linenumber {color: #dadada;}
7 | .cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;}
8 |
9 | .cm-s-mbo span.cm-comment {color: #95958a;}
10 | .cm-s-mbo span.cm-atom {color: #00a8c6;}
11 | .cm-s-mbo span.cm-number {color: #00a8c6;}
12 |
13 | .cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;}
14 | .cm-s-mbo span.cm-keyword {color: #ffb928;}
15 | .cm-s-mbo span.cm-string {color: #ffcf6c;}
16 |
17 | .cm-s-mbo span.cm-variable {color: #ffffec;}
18 | .cm-s-mbo span.cm-variable-2 {color: #00a8c6;}
19 | .cm-s-mbo span.cm-def {color: #ffffec;}
20 | .cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;}
21 | .cm-s-mbo span.cm-tag {color: #9ddfe9;}
22 | .cm-s-mbo span.cm-link {color: #f54b07;}
23 | .cm-s-mbo span.cm-error {background: #636363; color: #ffffec;}
24 |
25 | .cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;}
26 | .cm-s-mbo .CodeMirror-matchingbracket {
27 | text-decoration: underline;
28 | color: #f5e107 !important;
29 | }
30 |
31 | .cm-s-mbo .CodeMirror-matchingtag {background: #4e4e4e;}
32 |
33 | .cm-s-mbo span.cm-searching {
34 | background-color: none;
35 | background: none;
36 | box-shadow: 0 0 0 1px #ffffec;
37 | }
38 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/blackboard.css:
--------------------------------------------------------------------------------
1 | /* Port of TextMate's Blackboard theme */
2 |
3 | .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
4 | .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
5 | .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
6 | .cm-s-blackboard .CodeMirror-linenumber { color: #888; }
7 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
8 |
9 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; }
10 | .cm-s-blackboard .cm-atom { color: #D8FA3C; }
11 | .cm-s-blackboard .cm-number { color: #D8FA3C; }
12 | .cm-s-blackboard .cm-def { color: #8DA6CE; }
13 | .cm-s-blackboard .cm-variable { color: #FF6400; }
14 | .cm-s-blackboard .cm-operator { color: #FBDE2D;}
15 | .cm-s-blackboard .cm-comment { color: #AEAEAE; }
16 | .cm-s-blackboard .cm-string { color: #61CE3C; }
17 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; }
18 | .cm-s-blackboard .cm-meta { color: #D8FA3C; }
19 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; }
20 | .cm-s-blackboard .cm-tag { color: #8DA6CE; }
21 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; }
22 | .cm-s-blackboard .cm-header { color: #FF6400; }
23 | .cm-s-blackboard .cm-hr { color: #AEAEAE; }
24 | .cm-s-blackboard .cm-link { color: #8DA6CE; }
25 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
26 |
27 | .cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;}
28 | .cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/ntriples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: NTriples mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
18 |
23 |
27 |
28 |
29 |
30 | NTriples mode
31 |
40 |
41 |
44 | MIME types defined: text/n-triples.
45 |
46 |
--------------------------------------------------------------------------------
/email-templates/notify-winners-modified.ejs:
--------------------------------------------------------------------------------
1 | You've won <%= user.lineItems.length %> more ad slot(s) in auction <%= auctionId %>!
2 |
3 |
4 |
5 |
6 | Because an advertiser failed to pay for their ads on time, their slots have become available, and you have a chance to buy them. You have a reduced window of time in which to pay for these ads, but your original bid has been discounted somewhat to offset this. These extra slots are exactly the same as regular slots -- they do not have reduced ad time.
7 |
8 | Please promptly pay for the slot(s) you've won using the invoice link below. This invoice will expire on: <%= expiration %>. If you do not pay in time, you will lose your chance at these slots, though you will not be penalized further.
9 |
10 |
11 | Click here to view your invoice.
12 |
13 |
14 | Please ensure that the ads you want on the forum are in rotation. Ads submitted and approved but not marked "in rotation" will not be advertised. Once your payment clears and the ad period begins, ads marked "In Rotation" on your profile page will start being displayed in the forum's ad area. If you have more ads than slots, then the forum will randomly rotate between your ads. Your ads can be updated during the ad period, though modifications and new ads require approval.
15 |
16 |
17 |
18 | Thanks for participating in this auction!
19 |
20 |
21 | This is a automated email. Please do not reply to this email.
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/http/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: HTTP mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | HTTP mode
27 |
28 |
29 |
30 | POST /somewhere HTTP/1.1
31 | Host: example.com
32 | If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
33 | Content-Type: application/x-www-form-urlencoded;
34 | charset=utf-8
35 | User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
36 |
37 | This is the request body!
38 |
39 |
40 |
43 |
44 | MIME types defined: message/http.
45 |
46 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/jinja2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Jinja2 mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Jinja2 mode
27 |
28 | <html style="color: green">
29 | <!-- this is a comment -->
30 | <head>
31 | <title>Jinja2 Example</title>
32 | </head>
33 | <body>
34 | <ul>
35 | {# this is a comment #}
36 | {%- for item in li -%}
37 | <li>
38 | {{ item.label }}
39 | </li>
40 | {% endfor -%}
41 | </ul>
42 | </body>
43 | </html>
44 |
45 |
50 |
51 |
--------------------------------------------------------------------------------
/routes/bid.js:
--------------------------------------------------------------------------------
1 | /* jshint node: true */
2 | 'use strict';
3 |
4 | var bidsCommon = require(__dirname + '/common/bids');
5 |
6 | module.exports = {
7 | // POST bid
8 | newBid: function(req, res) {
9 | req.model.load('userBidsPerRegion', req);
10 | req.model.load('auctionUser', req);
11 | req.model.end(function(err, models) {
12 | if (err) { console.log(err); }
13 | bidsCommon.newBid(req, models, function() {
14 | res.redirect(req.browsePrefix + '/auctions/' + req.body.auctionId);
15 | });
16 | });
17 | },
18 | updateBid: function(req, res) {
19 | // updating bids are a admin only function for now
20 | if (!req.user.admin) { return res.redirect(req.browsePrefix); }
21 | req.params.bidId = req.body.bidId; // is this really needed?
22 | req.model.load('bid', req);
23 | req.model.end(function(err, models) {
24 | if (err) { console.log(err); res.redirect(req.browsePrefix); }
25 | else {
26 | bidsCommon.updateBid(req, models, function(err) {
27 | if(err) { console.log(err); }
28 | res.redirect(req.browsePrefix);
29 | });
30 | }
31 | });
32 | },
33 | deleteBid: function(req, res) {
34 | // deleting bids is an admin only function
35 | if (!req.user.admin) { return res.redirect(req.browsePrefix); }
36 |
37 | req.model.load('bid', req);
38 | req.model.end(function(err, models) {
39 | bidsCommon.deleteBid(req, models, function(err, results) {
40 | if (err) { res.send(500, err.message); }
41 | if (results) { res.json(results); }
42 | });
43 | });
44 | }
45 | };
46 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/z80/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Z80 assembly mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Z80 assembly mode
27 |
28 |
29 |
30 | #include "ti83plus.inc"
31 | #define progStart $9D95
32 | .org progStart-2
33 | .db $BB,$6D
34 | bcall(_ClrLCDFull)
35 | ld HL, 0
36 | ld (PenCol), HL
37 | ld HL, Message
38 | bcall(_PutS) ; Displays the string
39 | bcall(_NewLine)
40 | ret
41 | Message:
42 | .db "Hello world!",0
43 |
44 |
45 |
50 |
51 | MIME type defined: text/x-z80.
52 |
53 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/ecl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: ECL mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | ECL mode
27 |
28 | /*
29 | sample useless code to demonstrate ecl syntax highlighting
30 | this is a multiline comment!
31 | */
32 |
33 | // this is a singleline comment!
34 |
35 | import ut;
36 | r :=
37 | record
38 | string22 s1 := '123';
39 | integer4 i1 := 123;
40 | end;
41 | #option('tmp', true);
42 | d := dataset('tmp::qb', r, thor);
43 | output(d);
44 |
45 |
48 |
49 | Based on CodeMirror's clike mode. For more information see HPCC Systems web site.
50 | MIME types defined: text/x-ecl.
51 |
52 |
53 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/3024-day.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Name: 3024 day
4 | Author: Jan T. Sott (http://github.com/idleberg)
5 |
6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
8 |
9 | */
10 |
11 | .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
12 | .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
13 | .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
14 | .cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
15 | .cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
16 |
17 | .cm-s-3024-day span.cm-comment {color: #cdab53;}
18 | .cm-s-3024-day span.cm-atom {color: #a16a94;}
19 | .cm-s-3024-day span.cm-number {color: #a16a94;}
20 |
21 | .cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}
22 | .cm-s-3024-day span.cm-keyword {color: #db2d20;}
23 | .cm-s-3024-day span.cm-string {color: #fded02;}
24 |
25 | .cm-s-3024-day span.cm-variable {color: #01a252;}
26 | .cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}
27 | .cm-s-3024-day span.cm-def {color: #e8bbd0;}
28 | .cm-s-3024-day span.cm-bracket {color: #3a3432;}
29 | .cm-s-3024-day span.cm-tag {color: #db2d20;}
30 | .cm-s-3024-day span.cm-link {color: #a16a94;}
31 | .cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
32 |
33 | .cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
34 | .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
35 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/rust/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodeMirror: Rust mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Rust mode
27 |
28 |
29 |
30 | // Demo code.
31 |
32 | type foo = int;
33 | enum bar {
34 | some(int, foo),
35 | none
36 | }
37 |
38 | fn check_crate(x: int) {
39 | let v = 10;
40 | alt foo {
41 | 1 to 3 {
42 | print_foo();
43 | if x {
44 | blah() + 10;
45 | }
46 | }
47 | (x, y) { "bye" }
48 | _ { "hi" }
49 | }
50 | }
51 |
52 |
53 |
59 |
60 | MIME types defined: text/x-rustsrc.
61 |
62 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/hint/css-hint.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | "use strict";
3 |
4 | var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1,
5 | "first-letter": 1, "first-line": 1, "first-child": 1,
6 | before: 1, after: 1, lang: 1};
7 |
8 | CodeMirror.registerHelper("hint", "css", function(cm) {
9 | var cur = cm.getCursor(), token = cm.getTokenAt(cur);
10 | var inner = CodeMirror.innerMode(cm.getMode(), token.state);
11 | if (inner.mode.name != "css") return;
12 |
13 | var word = token.string, start = token.start, end = token.end;
14 | if (/[^\w$_-]/.test(word)) {
15 | word = ""; start = end = cur.ch;
16 | }
17 |
18 | var spec = CodeMirror.resolveMode("text/css");
19 |
20 | var result = [];
21 | function add(keywords) {
22 | for (var name in keywords)
23 | if (!word || name.lastIndexOf(word, 0) == 0)
24 | result.push(name);
25 | }
26 |
27 | var st = token.state.state;
28 | if (st == "pseudo" || token.type == "variable-3") {
29 | add(pseudoClasses);
30 | } else if (st == "block" || st == "maybeprop") {
31 | add(spec.propertyKeywords);
32 | } else if (st == "prop" || st == "parens" || st == "at" || st == "params") {
33 | add(spec.valueKeywords);
34 | add(spec.colorKeywords);
35 | } else if (st == "media" || st == "media_parens") {
36 | add(spec.mediaTypes);
37 | add(spec.mediaFeatures);
38 | }
39 |
40 | if (result.length) return {
41 | list: result,
42 | from: CodeMirror.Pos(cur.line, start),
43 | to: CodeMirror.Pos(cur.line, end)
44 | };
45 | });
46 | })();
47 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/paraiso-dark.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Name: Paraíso (Dark)
4 | Author: Jan T. Sott
5 |
6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
8 |
9 | */
10 |
11 | .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}
12 | .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}
13 | .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}
14 | .cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;}
15 | .cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;}
16 |
17 | .cm-s-paraiso-dark span.cm-comment {color: #e96ba8;}
18 | .cm-s-paraiso-dark span.cm-atom {color: #815ba4;}
19 | .cm-s-paraiso-dark span.cm-number {color: #815ba4;}
20 |
21 | .cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;}
22 | .cm-s-paraiso-dark span.cm-keyword {color: #ef6155;}
23 | .cm-s-paraiso-dark span.cm-string {color: #fec418;}
24 |
25 | .cm-s-paraiso-dark span.cm-variable {color: #48b685;}
26 | .cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;}
27 | .cm-s-paraiso-dark span.cm-def {color: #f99b15;}
28 | .cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;}
29 | .cm-s-paraiso-dark span.cm-tag {color: #ef6155;}
30 | .cm-s-paraiso-dark span.cm-link {color: #815ba4;}
31 | .cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;}
32 |
33 | .cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;}
34 | .cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
35 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/keymap/extra.js:
--------------------------------------------------------------------------------
1 | // A number of additional default bindings that are too obscure to
2 | // include in the core codemirror.js file.
3 |
4 | (function() {
5 | "use strict";
6 |
7 | var Pos = CodeMirror.Pos;
8 |
9 | function moveLines(cm, start, end, dist) {
10 | if (!dist || start > end) return 0;
11 |
12 | var from = cm.clipPos(Pos(start, 0)), to = cm.clipPos(Pos(end));
13 | var text = cm.getRange(from, to);
14 |
15 | if (start <= cm.firstLine())
16 | cm.replaceRange("", from, Pos(to.line + 1, 0));
17 | else
18 | cm.replaceRange("", Pos(from.line - 1), to);
19 | var target = from.line + dist;
20 | if (target <= cm.firstLine()) {
21 | cm.replaceRange(text + "\n", Pos(target, 0));
22 | return cm.firstLine() - from.line;
23 | } else {
24 | var targetPos = cm.clipPos(Pos(target - 1));
25 | cm.replaceRange("\n" + text, targetPos);
26 | return targetPos.line + 1 - from.line;
27 | }
28 | }
29 |
30 | function moveSelectedLines(cm, dist) {
31 | var head = cm.getCursor("head"), anchor = cm.getCursor("anchor");
32 | cm.operation(function() {
33 | var moved = moveLines(cm, Math.min(head.line, anchor.line), Math.max(head.line, anchor.line), dist);
34 | cm.setSelection(Pos(anchor.line + moved, anchor.ch), Pos(head.line + moved, head.ch));
35 | });
36 | }
37 |
38 | CodeMirror.commands.moveLinesUp = function(cm) { moveSelectedLines(cm, -1); };
39 | CodeMirror.commands.moveLinesDown = function(cm) { moveSelectedLines(cm, 1); };
40 |
41 | CodeMirror.keyMap["default"]["Alt-Up"] = "moveLinesUp";
42 | CodeMirror.keyMap["default"]["Alt-Down"] = "moveLinesDown";
43 | })();
44 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/3024-night.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Name: 3024 night
4 | Author: Jan T. Sott (http://github.com/idleberg)
5 |
6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
8 |
9 | */
10 |
11 | .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
12 | .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
13 | .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
14 | .cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;}
15 | .cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;}
16 |
17 | .cm-s-3024-night span.cm-comment {color: #cdab53;}
18 | .cm-s-3024-night span.cm-atom {color: #a16a94;}
19 | .cm-s-3024-night span.cm-number {color: #a16a94;}
20 |
21 | .cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;}
22 | .cm-s-3024-night span.cm-keyword {color: #db2d20;}
23 | .cm-s-3024-night span.cm-string {color: #fded02;}
24 |
25 | .cm-s-3024-night span.cm-variable {color: #01a252;}
26 | .cm-s-3024-night span.cm-variable-2 {color: #01a0e4;}
27 | .cm-s-3024-night span.cm-def {color: #e8bbd0;}
28 | .cm-s-3024-night span.cm-bracket {color: #d6d5d4;}
29 | .cm-s-3024-night span.cm-tag {color: #db2d20;}
30 | .cm-s-3024-night span.cm-link {color: #a16a94;}
31 | .cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;}
32 |
33 | .cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;}
34 | .cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
35 |
--------------------------------------------------------------------------------
/email-templates/registration.ejs:
--------------------------------------------------------------------------------
1 |
2 | You are receiving this email because someone using your email address is attempting to register for the bitcointalk.org ad auction system. If you did not do this, then you can just ignore this email. If you receive many copies of this email, go
here , enter your email address, and reset your password using the link that will be emailed to you.
3 |
4 | To participate in auctions, you must pay a one-time registration fee of <%= registrationFee %> BTC. This requirement is an automated means of allowing new bidders to easily join while also serving as an anti-spam measure to guard against the negative effects of non-serious bidders. This fee will be subtracted from your first invoice if you ever win any ad slots, so it is usually not an additional cost. However, it will not be refunded if you never win any ad slots or if you are banned from the auction system.
5 |
6 | In order to complete the registration process, please refer to the invoice link below. For your own protection, please verify that the URL begins with
<%= invoiceUrl %> .
7 |
8 |
9 | Click here to view your invoice.
10 |
11 |
12 | Upon completion of the payment process, you will become eligible to submit ads for review. After at least one of your advertisements is approved by an administrator, you will be able to bid in ad auctions. You can start this process by going to your profile page and creating an advertisement.
13 |
14 |
15 |
16 |
17 | This is a automated email. Please do not reply.
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "adness-api",
3 | "version": "0.9.1",
4 | "repository": {
5 | "type": "git",
6 | "url": "https://github.com/slickage/adness.git"
7 | },
8 | "description": "",
9 | "main": "index.js",
10 | "engines": {
11 | "node": ">=0.10.0",
12 | "npm": ">=1.3"
13 | },
14 | "scripts": {
15 | "test": "tap ./test"
16 | },
17 | "author": "James Wang ",
18 | "license": "MIT",
19 | "dependencies": {
20 | "async": "~0.2.10",
21 | "body-parser": "^1.4.3",
22 | "charlatan": "~0.1.9",
23 | "connect-assets": "~2.5.3",
24 | "connect-flash": "~0.1.1",
25 | "connect-redis": "^2.0.0",
26 | "cookie-parser": "^1.3.2",
27 | "csurf": "^1.3.0",
28 | "ejs": "~0.8.5",
29 | "ejs-locals": "~1.0.2",
30 | "emcee": "0.0.4",
31 | "errorhandler": "^1.1.1",
32 | "express": "~4.6.1",
33 | "express-jwt": "~0.1.0",
34 | "express-session": "^1.6.5",
35 | "geoip-lite": "~1.1.3",
36 | "google-caja": "0.0.2",
37 | "heckler": "slickage/heckler",
38 | "helmet": "^0.4.0",
39 | "jsonwebtoken": "~0.1.0",
40 | "lodash": "~2.4.1",
41 | "moment": "^2.6.0",
42 | "morgan": "^1.1.1",
43 | "mysql": "~2.0.1",
44 | "nano": "~4.4.0",
45 | "node-resque": "~0.5.1",
46 | "node-uuid": "~1.4.1",
47 | "nodemailer": "~0.6.0",
48 | "passport": "~0.1.18",
49 | "passport-local": "~0.1.6",
50 | "rate-limiter": "0.2.0",
51 | "request": "~2.34.0",
52 | "restify": "~2.6.1",
53 | "rework": "^1.0.0",
54 | "rework-walk": "^1.0.0",
55 | "serve-favicon": "^2.0.1",
56 | "shacrypt": "0.0.2"
57 | },
58 | "devDependencies": {
59 | "tap": "~0.4.8"
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/theme/paraiso-light.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Name: Paraíso (Light)
4 | Author: Jan T. Sott
5 |
6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
8 |
9 | */
10 |
11 | .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}
12 | .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}
13 | .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}
14 | .cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;}
15 | .cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;}
16 |
17 | .cm-s-paraiso-light span.cm-comment {color: #e96ba8;}
18 | .cm-s-paraiso-light span.cm-atom {color: #815ba4;}
19 | .cm-s-paraiso-light span.cm-number {color: #815ba4;}
20 |
21 | .cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;}
22 | .cm-s-paraiso-light span.cm-keyword {color: #ef6155;}
23 | .cm-s-paraiso-light span.cm-string {color: #fec418;}
24 |
25 | .cm-s-paraiso-light span.cm-variable {color: #48b685;}
26 | .cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;}
27 | .cm-s-paraiso-light span.cm-def {color: #f99b15;}
28 | .cm-s-paraiso-light span.cm-bracket {color: #41323f;}
29 | .cm-s-paraiso-light span.cm-tag {color: #ef6155;}
30 | .cm-s-paraiso-light span.cm-link {color: #815ba4;}
31 | .cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;}
32 |
33 | .cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;}
34 | .cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
35 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/addon/selection/active-line.js:
--------------------------------------------------------------------------------
1 | // Because sometimes you need to style the cursor's line.
2 | //
3 | // Adds an option 'styleActiveLine' which, when enabled, gives the
4 | // active line's wrapping the CSS class "CodeMirror-activeline",
5 | // and gives its background
the class "CodeMirror-activeline-background".
6 |
7 | (function() {
8 | "use strict";
9 | var WRAP_CLASS = "CodeMirror-activeline";
10 | var BACK_CLASS = "CodeMirror-activeline-background";
11 |
12 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
13 | var prev = old && old != CodeMirror.Init;
14 | if (val && !prev) {
15 | updateActiveLine(cm, cm.getCursor().line);
16 | cm.on("beforeSelectionChange", selectionChange);
17 | } else if (!val && prev) {
18 | cm.off("beforeSelectionChange", selectionChange);
19 | clearActiveLine(cm);
20 | delete cm.state.activeLine;
21 | }
22 | });
23 |
24 | function clearActiveLine(cm) {
25 | if ("activeLine" in cm.state) {
26 | cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS);
27 | cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS);
28 | }
29 | }
30 |
31 | function updateActiveLine(cm, selectedLine) {
32 | var line = cm.getLineHandleVisualStart(selectedLine);
33 | if (cm.state.activeLine == line) return;
34 | cm.operation(function() {
35 | clearActiveLine(cm);
36 | cm.addLineClass(line, "wrap", WRAP_CLASS);
37 | cm.addLineClass(line, "background", BACK_CLASS);
38 | cm.state.activeLine = line;
39 | });
40 | }
41 |
42 | function selectionChange(cm, sel) {
43 | updateActiveLine(cm, sel.head.line);
44 | }
45 | })();
46 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/pascal/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
CodeMirror: Pascal mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Pascal mode
27 |
28 |
29 |
30 | (* Example Pascal code *)
31 |
32 | while a <> b do writeln('Waiting');
33 |
34 | if a > b then
35 | writeln('Condition met')
36 | else
37 | writeln('Condition not met');
38 |
39 | for i := 1 to 10 do
40 | writeln('Iteration: ', i:1);
41 |
42 | repeat
43 | a := a + 1
44 | until a = 10;
45 |
46 | case i of
47 | 0: write('zero');
48 | 1: write('one');
49 | 2: write('two')
50 | end;
51 |
52 |
53 |
59 |
60 | MIME types defined: text/x-pascal.
61 |
62 |
--------------------------------------------------------------------------------
/public/scripts/codemirror/mode/pig/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
CodeMirror: Pig Latin mode
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
23 |
24 |
25 |
26 | Pig Latin mode
27 |
28 | -- Apache Pig (Pig Latin Language) Demo
29 | /*
30 | This is a multiline comment.
31 | */
32 | a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
33 | b = GROUP a BY (x,y,3+4);
34 | c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
35 | STORE c INTO "\path\to\output";
36 |
37 | --
38 |
39 |
40 |
47 |
48 |
49 | Simple mode that handles Pig Latin language.
50 |
51 |
52 | MIME type defined: text/x-pig
53 | (PIG code)
54 |