Changeset 16016 for extensions/gally/gally-default/js/gallyjs-tpp.js
- Timestamp:
- Jun 24, 2012, 9:26:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gally/gally-default/js/gallyjs-tpp.js
r12592 r16016 44 44 }, 45 45 container=null, 46 initialThumbPos=null, 46 47 47 48 /** … … 109 110 .bind("mousemove", function () { switchInterface('y', true); } ); 110 111 } 111 112 113 $("#navThumbPrev").css("top", $("#navThumbPrev").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");114 $("#navThumbNext").css("top", $("#navThumbNext").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");115 116 $("#theImage").css("top", $("#theImage").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px");117 112 118 113 $("#contentid").attr("rows", options.commentRows); … … 166 161 ); 167 162 163 $("#icon_derivatives").click(function() 164 { 165 var elt = $("#derivativeSwitchBox"); 166 167 elt.css("left", Math.min( $(this).position().left + $('#tabRandomButtons').outerWidth(true), $(window).width() - elt.outerWidth(true) - 5)) 168 .css("top", $(this).position().top) 169 .toggle(); 170 $('#iSimpleTip').css('display', 'none'); // if tip activated, hide it.. 171 } 172 ); 173 $("#derivativeSwitchBox, #privacyLevelBox").on("mouseleave click", function() 174 { 175 $(this).hide(); 176 } 177 ); 178 179 $('#iPrivacyLevelLink').click(function () 180 { 181 var elt = $("#privacyLevelBox"), 182 ePos = $("#privacyLevelLink"); 183 184 elt.css("left", $(this).position().left) 185 .css("top", $(this).position().top) 186 .toggle(); 187 } 188 ); 189 168 190 $(window).resize( function () { initializeImageMode("resize"); } ); 169 191 … … 192 214 var thumbWidth=0, 193 215 imgTop=0, 216 imgPos='', 194 217 cssValues = new Object; 195 218 … … 272 295 if($("#navThumbPrev").length>0) 273 296 { 274 $("#navThumbPrev").css("height", $("#copyright").prop("offsetTop")-$("#navThumbPrev").prop("offsetTop")-options.tabsHidden+"px"); 275 } 276 if($("#navThumbNext").length>0) 277 { 278 $("#navThumbNext").css("height", $("#copyright").prop("offsetTop")-$("#navThumbNext").prop("offsetTop")-options.tabsHidden+"px"); 297 initialThumbPos=$("#navThumbPrev").position().top; 298 } 299 else if($("#navThumbNext").length>0) 300 { 301 initialThumbPos=$("#navThumbNext").position().top; 302 } 303 else 304 { 305 initialThumbPos=-1; 279 306 } 280 307 } … … 311 338 } 312 339 313 314 340 imgTop=initialThumbPos; 341 //if position equals -1, mean top calculate it automatically - valid for "#navThumbPrev" & "#navThumbNext" 342 if(imgTop==-1) 343 { 344 imgTop=$("#theImage").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+($("#theImgContainer").height()-$("#navThumbPrev").height())/2; 345 } 346 347 $("#navThumbPrev") 348 .css("top", imgTop) 349 .css("height", $("#copyright").prop("offsetTop")-$("#navThumbPrev").prop("offsetTop")-options.tabsHidden+"px"); 350 351 $("#navThumbNext") 352 .css("top", imgTop) 353 .css("height", $("#copyright").prop("offsetTop")-$("#navThumbNext").prop("offsetTop")-options.tabsHidden+"px"); 354 355 356 $("#theImage").css("top", $("#theImage").prop("offsetTop")+$("#theHeader").prop("offsetHeight")+$("#theHeaderAlt").prop("offsetHeight")+"px"); 315 357 316 358 simulateHighRes(); … … 634 676 }; 635 677 678 function changeImgSrc(url,typeSave,typeMap,cookiePath) 679 { 680 $("#theMainImage") 681 .removeAttr("width height") 682 .attr("src", url) 683 .load(function () 684 { 685 initializeImageMode("resize"); 686 } 687 ); 688 689 $('#derivativeSwitchBox .switchCheck').css('visibility','hidden'); 690 $('#derivativeChecked'+typeSave).css('visibility','visible'); 691 692 document.cookie = 'picture_deriv='+typeSave+';path='+cookiePath; 693 } 694 695 function setPrivacyLevel(rootUrl, id, level) 696 { 697 var y = new PwgWS(rootUrl); 698 699 y.callService( 700 "pwg.images.setPrivacyLevel", 701 {image_id: id, level:level} , 702 { 703 method: "POST", 704 onFailure: function(num, text) { alert(num + " " + text); }, 705 onSuccess: function(result) { 706 jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden'); 707 jQuery('#levelCheck'+level).css('visibility','visible'); 708 } 709 } 710 ); 711 } 636 712 637 713 this.closeDisplayHigh = function () { closeDisplayHigh(); }; … … 641 717 this.getTabsProp = function () { return tabs; }; 642 718 this.openDisplayHigh = function (url) { openDisplayHigh(url); }; 719 this.changeImgSrc = function (url,typeSave,typeMap,cookiePath) { changeImgSrc(url,typeSave,typeMap,cookiePath); }; 720 this.setPrivacyLevel = function (rootUrl, id, level) { setPrivacyLevel(rootUrl, id, level); }; 643 721 644 722 init();
Note: See TracChangeset
for help on using the changeset viewer.