From 1ae4b11e7d681d7a4143f9aa2acf0863fc7e5f6b Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Thu, 22 Oct 2015 23:09:08 -0700 Subject: [PATCH] Add our real froala key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe a little bit overboard to stick this in an initializer, but it had to go somewhere. This kind of leaves the key open in the wild, but I don’t know how else we would distribute it to partners. --- app/initializers/froala.js | 13 +++++++++++++ tests/unit/initializers/froala-test.js | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 app/initializers/froala.js create mode 100644 tests/unit/initializers/froala-test.js diff --git a/app/initializers/froala.js b/app/initializers/froala.js new file mode 100644 index 0000000000..5fd20a718f --- /dev/null +++ b/app/initializers/froala.js @@ -0,0 +1,13 @@ +/* global $ */ +export function initialize() { + //version 1 key + $.Editable.DEFAULTS.key = 'vD1Ua1Mf1e1VSYKa1EPYD=='; + + //version 2 key (currently not in use) + //$.FroalaEditor.DEFAULTS.key = 'vD1Ua1Mf1e1VSYKa1EPYD=='; +} + +export default { + name: 'froala', + initialize: initialize +}; diff --git a/tests/unit/initializers/froala-test.js b/tests/unit/initializers/froala-test.js new file mode 100644 index 0000000000..4bea917390 --- /dev/null +++ b/tests/unit/initializers/froala-test.js @@ -0,0 +1,24 @@ +/* global $ */ +import Ember from 'ember'; +import { initialize } from '../../../initializers/froala'; +import { module, test } from 'qunit'; + +var registry, application; + +module('Unit | Initializer | froala', { + beforeEach: function() { + Ember.run(function() { + application = Ember.Application.create(); + registry = application.registry; + application.deferReadiness(); + }); + } +}); + +test('froala key is in the jquery global', function(assert) { + initialize(registry, application); + + let key = $.Editable.DEFAULTS.key; + assert.ok(key); + assert.ok(key.length > 10); +});