source: extensions/gally/gally-default/js/gallyjs-ttm.js @ 8528

Last change on this file since 8528 was 8528, checked in by grum, 13 years ago

Release 1.4.0
Rewrite some JS
fix bug bug:1983

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1/* -----------------------------------------------------------------------------
2  GALLY
3  Template for Piwigo
4  ------------------------------------------------------------------------------
5  file: gally/gallyjs-ttm.js
6  file release: 1.0.0
7  ------------------------------------------------------------------------------
8  author: grum at piwigo.org
9  << May the Little SpaceFrog be with you >>
10  ------------------------------------------------------------------------------
11  JS to manage bubbles tips
12
13  need jQuery 1.2.6
14
15  see the release_notes.txt file for more informations
16----------------------------------------------------------------------------- */
17
18var gallyTM=null;
19
20$(document).ready(
21  function()
22  {
23    gallyTM=new GallyTM();
24  }
25);
26
27
28function GallyTM ()
29{
30  var sTip=null,
31
32  initTips = function ()
33  {
34    if(options.manageTips)
35    {
36      $('#menubar dl:not(#mbTags) dd [title]').not('.sTipOnTop, .sTipOnBottom, .sTipOnLeft, .sTipOnRight').addClass('sTipOnRight');
37
38      sTip=new simpleTip();
39      $('[title]').each(
40        function ()
41        {
42          tipPos=options.manageTipsPos;
43
44          if($(this).hasClass('sTipOnTop')) { tipPos='tipOnTop'; }
45          else if($(this).hasClass('sTipOnRight')) { tipPos='tipOnRight'; }
46          else if($(this).hasClass('sTipOnLeft')) { tipPos='tipOnLeft'; }
47          else if($(this).hasClass('sTipOnBottom')) { tipPos='tipOnBottom'; }
48
49          switch(tipPos)
50          {
51            case 'tipOnTop':
52              sTip.doAction(
53                'add',
54                this,
55                {
56                  targetPos:'top-middle',
57                  tipPos:'bottom-middle',
58                  offsetY:14,
59                  arrowHeight:13,
60                  arrowWidth:17,
61                  drawArrow:true,
62                  arrowImgDir:options.themePath
63                }
64              );
65              break;
66            case 'tipOnRight':
67              sTip.doAction(
68                'add',
69                this,
70                {
71                  targetPos:'middle-right',
72                  tipPos:'middle-left',
73                  offsetX:12,
74                  arrowHeight:17,
75                  arrowWidth:12,
76                  drawArrow:true,
77                  arrowImgDir:options.themePath
78                }
79              );
80              break;
81            case 'tipOnLeft':
82              sTip.doAction(
83                'add',
84                this,
85                {
86                  targetPos:'middle-left',
87                  tipPos:'middle-right',
88                  offsetX:12,
89                  arrowHeight:17,
90                  arrowWidth:12,
91                  drawArrow:true,
92                  arrowImgDir:options.themePath
93                }
94              );
95              break;
96            case 'tipOnBottom':
97              sTip.doAction(
98                'add',
99                this,
100                {
101                  targetPos:'bottom-middle',
102                  tipPos:'top-middle',
103                  offsetY:12,
104                  arrowHeight:12,
105                  arrowWidth:17,
106                  drawArrow:true,
107                  arrowImgDir:options.themePath
108                }
109              );
110              break;
111          }
112        }
113      );
114    }
115  };
116
117  initTips();
118}
119
120
Note: See TracBrowser for help on using the repository browser.