mirror of
https://github.com/writeas/paste-chrome
synced 2018-07-20 11:45:21 +00:00
Clean up non-working code and logs
This commit is contained in:
parent
bea6b41d44
commit
add1a3c51d
10
popup.js
10
popup.js
@ -15,14 +15,8 @@ function publish(content, font) {
|
|||||||
var url = "https://write.as/api/";
|
var url = "https://write.as/api/";
|
||||||
var params = "w=" + encodeURIComponent(content) + "&font=" + font;
|
var params = "w=" + encodeURIComponent(content) + "&font=" + font;
|
||||||
http.open("POST", url, true);
|
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) {
|
if (http.readyState == 4) {
|
||||||
$publish.classList.remove('disabled');
|
$publish.classList.remove('disabled');
|
||||||
$publish.value = "Publish";
|
$publish.value = "Publish";
|
||||||
@ -44,8 +38,6 @@ function publish(content, font) {
|
|||||||
$url.value = url;
|
$url.value = url;
|
||||||
var $urlLink = document.getElementById("url-link");
|
var $urlLink = document.getElementById("url-link");
|
||||||
$urlLink.href = url;
|
$urlLink.href = url;
|
||||||
|
|
||||||
console.log("writeas add " + id + " " + editToken);
|
|
||||||
} else {
|
} else {
|
||||||
alert("Failed to post. Please try again.");
|
alert("Failed to post. Please try again.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user