discourse-data-explorer/assets/javascripts/discourse/initializers/initialize-data-explorer.js...

23 lines
731 B
Plaintext
Raw Normal View History

2015-11-20 20:49:23 -05:00
2015-08-25 23:48:19 -04:00
export default {
2015-11-20 20:49:23 -05:00
name: 'initialize-data-explorer',
2015-08-25 23:48:19 -04:00
initialize(container) {
2015-11-20 20:49:23 -05:00
container.lookup('store:main').addPluralization('query', 'queries');
2015-08-25 23:48:19 -04:00
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(searchString, position) {
var subjectString = this.toString();
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
}
2015-11-20 20:49:23 -05:00
// load route
require('discourse/plugins/discourse-data-explorer/discourse/explorer-route-map');
2015-08-25 23:48:19 -04:00
}
};