mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
23 lines
No EOL
736 B
JavaScript
23 lines
No EOL
736 B
JavaScript
Meteor.startup(function () {
|
|
|
|
// "custom_" is always loaded last, so it takes priority over every other prefix
|
|
Telescope.config.addCustomPrefix("custom_");
|
|
|
|
// loop over custom prefixes
|
|
Telescope.config.customPrefixes.forEach(function (prefix) {
|
|
|
|
// for each prefix, loop over all templates to find any replacements
|
|
Template.forEach(function (template) {
|
|
|
|
var templateName = template.viewName.replace("Template.", "");
|
|
|
|
// if current template name starts with the prefix, find original template and replace it
|
|
if (templateName.slice(0,prefix.length) === prefix) {
|
|
var oldTemplate = templateName.slice(prefix.length);
|
|
template.replaces(oldTemplate);
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
}); |