[PLUGINS] +set de base
[lhc/web/www.git] / www / plugins / spip-bonux-3 / javascript / jquery.qtip.activate.js
1 /*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6
7 /*!
8 * jquery.qtip. The jQuery tooltip plugin
9 *
10 * Copyright (c) 2009 Craig Thompson
11 * http://craigsworks.com
12 *
13 * Licensed under MIT
14 * http://www.opensource.org/licenses/mit-license.php
15 *
16 * Launch : February 2009
17 * Version : 1.0.0-rc3
18 * Released: Tuesday 12th May, 2009 - 00:00
19 * Debug: jquery.qtip.debug.js
20 */
21 (function($)
22 {
23 jQuery.fn.qtip_activate = function() {
24 return this.each(function() {
25 var c=jQuery(this).attr('class');
26 var ptarget = 'rightTop';
27 var ptooltip = 'leftTop';
28 var reg=new RegExp('target_[^\\s]+',"");
29 var f=c.match(reg);
30 if (f) { ptarget = f[0].substr(7);}
31 reg=new RegExp('tooltip_[^\\s]+',"");
32 f=c.match(reg);
33 if (f) { ptooltip = f[0].substr(8);}
34
35 var content = jQuery(this).siblings('.qTipContent');
36 if (content.length)
37 jQuery(this).qtip({
38 content: {
39 text: content
40 },
41 hide: {
42 fixed: true
43 },
44 style: {
45 tip: true,
46 name: 'light' // Inherit from preset style
47 /*width: { max:220}*/
48 },
49 position: {
50 corner: {target: ptarget, tooltip: ptooltip}
51 }
52 });
53 jQuery(this).addClass('qTipDone');
54 });
55 }
56
57 jQuery(function() {
58 jQuery('.qTip').qtip_activate();
59 });
60
61 // ... et a chaque fois que le DOM change
62 onAjaxLoad(function() {
63 if (jQuery){
64 jQuery('.qTip',this).qtip_activate();
65 }
66 });
67
68 })(jQuery);