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

20 lines
679 B
Plaintext
Raw Normal View History

2015-08-25 23:48:19 -04:00
export default {
2018-10-10 07:56:23 -04:00
name: "initialize-data-explorer",
2015-08-25 23:48:19 -04:00
initialize(container) {
2018-10-10 07:56:23 -04:00
container.lookup("store:main").addPluralization("query", "queries");
2015-11-20 20:49:23 -05:00
2015-08-25 23:48:19 -04:00
if (!String.prototype.endsWith) {
2019-06-14 12:29:06 -04:00
// eslint-disable-next-line no-extend-native
2018-10-10 07:56:23 -04:00
String.prototype.endsWith = function(searchString, position) {
const subjectString = this.toString();
2015-08-25 23:48:19 -04:00
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
const lastIndex = subjectString.indexOf(searchString, position);
2015-08-25 23:48:19 -04:00
return lastIndex !== -1 && lastIndex === position;
};
}
}
};