init
This commit is contained in:
commit
d65d4834dd
2 changed files with 88 additions and 0 deletions
40
main.js
Normal file
40
main.js
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
try {
|
||||
(function() {
|
||||
var inputs = document.querySelectorAll('input[type="text"], input[autofocus], input[placeholder]');
|
||||
var inputsLength = inputs.length;
|
||||
|
||||
for (var u = 0; u < inputsLength; u++) {
|
||||
inputs[u].blur();
|
||||
}
|
||||
|
||||
var profile = document.querySelector('.profile');
|
||||
|
||||
if (profile) {
|
||||
var currentTab = profile.querySelector('.menu a.item.active');
|
||||
|
||||
if (currentTab && currentTab.getAttribute('href').indexOf('tab=activity') !== -1) {
|
||||
var feeds = profile.querySelector('.feeds');
|
||||
var news = profile.querySelector('.feeds > .news');
|
||||
|
||||
if (feeds && news) {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('class', 'gitnet-activity-iframe');
|
||||
iframe.setAttribute('src', 'https://git.deblan.org/index2.php?username=' + document.querySelector('meta[property="og:title"]').getAttribute('content'));
|
||||
iframe.setAttribute('frameborder', '0');
|
||||
|
||||
feeds.insertBefore(iframe, news);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var stylusInterval = window.setInterval(function() {
|
||||
var stylus = document.querySelector('style.stylus');
|
||||
|
||||
if (stylus && !stylus.getAttribute('data-clean')) {
|
||||
stylus.innerHTML = '';
|
||||
stylus.setAttribute('data-clean', 1);
|
||||
window.clearInterval(stylusInterval);
|
||||
}
|
||||
}, 100);
|
||||
})();
|
||||
} catch(e) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue