WordPress.org

Make WordPress Core

Ticket #3878: new-post-bookmarklet.patch

File new-post-bookmarklet.patch, 3.9 KB (added by DD32, 7 years ago)

Bookmarklet Patch

  • post-new.php

     
    5454include('edit-form-advanced.php'); 
    5555?> 
    5656 
    57 <?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?> 
    5857<div id="wp-bookmarklet" class="wrap"> 
    5958<h3><?php _e('WordPress Bookmarklet'); ?></h3> 
    60 <p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p> 
     59<p><?php _e('Right click on the following link and choose "Add to favorites" or "Bookmark Link" to create a posting shortcut.'); ?></p> 
    6160<p> 
    62  
    63 <?php 
    64 if ($is_NS4 || $is_gecko) { 
    65 ?> 
    66 <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a>  
    67 <?php 
    68 } else if ($is_winIE) { 
    69 ?> 
    70 <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&amp;popupurl='+encodeURIComponent(location.href)+'&amp;popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> 
    71 <script type="text/javascript"> 
    72 <!-- 
    73 function oneclickbookmarklet(blah) { 
    74 window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120"); 
    75 } 
    76 // --> 
    77 </script> 
    78 <br /> 
    79 <br /> 
    80 <?php _e('One-click bookmarklet:') ?><br /> 
    81 <a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a>  
    82 <?php 
    83 } else if ($is_opera) { 
    84 ?> 
    85 <a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>  
    86 <?php 
    87 } else if ($is_macIE) { 
    88 ?> 
    89 <a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a>  
    90 <?php 
    91 } 
    92 ?> 
     61<a href="javascript:function A(b){return (encodeURIComponent)?encodeURIComponent(b):escape(b);}Q='';if(window.getSelection){Q=window.getSelection();}else if (document.getSelection){Q=document.getSelection()}else if(document.selection){Q=document.selection.createRange().text;}void(window.open('<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+A(Q)+'&amp;popupurl='+A(location.href)+'&amp;popuptitle='+A(document.title)));" title="<?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?>"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a> <?php echo __('New Window/tab') ?><br/> 
     62<a href="javascript:function A(b){return (encodeURIComponent)?encodeURIComponent(b):escape(b);}Q='';if(window.getSelection){Q=window.getSelection();}else if (document.getSelection){Q=document.getSelection()}else if(document.selection){Q=document.selection.createRange().text;}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+A(Q)+'&amp;popupurl='+A(location.href)+'&amp;popuptitle='+A(document.title);" title="<?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?>"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a> <?php echo __('Current Window') ?> 
    9363</p> 
    9464</div> 
    95 <?php } ?> 
    9665 
    9766<?php include('admin-footer.php'); ?>