Bug Tracker

Changeset 4511

Show
Ignore:
Timestamp:
01/22/08 22:36:19 (1 year ago)
Author:
kswedberg
Message:

cluetip: added simple/experimental delayedClose option to allow auto-closing of clueTip after given number of milliseconds;
fixed annoyance (reported at http://plugins.jquery.com/node/1081): default title attributes showing before cluetip when using long interval in hoverIntent; added simple/experimental delayedClose option to allow auto-closing of clueTip after given number of milliseconds.

Location:
trunk/plugins/cluetip
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/cluetip/Changelog.txt

    r3829 r4511  
    11 
    22== New and Noteworthy == 
     3 
     4== 0.9.5 ==  
     5 
     6* added clickThrough option to allow click to go to page, even if href and tipAttribute are equal.  
     7* added experimental mouse tracking option 
     8* added simple/experimental delayedClose option to allow auto-closing of clueTip after given number of milliseconds. 
     9* added "focus" as an available value for "activation" option. Will show clueTip on focus of a form element, hide on blur. 
     10* added support for bgiframe plugin. When the bgiframe plugin is referenced in the docuement, clueTip will use it (in IE6). 
     11* cleaned up default ajaxProcess option. 
     12* provided public access to all default plugin settings (thanks malsup!) 
     13* fixed bug (reported at http://jquery.com/plugins/node/941) when splitTitle is used and title attribute is empty 
     14* fixed bug where a variable was improperly nested in an if statement 
     15* fixed bug with incorrectly disabling link when no href is present in invoking element 
     16* fixed annoyance (reported at http://plugins.jquery.com/node/1081): default title attributes showing before cluetip when using long interval in hoverIntent. 
    317 
    418== 0.9.3 ==  
  • trunk/plugins/cluetip/demo/demo.js

    r3932 r4511  
    11 
    22/* the next line is an example of how you can override default options globally (currently commented out) ... */ 
    3  // $.fn.cluetip.defaults.sticky = true; 
     3 
     4 // $.fn.cluetip.defaults.tracking = true; 
    45 
    56$(document).ready(function() { 
  • trunk/plugins/cluetip/demo/index.html

    r3932 r4511  
    77  <title>clueTip : A jQuery Plugin</title> 
    88 
    9   <script src="../jquery.js" type="text/javascript"></script> 
     9  <script src="../jquery-1.2.2.min.js" type="text/javascript"></script> 
    1010  <script src="../jquery.dimensions.js" type="text/javascript"></script> 
    1111  <script src="../jquery.hoverIntent.js" type="text/javascript"></script> 
  • trunk/plugins/cluetip/jquery.cluetip.js

    r4039 r4511  
    11/* 
    22 * jQuery clueTip plugin 
    3  * Version 0.9.3.2  (12/05/2007) 
     3 * Version 0.9.5  (01/22/2008) 
    44 * @requires jQuery v1.1.1+ 
    55 * @requires Dimensions plugin  
     
    5656 * More examples can be found at http://plugins.learningjquery.com/cluetip/demo/ 
    5757 *  
    58  * Full list of options/settings can be found at the bottom of this file 
     58 * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/ 
    5959 */ 
    6060 
     
    8383      var cluetipContents = false; 
    8484      var cluezIndex = parseInt(opts.cluezIndex, 10)-1; 
    85       var isActive = false; 
    86        
     85      var isActive = false, closeOnDelay = 0; 
     86 
    8787      // create the cluetip divs 
    8888      if (!$cluetip) { 
     
    9090        $cluetipTitle = $('<h3 id="cluetip-title"></h3>');         
    9191        $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle); 
    92         $cluetip = $('<div></div>').attr({'id': 'cluetip'}).css({zIndex: opts.cluezIndex}) 
     92        $cluetip = $('<div id="cluetip"></div>').css({zIndex: opts.cluezIndex}) 
    9393        .append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide(); 
    9494        $('<div id="cluetip-waitimage"></div>').css({position: 'absolute', zIndex: cluezIndex-1}) 
     
    116116      var tipHeight, wHeight; 
    117117      var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px'; 
    118       var sTop, linkTop, posY, tipY, mouseY; 
     118      var sTop, linkTop, posY, tipY, mouseY, baseline; 
    119119      // horizontal measurement variables 
    120120      var tipWidth = parseInt(opts.width, 10) + parseInt($cluetip.css('paddingLeft')) + parseInt($cluetip.css('paddingRight')) + dropShadowSteps; 
     
    127127      var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : ''; 
    128128      if (opts.splitTitle) { 
    129         if(tipTitle == undefined){ tipTitle = '';} 
     129        if(tipTitle == undefined) {tipTitle = '';} 
    130130        tipParts = tipTitle.split(opts.splitTitle); 
    131131        tipTitle = tipParts.shift(); 
    132132      } 
    133133      var localContent; 
     134       
    134135 
    135136/***************************************       
     
    187188***************************************/ 
    188189      if (tipParts) { 
    189         for (var i=0; i < tipParts.length; i++){ 
     190        var tpl = tipParts.length; 
     191        for (var i=0; i < tpl; i++){ 
    190192          if (i == 0) { 
    191193            $cluetipInner.html(tipParts[i]); 
     
    211213            if (opts.waitImage) { 
    212214              $('#cluetip-waitimage') 
    213               .css({top: mouseY+20, left: mouseX}) 
     215              .css({top: mouseY+20, left: mouseX+20}) 
    214216              .show(); 
    215217            } 
     
    283285      $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight}); 
    284286      tipHeight = defHeight == 'auto' ? $cluetip.outerHeight() : parseInt(defHeight,10);    
    285       tipY = posY;       
     287      tipY = posY; 
     288      baseline = sTop + wHeight; 
    286289      if (opts.positionBy == 'fixed') { 
    287290        tipY = posY - opts.dropShadowSteps + tOffset; 
    288291      } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') { 
    289         if (posY + tipHeight + tOffset > sTop + wHeight && mouseY - sTop > tipHeight + tOffset) {  
     292        if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) {  
    290293          tipY = mouseY - tipHeight - tOffset; 
    291294          direction = 'top'; 
     
    294297          direction = 'bottom'; 
    295298        } 
    296       } else if ( posY + tipHeight + tOffset > sTop + wHeight ) { 
    297         tipY = (tipHeight >= wHeight) ? sTop : sTop + wHeight - tipHeight - tOffset; 
     299      } else if ( posY + tipHeight + tOffset > baseline ) { 
     300        tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset; 
    298301      } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") { 
    299302        tipY = bpY - tOffset; 
     
    317320      if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: opts.width}).show(); 
    318321      if ($.fn.bgiframe) { $cluetip.bgiframe(); } 
    319       // trigger the optional onShow function       
     322      // trigger the optional onShow function 
     323      if (opts.delayedClose > 0) { 
     324        closeOnDelay = setTimeout(cluetipClose, opts.delayedClose); 
     325      } 
     326 
    320327      opts.onShow($cluetip, $cluetipInner); 
     328       
    321329    }; 
    322330 
     
    329337      if (!opts.sticky || (/click|toggle/).test(opts.activation) ) { 
    330338        cluetipClose(); 
     339clearTimeout(closeOnDelay);         
    331340      }; 
    332341      if (opts.hoverClass) { 
     
    390399        }; 
    391400        if ($.fn.hoverIntent && opts.hoverIntent) { 
    392           $this.hoverIntent({ 
     401          $this.mouseover(function() {$this.attr('title',''); }) 
     402          .hoverIntent({ 
    393403            sensitivity: opts.hoverIntent.sensitivity, 
    394404            interval: opts.hoverIntent.interval,   
     
    454464    clickThrough:     false,    // if true, and activation is not 'click', then clicking on link will take user to the link's href, 
    455465                                // even if href and tipAttribute are equal 
    456     tracking:         false,    // if true, clueTip will track mouse movement 
     466    tracking:         false,    // if true, clueTip will track mouse movement (experimental) 
     467    delayedClose:     0,        // close clueTip on a timed delay (experimental) 
    457468    closePosition:    'top',    // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title' 
    458469    closeText:        'Close',  // text (or HTML) to to be clicked to close sticky clueTips 
     
    483494    // process data retrieved via xhr before it's displayed 
    484495    ajaxProcess:      function(data) { 
    485                         data = $(data).not('style, meta, link, script, title'); 
     496                        data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<link(.|\s)*?\/link>/g,''); 
    486497                        return data; 
    487498    },                 
     
    492503    } 
    493504  }; 
    494    
     505 
    495506 
    496507/*