1234567891011121314151617181920212223 |
- /**
- * Content types need to be allowed/forbidden at the global level, rather than a save level.
- * They should be able to be changed at any time.
- * They should be as little vague as is reasonable.
- */
- module ContentHandler {
- let contentHash : {[id : string] : ContentType} = {};
- let contentArray : Array<ContentType> = [];
- export function registerContentType (type : ContentType) {
- if (contentHash[type.getId()] != undefined) {
- console.error("[ContentHandler} Can't register the content.", type, "Old:", contentHash[type.getId()]);
- return;
- } else {
- contentHash[type.getId()] = type;
- contentArray.push(type);
- }
- }
- export function getContentTypes () {
- return contentArray.slice();
- }
- }
|