Commit 06717abc1c4829d742b8768d5a1d8bbbb000a6dd

Authored by yekolia
1 parent 5de6c7c6

New:

- Add the position in jQuery tipTip lib.
Showing 1 changed file with 67 additions and 3 deletions   Show diff stats
web/CXM_jquery_tiptip.anubis
@@ -13,6 +13,44 @@ read tools/basis.anubis @@ -13,6 +13,44 @@ read tools/basis.anubis
13 read system/string.anubis 13 read system/string.anubis
14 read system/convert.anubis 14 read system/convert.anubis
15 15
  16 +/* jQuery tipTip position type */
  17 +public type JQ_tiptip_position:
  18 + jq_tiptip_top,
  19 + jq_tiptip_left,
  20 + jq_tiptip_bottom, // is default
  21 + jq_tiptip_right
  22 +.
  23 +
  24 +/* position to string */
  25 +public define String
  26 + jq_tiptip_position_to_string
  27 + (
  28 + JQ_tiptip_position p
  29 + )
  30 + =
  31 + if p is
  32 + {
  33 + jq_tiptip_top then "top",
  34 + jq_tiptip_left then "left",
  35 + jq_tiptip_bottom then "bottom",
  36 + jq_tiptip_right then "right"
  37 + }
  38 + .
  39 +
  40 +/* position to string */
  41 +public define JQ_tiptip_position
  42 + string_to_jq_tiptip_position
  43 + (
  44 + String s
  45 + )
  46 + =
  47 + if s="top" then jq_tiptip_top
  48 + else if s="left" then jq_tiptip_left
  49 + else if s="bottom" then jq_tiptip_bottom
  50 + else if s="right" then jq_tiptip_right
  51 + else jq_tiptip_bottom //is default
  52 + .
  53 +
16 /* Initialize jQuery tipTip */ 54 /* Initialize jQuery tipTip */
17 public define List(HTML_Head_Tag) 55 public define List(HTML_Head_Tag)
18 jquery_tiptip_init 56 jquery_tiptip_init
@@ -27,13 +65,14 @@ public define List(HTML_Head_Tag) @@ -27,13 +65,14 @@ public define List(HTML_Head_Tag)
27 . 65 .
28 66
29 67
30 -/* Create a tipTip tooltip with a HTML_Partial_Content */ 68 +/* Create a tipTip tooltip with a HTML_Partial_Content and position */
31 public define HTML_Partial_Content 69 public define HTML_Partial_Content
32 jquery_tiptip 70 jquery_tiptip
33 ( 71 (
34 String rollovered_id, // id of the element on which toolip will be displayed => IT MUST BE UNIQUE !!!! 72 String rollovered_id, // id of the element on which toolip will be displayed => IT MUST BE UNIQUE !!!!
35 String tooltip_id, // id used to make a container around tooltip content => Uniqueness of the container's id is made with the addition of a timestamp as a suffix 73 String tooltip_id, // id used to make a container around tooltip content => Uniqueness of the container's id is made with the addition of a timestamp as a suffix
36 - HTML_Partial_Content tooltip_partial_content 74 + HTML_Partial_Content tooltip_partial_content,
  75 + JQ_tiptip_position position
37 ) 76 )
38 = 77 =
39 if tooltip_partial_content is partial_content(head, body) then 78 if tooltip_partial_content is partial_content(head, body) then
@@ -43,7 +82,7 @@ public define HTML_Partial_Content @@ -43,7 +82,7 @@ public define HTML_Partial_Content
43 $(document).ready(function() 82 $(document).ready(function()
44 { 83 {
45 var tooltip_"+now+"=$('#"+tooltip_id+"-"+now+"').html(); 84 var tooltip_"+now+"=$('#"+tooltip_id+"-"+now+"').html();
46 - $('#"+rollovered_id+"').tipTip({maxWidth: 'auto', edgeOffset: 10, content: tooltip_"+now+"}); 85 + $('#"+rollovered_id+"').tipTip({maxWidth: 'auto', edgeOffset: 10, defaultPosition: \""+jq_tiptip_position_to_string(position)+"\", content: tooltip_"+now+"});
47 }); 86 });
48 ")) 87 "))
49 . 88 .
@@ -56,6 +95,31 @@ public define HTML_Partial_Content @@ -56,6 +95,31 @@ public define HTML_Partial_Content
56 ]) 95 ])
57 ) 96 )
58 . 97 .
  98 +
  99 +/* Create a tipTip tooltip with a HTML_Off_Form and position */
  100 +public define HTML_Partial_Content
  101 + jquery_tiptip
  102 + (
  103 + String rollovered_id, // id of the element on which toolip will be displayed => IT MUST BE UNIQUE !!!!
  104 + String tooltip_id, // id used to make a container around tooltip content => Uniqueness of the container's id is made with the addition of a timestamp as a suffix
  105 + HTML_Off_Form html_content,
  106 + JQ_tiptip_position position
  107 + )
  108 + =
  109 + jquery_tiptip(rollovered_id, tooltip_id, partial_content([], html_content), position)
  110 + .
  111 +
  112 +/* Create a tipTip tooltip with a HTML_Partial_Content */
  113 +public define HTML_Partial_Content
  114 + jquery_tiptip
  115 + (
  116 + String rollovered_id, // id of the element on which toolip will be displayed => IT MUST BE UNIQUE !!!!
  117 + String tooltip_id, // id used to make a container around tooltip content => Uniqueness of the container's id is made with the addition of a timestamp as a suffix
  118 + HTML_Partial_Content tooltip_partial_content
  119 + )
  120 + =
  121 + jquery_tiptip(rollovered_id, tooltip_id, tooltip_partial_content, jq_tiptip_bottom)
  122 + .
59 123
60 /* Create a tipTip tooltip with a HTML_Off_Form */ 124 /* Create a tipTip tooltip with a HTML_Off_Form */
61 public define HTML_Partial_Content 125 public define HTML_Partial_Content