summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-04 23:11:05 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-04 23:11:05 +0200
commit1527555a9631cce1eb37dd7fa76cac27adaeba96 (patch)
tree7ec3bcd6cca92198acbe87daadaf274a06dcab92 /data
parent361c94895daf7680e54589f8379dc9d647282941 (diff)
downloadsemanticscuttle-1527555a9631cce1eb37dd7fa76cac27adaeba96.tar.gz
semanticscuttle-1527555a9631cce1eb37dd7fa76cac27adaeba96.tar.bz2
restructure opera bookmarklet popup code (doesnt work currently :)) and make normal opera bookmarklet code a bit easier to read
Diffstat (limited to 'data')
-rw-r--r--data/templates/editbookmark.tpl.php39
1 files changed, 31 insertions, 8 deletions
diff --git a/data/templates/editbookmark.tpl.php b/data/templates/editbookmark.tpl.php
index 99afa9c..b7fb227 100644
--- a/data/templates/editbookmark.tpl.php
+++ b/data/templates/editbookmark.tpl.php
@@ -259,25 +259,48 @@ $popupLink = 'javascript:'
. '?action=add'
. "&address='+encodeURIComponent(document.location.href)+'"
. "&title='+encodeURIComponent(document.title)+'"
- . "&description='+encodeURIComponent(SELECTION)+'"
- . "';";
+ . "&description='+encodeURIComponent(SELECTION)"
+ . ";";
$link = 'opera:/button/'
//Opera command
- . 'Go to page,'
+ . 'Go to page'
//command parameter 1
- . '"' . rawurlencode($popupLink) . '",'
+ . ',"' . rawurlencode($popupLink) . '"'
//command parameter 2
. ','
//button title
- . '"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '",'
- //button icon
- . '"Scuttle"';
+ . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '"'
+ //button icon name
+ . ',"Scuttle"';
echo jsEscTitle(htmlspecialchars($link));
?>'.replace('SELECTION', selection)
+ '"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?></a>'
+ '</li>'
+ '<li>'
- + '<a class="bookmarklet" href="opera:/button/Go%20to%20page,%20%22javascript:x=document;a=encodeURIComponent(x.location.href);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);void 0;%22,,%22Post%20to%20<?php echo urlencode($GLOBALS['sitename']); ?>%20(Pop-up)%22,%22Scuttle%22"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>'
+ + '<a class="bookmarklet" href="'
+ + '<?php
+$popupLink = 'javascript:'
+ . 'open('
+ . "'" . createURL('bookmarks', $GLOBALS['user'])
+ . '?action=add'
+ . '&popup=1'
+ . "&address='+encodeURIComponent(document.location.href)+'"
+ . "&title='+encodeURIComponent(document.title)+'"
+ . "&description='+encodeURIComponent(SELECTION)"
+ . ","
+ . "'" . 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"
+ . ");void 0";
+$link = 'opera:/button/'
+ . 'Go to page'
+ . ',"' . rawurlencode($popupLink) . '"'
+ . ','
+ . ',"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . ' (Pop-up)"'
+ . ',"Scuttle"';
+echo jsEscTitle(htmlspecialchars($link));
+?>'.replace('SELECTION', selection)
+ + '"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>'
+ '</li>'
+ '</ul>'
);