Changeset 8864 for extensions/Autosize/js
- Timestamp:
- Jan 24, 2011, 11:15:38 AM (13 years ago)
- Location:
- extensions/Autosize/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/Affiche_script.js
r8807 r8864 50 50 //========================================================================== 51 51 function Wait_Affichage() { 52 53 52 fade_in = parseInt(fade_in); 53 54 54 if (!jQuery().newResize()) { 55 55 setTimeout("Wait_Affichage()", 500); 56 56 return 57 57 } 58 58 nu_img++; 59 59 if (fade_in == 0) { 60 60 jQuery(Parent).css({ opacity: "1" }); … … 73 73 } 74 74 ); 75 } 75 } 76 if (nu_img > 1) return; 77 78 79 80 img_h = jQuery(TheImg).height(); 81 img_w = jQuery(TheImg).width(); 82 83 jQuery("#src_img_h").val(img_h); 84 jQuery("#src_img_w").val(img_w); 85 jQuery("#ret_autosize").val(src_img); 86 87 jQuery("#ret_autosize").trigger('ON'); 88 76 89 77 90 } … … 82 95 function Autosize_resize(Obj) { 83 96 if (typeof cl_visible != "undefined") return; 84 var winwidth = jQuery(window).width(); 85 var winheight = jQuery(window).height(); 97 98 99 100 conf = jQuery(Obj).get(0).conf; 101 Obj = jQuery(Obj).get(0).obj; 102 myWindow = jQuery("#" + conf.parent).infos(); 103 104 if (myWindow == 0) myWindow = jQuery(window).infos(); 105 marge_basse = 0; 106 if (conf.MargeBasse) 107 marge_basse = jQuery().Get_Val_int( 108 conf.MargeBasse 109 ); 86 110 info_Obj = jQuery(Obj).infos(); 87 111 h1_left = jQuery(Obj).absoluteLeft(); 88 h1_top = jQuery(Obj).absoluteTop(); 89 h1 = (winheight - h1_top); 90 img = jQuery(Obj).find("img") ; 91 rap = jQuery(img).height() / jQuery(img).width(); 92 w2 = (h1 / rap); 93 94 if (w2 < info_Obj.width) 95 marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2)+"px"; 96 else 97 marginLeft = "auto"; 98 Obj.css({ width: "auto", 99 marginLeft: "auto", 100 verticalAlign: "middle", textAlign: "center" 101 }); 102 Obj.height(h1); 103 104 105 img.height(h1); 106 img.width(w2); 107 108 109 112 h1_top = jQuery(Obj).absoluteTop(); 113 if (typeof old_h1 == "undefined") old_h1 = 0; 114 115 116 117 if (h1_top < info_Obj.height) 118 h1 = (myWindow.height - h1_top - marge_basse); 119 else 120 h1 = (myWindow.height - marge_basse); 121 122 if (h1 == old_h1) return; 123 old_h1 = h1; 124 125 imgs = jQuery(Obj).find("img"); 126 rap = jQuery(imgs).height() / jQuery(imgs).width(); 127 w2 = (h1 / rap); 128 129 // ("source:" + message); 130 131 if (w2 < info_Obj.width) 132 marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px"; 133 else 134 marginLeft = "auto"; 135 136 jQuery(Obj).css({ width: "auto", 137 marginLeft: "auto", marginBottom: 0 + "px", 138 verticalAlign: "middle", textAlign: "center" 139 }); 140 jQuery(Obj).height(h1); 141 //============================================================= 142 if (conf.ResizePicture != "true") { 143 144 } else 145 jQuery(imgs).each(function (i) { 146 img = jQuery(this); 147 rap = jQuery(this).height() / jQuery(this).width(); 148 w2 = parseInt(h1 / rap); 149 if (w2 > 0 && h1 > 0 && img.length > 0) { 150 img.height(h1); 151 img.width(w2); 152 } 153 154 }); 155 156 157 158 110 159 } 111 160 jQuery.extend(jQuery.expr[':'], { … … 114 163 n1 = a.className; 115 164 // personal_block 116 if (n1 == "autosize") { 117 List_autosize.push(a); 118 Autosize_resize(jQuery(a)); 119 jQuery(a).css({ opacity: 1 }); 120 165 if (n1.match(RegExp("autosize", "gi"))) { 166 // autoresize = "MargeBasse:30px; ResizePicture:false" 167 infconf = jQuery(a).attr("autosize"); 168 n1 = typeof infconf; 169 conf = { MargeBasse: 0, NoPicture: false } 170 if (n1 == "undefined") { 171 172 } else { 173 tableau = infconf.split(";"); 174 for (var i = 0; i < tableau.length; i++) { 175 tableau2 = tableau[i].split(":"); 176 conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]); 177 } 178 179 List_autosize.push({ obj: a, conf: conf }); 180 jQuery(a).css({ opacity: 1 }); 181 } 121 182 } 122 183 // Css = jQuery(a).getStyles(a); … … 126 187 } 127 188 }); 128 129 130 189 190 191 function List_autosize_resize(event, ui) { 192 if (List_autosize.length == 0) return; 193 for (i = 0; i < List_autosize.length; i++) { 194 Autosize_resize(jQuery(List_autosize[i])); 195 } 196 197 } 131 198 //============================================================== 132 199 jQuery(document).ready( … … 139 206 jQuery(window).resize( 140 207 function (event, ui) { 141 if (List_autosize.length == 0) return; 142 for (i = 0; i < List_autosize.length; i++) { 143 Autosize_resize(jQuery(List_autosize[i])); 144 } 208 List_autosize_resize(event, ui); 145 209 146 210 }); … … 151 215 if (List_autosize.length == 0) return; 152 216 for (i = 0; i < List_autosize.length; i++) { 153 Autosize_resize(jQuery(List_autosize[i])); 217 Autosize_resize(jQuery(List_autosize[i])); 154 218 } 155 219 … … 251 315 jQuery(bp1).trigger('ON'); 252 316 } 317 if (typeof cl_visible == "undefined") return; 318 if (!cl_visible == true) { return true; } 253 319 var chk = eval(user_status + "_enabled"); 254 if (!cl_visible == true) { return true; }255 320 if (chk == "") { return true; } 256 321 … … 1236 1301 info_description.bottom -= info_img.top; 1237 1302 } 1238 // if (msie == true) info_description.bottom -= 4;1303 // if (msie == true) info_description.bottom -= 4; 1239 1304 1240 1305 info_description.height = info_description.bottom - info_description.top; … … 1366 1431 // Add 10 testing debugs to start with 1367 1432 jQuery(window).load(function () { 1433 DEBUG = (typeof DEBUG != "undefined") ? DEBUG : "false"; 1368 1434 if (DEBUG == "true") { 1369 1435 for (var i = 0; i < 10; i++) { -
extensions/Autosize/js/conflit.js
r8792 r8864 1 1 //==== cl_conflit remplace $(... avec jQuery( ==== 2 3 2 //=================================================== 4 3 var detect = navigator.userAgent.toLowerCase(); … … 7 6 //============================================================================== 8 7 browser = detect_browser(); 9 10 8 function detect_browser() { 11 9 12 10 mybrowser = { 13 11 browser: "", … … 19 17 firefox: false, 20 18 msie: false, 21 netscape: false 19 netscape: false, 20 seamonkey: false 22 21 } 23 22 if (checkIt('konqueror')) { mybrowser.Konqueror = true; lbrowser = "konqueror"; OS = "Linux"; } 23 else if (checkIt('seamonkey')) { mybrowser.seamonkey = true; lbrowser = "seamonkey"; } 24 24 else if (checkIt('chrome')) { mybrowser.chrome = true; lbrowser = "chrome"; } 25 25 else if (checkIt('safari')) { mybrowser.safari = true; lbrowser = "safari"; } … … 39 39 else OS = "an unknown operating system"; 40 40 } 41 mybrowser.version = version;41 mybrowser.version = version; 42 42 mybrowser.OS = OS; 43 43 mybrowser.browser = lbrowser; 44 44 return mybrowser 45 46 47 45 }; 48 49 50 51 46 function checkIt(string) { 52 47 place = detect.indexOf(string) + 1; … … 54 49 return place; 55 50 } 51 56 52 /* 57 53 58 54 */ 59 60 61 55 konqueror = mybrowser.konqueror || false; 62 56 chrome = mybrowser.chrome || false; … … 67 61 msie = mybrowser.msie || false; 68 62 netscape = mybrowser.netscape || false; 69 70 71 72 63 var time_out = 0; 73 64 //=================================================== 74 75 65 nbpa = 0; 76 66 var Fn; … … 188 178 }) 189 179 //============================================================= 190 191 180 // jQuery(window).resize(); 192 181 }); 193 //=============================================================194 182 // $ = _$2; ; 195 183 }); 196 197 198 199 184 //========================================================= 200 201 185 jQuery.fn.extend({ 186 $: function (el, nc) { 187 a = conflit(el, nc); 188 return a; 189 }, 202 190 203 191 //---------------- luciano ------------------------------- … … 481 469 } 482 470 //==================================== 483 test_conflit = false; 471 484 472 librairies = new Array; 485 473 $_ = $; … … 535 523 })(jQuery); 536 524 537 if (test_conflit != true) { 525 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 526 527 } else {} 538 528 //-------------------------------------------------------------- 539 529 $_0 = $; 540 541 530 function $(element, nc0) { 542 531 if (typeof jQuery.fn.infos != "function") … … 546 535 return a; 547 536 } 548 549 550 $.isFunction = function (value) { return jQuery.isFunction(value); } 551 $.inArray = function (a, b) { return jQuery.inArray(a, b); } 552 $.error = function (a , b , c) {jQuery.error(a , b , c);} 553 554 if (typeof ($.extend) != "function") { 555 $.extend = function (a,b) { 556 return jQuery.extend(a, b); 557 } ; 558 559 560 } 561 562 if (typeof ($.ajax) != "function") { 563 $.ajax = function (origSettings) { 564 jQuery.ajax(origSettings); 565 } 566 567 568 $.parseJSON = function (msg) { 569 return jQuery.parseJSON(msg); 570 } 571 572 } 573 //============================================ 574 /* url (String): URl de la page à charger 575 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur. 576 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées. 577 * type (String): (optionnel) format des données renvoyées à la fonction de callback 578 */ 579 if (typeof ($.get) != "function") { 580 $.get = function (a, b, c, d) { 581 return jQuery.get(a, b, c, d); 582 } 583 } 584 if (typeof ($.post) != "function") { 585 586 $.post = function (a, b, c, d) { 587 return jQuery.post(a, b, c, d); 588 } 589 ; 590 591 } 592 593 } 594 //-------------------------------------------------------------- 537 //=== ajout des fonctions jQuery === 538 jQuery.extend($, jQuery); 539 540 541 //-------------------------------------------------------------- 542
Note: See TracChangeset
for help on using the changeset viewer.