mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Remove polyfills: we don't support IE anymore (#18)
* Remove polyfills: we don't support IE anymore
This commit is contained in:
committed by
GitHub
parent
f390676f2f
commit
a232d8bcfc
@@ -11,12 +11,10 @@ import { extend } from 'flarum/extend';
|
|||||||
import TextEditor from 'flarum/components/TextEditor';
|
import TextEditor from 'flarum/components/TextEditor';
|
||||||
import MarkdownArea from 'mdarea';
|
import MarkdownArea from 'mdarea';
|
||||||
|
|
||||||
import './polyfills';
|
|
||||||
import MarkdownToolbar from './components/MarkdownToolbar';
|
import MarkdownToolbar from './components/MarkdownToolbar';
|
||||||
import MarkdownButton from './components/MarkdownButton';
|
import MarkdownButton from './components/MarkdownButton';
|
||||||
|
|
||||||
app.initializers.add('flarum-markdown', function(app) {
|
app.initializers.add('flarum-markdown', function(app) {
|
||||||
|
|
||||||
let index = 1;
|
let index = 1;
|
||||||
|
|
||||||
extend(TextEditor.prototype, 'init', function() {
|
extend(TextEditor.prototype, 'init', function() {
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
/*! https://mths.be/startswith v0.2.0 by @mathias */
|
|
||||||
if (!String.prototype.startsWith) {
|
|
||||||
Object.defineProperty(String.prototype, 'startsWith', {
|
|
||||||
value: function(search, pos) {
|
|
||||||
pos = !pos || pos < 0 ? 0 : +pos;
|
|
||||||
return this.substring(pos, pos + search.length) === search;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.prototype.endsWith) {
|
|
||||||
String.prototype.endsWith = function(search, this_len) {
|
|
||||||
if (this_len === undefined || this_len > this.length) {
|
|
||||||
this_len = this.length;
|
|
||||||
}
|
|
||||||
return this.substring(this_len - search.length, this_len) === search;
|
|
||||||
};
|
|
||||||
}
|
|
Reference in New Issue
Block a user