Changeset 18735 for extensions/Autosize/js/Affiche_script.js
- Timestamp:
- Oct 25, 2012, 3:24:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r18731 r18735 57 57 } 58 58 //____________________ Save_cookies _____________________________ 59 /************************************************ 60 * 61 *************************************************/ 59 62 Get_cookies = function () { 60 63 parametres = { … … 76 79 theImageBottom: jQuery.cookie('theImageBottom'), 77 80 theImageRight: jQuery.cookie('theImageRight'), 78 79 81 theImageMargeZone: { width: jQuery.cookie('theImageMargeWidth'), 80 82 height: jQuery.cookie('theImageMargeHeight') … … 334 336 } 335 337 338 infos_theImage = jQuery(theImage_id).infos(true); // conteneur 339 336 340 337 341 if (test_theme("simple")) { … … 339 343 theImageAndInfos_id = "#content"; 340 344 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 341 infos_theImage = jQuery(theImage_id).infos(true); // conteneur342 345 infos_theImage.height = infos_window.height - infos_theImage.top; 343 346 // jQuery(theImage_id).height(infos_theImage.height); … … 365 368 zheight = infos_window.height - (infos_theImage.top); 366 369 } 367 h01 = 0; 368 h02 = 0; 369 if (options.check_desc_v) { 370 371 infos_comments = jQuery("#comments").infos(true); 372 infos_Licence = jQuery(".licencetag").infos(true); 373 infos_imageComment = jQuery(imageComment_id).infos(true); 374 375 if (infos_imageComment.visible == true && infos_imageComment.general.bottom > infos_theMainImage.bottom) { 376 h02 = infos_imageComment.general.bottom - infos_theMainImage.bottom; 377 } 378 if (infos_Licence.visible == true && infos_Licence.general.bottom > infos_theMainImage.bottom) { 379 h01 = infos_Licence.general.bottom - infos_theMainImage.bottom; 380 } 381 delta_h = infos_imageInfos.bottom - infos_imageInfos.top; 382 info_comments1 = jQuery(theImage_id + " p").infos(true); 383 if (test_theme("simple")) { 384 options.marge_basse += info_comments1.general.height; 385 386 } else { 387 if (test_theme("stripped")) { 388 389 } else 390 options.marge_basse += Math.max(h01, h02); 370 371 372 if (options.check_desc_v) { } 373 374 infos_comments = jQuery("#comments").infos(true); 375 infos_Licence = jQuery(".licencetag").infos(true); 376 infos_imageComment = jQuery(imageComment_id).infos(true); 377 378 379 380 if (test_theme("simple")) { 381 382 383 } else { 384 if (test_theme("stripped")) { 385 386 } else 391 387 392 388 if (test_theme("blanc , pure, hr_ ")) { … … 394 390 options.marge_droite += 10; 395 391 } 396 } 397 } 392 } 393 394 398 395 Zone_image = { image_init: { 399 396 width: infos_theMainImage.width, … … 597 594 **********************/ 598 595 jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ") 599 .load(function (e) { 596 .load(function (e) { 600 597 src = this.src; 601 598 theMainImage_st = true; … … 603 600 Zone_image = {}; 604 601 } 605 Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height } 606 return; 607 if (typeof theMainImage_id != "undefined") 608 if (!init_img(this)) { 609 nu_img = 0; 602 Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height }; 603 if (!init_img(this)) { 604 nu_img = 0; 605 } 606 607 }) 608 .error(function (e) { 609 if (!this.complete) { 610 jQuery(this).hide(); 611 612 } 613 614 }) 615 .bind("Finish", function (e, data) { 616 if (typeof imageInfos_id == "undefined") return; 617 Autosize_resize(true, options); 618 }) 619 .bind("ON", function (e, data) { 620 if (data.status != "ok") { 621 popup = jQuery(".errors"); 622 if (popup.length == 0) { 623 jQuery("#theImage").append("<div class='errors'><span></span></div>"); 624 } 625 jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText); 626 jQuery(".errors").show().delay(20000).hide(2000); 627 return; 610 628 } 611 }) 612 .error(function (e) { 613 614 }) 615 .bind("Finish", function (e, data) { 616 if (typeof imageInfos_id == "undefined") return; 617 Autosize_resize(true, options); 618 }) 619 .bind("ON", function (e, data) { 620 if (data.status != "ok") { 621 popup = jQuery(".errors"); 622 if (popup.length == 0) { 623 jQuery("#theImage").append("<div class='errors'><span></span></div>"); 624 } 625 jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText); 626 jQuery(".errors").show().delay(20000).hide(2000); 627 return; 628 } 629 if (data.src) { 630 theImg = document.getElementById(theMainImage_id.replace("#", "")); 631 jQuery("#theMainImage").attr("src", data.src); 632 theImg.src = data.src; 633 if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) { 634 theImg.src = options.imgSrc; 635 636 } 637 } 638 }); 629 if (data.src) { 630 theImg = document.getElementById(theMainImage_id.replace("#", "")); 631 jQuery("#theMainImage").attr("src", data.src); 632 theImg.src = data.src; 633 if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) { 634 theImg.src = options.imgSrc; 635 636 } 637 } 638 }); 639 639 640 640 … … 900 900 Save_cookies(options); 901 901 if (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi") { 902 jQuery(theImg).width(Zone_image.image_init.width); 903 jQuery(theImg).height(Zone_image.image_init.height); 902 904 return; 903 905 … … 968 970 if (url) { 969 971 if (options.imgSrc != url) { 970 url = options.imgSrc;972 options.imgSrc = url; 971 973 } 972 974 } … … 998 1000 this.src = this.src; 999 1001 // alert(this.src + ' Image does not exist !!'); 1002 }).error(function (i) { 1003 this.src = this.src; 1000 1004 }); 1001 1005 ; … … 1207 1211 if (typeof Zone_image == "undefined") Zone_image = { image: {} }; 1208 1212 if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; 1209 theImg.height = img_init.height;1210 theImg.width = img_init.width;1213 // theImg.height = img_init.height; 1214 // theImg.width = img_init.width; 1211 1215 1212 1216 Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport }; … … 1312 1316 options.theImageMargeZone = Zone_image.marges; 1313 1317 if (Type_Img != 'charlie') { 1314 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" && Type_Img != 'pamoorama') {1315 IMg = Get_Maxi(Zone_image.image_init);1318 if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize" ) { 1319 return ; 1316 1320 } else { 1317 1321 IMg = Get_Maxi(Zone_image.image); … … 1576 1580 retrait_img.height += 2; 1577 1581 1582 1578 1583 //=============================================================== 1579 1584 retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding … … 1581 1586 retrait_img.width += Math.ceil(options.marges_llgbo || 0); 1582 1587 retrait_img.width += 2; 1583 1588 if (!options.check_desc_v) 1589 marge_bottom = 0; 1584 1590 1585 1591 //================== Limite Format Image ===================== … … 1729 1735 case "img_autre": 1730 1736 if (!theMainImage_id) { 1731 if (DEBUG_autosize == "true") alert("The_MainImage=null");1737 if (DEBUG_autosize.match("true", gi)) alert("The_MainImage=null"); 1732 1738 return; 1733 1739 … … 1956 1962 *********************************************/ 1957 1963 /* 1958 if (DEBUG_autosize == "true"){1964 if (DEBUG_autosize.match("true",gi)) { 1959 1965 for (var i = 0; i < 10; i++) { 1960 1966 jQuery('#adddebugs').click(); … … 1999 2005 2000 2006 2001 if (DEBUG_autosize == "mouse") {2007 if (DEBUG_autosize.match("mouse", "gi")) { 2002 2008 var mouseLocation = new Point(-500, -500); 2003 2009 function Point(x, y) { … … 2129 2135 function Debug_pos() { 2130 2136 return; 2131 if (DEBUG_autosize == "true") {2137 if (DEBUG_autosize.match("true", gi)) { 2132 2138 2133 2139 jQuery("[id ^='Debug']").show(); … … 2155 2161 2156 2162 2157 }); // ready2163 }); // ready 2158 2164 2159 2165
Note: See TracChangeset
for help on using the changeset viewer.