Simple API for processors

This commit is contained in:
Remy Sharp 2012-06-21 12:50:34 +01:00
parent 52f4e2785e
commit c16b8f3c00

View File

@ -82,4 +82,28 @@ var processors = jsbin.processors = {
return function (source) { return source; };
}
};
};
processors.set = function (panel, preprocessor) {
if (jsbin.panels.panels[panel]) {
if (preprocessor && processors[preprocessor]) {
jsbin.panels.panels[panel].processor = processors[preprocessor]();
} else {
// remove the preprocessor
jsbin.panels.panels[panel].processor = function (source) {
return source;
};
}
}
};