var message = 'Are you sure you want to delete '+ links.length +' links?\n';
message += 'This action is IRREVERSIBLE!\n\nTitles:\n';
- var ids = '';
+ var ids = [];
links.forEach(function(item) {
message += ' - '+ item['title'] +'\n';
- ids += item['id'] +'+';
+ ids.push(item['id']);
});
if (window.confirm(message)) {
- window.location = '?delete_link&lf_linkdate='+ ids +'&token='+ token.value;
+ window.location = '?delete_link&lf_linkdate='+ ids.join('+') +'&token='+ token.value;
}
});
}
function activateFirefoxSocial(node) {
var loc = location.href;
- var baseURL = loc.substring(0, loc.lastIndexOf("/"));
+ var baseURL = loc.substring(0, loc.lastIndexOf("/") + 1);
+ var title = document.title;
// Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
var data = {
- name: "{$shaarlititle}",
+ name: title,
description: "The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community.",
author: "Shaarli",
version: "1.0.0",
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));