Bläddra i källkod

Clean up non-working code and logs

tags/v2.0
Matt Baer 9 år sedan
förälder
incheckning
add1a3c51d
1 ändrade filer med 1 tillägg och 9 borttagningar
  1. +1
    -9
      popup.js

+ 1
- 9
popup.js Visa fil

@@ -15,14 +15,8 @@ function publish(content, font) {
var url = "https://write.as/api/";
var params = "w=" + encodeURIComponent(content) + "&font=" + font;
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("User-Agent", "Write.as Chrome Extension v1.0");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() { //Call a function when the state changes.
http.onreadystatechange = function() {
if (http.readyState == 4) {
$publish.classList.remove('disabled');
$publish.value = "Publish";
@@ -44,8 +38,6 @@ function publish(content, font) {
$url.value = url;
var $urlLink = document.getElementById("url-link");
$urlLink.href = url;
console.log("writeas add " + id + " " + editToken);
} else {
alert("Failed to post. Please try again.");
}


Laddar…
Avbryt
Spara