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

Last change on this file since 16016 was 16016, checked in by grum, 12 years ago

feature:2664- compatibility with Piwigo 2.4

  • 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:options.tipsSize,
59                  arrowHeight:options.tipsSize,
60                  arrowWidth:options.tipsSize,
61                  drawArrow:true
62                }
63              );
64              break;
65            case 'tipOnRight':
66              sTip.doAction(
67                'add',
68                this,
69                {
70                  targetPos:'middle-right',
71                  tipPos:'middle-left',
72                  offsetX:options.tipsSize,
73                  arrowHeight:options.tipsSize,
74                  arrowWidth:options.tipsSize,
75                  drawArrow:true
76                }
77              );
78              break;
79            case 'tipOnLeft':
80              sTip.doAction(
81                'add',
82                this,
83                {
84                  targetPos:'middle-left',
85                  tipPos:'middle-right',
86                  offsetX:options.tipsSize,
87                  arrowHeight:options.tipsSize,
88                  arrowWidth:options.tipsSize,
89                  drawArrow:true
90                }
91              );
92              break;
93            case 'tipOnBottom':
94              sTip.doAction(
95                'add',
96                this,
97                {
98                  targetPos:'bottom-middle',
99                  tipPos:'top-middle',
100                  offsetY:options.tipsSize,
101                  arrowHeight:options.tipsSize,
102                  arrowWidth:options.tipsSize,
103                  drawArrow:true
104                }
105              );
106              break;
107          }
108        }
109      );
110    }
111  };
112
113  initTips();
114}
115
116
Note: See TracBrowser for help on using the repository browser.