mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Simple API for processors
This commit is contained in:
parent
52f4e2785e
commit
c16b8f3c00
@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user