mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
make string.endsWith compatible with IE
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
This commit is contained in:
parent
befaa17357
commit
1e262352d9
|
|
@ -1,10 +1,17 @@
|
|||
---
|
||||
---
|
||||
{% if site.suffix %}
|
||||
if(!String.prototype.endsWith) {
|
||||
String.prototype.endsWith = function (ending) {
|
||||
if(typeof ending !== 'string') return false;
|
||||
if(!ending) return true;
|
||||
return this.slice(-ending.length) === ending;
|
||||
};
|
||||
}
|
||||
if(!document.location.hostname.endsWith('{{ site.suffix }}') &&
|
||||
!document.location.hostname.endsWith('{{ site.suffix }}.')){
|
||||
document.title = document.title.replace(/(清华)|(tsinghua)|(tuna)/gi, '');
|
||||
$().ready(function(){
|
||||
$().ready(() => {
|
||||
$(document.body).addClass('nonthu');
|
||||
})
|
||||
}
|
||||
Loading…
Reference in New Issue