Changeset 4489 for extensions/gally/gallyjs-tcp.js
- Timestamp:
- Dec 13, 2009, 11:35:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gally/gallyjs-tcp.js
r4446 r4489 1 1 /* ----------------------------------------------------------------------------- 2 GALLY 2 GALLY 3 3 Template for Piwigo 4 4 ------------------------------------------------------------------------------ … … 18 18 var menuState; 19 19 20 $("document").ready( function() 21 { 22 initMenu(); 20 $("document").ready( function() 21 { 22 initMenu(); 23 23 initContentDesc(); 24 24 } 25 25 ); 26 26 27 function initMenu()28 {29 $("#menubar").css(30 {31 visibility:"hidden",32 top: $("#titrePageID").attr("offsetTop")+$("#titrePageID").attr("offsetHeight")-2+'px'33 }34 );35 switchmenu('n');36 switch(options.menuWidth)37 {38 case "auto":39 $("#menubar").css("width", "auto");40 maxwidth=options.menuMaxWidth;41 if(jQuery.browser.msie)42 {43 maxwidth=options.menuMSIEMaxWidth;44 }45 if(maxwidth>0) { $("#menubar").css("max-width", maxwidth+"px"); }46 break;47 case "info":48 $("#menubar").css("width", $(".additionnal_info").css("width"));49 break;50 default:51 $("#menubar").css("width", options.menuWidth+"px");52 }53 }54 27 55 28 function initContentDesc() … … 62 35 } 63 36 /* 64 this code permit to manage 3 informations panels with one text area (or 2 if 37 this code permit to manage 3 informations panels with one text area (or 2 if 65 38 extended description plugin is used) 66 39 67 this function don't use a regExp object (due to some freeze with this method 40 this function don't use a regExp object (due to some freeze with this method 68 41 during test) 69 42 70 43 known tags : 71 <!--up-down--> 44 <!--up-down--> 72 45 <!--right-left--> 73 46 … … 75 48 already managed by the plugin : 76 49 - top text is in a <div class="additional_info"> 77 => text is moved to the to the '#additional_infoTOP' div and 50 => text is moved to the to the '#additional_infoTOP' div and 78 51 the '.additional_info' div added by the plugin is deleted 79 52 - bottom text is in <div id="additional_infoLEFT"> 80 53 => if tag "<!--right-left-->" is present 81 text on right is moved to the to the '#additional_infoBOTTOM' div and 54 text on right is moved to the to the '#additional_infoBOTTOM' div and 82 55 removed from the '#additional_infoLEFT' div 83 56 84 if the plugin "ExtendedDescription" is not installed, all the text is in 85 the <div id="additional_infoLEFT"> 57 if the plugin "ExtendedDescription" is not installed, all the text is in 58 the <div id="additional_infoLEFT"> 86 59 => if tag "<!--up-down-->" is present 87 text on right is moved to the to the '#additional_infoTOP' div and 60 text on right is moved to the to the '#additional_infoTOP' div and 88 61 removed from the '#additional_infoLEFT' div 89 62 => if tag "<!--right-left-->" is present on the '#additional_infoLEFT' div 90 text on right is moved to the to the '#additional_infoBOTTOM' div and 63 text on right is moved to the to the '#additional_infoBOTTOM' div and 91 64 removed from the '#additional_infoLEFT' div 92 65 */ 93 66 94 67 // <!--up-down--> tag 95 68 txt = $("#additional_infoLEFT").attr("innerHTML"); 96 69 if(txt==null) { txt=""; } 97 70 tmp = txt.indexOf("<!--up-down-->"); 98 71 99 72 if(tmp>-1) 100 73 { // tag is not managed by the ExtendedDescription plugin … … 104 77 else 105 78 { // perhaps tag is managed by the ExtendedDescription plugin 106 $(".additional_info").each( function (i) 79 $(".additional_info").each( function (i) 107 80 { 108 81 if(this.id=="") … … 117 90 // <!--right-left--> tag 118 91 tmp = txt.indexOf("<!--right-left-->"); 119 92 120 93 if(tmp>-1) 121 { // tag is present, cut the right text to the 94 { // tag is present, cut the right text to the 122 95 $("#additional_infoBOTTOM").attr("innerHTML", txt.slice(0,tmp)); 123 96 txt=txt.substr(tmp+17); 124 97 } 125 98 126 $("#additional_infoLEFT").attr("innerHTML", txt); 99 $("#additional_infoLEFT").attr("innerHTML", txt); 127 100 128 101 if((txt.replace(/\s*/im, "")=="")&&($("#additional_infoID").length>0)) … … 154 127 } 155 128 129 130 function initMenu() 131 { 132 if(options.menuAnimated != "noswitch") 133 { 134 $("#menubar").css( 135 { 136 visibility:"hidden", 137 top: $("#titrePageID").attr("offsetTop")+$("#titrePageID").attr("offsetHeight")-2+'px' 138 } 139 ); 140 switchmenu('n'); 141 switch(options.menuWidth) 142 { 143 case "auto": 144 $("#menubar").css("width", "auto"); 145 maxwidth=options.menuMaxWidth; 146 if(jQuery.browser.msie) 147 { 148 maxwidth=options.menuMSIEMaxWidth; 149 } 150 if(maxwidth>0) { $("#menubar").css("max-width", maxwidth+"px"); } 151 break; 152 case "info": 153 $("#menubar").css("width", $(".additionnal_info").css("width")); 154 break; 155 default: 156 $("#menubar").css("width", options.menuWidth+"px"); 157 } 158 } 159 else 160 { 161 $("#menubar dl dd").each( 162 function (index, elem) 163 { 164 //alert($(this.parentNode).attr('offsetWidth')+"---"+$(this.parentNode).attr('id')); 165 $(this).css("min-width", $(this.parentNode).attr('offsetWidth')); 166 if(jQuery.browser.msie) 167 { 168 $(this).css("max-width", options.menuMSIEMaxWidth+"px"); 169 } 170 } 171 ); 172 } 173 } 156 174 157 175 … … 171 189 visibility:"visible", 172 190 height:"auto" 173 }).fadeTo(options.animateDelay,1); 191 }).fadeTo(options.animateDelay,1); 174 192 $("#icon_menu").attr("className", "button2"); 175 193 menuState=true; 176 194 break; 177 195 default: 178 $("#menubar").fadeTo(options.animateDelay, 0, function () { 196 $("#menubar").fadeTo(options.animateDelay, 0, function () { 179 197 $("#menubar").css({ 180 198 visibility:"hidden", 181 199 height:"0px" 182 }); 200 }); 183 201 }); 184 202 $("#icon_menu").attr("className", "button"); … … 194 212 visibility:"visible", 195 213 height:"auto" 196 }); 214 }); 197 215 $("#icon_menu").attr("className", "button2"); 198 216 menuState=true; … … 202 220 visibility:"hidden", 203 221 height:"0px" 204 }); 222 }); 205 223 $("#icon_menu").attr("className", "button"); 206 224 menuState=false;
Note: See TracChangeset
for help on using the changeset viewer.