*
* TODO: support error code in the backend for AJAX requests
*/
- var existingTags = document.querySelector('input[name="taglist"]').value.split(' ');
+ var tagList = document.querySelector('input[name="taglist"]');
+ var existingTags = tagList ? tagList.value.split(' ') : [];
var awesomepletes = [];
// Display/Hide rename form
});
});
- updateAwesompleteList('.rename-tag-input', document.querySelector('input[name="taglist"]').value.split(' '), awesomepletes);
+ updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
};
/**
function activateFirefoxSocial(node) {
var loc = location.href;
- var baseURL = loc.substring(0, loc.lastIndexOf("/"));
+ var baseURL = loc.substring(0, loc.lastIndexOf("/") + 1);
// Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
var data = {
icon32URL: baseURL + "/images/favicon.ico",
icon64URL: baseURL + "/images/favicon.ico",
- shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
+ shareURL: baseURL + "?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi",
homepageURL: baseURL
};
node.setAttribute("data-service", JSON.stringify(data));