Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

new icons, add votes

  • Loading branch information...
commit 5af0bf327337b236dd17d924ddb16b0035fa12b3 1 parent ce0d8f1
@Gemorroj authored
View
2  background.js
@@ -8,7 +8,7 @@ opera.contexts.toolbar.addItem(opera.contexts.toolbar.createItem({
disabled: false,
popup: {
href: "popup.html",
- width: 400,
+ width: 496,
height: 500
}
}));
View
BIN  icons/icon18.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  icons/icon64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
26 popup.css
@@ -65,4 +65,30 @@ div.account td.stats em.bad {
div.account td.stats em.good {
color: rgb(0, 205, 5);
font-style: normal;
+}
+
+div.account form.vote {
+ color: #989898;
+ font-size: 10px;
+ margin-left: 320px;
+ padding: 10px;
+}
+
+div.account form.vote label {
+ display: block;
+ line-height: 125%;
+ margin-bottom: 5px;
+}
+
+form input.submit {
+ background-color: #CD0000;
+ border: 1px solid #E67D7D;
+ color: #FFFFFF;
+ cursor: pointer;
+ font-size: 12px;
+}
+
+div.account form.vote input.yes {
+ background-color: #00CD05;
+ border: 1px solid #61FF60;
}
View
32 popup.js
@@ -1,3 +1,26 @@
+function castVote (site, account, vote) {
+ var val = document.getElementById("account" + account);
+
+ var img = document.createElement("img");
+ img.src = "loader.gif";
+ img.alt = "Please, Wait...";
+
+ val.appendChild(img);
+
+ var xmlhttp = new XMLHttpRequest();
+ xmlhttp.onreadystatechange = function () {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ val.removeChild(img);
+ val.appendChild(document.createTextNode("Ok"));
+ } else if (xmlhttp.readyState >= 4) {
+ val.removeChild(img);
+ val.appendChild(document.createTextNode("Error"));
+ }
+ };
+ xmlhttp.open("GET", 'http://www.bugmenot.com/vote_ajax.php?id=' + account + '&site=' + site + '&vote=' + vote, false);
+ xmlhttp.send(null);
+}
+
window.addEventListener('DOMContentLoaded', function () {
var key;
@@ -29,11 +52,18 @@ window.addEventListener('DOMContentLoaded', function () {
key = Number(xml.querySelectorAll("script")[1].innerText.replace(/[^0-9-]/g, ''));
var form = xml.querySelector("div.panel.minor");
+
+
+ var nodes = form.querySelectorAll("form");
+ for (var i = 0, l = nodes.length; i < l; i++) {
+ nodes[i].action = "#";
+ }
+ /*
var nodes = form.querySelectorAll("form");
for (var i = 0, l = nodes.length; i < l; i++) {
nodes[i].parentNode.removeChild(nodes[i]);
}
-
+ */
return form.innerHTML.replace(/<script>d\('(.+)'\);<\/script>/g, function (str, p1) {
return decoder(p1);
});
Please sign in to comment.
Something went wrong with that request. Please try again.