mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
12 lines
442 B
Plaintext
12 lines
442 B
Plaintext
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||
|
|
||
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||
|
@computed("value", "model.compiledRegularExpression")
|
||
|
matches(value, regexpString) {
|
||
|
if (!value || !regexpString) return;
|
||
|
let censorRegexp = new RegExp(regexpString, "ig");
|
||
|
return value.match(censorRegexp);
|
||
|
}
|
||
|
});
|