-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
716 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
chrome.storage.local.get({ | ||
//DOMYSLNE USTAWIENIA CHROME | ||
baner: true, | ||
banerurl: "https://i.imgur.com/OYSVEl8.png" | ||
}, function(items) { | ||
if (items.baner){ | ||
|
||
//Using CSS as a placeholder so the banner doesnt flicker | ||
//CSS applies as soon as element is shown (It can be set before element exists) | ||
//JS has a delay (it needs DOM completely loaded) | ||
var customStyles = document.createElement('style'); | ||
customStyles.appendChild(document.createTextNode( | ||
"#top-banner { visibility: hidden } #top-banner-container { background: url(" + items.banerurl + ") no-repeat, url(/assets/img/synergia/header/systema.png) top left no-repeat !important; }" | ||
)); | ||
//banerurl set by user, shouldnt be a problem //I dont even know if there is any risk with CSS | ||
document.documentElement.appendChild(customStyles); | ||
|
||
//When everthing is loaded do JS anyway because background: url isn't perfect | ||
document.addEventListener("DOMContentLoaded", function() { | ||
var banerElement = document.getElementById("top-banner"); | ||
banerElement.src = items.banerurl; | ||
banerElement.style.visibility = "visible"; | ||
}); | ||
|
||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
chrome.storage.local.get({ | ||
glowna: true | ||
}, function(items) { | ||
if (items.glowna == true) { | ||
|
||
var customStyles = document.createElement('style'); | ||
customStyles.appendChild(document.createTextNode( | ||
".center.main-page { display: none; } .container.static.margin-bottom { display: none; } #footer {display: none;}" | ||
)); | ||
document.documentElement.appendChild(customStyles); | ||
|
||
}; | ||
}); | ||
|
||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
|
||
|
||
var szczesliwyNum = document.getElementsByClassName("szczesliwy-numerek")[0].children[0].textContent; | ||
var teksik = document.getElementsByClassName("szczesliwy-numerek")[0].parentElement.children[2].textContent; | ||
localStorage.setItem("szczesliwy", szczesliwyNum); | ||
localStorage.setItem("szczesliwytex", teksik); | ||
var tb = document.getElementById("top-banner-container").children[0]; | ||
var myheader = document.createElement('p1'); | ||
myheader.style.position = "absolute"; | ||
myheader.style.top = "85%"; | ||
myheader.textContent = teksik + szczesliwyNum; | ||
tb.insertBefore(myheader, tb.firstChild); | ||
|
||
chrome.storage.local.get({ | ||
glowna: true | ||
}, function(items) { | ||
if (items.glowna == true) { | ||
document.getElementById("body").innerHTML = '<div><iframe style="position:absolute;left:0px;width:100%;height:85%" src="https://synergia.librus.pl/przegladaj_plan_lekcji" scrolling="yes" align="middle" frameborder="0"></iframe></div>'; | ||
}; | ||
}); | ||
|
||
}); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function OdpalDodanaPrzezemnieAnimacje(){ | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
style.textContent = '.grade-box { position: fixed; }'; | ||
document.getElementsByTagName('head')[0].appendChild(style); | ||
|
||
|
||
|
||
function makeNewPosition(){ | ||
|
||
var h = $(window).height() - 50; | ||
var w = $(window).width() - 50; | ||
|
||
var nh = Math.floor(Math.random() * h); | ||
var nw = Math.floor(Math.random() * w); | ||
|
||
return [nh,nw]; | ||
|
||
} | ||
function calcSpeed(prev, next) { | ||
var x = Math.abs(prev[1] - next[1]); | ||
var y = Math.abs(prev[0] - next[0]); | ||
var greatest = x > y ? x : y; | ||
var speedModifier = 0.01; | ||
var speed = Math.ceil(greatest / speedModifier); | ||
return speed; | ||
} | ||
function sleep(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
function animateDiv(objekt){ | ||
var newq = makeNewPosition(); | ||
var oldq = objekt.offset(); | ||
var speed = calcSpeed([oldq.top, oldq.left], newq); | ||
|
||
objekt.animate({ top: newq[0], left: newq[1] }, speed, function(){ | ||
animateDiv(objekt); | ||
}); | ||
}; | ||
|
||
function WystartujAnimacje(){ | ||
$('.grade-box').each(function(){ | ||
animateDiv($(this)); | ||
}); | ||
} | ||
WystartujAnimacje(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"manifest_version": 2, | ||
|
||
"name": "Edziennik-plus", | ||
"description": "Więcej funkcji w dzienniku elektronicznym", | ||
"version": "0.3.2", | ||
"icons": {"128":"icon.png"}, | ||
"author": "MS", | ||
"options_ui": { | ||
"page": "options.html", | ||
"chrome_style": true | ||
}, | ||
"web_accessible_resources": [ | ||
"wiadantyspamweb.js", | ||
"magicznyweb.js" | ||
], | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://synergia.librus.pl/przegladaj_oceny/uczen"], | ||
"js": ["oceny.js"], | ||
"run_at": "document_start" | ||
}, | ||
{ | ||
"matches": ["https://synergia.librus.pl/uczen_index"], | ||
"js": ["glowna.js"], | ||
"run_at": "document_start" | ||
}, | ||
{ | ||
"matches": ["https://synergia.librus.pl/*"], | ||
"js": ["banerinject.js"], | ||
"run_at": "document_start" | ||
}, | ||
{ | ||
"matches": ["https://synergia.librus.pl/wiadomosci", "https://synergia.librus.pl/wiadomosci/5", "https://synergia.librus.pl/wiadomosci/5/*"], | ||
"js": ["wiadantyspam.js"], | ||
"run_at": "document_idle" | ||
}, | ||
{ | ||
"matches": ["https://synergia.librus.pl/*"], | ||
"exclude_matches": ["https://synergia.librus.pl/uczen_index"], | ||
"js": ["szczesliwy.js"], | ||
"run_at": "document_end" | ||
} | ||
], | ||
"permissions": [ | ||
"storage", | ||
"tabs", | ||
"https://synergia.librus.pl/*" | ||
] | ||
} |
Oops, something went wrong.