WordPress.org

Plugin Directory

Changeset 413226 for feedwordpress


Ignore:
Timestamp:
07/21/11 13:47:45 (6 years ago)
Author:
radgeek
Message:

WP3.2 partial JS fix: get tagBox working again. Cat box is still imperfect; you can add posts but it doesn't clear out the input box after.

Location:
feedwordpress/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/admin-ui.php

    r409685 r413226  
    747747 
    748748function fwp_tags_box ($tags, $object, $params = array()) { 
     749    $params = wp_parse_args($params, array( // Default values 
     750    'taxonomy' => 'post_tag', 
     751    'textarea_name' => NULL, 
     752    'textarea_id' => NULL, 
     753    'input_id' => NULL, 
     754    'input_name' => NULL, 
     755    'id' => NULL, 
     756    'box_title' => __('Post Tags'), 
     757    )); 
     758     
    749759    if (!is_array($tags)) : $tags = array(); endif; 
    750     $tax_name = (isset($params['taxonomy']) ? $params['taxonomy'] : 'post_tag'); 
     760     
     761    $tax_name = $params['taxonomy']; 
     762    $taxonomy = get_taxonomy($params['taxonomy']); 
     763    $disabled = (!current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''); 
     764     
    751765    $desc = "<p style=\"font-size:smaller;font-style:bold;margin:0\">Tag $object as...</p>"; 
    752766 
    753     if (isset($params['textarea_name'])) : 
    754         $textAreaName = $params['textarea_name']; 
    755     else : 
    756         $textAreaName = "tax_input[$tax_name]"; 
     767    if (is_null($params['textarea_name'])) : 
     768        $params['textarea_name'] = "tax_input[$tax_name]"; 
    757769    endif; 
     770    if (is_null($params['textarea_id'])) : 
     771        $params['textarea_id'] = "tax-input-${tax_name}"; 
     772    endif; 
     773    if (is_null($params['input_id'])) : 
     774        $params['input_id'] = "new-tag-${tax_name}"; 
     775    endif; 
     776    if (is_null($params['input_name'])) : 
     777        $params['input_name'] = "newtag[$tax_name]"; 
     778    endif; 
     779     
     780    if (is_null($params['id'])) : 
     781        $params['id'] = $tax_name; 
     782    endif; 
     783     
    758784    print $desc; 
    759785    $helps = __('Separate tags with commas.'); 
    760786    $box['title'] = __('Tags'); 
    761787    ?> 
    762         <div class="tagsdiv" id="<?php echo $tax_name; ?>"> 
    763             <div class="jaxtag"> 
    764             <div class="nojs-tags hide-if-js"> 
    765             <p><?php _e('Add or remove tags'); ?></p> 
    766             <textarea name="<?php echo esc_html($textAreaName); ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div> 
    767      
    768             <div class="ajaxtag hide-if-no-js"> 
    769                     <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> 
    770                     <div class="taghint"><?php _e('Add new tag'); ?></div> 
    771                     <p> 
    772                     <input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> 
    773                     <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /> 
    774                     </p> 
    775             </div></div> 
    776             <p class="howto"><?php echo $helps; ?></p> 
    777             <div class="tagchecklist"></div> 
    778             </div> 
    779             <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p> 
    780         <?php 
     788<div class="tagsdiv" id="<?php echo $params['id']; ?>"> 
     789    <div class="jaxtag"> 
     790    <div class="nojs-tags hide-if-js"> 
     791    <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> 
     792    <textarea name="<?php echo $params['textarea_name']; ?>" class="the-tags" id="<?php echo $params['textarea_id']; ?>"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div> 
     793     
     794    <?php if ( current_user_can($taxonomy->cap->assign_terms) ) :?> 
     795    <div class="ajaxtag hide-if-no-js"> 
     796        <label class="screen-reader-text" for="<?php echo $params['input_id']; ?>"><?php echo $params['box_title']; ?></label> 
     797        <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div> 
     798        <p><input type="text" id="<?php print $params['input_id']; ?>" name="<?php print $params['input_name']; ?>" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> 
     799        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" /></p> 
     800    </div> 
     801    <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p> 
     802    <?php endif; ?> 
     803    </div> 
     804     
     805    <div class="tagchecklist"></div> 
     806</div> 
     807<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?> 
     808<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p> 
     809<?php endif; 
     810 
    781811} 
    782812 
  • feedwordpress/trunk/feedwordpress-elements.js

    r303444 r413226  
    6363        if ( !s ) { return false; } 
    6464 
    65         if ( !e.is("[class^=add:" + list.id + ":]") ) { return !fwpList.add.call( list, e, s ); } 
     65        if ( !e.is('[class^="add:' + list.id + ':"]') ) { return !fwpList.add.call( list, e, s ); } 
    6666 
    6767        if ( !s.element ) { return true; } 
     
    9292 
    9393            jQuery.each( res.responses, function() { 
     94                    // FIXME: Causes ownerDocument is undefined breakage in WP3.2 
    9495                fwpList.add.call( list, this.data, $.extend( {}, s, { // this.firstChild.nodevalue 
    9596                    pos: this.position || 0, 
     
    322323        var list = this; 
    323324 
    324         $("[class^=add:" + list.id + ":]", el || null) 
     325        $('[class^="add:' + list.id + ':"]', el || null) 
    325326            .filter('form').submit( function() { return list.fwpList.add(this); } ).end() 
    326327            .not('form').click( function() { return list.fwpList.add(this); } ); 
    327         $("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.fwpList.del(this); } ); 
    328         $("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.fwpList.dim(this); } ); 
     328        $('[class^="delete:' + list.id + ':"]', el || null).click( function() { return list.fwpList.del(this); } ); 
     329        $('[class^="dim:' + list.id + ':"]', el || null).click( function() { return list.fwpList.dim(this); } ); 
    329330    }, 
    330331 
  • feedwordpress/trunk/feedwordpress.php

    r413101 r413226  
    44Plugin URI: http://feedwordpress.radgeek.com/ 
    55Description: simple and flexible Atom/RSS syndication for WordPress 
    6 Version: 2011.0714 
     6Version: 2011.0721 
    77Author: Charles Johnson 
    88Author URI: http://radgeek.com/ 
     
    1212/** 
    1313 * @package FeedWordPress 
    14  * @version 2011.0714 
     14 * @version 2011.0721 
    1515 */ 
    1616 
     
    3535# -- Don't change these unless you know what you're doing... 
    3636 
    37 define ('FEEDWORDPRESS_VERSION', '2011.0714'); 
     37define ('FEEDWORDPRESS_VERSION', '2011.0721'); 
    3838define ('FEEDWORDPRESS_AUTHOR_CONTACT', 'http://radgeek.com/contact'); 
    3939 
  • feedwordpress/trunk/readme.txt

    r405388 r413226  
    55Requires at least: 3.0 
    66Tested up to: 3.2 
    7 Stable tag: 2011.0706 
     7Stable tag: 2011.0721 
    88 
    99FeedWordPress syndicates content from feeds you choose into your WordPress weblog.  
     
    9595== Changelog == 
    9696 
     97= 2011.0721 = 
     98 
     99*   BUGFIX: SERIOUS BUG CAUSING RARE UNEXPECTED DELETION OF PAGES AND OTHER 
     100    CONTENT. A bug in the guid-checking code for some rare kinds of guids could 
     101    cause content in the wp_posts table to seemingly disappear at random after 
     102    FeedWordPress updates.This most frequently but not exclusively affected 
     103    static pages. What actually happened is that in these rare cases the 
     104    existing static page was mistaken for an older version of the new incoming 
     105    syndicated post, which was then stored as a new revision of the original 
     106    page. The bug that caused these mistaken identities has been fixed. 
     107     
     108*   BUGFIX: UNWANTED AUTOMATIC PAGE-LOAD-BASED UPDATES NO LONGER A NUISANCE. 
     109    Some users encountered a bug in which FeedWordPress would adopt an automatic 
     110    page-load-based update method, even if they had requested that it not do 
     111    so, and that it use a manual or cron job update method instead. The bug 
     112    causing this has been fixed, and page-load-based updates should no longer 
     113    trigger unless explicitly turned on. 
     114 
     115*   WP 3.2 USER INTERFACE COMPATIBILITY: POST TAGS BOX NOW WORKS AGAIN. The 
     116    release of WordPress 3.2 caused a breakage in the tags box which prevented 
     117    you from adding or removing tags under Syndication --> Categories & Tags. 
     118    (The breakage was the result of an incompatibility introduced by the new 
     119    release of jQuery.) This breakage has now been fixed, and the tags box 
     120    should work correctly again. 
     121 
     122*   FEED UPDATE SCHEDULING IMPROVEMENTS: UI. The Syndicated Sources table now 
     123    provides considerably more data to understand update scheduling, when 
     124    specific scheduling decisions are made because of, e.g., requests from the 
     125    feed producer. 
     126     
     127*   FEED UPDATE SCHEDULING IMPROVEMENTS: ENFORCEABLE "MINIMUM INTERVAL" SETTIN 
     128    TO SPACE OUT UPDATES. Some feeds request specific update schedules, using 
     129    standard elements such as sy:updateFrequency and rss:ttl. Normally, 
     130    FeedWordPress respects any scheduling requests that a feed makes -- if it 
     131    requests a longer gap between polls than what FWP would normally adopt, then 
     132    FWP slows down to meet the request. If it indicates a shorter gap than what 
     133    FWP would normally adopt, FWP speeds up and checks that feed for updates 
     134    more often than it normally would. Now, there should not be any way for user 
     135    settings to override an explicit slow-down request from the feed producer -- 
     136    if producers indicate a particular update schedule, then polling the feed 
     137    more frequently than they request is considered abusive behavior. But 
     138    there's no reason why users should not be able -- if they so desire -- to 
     139    override speed-up requests, and poll a feed *less* frequently than the 
     140    indicated update schedule, if the FWP user wants to space update checkins 
     141    over a longer interval of time. Before, they could not do this: FWP always 
     142    sped up to meet the indicated update schedule. Now, they can do this, by 
     143    using the new "Minimum Interval" setting in Syndication --> Feeds & 
     144    Updates.. 
     145     
    97146= 2011.0706 = 
    98147 
Note: See TracChangeset for help on using the changeset viewer.