explain opera button commands
This commit is contained in:
parent
28460d52cb
commit
361c94895d
1 changed files with 14 additions and 7 deletions
|
@ -24,6 +24,10 @@ function jsEscTitleDouble($title)
|
||||||
{
|
{
|
||||||
return addcslashes(addcslashes($title, "'"), "'\\");
|
return addcslashes(addcslashes($title, "'"), "'\\");
|
||||||
}
|
}
|
||||||
|
function fixOperaButtonName($name) {
|
||||||
|
//yes, opera has problems with double quotes in button names
|
||||||
|
return str_replace('"', "''", $name);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($row['tags'])) {
|
if (is_array($row['tags'])) {
|
||||||
$row['tags'] = implode(', ', $row['tags']);
|
$row['tags'] = implode(', ', $row['tags']);
|
||||||
|
@ -249,10 +253,6 @@ if (browser == "Opera") {
|
||||||
+ '<li>'
|
+ '<li>'
|
||||||
+ '<a class="bookmarklet" href="'
|
+ '<a class="bookmarklet" href="'
|
||||||
+ '<?php
|
+ '<?php
|
||||||
function fixOperaButtonName($name) {
|
|
||||||
//yes, opera has problems with double quotes in button names
|
|
||||||
return str_replace('"', "''", $name);
|
|
||||||
}
|
|
||||||
$popupLink = 'javascript:'
|
$popupLink = 'javascript:'
|
||||||
. "location.href='"
|
. "location.href='"
|
||||||
. createURL('bookmarks', $GLOBALS['user'])
|
. createURL('bookmarks', $GLOBALS['user'])
|
||||||
|
@ -261,9 +261,16 @@ $popupLink = 'javascript:'
|
||||||
. "&title='+encodeURIComponent(document.title)+'"
|
. "&title='+encodeURIComponent(document.title)+'"
|
||||||
. "&description='+encodeURIComponent(SELECTION)+'"
|
. "&description='+encodeURIComponent(SELECTION)+'"
|
||||||
. "';";
|
. "';";
|
||||||
$link = 'opera:/button/Go to page,'
|
$link = 'opera:/button/'
|
||||||
. '"' . rawurlencode($popupLink) . '"'
|
//Opera command
|
||||||
. ',,"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '",'
|
. 'Go to page,'
|
||||||
|
//command parameter 1
|
||||||
|
. '"' . rawurlencode($popupLink) . '",'
|
||||||
|
//command parameter 2
|
||||||
|
. ','
|
||||||
|
//button title
|
||||||
|
. '"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '",'
|
||||||
|
//button icon
|
||||||
. '"Scuttle"';
|
. '"Scuttle"';
|
||||||
echo jsEscTitle(htmlspecialchars($link));
|
echo jsEscTitle(htmlspecialchars($link));
|
||||||
?>'.replace('SELECTION', selection)
|
?>'.replace('SELECTION', selection)
|
||||||
|
|
Loading…
Reference in a new issue