summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-01 08:17:01 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-01 08:17:01 +0200
commit43974a15f24859fd817adccb6c906522748ce42d (patch)
tree96481fa914d247017e5c734386552f223a6ecae0 /data
parent7a45f330a7a6011a1816ffb77011518c29f332c2 (diff)
downloadsemanticscuttle-43974a15f24859fd817adccb6c906522748ce42d.tar.gz
semanticscuttle-43974a15f24859fd817adccb6c906522748ce42d.tar.bz2
make popup bookmarklet work in firefox when the title contains double and single quotes. opera still broken, though
Diffstat (limited to 'data')
-rw-r--r--data/templates/editbookmark.tpl.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/data/templates/editbookmark.tpl.php b/data/templates/editbookmark.tpl.php
index 8b98987..1a74290 100644
--- a/data/templates/editbookmark.tpl.php
+++ b/data/templates/editbookmark.tpl.php
@@ -20,6 +20,10 @@ function jsEscTitle($title)
{
return addcslashes($title, "'");
}
+function jsEscTitleDouble($title)
+{
+ return addcslashes(addcslashes($title, "'"), "'\\");
+}
if (is_array($row['tags'])) {
$row['tags'] = implode(', ', $row['tags']);
@@ -261,7 +265,7 @@ if (browser == "Opera") {
+ 't=encodeURIComponent(x.title);'
+ 'd=encodeURIComponent('+selection+');'
+ 'open('
- + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;popup=1&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d,\'<?php echo htmlspecialchars(jsEscTitle($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2'
+ + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;popup=1&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2'
+ ');void 0;">'
+ '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>'
+ '</a>'