Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set cursor focus to title when creating page
#1
Sets the cursor focus to the page title field if creating a new page.
Paste the following code on your text editor and save as setfocus-editpage.php (or whatever) in your plugins folder:

Code:
<?php

/* setfocus-editpage.php */
/* for GetSimple 2.02+ */

$thisfile = basename(__FILE__, ".php");
register_plugin(
    $thisfile,
    'Set focus (edit page)',
    '0.1 beta',
    'Carlos Navarro',
    '#',
    'Set cursor focus to title field when creating a new page'
);

add_action('edit-content','setfocus_editpage');

function setfocus_editpage() {
    global $data_edit;
    if(!isset($data_edit)) { echo "<script type=\"text/javascript\">try{document.getElementById('post-title').focus();}catch(e){}</script>"; }
}
?>

Sorry, not for 2.01 (didn't have the edit-content hook)
Reply


Messages In This Thread
Set cursor focus to title when creating page - by Carlos - 2010-06-08, 23:26:24



Users browsing this thread: 1 Guest(s)