// ==UserScript==
// @name           Blogger BlogThis Add Labels
// @namespace      http://userscripts.org/users/99
// @description    Adds the Labels Input to the BlogThis Pop-Up
// @include        http://*.blogger.com/blog-this.g*
// ==/UserScript==

BlogThis_Default_Label_Name = "5ivethings, ";
// When I use BlogThis, I don't like the posts to have titles, 
// so I just delete the text in the Title input too. 
// Set to true if you want the title to be blank
var blankTitle = true;

var publishButton, labelInput;
publishButton = document.getElementById("publishButton");
if (publishButton) {
    labelInput = document.createElement('input');
    labelInput.setAttribute("id", "post-labels");
    labelInput.setAttribute("name", "postLabels");
    labelInput.setAttribute("type", "text");
    labelInput.setAttribute("value", BlogThis_Default_Label_Name);
    labelInput.style.marginTop = "13px;";
    publishButton.parentNode.insertBefore(labelInput, publishButton.nextSibling);
    
    labelLabel = document.createElement("label");
    labelLabel.setAttribute("for", "post-labels");
    labelLabel.innerHTML = "Labels: ";
    labelLabel.style.marginLeft = "200px;";
    labelInput.parentNode.insertBefore(labelLabel, labelInput);
}

if(blankTitle == true){
	var titleInput
	titleInput = document.getElementById("f-title");
	if (titleInput) {
		titleInput.value = "";
	}
}