Changeset 11277
- Timestamp:
- Jun 9, 2011, 4:13:50 PM (13 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r11066 r11277 1 1 Parent = "#theImage"; 2 3 2 4 function Toggle_bp() { 3 5 cl_visible = !cl_visible; … … 81 83 82 84 83 img_h = jQuery( TheImg).height();84 img_w = jQuery( TheImg).width();85 img_h = jQuery(theImg).height(); 86 img_w = jQuery(theImg).width(); 85 87 86 88 jQuery("#src_img_h").val(img_h); … … 96 98 jQuery("#ret_autosize").trigger('ON', { width: img_w, 97 99 height: img_h, 98 theImage: TheImg,100 theImage: theImg, 99 101 src_img: src_img, 100 102 window_height: Window_Affichage.height, … … 243 245 jQuery(window).unload(function () { 244 246 try { 245 if ( TheImg) {246 jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur247 jQuery.cookie('img_h', jQuery( TheImg).height());248 jQuery.cookie('img_w', jQuery( TheImg).width());247 if (theImg) { 248 jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur 249 jQuery.cookie('img_h', jQuery(theImg).height()); 250 jQuery.cookie('img_w', jQuery(theImg).width()); 249 251 jQuery.cookie('window_height', Window_Affichage.height); 250 252 jQuery.cookie('window_width', Window_Affichage.width); … … 272 274 return; 273 275 } 276 277 274 278 //========================================================= 275 279 if (typeof (options) == "undefined") { … … 295 299 //============================================================= 296 300 Type_Img = ""; 297 TheImg = null;301 theImg = null; 298 302 nopano = false; 303 299 304 300 305 Zone_Affichage = { height: 0, width: 0 }; … … 372 377 newResize: function () { 373 378 // 379 374 380 if (typeof options != undefined) 375 381 if (options.imageAutosize) … … 459 465 marge_left += Zone_Affichage.borderwidth.left; 460 466 winwidth -= (marge_right + marge_left); 461 //--------------------------------------------- 462 jQuery(Parent).width(winwidth); 463 jQuery(Parent).css({ height: "auto" }); 464 465 // jQuery(Parent).height(Zone_Affichage.height); 466 //--------------------------------------------- 467 467 468 468 469 if (Type_Img == "pamoorama") { … … 485 486 var info_pamoorama_footer = jQuery("#pamoorama_footer").infos(); 486 487 var info_pamoorama_frame = jQuery("#pamoorama_frame").infos(); 487 TheImg = jQuery("#pamoorama");488 obj = TheImg.get(0);488 theImg = jQuery("#pamoorama"); 489 obj = theImg.get(0); 489 490 490 491 } else { … … 520 521 521 522 case "panorama": 522 // return; 523 524 525 TheImg = jQuery().Get_Img_Maxi("#Panorama img"); 526 info_theImage = jQuery(TheImg).infos(); 523 // return; 524 525 //the theMainImage ?? 526 theImg = jQuery("#theMainImage"); 527 if (theImg.length > 0) 528 theImg = theImg[0]; 529 else 530 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]"); 531 info_theImage = jQuery(theImg).infos(); 527 532 info_the_page = jQuery("#the_page").infos(); 528 533 … … 530 535 case "img": 531 536 532 if (! TheImg) return true;537 if (!theImg) return true; 533 538 if (theme.match(RegExp("luciano", "g"))) { 534 TheImg = jQuery("#the_page #theImg");535 } 536 info_theImage = jQuery( TheImg).infos();539 theImg = jQuery("#the_page #theImg"); 540 } 541 info_theImage = jQuery(theImg).infos(); 537 542 info_the_page = jQuery("#the_page").infos(); 538 543 … … 540 545 break 541 546 case "img_autre": 542 if (! TheImg) {543 if (DEBUG_autosize == "true") alert(" TheImg=null");547 if (!theImg) { 548 if (DEBUG_autosize == "true") alert("theImg=null"); 544 549 return true; 545 550 546 551 } 547 info_theImage = jQuery( TheImg).infos();552 info_theImage = jQuery(theImg).infos(); 548 553 info_the_page = jQuery("#the_page").infos(); 549 554 … … 589 594 590 595 591 TheImg = myPamoorama.image;596 theImg = myPamoorama.image; 592 597 info_theImage = jQuery("#pamoorama").infos(); 593 598 info_theImage.height = img_reelle.height; … … 600 605 601 606 } 602 MinWidth = jQuery(TheImg).css("minWidth"); 607 //================= Vérification taille image ================== 608 MinWidth = jQuery(theImg).css("minWidth"); 603 609 if (MinWidth == "0px") 604 610 MinWidth = mini_width; 605 MinHeight = jQuery( TheImg).css("minHeight");611 MinHeight = jQuery(theImg).css("minHeight"); 606 612 if (MinHeight == "0px") 607 613 MinHeight = mini_height; 608 614 609 MaxWidth = jQuery( TheImg).css("maxWidth");615 MaxWidth = jQuery(theImg).css("maxWidth"); 610 616 if (MaxWidth == "0px") 611 617 MaxWidth = winwidth; 612 MaxHeight = jQuery( TheImg).css("maxHeight");618 MaxHeight = jQuery(theImg).css("maxHeight"); 613 619 if (MaxHeight == "0px") 614 620 MaxHeight = mwinheight; 615 621 616 622 //=============== Vérification taille minimale autorizée ====================== 617 var miniWidth = jQuery( TheImg).Get_Val_int(MinWidth, mini_width);618 var miniHeight = jQuery( TheImg).Get_Val_int(MinHeight, mini_height);623 var miniWidth = jQuery(theImg).Get_Val_int(MinWidth, mini_width); 624 var miniHeight = jQuery(theImg).Get_Val_int(MinHeight, mini_height); 619 625 if (winwidth < mini_width2) mini_width2 = winwidth; 620 626 621 var miniWidth2 = jQuery(TheImg).Get_Val_int(MinWidth, mini_width2); 622 var miniHeight2 = jQuery(TheImg).Get_Val_int(MinHeight, mini_height2); 623 624 625 var maxWidth = jQuery(TheImg).Get_Val_int(MaxWidth, winwidth, "0"); 626 maxHeight = jQuery(TheImg).Get_Val_int(MaxHeight, winheight, "0"); 627 var miniWidth2 = jQuery(theImg).Get_Val_int(MinWidth, mini_width2); 628 var miniHeight2 = jQuery(theImg).Get_Val_int(MinHeight, mini_height2); 629 630 631 var maxWidth = jQuery(theImg).Get_Val_int(MaxWidth, winwidth, "0"); 632 maxHeight = jQuery(theImg).Get_Val_int(MaxHeight, winheight, "0"); 633 627 634 628 635 … … 631 638 632 639 img_reelle.width = parseInt(img_reelle.width); 633 jQuery(Cadre).width(mini_width); 640 // jQuery(Cadre).width(mini_width); 641 642 634 643 if (img_reelle.width < mini_width) { 635 jQuery(Cadre).width(mini_width);644 //jQuery(Cadre).width(mini_width); 636 645 return true; 637 646 … … 639 648 640 649 img_reelle.height = parseInt(img_reelle.height); 641 if (img_reelle.height < parseInt(mini_height)) return true; 650 if (img_reelle.height < parseInt(mini_height)) 651 return true; 642 652 //================================================================================== 653 //--------------------------------------------- 654 // jQuery(Parent).width(winwidth); 655 // jQuery(Parent).css({ height: "auto" }); 656 // jQuery(Parent).height(Zone_Affichage.height); 657 //--------------------------------------------- 658 643 659 if (rapport < 0) { 644 660 … … 798 814 //=============LLGBO2 =========================== 799 815 t1 = llgboframe; 800 if (! TheImg.src) {801 TheImg = jQuery(TheImg).find("img").get(0)802 if (! TheImg.src) {803 TheImg = jQuery(Parent).find("div").get(0)816 if (!theImg.src) { 817 theImg = jQuery(theImg).find("img").get(0) 818 if (!theImg.src) { 819 theImg = jQuery(Parent).find("div").get(0) 804 820 } 805 821 } 806 if ( TheImg.src) {822 if (theImg.src) { 807 823 808 824 … … 945 961 946 962 } else if (Type_Img == "panorama") { 947 948 // ----- jQuery(TheImg).panorama2(img_finale.height, img_finale.width);949 // jQuery(TheImg).height(img_finale.height);950 // jQuery(TheImg).width(img_finale.width);951 jQuery("#Panorama div").height(img_finale.height);963 // ----- jQuery(theImg).panorama2(img_finale.height, img_finale.width); 964 // jQuery(theImg).height(img_finale.height); 965 // jQuery(theImg).width(img_finale.width); 966 // n = jQuery.fn.panorama(); 967 // jQuery("#Panorama div").height(img_finale.height); 952 968 // class=simple_panorama 953 954 jQuery(".panorama-viewport").css("left", "2px"); 955 jQuery(".panorama-viewport").css("width", "auto"); 969 // jQuery("#Panorama div").height(img_finale.height); 970 if (typeof asp_options != "undefined") 971 n = asp_options; 972 n1 = jQuery("#Panorama div").width(); 973 // asp_options.viewport_width = winwidth; 974 //n =n.panorama_animate(); 975 //jQuery("#panoramaContainer").stop(); ; 976 // n = jQuery(theImg).panorama(asp_options); 977 978 //jQuery("#Panorama div").width(asp_options.viewport_width); 979 980 jQuery(".panorama-viewport").css("margin", "auto"); 981 982 n = info_imageToolBar; 956 983 957 984 958 985 } else if (Type_Img == "pamoorama") { 986 987 988 959 989 info_theImage.height = Zone_Affichage.height; 960 990 img_height = myPamoorama.imageHeight … … 964 994 new_width = Zone_Affichage.width - marge_right - marge_left; 965 995 new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left); 996 if (new_width > myPamoorama.imageWidth) 997 new_width = myPamoorama.imageWidth; 966 998 967 999 … … 987 1019 jQuery("#pamoorama_outter").width(new_width); 988 1020 989 1021 jQuery("#pamoorama_thumb").width(200 / zoom); 990 1022 // commenter sinon outter augmente à chaque resize 991 1023 // jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height); 992 1024 // pamoorama_frame 993 1025 994 1026 … … 1008 1040 1009 1041 1010 } else if ( TheImg.src) {1042 } else if (theImg.src) { 1011 1043 //--- background ?? --- 1012 jQuery( TheImg).height(img_finale.height);1013 jQuery( TheImg).width(img_finale.width);1014 jQuery( TheImg).css({ height: img_finale.height + "px ",1044 jQuery(theImg).height(img_finale.height); 1045 jQuery(theImg).width(img_finale.width); 1046 jQuery(theImg).css({ height: img_finale.height + "px ", 1015 1047 width: img_finale.width + "px " 1016 1048 }); … … 1019 1051 } else { 1020 1052 //===map ? luciano === 1021 jQuery( TheImg).height(img_finale.height);1022 jQuery( TheImg).width(img_finale.width);1023 jQuery( TheImg).css({ height: img_finale.height + "px ",1053 jQuery(theImg).height(img_finale.height); 1054 jQuery(theImg).width(img_finale.width); 1055 jQuery(theImg).css({ height: img_finale.height + "px ", 1024 1056 width: img_finale.width + "px " 1025 1057 }); … … 1116 1148 info_theImageBox = jQuery("#theImageAndTitle").infos(); 1117 1149 p1 = jQuery(".randomButtons").infos(); 1118 p2 =jQuery("#imageHeaderBar").infos();1150 p2 = jQuery("#imageHeaderBar").infos(); 1119 1151 jQuery("#theImage").width("width", info_theImageBox.width + "px"); 1120 1152 jQuery("#theImageAndTitle").css("position", "relative"); 1121 jQuery("#theImageAndTitle").css({ marginTop: "0px",1153 jQuery("#theImageAndTitle").css({ marginTop: "0px", 1122 1154 paddingTop: (p1.top) + "px" 1123 1155 }); … … 1184 1216 var w00 = 0; 1185 1217 var myImg = null; 1218 img = jQuery(myobj); 1219 1220 img = jQuery('img[alt]'); 1221 1186 1222 jQuery(myobj).each(function (i) { 1187 1223 w0 = img_reelle.width; … … 1208 1244 if (typeof (marge_top) != "undefined") return result; 1209 1245 info_imageToolBar = jQuery("#imageToolBar").infos(); 1246 1247 1210 1248 if (info_imageToolBar.position == "absolute") { 1211 1249 jQuery("#imageToolBar").css("position", "relative"); … … 1213 1251 } 1214 1252 optiontop = 0; 1253 1215 1254 1216 1255 info_imageInfoBar = jQuery("#imageInfoBar").infos(); … … 1255 1294 info_thePicturePage.margin.top + optiontop); 1256 1295 result = info_imageToolBar; 1257 result.width = "20%";1258 result.left = "40%";1296 // result.width = "20%"; 1297 // result.left = "40%"; 1259 1298 result.marge_top = marge_top; 1260 1299 result.img_top = img_top; … … 1339 1378 if (theme.match(RegExp("luciano", "g"))) { 1340 1379 jQuery("#imageContainer").css({ height: "auto" }); 1341 TheImg = jQuery(Parent + " #theImg img");1342 info_img = jQuery( TheImg).infos();1380 theImg = jQuery(Parent + " #theImg img"); 1381 info_img = jQuery(theImg).infos(); 1343 1382 1344 1383 … … 1356 1395 }); 1357 1396 1358 TheImg = jQuery("#map");1359 info_img = jQuery( TheImg).infos();1397 theImg = jQuery("#map"); 1398 info_img = jQuery(theImg).infos(); 1360 1399 1361 1400 … … 1365 1404 1366 1405 }); 1367 TheImg = jQuery("#charlie")1368 info_img = jQuery( TheImg).infos();1406 theImg = jQuery("#charlie") 1407 info_img = jQuery(theImg).infos(); 1369 1408 1370 1409 … … 1372 1411 } else if (jQuery(Parent + " embed").length > 0) { 1373 1412 1374 TheImg = jQuery(Parent + " embed");1375 info_img = jQuery( TheImg).infos();1413 theImg = jQuery(Parent + " embed"); 1414 info_img = jQuery(theImg).infos(); 1376 1415 1377 1416 … … 1382 1421 return 1383 1422 } 1384 TheImg = jQuery("#pamoorama");1385 info_img = jQuery( TheImg).infos();1423 theImg = jQuery("#pamoorama"); 1424 info_img = jQuery(theImg).infos(); 1386 1425 info_footer = jQuery("#pamoorama_footer").infos(); 1387 1426 info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height); 1388 1427 1389 1428 } else { 1390 TheImg = jQuery(Parent + " img"); 1391 1392 TheImg = Get_Img_Maxi(TheImg); 1393 if (!TheImg) TheImg = jQuery(Parent); // sans img ?? 1394 info_img = jQuery(TheImg).infos(); 1429 theImg = jQuery(Parent + " img[alt]"); 1430 1431 //theImg = Get_Img_Maxi(theImg); 1432 //theMainImage 1433 1434 if (!theImg) 1435 theImg = jQuery(Parent); // sans img ?? 1436 if (theImg.length > 1) 1437 {theImg = theImg[0]; 1438 1439 } 1440 1441 info_img = jQuery(theImg).infos(); 1395 1442 } 1396 1443 //===================================================================================== -
extensions/Autosize/js/autosize.dimensions.js
r10845 r11277 145 145 Css = jQuery(elem).getStyles(elem); 146 146 myposition = Css.position.toString() || ""; 147 147 148 148 149 149 width = jQuery(elem).outerWidth(); … … 188 188 } 189 189 if (elem == window) { 190 Cl_Position = { Top: 0, Left: 0 };190 Cl_Position = { top: 0, left: 0 }; 191 191 } else { 192 192 Cl_Position = jQuery(elem).d_position(); … … 218 218 d_position: function () { 219 219 var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; 220 220 l1 = jQuery(elem).css("left"); 221 221 if (elem) { 222 222 offsetParent = this.offsetParent(); -
extensions/Autosize/js/conflit.js
r10913 r11277 64 64 nbpa = 0; 65 65 var Fn; 66 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {67 68 } else {69 $mootools = $;70 }71 //====================================================72 66 function conflit(element, nc) { 73 //--- cl_conflit 67 if(typeof DEBUG != "boolean") DEBUG = false ; 68 //--- cl_conflit 74 69 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 75 70 ret_element = jQuery(element); … … 210 205 jQuery("#icon_gmaps").bind('click', function () { 211 206 //jQuery("#iGMapsIconContent").dialog("open"); 212 if (Version_pwg > '2.2.0' )213 207 if (Version_pwg > '2.2.0' ) 208 return; 214 209 jQuery('html,body').stop().scrollTop(0); 215 210 jQuery('html,body').stop().scrollLeft(0); -
extensions/Autosize/js/conflit_2.js
r10913 r11277 1 2 //=== ajout des fonctions jQuery === 3 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 4 $mootools = window.$; 5 } else { 6 if (typeof jQuery != 'undefined') { 7 if (typeof $mootools != 'undefined') { 8 if (typeof (gmaps) != "undefined") { 1 if (typeof Type_Img ) { 2 //=== ajout des fonctions jQuery === 3 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 4 $mootools = window.$; 5 } else { 6 if (typeof jQuery != 'undefined') { 7 if (typeof $mootools != 'undefined') { 8 if (typeof (gmaps) != "undefined") { 9 } 10 $ = jQuery.fn.$; 11 jQuery.extend($, $mootools); 12 jQuery.extend($, jQuery.fn); 13 } else { 14 $ = jQuery.fn.$; 15 jQuery.extend($, jQuery.fn); 9 16 } 10 $ = jQuery.fn.$;11 jQuery.extend($, $mootools);12 jQuery.extend($, jQuery.fn);13 } else {14 $ = jQuery.fn.$;15 jQuery.extend($, jQuery.fn);16 17 } 17 18 } -
extensions/Autosize/main.inc.php
r10913 r11277 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: auto4 Version: 1.6.3a 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448 -
extensions/Autosize/template/header_2_2.tpl
r11066 r11277 1 1 {if not empty($pamoorama)} 2 3 <script id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script> 4 <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script> 2 <script id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script> 3 <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script> 5 4 {else} 6 5 {/if} 7 {* au ou jquery non défini *}6 {* au cas ou jquery non défini *} 8 7 {combine_script id="jquery" load="header" path = "themes/default/js/jquery.min.js"} 9 8 {combine_script id="conflit_script0" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" } -
extensions/Autosize/template/picture.tpl
r8957 r11277 1 2 3 1 4 <style type="text/css"> 2 5 #bp_cla {ldelim} … … 12 15 13 16 <script language=javascript type="text/javascript"> 17 18 19 {if $ASP.width} 20 var asp_options ={ldelim} }; 21 22 var w = $("#imageToolBar").width(); 23 if (w === null) {ldelim} w = $("#theImage").width(); } 24 if (w < {$ASP.min_viewport_width}) {ldelim} w = .75 * $("#theImage").width(); } 25 var m = w; 26 w = w * ( Math.min( Math.max({$ASP.viewport_width} / 100, .5) , 1 )); 27 w = Math.round(Math.min( {$ASP.max_viewport_width} , Math.max( {$ASP.min_viewport_width}, w) )); 28 var s = (100 - {$ASP.speed}) * 2000; 29 var p = Math.round(Math.min(Math.max({$ASP.width} * ( {$ASP.start_position} / 100 ), 0), {$ASP.width})); 30 if ({$ASP.width} > w) {ldelim} 31 $("#theImage img").eq(0).removeAttr("style").attr({ldelim}width:{$ASP.width},height:{$ASP.height}}).addClass("simple_panorama"); 32 asp_options = {ldelim} 33 viewport_width: w, 34 speed: s, 35 direction: '{$ASP.direction}', 36 control_display: '{$ASP.control_display}', 37 start_position : p, 38 auto_start : {$ASP.auto_start}, 39 mode_360 : {$ASP.mode_360}, 40 loop_180 : {$ASP.loop_180} 41 }; 42 //$("#theImage img.simple_panorama").panorama(asp_options); 43 }; 44 45 {/if} 46 14 47 var src1="{$cl_autosize_button.ICON}"; 15 48 var src2="{$cl_autosize_button.ICON2}";
Note: See TracChangeset
for help on using the changeset viewer.