That was very helpful (after I read through 5 Ember tutorials and 1 on es6). Here’s what I came up with for others if they need it (in /plugins/myplugin/assets/javascripts/discourse/initializers/listener.js.es6):
import { withPluginApi } from 'discourse/lib/plugin-api';
import { observes } from "ember-addons/ember-computed-decorators";
function initializeIntelligentTagger(api) {
const ComposerController = api.container.lookupFactory("controller:composer");
ComposerController.reopen({
editPostItem: function () {
console.log(this.get('model.title'));
console.log(this.get('model.reply'));
}.observes('model.reply')
});
}
export default {
name: "add-intelligent-tagger",
initialize() {
withPluginApi('0.0.1', initializeIntelligentTagger);
}
};
Critiques would be appreciated. Next, I’ll work on the ajax call to guess at tags. I’m thinking of first removing the top 10k most common words, then have a lookup table for v1, then feed it to a deep-learning algorithm to train for v2) - hints welcome.