WordPress.org

Make WordPress Core

Changeset 6542


Ignore:
Timestamp:
01/03/08 01:34:11 (6 years ago)
Author:
matt
Message:

New tag interface, tag auto-suggest while typing. Rough - suggest and parts of JS should probably be refactored. Hat tip: jhodgdon.

Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r6373 r6542  
    77if ( !is_user_logged_in() ) 
    88    die('-1'); 
     9 
     10if ( 'ajax-tag-search' == $_GET['action'] ) { 
     11    if ( !current_user_can( 'manage_categories' ) ) 
     12        die('-1'); 
     13 
     14    $s = $_GET['q']; // is this slashed already? 
     15 
     16    if ( strstr( $s, ',' ) ) 
     17        die; // it's a multiple tag insert, we won't find anything 
     18    $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" ); 
     19    echo join( $results, "\n" ); 
     20    die; 
     21} 
    922 
    1023function get_out_now() { exit; } 
  • trunk/wp-admin/edit-form-advanced.php

    r6213 r6542  
    158158<?php echo $form_prevstatus ?> 
    159159 
    160 <fieldset id="tagdiv"> 
    161     <legend><?php _e('Tags (separate multiple tags with commas: cats, pet food, dogs)'); ?></legend> 
    162     <div><input type="text" name="tags_input" class="tags-input" id="tags-input" size="30" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></div> 
    163 </fieldset> 
    164  
    165160<p class="submit"> 
    166161<span id="autosave"></span> 
     
    202197 
    203198<div class="dbx-b-ox-wrapper"> 
     199<fieldset id="tagdiv" class="dbx-box"> 
     200<div class="dbx-h-andle-wrapper"> 
     201<h3 class="dbx-handle"><?php _e('Tags (separate multiple tags with commas: cats, pet food, dogs)'); ?></h3> 
     202</div> 
     203<div class="dbx-c-ontent-wrapper"> 
     204<div class="dbx-content"> 
     205<p id="jaxtag"> 
     206<input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /> 
     207</p> 
     208<p id="tagchecklist"></p> 
     209</div></div> 
     210</fieldset> 
     211</div> 
     212 
     213<div class="dbx-b-ox-wrapper"> 
    204214<fieldset id="postexcerpt" class="dbx-box"> 
    205215<div class="dbx-h-andle-wrapper"> 
     
    207217</div> 
    208218<div class="dbx-c-ontent-wrapper"> 
    209 <div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div> 
    210 </div> 
     219<div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea> 
     220</div></div> 
    211221</fieldset> 
    212222</div> 
  • trunk/wp-admin/post-new.php

    r6513 r6542  
    77wp_enqueue_script('jquery'); 
    88wp_enqueue_script('autosave'); 
     9wp_enqueue_script('post'); 
     10 
    911require_once ('./admin-header.php'); 
    1012 
  • trunk/wp-admin/post.php

    r6213 r6542  
    5959    } 
    6060 
    61     if($post->post_status == 'draft') { 
     61    wp_enqueue_script('post'); 
     62 
     63    if( 'draft' == $post->post_status ) { 
    6264        wp_enqueue_script('prototype'); 
    6365        wp_enqueue_script('autosave'); 
    6466    } 
     67 
    6568    require_once('admin-header.php'); 
    6669 
  • trunk/wp-admin/wp-admin.css

    r6484 r6542  
    9191body    { 
    9292    background: #fff; 
    93     color: #000; 
     93    color: #333; 
    9494    margin: 0; 
    9595    padding: 0; 
     
    138138} 
    139139 
    140 input:focus, textarea:focus, label:focus { 
    141     background: #fff; 
    142     border: 1px solid #686868; 
    143 } 
    144  
    145140.form-invalid { 
    146141    background-color: #FF9999 !important; 
     
    160155 
    161156textarea, input, select { 
    162     background: #f4f4f4; 
    163     border: 1px solid #b2b2b2; 
    164     color: #000; 
    165157    font: 13px Verdana, Arial, Helvetica, sans-serif; 
    166158    margin: 1px; 
     
    297289 
    298290.submit input, .submit input:focus, .button, .button:focus { 
    299     background: url(images/fade-butt.png); 
    300291    color: #246; 
    301     padding: 0.3em; 
    302     -moz-border-radius: 4px; 
     292    padding: 2px; 
    303293} 
    304294 
     
    388378} 
    389379 
    390 #postdiv, #titlediv, #guiddiv, #tagdiv { 
     380#postdiv, #titlediv, #guiddiv { 
    391381    margin: 0 8px 0 0; 
    392382    padding: 0; 
     
    408398} 
    409399 
    410 #titlediv input, #guiddiv input, #tagdiv input { 
     400#titlediv input, #guiddiv input { 
    411401    margin: 0; 
    412402    width: 100%; 
     
    13971387    border-bottom: 1px solid #448abd; 
    13981388} 
     1389 
     1390/* Post Screen */ 
     1391 
     1392#tagchecklist { 
     1393    margin-left: 5px; 
     1394    font-size: 12px; 
     1395} 
     1396 
     1397#tagchecklist span { 
     1398    margin-right: 15px; 
     1399    display: block; 
     1400    float: left; 
     1401    font-size: 11px; 
     1402} 
     1403 
     1404#tagchecklist span a { 
     1405    margin-top: 5px; 
     1406    cursor: pointer; 
     1407    width: 10px; 
     1408    height: 10px; 
     1409    background: url(images/xit.gif) no-repeat; 
     1410    display: block; 
     1411    float: left; 
     1412    text-indent: -9999px; 
     1413    overflow: hidden; 
     1414} 
     1415#tagchecklist span a:hover { 
     1416    background: url(images/xit.gif) no-repeat -10px 0; 
     1417} 
     1418 
     1419#newtag { 
     1420    color: #999; 
     1421} 
     1422 
     1423.howto { 
     1424    font-style: italic; 
     1425    display: block; 
     1426    color: #999; 
     1427} 
     1428 
     1429.ac_results { 
     1430    border: 1px solid gray; 
     1431    background-color: white; 
     1432    padding: 0; 
     1433    margin: 0; 
     1434    list-style: none; 
     1435    position: absolute; 
     1436    z-index: 10000; 
     1437    display: none; 
     1438} 
     1439 
     1440.ac_results li { 
     1441    padding: 2px 5px; 
     1442    white-space: nowrap; 
     1443    color: #101010; 
     1444    text-align: left; 
     1445} 
     1446 
     1447.ac_over { 
     1448    cursor: pointer; 
     1449    background-color: #F0F0B8; 
     1450} 
     1451 
     1452.ac_match { 
     1453    text-decoration: underline; 
     1454    color: black; 
     1455} 
  • trunk/wp-includes/functions.php

    r6535 r6542  
    12861286        } 
    12871287        $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce( $action ) . "' />\n"; 
    1288         $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars( wp_explain_nonce( $action ) ) . "</p>\n\t\t<p><a href='$adminurl'>" . __( 'No' ) . "</a> <input type='submit' value='" . __( 'Yes' ) . "' /></p>\n\t\t</div>\n\t</form>\n"; 
     1288        $html .= "\t\t<div id='message' class='updated fade'>\n\t\t<p>" . wp_specialchars( wp_explain_nonce( $action ) ) . "</p>\n\t\t<p><a href='$adminurl'>" . __( 'No' ) . "</a> <input type='submit' value='" . __( 'Yes' ) . "' /></p>\n\t\t</div>\n\t</form>\n"; 
    12891289    } else { 
    1290         $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars( wp_explain_nonce( $action ) ) . "</p>\n\t<p><a href='$adminurl'>" . __( 'No' ) . "</a> <a href='" . clean_url( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $_SERVER['REQUEST_URI'] ) ) . "'>" . __( 'Yes' ) . "</a></p>\n\t</div>\n"; 
     1290        $html .= "\t<div id='message' class='updated fade'>\n\t<p>" . wp_specialchars( wp_explain_nonce( $action ) ) . "</p>\n\t<p><a href='$adminurl'>" . __( 'No' ) . "</a> <a href='" . clean_url( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $_SERVER['REQUEST_URI'] ) ) . "'>" . __( 'Yes' ) . "</a></p>\n\t</div>\n"; 
    12911291    } 
    12921292    $html .= "</body>\n</html>"; 
  • trunk/wp-includes/script-loader.php

    r6512 r6542  
    8181        $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '1.0.3'); 
    8282        $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2'); 
     83        $this->add( 'dimensions', '/wp-includes/js/jquery/jquery.dimensions.min.js', array('jquery'), '1.1.2'); 
     84        $this->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('dimensions'), '1.1'); 
    8385 
    8486        if ( is_admin() ) { 
     
    130132            $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); 
    131133            $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); 
     134            $this->add( 'post', '/wp-admin/js/post.js', array('suggest'), '20080102' ); 
    132135            $this->localize( 'upload', 'uploadL10n', array( 
    133136                'browseTitle' => attribute_escape(__('Browse your files')), 
Note: See TracChangeset for help on using the changeset viewer.