Vulcan/packages/telescope-base/lib/base.js

187 lines
3.7 KiB
JavaScript
Raw Normal View History

2014-09-18 07:24:42 +09:00
// ------------------------------------- Schemas -------------------------------- //
2014-07-06 14:09:55 +09:00
// array containing properties to be added to the post/settings/comments schema on startup.
addToPostSchema = [];
2014-07-06 14:09:55 +09:00
addToCommentsSchema = [];
addToSettingsSchema = [];
2014-09-18 07:24:42 +09:00
// ------------------------------------- Navigation -------------------------------- //
// array containing nav items; initialize with views menu and admin menu
primaryNav = ['viewsMenu', 'adminMenu'];
secondaryNav = ['userMenu', 'notificationsMenu', 'submitButton'];
// array containing items in the admin menu
adminNav = [];
// array containing items in the views menu
viewNav = [
{
route: 'posts_top',
label: 'Top'
},
{
route: 'posts_new',
label: 'New'
},
{
route: 'posts_best',
label: 'Best'
},
{
route: 'posts_digest',
label: 'Digest'
2014-09-18 07:24:42 +09:00
}
];
2014-09-18 07:24:42 +09:00
// ------------------------------------- Views -------------------------------- //
// object containing post list view parameters
viewParameters = {}
viewParameters.top = function (terms) {
return {
options: {sort: {sticky: -1, score: -1}}
};
}
viewParameters.new = function (terms) {
return {
options: {sort: {sticky: -1, postedAt: -1}}
};
}
viewParameters.best = function (terms) {
return {
options: {sort: {sticky: -1, baseScore: -1}}
};
}
viewParameters.pending = function (terms) {
return {
find: {status: 1},
options: {sort: {createdAt: -1}}
};
}
viewParameters.digest = function (terms) {
return {
find: {
postedAt: {
$gte: terms.after,
$lt: terms.before
}
},
options: {
2014-09-11 10:34:43 +09:00
sort: {sticky: -1, baseScore: -1, limit: 0}
}
};
2014-07-04 12:44:36 +09:00
}
heroModules = [];
2014-09-18 07:24:42 +09:00
footerModules = [];
2014-07-04 12:44:36 +09:00
// array containing post modules
2014-07-05 13:32:01 +09:00
modulePositions = [
2014-07-07 13:41:25 +09:00
'left-left',
'left-center',
'left-right',
'center-left',
'center-center',
'center-right',
'right-left',
'right-center',
'right-right'
2014-07-05 13:32:01 +09:00
];
2014-07-04 12:44:36 +09:00
postModules = [
{
2014-07-04 14:07:50 +09:00
template: 'postUpvote',
2014-07-07 14:36:51 +09:00
position: 'left-left'
2014-07-04 12:44:36 +09:00
},
{
template: 'postActions',
position: 'left-right'
2014-07-04 12:44:36 +09:00
},
{
template: 'postContent',
position: 'center-center'
},
2014-07-04 12:44:36 +09:00
{
2014-07-04 14:07:50 +09:00
template: 'postDiscuss',
2014-07-07 14:36:51 +09:00
position: 'right-right'
2014-07-04 12:44:36 +09:00
}
2014-07-05 11:24:28 +09:00
];
postHeading = [
{
template: 'postTitle',
order: 1
},
{
template: 'postDomain',
order: 5
}
]
postMeta = [
{
2014-09-12 18:53:49 +09:00
template: 'postInfo',
order: 1
},
{
template: 'postCommentsLink',
order: 3
},
{
template: 'postAdmin',
order: 5
}
]
2014-07-05 18:06:28 +09:00
// ------------------------------ Callbacks ------------------------------ //
2014-08-01 09:07:58 +09:00
postSubmitRenderedCallbacks = [];
2014-07-05 18:06:28 +09:00
postSubmitClientCallbacks = [];
postSubmitMethodCallbacks = [];
2014-09-20 10:42:42 +09:00
postAfterSubmitMethodCallbacks = [];
2014-07-05 18:06:28 +09:00
2014-08-01 09:07:58 +09:00
postEditRenderedCallbacks = [];
2014-07-05 18:06:28 +09:00
postEditClientCallbacks = [];
postEditMethodCallbacks = []; // not used yet
2014-09-20 10:42:42 +09:00
postAfterMethodCallbacks = []; // not used yet
2014-07-05 18:06:28 +09:00
commentSubmitRenderedCallbacks = [];
commentSubmitClientCallbacks = [];
commentSubmitMethodCallbacks = [];
2014-09-20 10:42:42 +09:00
commentAfterSubmitMethodCallbacks = [];
2014-07-05 18:06:28 +09:00
commentEditRenderedCallbacks = [];
commentEditClientCallbacks = [];
commentEditMethodCallbacks = []; // not used yet
2014-09-20 10:42:42 +09:00
commentAfterEditMethodCallbacks = []; // not used yet
2014-07-05 18:06:28 +09:00
// ------------------------------ Dynamic Templates ------------------------------ //
2014-07-05 11:24:28 +09:00
templates = {}
getTemplate = function (name) {
// if template has been overwritten, return this; else return template name
return !!templates[name] ? templates[name] : name;
}
// ------------------------------ Theme Settings ------------------------------ //
themeSettings = {
'useDropdowns': true // whether or not to use dropdown menus in a theme
2014-09-18 07:24:42 +09:00
};
// ------------------------------ Subscriptions ------------------------------ //
// array containing subscriptions to be preloaded
preloadSubscriptions = [];