Changeset 746381
- Timestamp:
- 07/25/2013 05:07:31 PM (12 years ago)
- Location:
- tippy
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
tippy/tags/5.3.0/readme.txt
r740851 r746381 5 5 Requires at least: 2.5 6 6 Tested up to: 3.5.1 7 Stable tag: 5. 2.27 Stable tag: 5.3.0 8 8 9 9 Allows users to turn text into a tooltip or popup using a special [tippy] tag. … … 29 29 30 30 == Changelog == 31 32 = 5.3.0 = 33 * Adds a new swapimg attribute which makes it easy to swap images on hover, similar to swaptitle 31 34 32 35 = 5.2.2 = -
tippy/tags/5.3.0/tippy.css
r687302 r746381 14 14 border-bottom: 1px dotted; 15 15 cursor: pointer; 16 position: relative; 17 display: inline-block; 18 } 19 20 .tippy_link img { 21 position: absolute; 22 top: 0; 23 left: 0; 16 24 } 17 25 -
tippy/tags/5.3.0/tippy.js
r740851 r746381 23 23 this.swaptitle = ''; 24 24 this.isSwapped = false; 25 26 this.swapimg = ''; 27 this.swapimgelement = new Object(); 28 this.imgSwapped = new Object(); 25 29 26 30 // Fadeout delay. Set both default and delay to adjust for user changes. … … 185 189 186 190 this.doSwapTitle(false); 191 this.doSwapImage(false); 187 192 } 188 193 … … 314 319 } 315 320 } 316 321 322 this.doSwapImage = function(newSwap) 323 { 324 tippyToSwap = '#' + this.tippyLinkId; 325 326 if (!newSwap && this.imgSwapped[tippyToSwap]) { 327 this.imgSwapped[tippyToSwap] = false; 328 329 this.jQuery(tippyToSwap + ' img').fadeIn(250); 330 this.swapimgelement[tippyToSwap].fadeOut(250); 331 } 332 333 if (this.swapimg !== '' && newSwap && !this.imgSwapped[tippyToSwap]) { 334 if (!(tippyToSwap in this.swapimgelement)) { 335 this.swapimgelement[tippyToSwap] = this.jQuery(tippyToSwap + ' img').clone(); 336 this.swapimgelement[tippyToSwap].attr('src', this.swapimg); 337 this.swapimgelement[tippyToSwap].css('display', 'none'); 338 this.swapimgelement[tippyToSwap].appendTo('#' + this.tippyLinkId); 339 } 340 341 this.imgSwapped[tippyToSwap] = true; 342 343 this.jQuery(tippyToSwap + ' img').fadeOut(250); 344 this.swapimgelement[tippyToSwap].fadeIn(250); 345 } 346 } 347 348 this.swapImg = function(toSwap, newImg) 349 { 350 this.jQuery(toSwap).attr('src', newImg); 351 this.jQuery(toSwap).fadeIn('fast'); 352 } 353 317 354 this.loadTip = function(tipArgs) 318 355 { … … 339 376 this.swaptitle = ''; 340 377 } 378 379 // Did the user specify a swapimg? 380 if (tipArgs.swapimg !== undefined) { 381 this.swapimg = tipArgs.swapimg; 382 } else { 383 this.swapimg = ''; 384 } 341 385 342 386 this.doSwapTitle(true); 387 this.doSwapImage(true); 343 388 344 389 // Check the delay … … 535 580 } 536 581 537 console.log(this.showClose);538 582 if (this.showClose) { 539 583 headerClose = '<div class="domTip_tipCloseLink tippy_closelink" onClick="Tippy.fadeTippyFromClose();">' + this.closeText + '</div>'; … … 568 612 { 569 613 if (domTip_headerText !== "") { 570 this.jQuery("#" + domTip_tipElement).attr('tippyTitle', domTip_headerText);614 jQuery("#" + domTip_tipElement).attr('tippyTitle', domTip_headerText); 571 615 } 572 616 … … 579 623 Tippy.fadeTippyOut(); 580 624 } 625 626 jQuery(window).load(function() { 627 jQuery('.tippy_link:has(>img)').each(function() { 628 imgSize = jQuery('img', this).outerHeight(); 629 jQuery(this).css('height', imgSize + 'px'); 630 }); 631 }); -
tippy/tags/5.3.0/tippy.php
r740851 r746381 4 4 Plugin URI: http://croberts.me/tippy/ 5 5 Description: Simple plugin to display tooltips within your WordPress blog. 6 Version: 5. 2.26 Version: 5.3.0 7 7 Author: Chris Roberts 8 8 Author URI: http://croberts.me/ … … 341 341 'method' => false, 342 342 'container' => false, 343 'img' => false), $attributes); 343 'img' => false, 344 'swapimg' => false), $attributes); 344 345 345 346 if (!empty($tippyAtts['href'])) { … … 377 378 'method' => $tippyAtts['method'], 378 379 'container' => $tippyAtts['container'], 379 'img' => $tippyAtts['img']); 380 'img' => $tippyAtts['img'], 381 'swapimg' => $tippyAtts['swapimg']); 380 382 381 383 $tippyLink = $this->getLink($tippyArr); … … 412 414 * 'swaptitle' => Optional string; text to show when hovering over the Tippy link. Does not work with an image. 413 415 * 'img' => Optional string (either this or title must be set); users may want Tippy to trigger on an image rather than text. This should be the full address to the image. 416 * 'swapimg' => Optional string similar to swaptitle, display an alternate img on hover. Only used if img is also set. 414 417 * 'text' => Required string; should first be passed through tippy_format_text(do_shortcode($text)). 415 418 * 'href' => Optional string; contains link href for the Tippy link, if desired. … … 471 474 $tippyContainer = isset($tippyArray['container']) ? $tippyArray['container'] : false; 472 475 $tippyImg = isset($tippyArray['img']) ? $tippyArray['img'] : false; 476 $tippySwapImg = isset($tippyArray['swapimg']) ? $tippyArray['swapimg'] : false; 473 477 $tippyUseDiv = isset($tippyArray['useDiv']) ? $tippyArray['useDiv'] : false; 474 478 … … 550 554 if (!empty($tippySwapTitle)) { 551 555 $this->addTippyObjectValue("swaptitle", $tippySwapTitle, "'%s'"); 556 } 557 558 // See if we have a swap image 559 if (!empty($tippySwapImg)) { 560 $this->addTippyObjectValue("swapimg", $tippySwapImg, "'%s'"); 552 561 } 553 562 -
tippy/trunk/readme.txt
r740851 r746381 5 5 Requires at least: 2.5 6 6 Tested up to: 3.5.1 7 Stable tag: 5. 2.27 Stable tag: 5.3.0 8 8 9 9 Allows users to turn text into a tooltip or popup using a special [tippy] tag. … … 29 29 30 30 == Changelog == 31 32 = 5.3.0 = 33 * Adds a new swapimg attribute which makes it easy to swap images on hover, similar to swaptitle 31 34 32 35 = 5.2.2 = -
tippy/trunk/tippy.css
r687302 r746381 14 14 border-bottom: 1px dotted; 15 15 cursor: pointer; 16 position: relative; 17 display: inline-block; 18 } 19 20 .tippy_link img { 21 position: absolute; 22 top: 0; 23 left: 0; 16 24 } 17 25 -
tippy/trunk/tippy.js
r740851 r746381 23 23 this.swaptitle = ''; 24 24 this.isSwapped = false; 25 26 this.swapimg = ''; 27 this.swapimgelement = new Object(); 28 this.imgSwapped = new Object(); 25 29 26 30 // Fadeout delay. Set both default and delay to adjust for user changes. … … 185 189 186 190 this.doSwapTitle(false); 191 this.doSwapImage(false); 187 192 } 188 193 … … 314 319 } 315 320 } 316 321 322 this.doSwapImage = function(newSwap) 323 { 324 tippyToSwap = '#' + this.tippyLinkId; 325 326 if (!newSwap && this.imgSwapped[tippyToSwap]) { 327 this.imgSwapped[tippyToSwap] = false; 328 329 this.jQuery(tippyToSwap + ' img').fadeIn(250); 330 this.swapimgelement[tippyToSwap].fadeOut(250); 331 } 332 333 if (this.swapimg !== '' && newSwap && !this.imgSwapped[tippyToSwap]) { 334 if (!(tippyToSwap in this.swapimgelement)) { 335 this.swapimgelement[tippyToSwap] = this.jQuery(tippyToSwap + ' img').clone(); 336 this.swapimgelement[tippyToSwap].attr('src', this.swapimg); 337 this.swapimgelement[tippyToSwap].css('display', 'none'); 338 this.swapimgelement[tippyToSwap].appendTo('#' + this.tippyLinkId); 339 } 340 341 this.imgSwapped[tippyToSwap] = true; 342 343 this.jQuery(tippyToSwap + ' img').fadeOut(250); 344 this.swapimgelement[tippyToSwap].fadeIn(250); 345 } 346 } 347 348 this.swapImg = function(toSwap, newImg) 349 { 350 this.jQuery(toSwap).attr('src', newImg); 351 this.jQuery(toSwap).fadeIn('fast'); 352 } 353 317 354 this.loadTip = function(tipArgs) 318 355 { … … 339 376 this.swaptitle = ''; 340 377 } 378 379 // Did the user specify a swapimg? 380 if (tipArgs.swapimg !== undefined) { 381 this.swapimg = tipArgs.swapimg; 382 } else { 383 this.swapimg = ''; 384 } 341 385 342 386 this.doSwapTitle(true); 387 this.doSwapImage(true); 343 388 344 389 // Check the delay … … 535 580 } 536 581 537 console.log(this.showClose);538 582 if (this.showClose) { 539 583 headerClose = '<div class="domTip_tipCloseLink tippy_closelink" onClick="Tippy.fadeTippyFromClose();">' + this.closeText + '</div>'; … … 568 612 { 569 613 if (domTip_headerText !== "") { 570 this.jQuery("#" + domTip_tipElement).attr('tippyTitle', domTip_headerText);614 jQuery("#" + domTip_tipElement).attr('tippyTitle', domTip_headerText); 571 615 } 572 616 … … 579 623 Tippy.fadeTippyOut(); 580 624 } 625 626 jQuery(window).load(function() { 627 jQuery('.tippy_link:has(>img)').each(function() { 628 imgSize = jQuery('img', this).outerHeight(); 629 jQuery(this).css('height', imgSize + 'px'); 630 }); 631 }); -
tippy/trunk/tippy.php
r740851 r746381 4 4 Plugin URI: http://croberts.me/tippy/ 5 5 Description: Simple plugin to display tooltips within your WordPress blog. 6 Version: 5. 2.26 Version: 5.3.0 7 7 Author: Chris Roberts 8 8 Author URI: http://croberts.me/ … … 341 341 'method' => false, 342 342 'container' => false, 343 'img' => false), $attributes); 343 'img' => false, 344 'swapimg' => false), $attributes); 344 345 345 346 if (!empty($tippyAtts['href'])) { … … 377 378 'method' => $tippyAtts['method'], 378 379 'container' => $tippyAtts['container'], 379 'img' => $tippyAtts['img']); 380 'img' => $tippyAtts['img'], 381 'swapimg' => $tippyAtts['swapimg']); 380 382 381 383 $tippyLink = $this->getLink($tippyArr); … … 412 414 * 'swaptitle' => Optional string; text to show when hovering over the Tippy link. Does not work with an image. 413 415 * 'img' => Optional string (either this or title must be set); users may want Tippy to trigger on an image rather than text. This should be the full address to the image. 416 * 'swapimg' => Optional string similar to swaptitle, display an alternate img on hover. Only used if img is also set. 414 417 * 'text' => Required string; should first be passed through tippy_format_text(do_shortcode($text)). 415 418 * 'href' => Optional string; contains link href for the Tippy link, if desired. … … 471 474 $tippyContainer = isset($tippyArray['container']) ? $tippyArray['container'] : false; 472 475 $tippyImg = isset($tippyArray['img']) ? $tippyArray['img'] : false; 476 $tippySwapImg = isset($tippyArray['swapimg']) ? $tippyArray['swapimg'] : false; 473 477 $tippyUseDiv = isset($tippyArray['useDiv']) ? $tippyArray['useDiv'] : false; 474 478 … … 550 554 if (!empty($tippySwapTitle)) { 551 555 $this->addTippyObjectValue("swaptitle", $tippySwapTitle, "'%s'"); 556 } 557 558 // See if we have a swap image 559 if (!empty($tippySwapImg)) { 560 $this->addTippyObjectValue("swapimg", $tippySwapImg, "'%s'"); 552 561 } 553 562
Note: See TracChangeset
for help on using the changeset viewer.