From 587e9d917ce90832b50fe89673c1940fd5778ce5 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 21 Nov 2015 12:49:23 +1100 Subject: [PATCH] fixes so it works in no constants mode --- .../discourse/initializers/add-query-plurazliation.js.es6 | 7 ------- ...ng-endswith.js.es6 => initialize-data-explorer.js.es6} | 8 +++++++- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 assets/javascripts/discourse/initializers/add-query-plurazliation.js.es6 rename assets/javascripts/discourse/initializers/{polyfill-string-endswith.js.es6 => initialize-data-explorer.js.es6} (70%) diff --git a/assets/javascripts/discourse/initializers/add-query-plurazliation.js.es6 b/assets/javascripts/discourse/initializers/add-query-plurazliation.js.es6 deleted file mode 100644 index 9710135..0000000 --- a/assets/javascripts/discourse/initializers/add-query-plurazliation.js.es6 +++ /dev/null @@ -1,7 +0,0 @@ - -export default { - name: 'add-query-pluralization', - initialize(container) { - container.lookup('store:main').addPluralization('query', 'queries'); - } -}; diff --git a/assets/javascripts/discourse/initializers/polyfill-string-endswith.js.es6 b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 similarity index 70% rename from assets/javascripts/discourse/initializers/polyfill-string-endswith.js.es6 rename to assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 index 3fca9cb..c3c08c3 100644 --- a/assets/javascripts/discourse/initializers/polyfill-string-endswith.js.es6 +++ b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 @@ -1,6 +1,9 @@ + export default { - name: 'polyfill-string-endswith', + name: 'initialize-data-explorer', initialize(container) { + container.lookup('store:main').addPluralization('query', 'queries'); + if (!String.prototype.endsWith) { String.prototype.endsWith = function(searchString, position) { var subjectString = this.toString(); @@ -12,5 +15,8 @@ export default { return lastIndex !== -1 && lastIndex === position; }; } + + // load route + require('discourse/plugins/discourse-data-explorer/discourse/explorer-route-map'); } };