Vulcan/packages/nova-lib/lib/config.js

60 lines
1.9 KiB
JavaScript
Raw Normal View History

2016-02-17 14:39:56 +09:00
/**
* Kick off the global namespace for Telescope.
* @namespace Telescope
*/
Telescope = {};
Telescope.VERSION = '0.25.7';
2016-02-16 15:08:30 +09:00
// ------------------------------------- Config -------------------------------- //
/**
2015-05-10 13:37:42 +09:00
* Telescope configuration namespace
* @namespace Telescope.config
*/
2016-02-16 15:08:30 +09:00
Telescope.config = {};
// ------------------------------------- Schemas -------------------------------- //
SimpleSchema.extendOptions({
private: Match.Optional(Boolean),
editable: Match.Optional(Boolean), // editable: true means the field can be edited by the document's owner
hidden: Match.Optional(Boolean), // hidden: true means the field is never shown in a form no matter what
editableBy: Match.Optional([String]),
publishedTo: Match.Optional([String]),
required: Match.Optional(Boolean), // required: true means the field is required to have a complete profile
public: Match.Optional(Boolean), // public: true means the field is published freely
profile: Match.Optional(Boolean), // profile: true means the field is shown on user profiles
template: Match.Optional(String), // template used to display the field
autoform: Match.Optional(Object) // autoform placeholder
// editableBy: Match.Optional(String)
});
// ------------------------------------- Components -------------------------------- //
Telescope.components = {};
Telescope.registerComponent = (name, component) => {
Telescope.components[name] = component;
};
Telescope.getComponent = (name) => {
return Telescope.components[name];
};
// ------------------------------------- Subscriptions -------------------------------- //
/**
* Subscriptions namespace
* @namespace Telescope.subscriptions
*/
Telescope.subscriptions = [];
/**
* Add a subscription to be preloaded
* @param {string} subscription - The name of the subscription
*/
Telescope.subscriptions.preload = function (subscription, args) {
Telescope.subscriptions.push({name: subscription, arguments: args});
2016-02-17 15:09:49 +09:00
};