aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/default/js
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/default/js')
-rw-r--r--tpl/default/js/shaarli.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js
index 4ebb7815..4f49affa 100644
--- a/tpl/default/js/shaarli.js
+++ b/tpl/default/js/shaarli.js
@@ -418,7 +418,8 @@ window.onload = function () {
418 * 418 *
419 * TODO: support error code in the backend for AJAX requests 419 * TODO: support error code in the backend for AJAX requests
420 */ 420 */
421 var existingTags = document.querySelector('input[name="taglist"]').value.split(' '); 421 var tagList = document.querySelector('input[name="taglist"]');
422 var existingTags = tagList ? tagList.value.split(' ') : [];
422 var awesomepletes = []; 423 var awesomepletes = [];
423 424
424 // Display/Hide rename form 425 // Display/Hide rename form
@@ -515,7 +516,7 @@ window.onload = function () {
515 }); 516 });
516 }); 517 });
517 518
518 updateAwesompleteList('.rename-tag-input', document.querySelector('input[name="taglist"]').value.split(' '), awesomepletes); 519 updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
519}; 520};
520 521
521/** 522/**
@@ -605,7 +606,7 @@ function htmlEntities(str)
605 606
606function activateFirefoxSocial(node) { 607function activateFirefoxSocial(node) {
607 var loc = location.href; 608 var loc = location.href;
608 var baseURL = loc.substring(0, loc.lastIndexOf("/")); 609 var baseURL = loc.substring(0, loc.lastIndexOf("/") + 1);
609 610
610 // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable. 611 // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
611 var data = { 612 var data = {
@@ -618,7 +619,7 @@ function activateFirefoxSocial(node) {
618 icon32URL: baseURL + "/images/favicon.ico", 619 icon32URL: baseURL + "/images/favicon.ico",
619 icon64URL: baseURL + "/images/favicon.ico", 620 icon64URL: baseURL + "/images/favicon.ico",
620 621
621 shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}", 622 shareURL: baseURL + "?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi",
622 homepageURL: baseURL 623 homepageURL: baseURL
623 }; 624 };
624 node.setAttribute("data-service", JSON.stringify(data)); 625 node.setAttribute("data-service", JSON.stringify(data));