qacaptcha.js 453 B

12345678910111213141516171819202122
  1. import Ember from 'ember';
  2. export default Ember.Service.extend({
  3. field: 'qacaptcha-field',
  4. model: null,
  5. load: function() {
  6. // Obtain QA question from API
  7. var promise = this.store.find('captcha-question', 1);
  8. var self = this;
  9. promise.then(function(model) {
  10. self.set('model', model);
  11. });
  12. return promise;
  13. },
  14. value: function() {
  15. return Ember.$('#captcha-question').val() || '';
  16. }.property().volatile()
  17. });