exit;\r
}\r
\r
-/*\r
+/**\r
+ * getBookmarklet()\r
* Returns the Javascript code for a bookmarklet that works on most modern browsers\r
- * @param blogid\r
+ * \r
+ * @param integer $blogid ID for weblog\r
+ * @return script to call Bookmarklet\r
*/\r
-function getBookmarklet($blogid) {\r
- global $CONF;\r
-\r
- // normal\r
- $document = 'document';\r
- $bookmarkletline = "javascript:Q='';x=".$document.";y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();}wingm=window.open('";\r
- $bookmarkletline .= $CONF['AdminURL'] . "bookmarklet.php?blogid=$blogid";\r
- $bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=550,left=10,top=10,status=yes,resizable=yes');wingm.focus();";\r
-\r
- return $bookmarkletline;\r
+function getBookmarklet($blogid, $width=600, $height=500)\r
+{\r
+ global $CONF;\r
+ \r
+ $script = "Q='';"\r
+ . "x=document;"\r
+ . "y=window;"\r
+ . "if ( x.selection )"\r
+ . "{"\r
+ . " Q=x.selection.createRange().text;"\r
+ . "}"\r
+ . "else if ( y.getSelection )"\r
+ . "{"\r
+ . " Q=y.getSelection();"\r
+ . "}"\r
+ . "else if ( x.getSelection )"\r
+ . "{"\r
+ . " Q=x.getSelection();"\r
+ . "}"\r
+ . "wingm = window.open('{$CONF['AdminURL']}bookmarklet.php?blogid={$blogid}"\r
+ . " &logtext=' + encodeURIComponent(Q) +"\r
+ . " '&loglink=' + encodeURIComponent(x.location.href) +"\r
+ . " '&loglinktitle=' + encodeURIComponent(x.title),"\r
+ . " 'nucleusbm',"\r
+ . " 'scrollbars=yes,width={$width},height={$height},left=10,top=10,status=yes,resizable=yes');"\r
+ . "wingm.focus();";\r
+ \r
+ return $script;\r
}\r
// END: functions from the end of file ADMIN.php\r
\r