1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-12 02:42:48 +00:00

updated bunch of file paths and changed the way posts are loaded

This commit is contained in:
2016-01-05 12:28:04 -06:00
parent 4bb8cae81e
commit 6ab45fe935
13249 changed files with 317868 additions and 2101398 deletions

View File

@@ -3,7 +3,8 @@
* Module dependencies.
*/
var STATES = require('./connectionstate')
var EventEmitter = require('events').EventEmitter;
var STATES = require('./connectionstate');
/**
* Abstract Collection constructor
@@ -16,7 +17,7 @@ var STATES = require('./connectionstate')
* @api public
*/
function Collection (name, conn, opts) {
function Collection(name, conn, opts) {
if (undefined === opts) opts = {};
if (undefined === opts.capped) opts.capped = {};
@@ -34,11 +35,12 @@ function Collection (name, conn, opts) {
this.conn = conn;
this.queue = [];
this.buffer = this.opts.bufferCommands;
this.emitter = new EventEmitter();
if (STATES.connected == this.conn.readyState) {
this.onOpen();
}
};
}
/**
* The collection name
@@ -73,7 +75,7 @@ Collection.prototype.conn;
* @api private
*/
Collection.prototype.onOpen = function () {
Collection.prototype.onOpen = function() {
var self = this;
this.buffer = false;
self.doQueue();
@@ -85,7 +87,7 @@ Collection.prototype.onOpen = function () {
* @api private
*/
Collection.prototype.onClose = function () {
Collection.prototype.onClose = function() {
if (this.opts.bufferCommands) {
this.buffer = true;
}
@@ -100,7 +102,7 @@ Collection.prototype.onClose = function () {
* @api private
*/
Collection.prototype.addQueue = function (name, args) {
Collection.prototype.addQueue = function(name, args) {
this.queue.push([name, args]);
return this;
};
@@ -111,11 +113,15 @@ Collection.prototype.addQueue = function (name, args) {
* @api private
*/
Collection.prototype.doQueue = function () {
for (var i = 0, l = this.queue.length; i < l; i++){
Collection.prototype.doQueue = function() {
for (var i = 0, l = this.queue.length; i < l; i++) {
this[this.queue[i][0]].apply(this, this.queue[i][1]);
}
this.queue = [];
var _this = this;
process.nextTick(function() {
_this.emitter.emit('queue');
});
return this;
};
@@ -123,7 +129,7 @@ Collection.prototype.doQueue = function () {
* Abstract method that drivers must implement.
*/
Collection.prototype.ensureIndex = function(){
Collection.prototype.ensureIndex = function() {
throw new Error('Collection#ensureIndex unimplemented by driver');
};
@@ -131,7 +137,7 @@ Collection.prototype.ensureIndex = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.findAndModify = function(){
Collection.prototype.findAndModify = function() {
throw new Error('Collection#findAndModify unimplemented by driver');
};
@@ -139,7 +145,7 @@ Collection.prototype.findAndModify = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.findOne = function(){
Collection.prototype.findOne = function() {
throw new Error('Collection#findOne unimplemented by driver');
};
@@ -147,7 +153,7 @@ Collection.prototype.findOne = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.find = function(){
Collection.prototype.find = function() {
throw new Error('Collection#find unimplemented by driver');
};
@@ -155,7 +161,7 @@ Collection.prototype.find = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.insert = function(){
Collection.prototype.insert = function() {
throw new Error('Collection#insert unimplemented by driver');
};
@@ -163,7 +169,7 @@ Collection.prototype.insert = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.save = function(){
Collection.prototype.save = function() {
throw new Error('Collection#save unimplemented by driver');
};
@@ -171,7 +177,7 @@ Collection.prototype.save = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.update = function(){
Collection.prototype.update = function() {
throw new Error('Collection#update unimplemented by driver');
};
@@ -179,7 +185,7 @@ Collection.prototype.update = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.getIndexes = function(){
Collection.prototype.getIndexes = function() {
throw new Error('Collection#getIndexes unimplemented by driver');
};
@@ -187,7 +193,7 @@ Collection.prototype.getIndexes = function(){
* Abstract method that drivers must implement.
*/
Collection.prototype.mapReduce = function(){
Collection.prototype.mapReduce = function() {
throw new Error('Collection#mapReduce unimplemented by driver');
};