Make WordPress Core

Changeset 11906


Ignore:
Timestamp:
09/08/2009 08:06:52 PM (15 years ago)
Author:
ryan
Message:

Fix Press This bookmarklet for Safari 4. Props noel. fixes #10749

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r11866 r11906  
    16491649function get_shortcut_link() {
    16501650    $link = "javascript:
    1651             var d=document,
    1652             w=window,
    1653             e=w.getSelection,
    1654             k=d.getSelection,
     1651            var d=document, 
     1652            w=window, 
     1653            e=w.getSelection, 
     1654            k=d.getSelection, 
    16551655            x=d.selection,
    16561656            s=(e?e():(k)?k():(x?x.createRange().text:0)),
     
    16581658            l=d.location,
    16591659            e=encodeURIComponent,
    1660             g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2';
    1661             function a(){
    1662                 if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=720,height=570')){
    1663                     l.href=g;
    1664                 }
    1665             }";
    1666             if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)
    1667                 $link .= 'setTimeout(a,0);';
    1668             else
    1669                 $link .= 'a();';
    1670 
    1671             $link .= "void(0);";
     1660            u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';
     1661            a=function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=720,height=570'))l.href=u;};
     1662            if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
     1663            void(0)";
    16721664
    16731665    $link = str_replace(array("\r", "\n", "\t"),  '', $link);
Note: See TracChangeset for help on using the changeset viewer.