1 | |
---|
2 | // problème avec GMaps+diaporama: |
---|
3 | // corriger gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow'])) |
---|
4 | //============================================================== |
---|
5 | jQuery(document).ready(function (jQuery) { |
---|
6 | //============================================================= |
---|
7 | // REPONSE ACTION |
---|
8 | //============================================================= |
---|
9 | jQuery("#reset").click(function () { |
---|
10 | location.reload(); |
---|
11 | }); |
---|
12 | |
---|
13 | |
---|
14 | //=========================================================== |
---|
15 | // REPONSE TRIGGER |
---|
16 | //=========================================================== |
---|
17 | jQuery('#pamoorama').live('ON', function (e) { |
---|
18 | jQuery(jQuery('.debug').get(1)).trigger('ON'); |
---|
19 | if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) { |
---|
20 | Bandeau_bas = infos_Description_f("#theImage"); |
---|
21 | Bandeau = Bandeau_bas.top; |
---|
22 | } |
---|
23 | }); |
---|
24 | //============================================================= |
---|
25 | jQuery('#ret_autosize').live('ON', function (e) { |
---|
26 | if (nu_img == "") nu_img = 8; |
---|
27 | jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); |
---|
28 | |
---|
29 | }); |
---|
30 | |
---|
31 | //========================================================== |
---|
32 | jQuery("map area").mouseover(function (e) { |
---|
33 | hok = this; |
---|
34 | |
---|
35 | }); |
---|
36 | |
---|
37 | //================================== |
---|
38 | // jQuery("#llgbo").trigger("ON"); |
---|
39 | //================================== |
---|
40 | jQuery(llgbo_id).live('ON', function (e) { |
---|
41 | n_id = this; |
---|
42 | infos_llgbo = jQuery(llgbo_id).infos(); |
---|
43 | if (infos_llgbo.visible == false) return; |
---|
44 | |
---|
45 | marges_llgbo = 0; |
---|
46 | if (infos_llgbo.height > 0) { |
---|
47 | infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos(); |
---|
48 | infos_llgboframe31 = jQuery(llgbo_id + " div:first").infos(); |
---|
49 | //============================================= |
---|
50 | ll2 = infos_llgboframe1.width; // llgboframe1 |
---|
51 | ll1 = infos_llgboframe31.general.width; // llgboframe31 |
---|
52 | options.marges_llgbo = (ll1 - ll2); |
---|
53 | infos_llgboh2 = jQuery("#llgboh2").infos(); |
---|
54 | } |
---|
55 | }); |
---|
56 | //============================== |
---|
57 | // jQuery("#mapPicture").trigger("ON"); |
---|
58 | //============================== |
---|
59 | jQuery("#mapPicture").live('ON', function (e) { |
---|
60 | p2 = jQuery("#infoSwitcher").infos(); |
---|
61 | }); |
---|
62 | //============================== |
---|
63 | // jQuery("#map").trigger("ON"); |
---|
64 | //============================== |
---|
65 | jQuery("#map").live('ON', function (e) { |
---|
66 | |
---|
67 | }); |
---|
68 | |
---|
69 | //=================================== |
---|
70 | // jQuery("#theImage").trigger("ON"); |
---|
71 | //=================================== |
---|
72 | jQuery("#theImage").live('ON', function (e) { |
---|
73 | target = e.target.id; |
---|
74 | |
---|
75 | id = this.id; |
---|
76 | theImage_init("#theImage"); |
---|
77 | }); |
---|
78 | |
---|
79 | /*********************** |
---|
80 | * |
---|
81 | **********************/ |
---|
82 | jQuery("#theMainImage").error(function (e) { |
---|
83 | alert(this.src + ' Image does not exist !!'); |
---|
84 | }); |
---|
85 | |
---|
86 | jQuery("#theMainImage,.preload, .next1 , ").load(function (e) { |
---|
87 | if (init_img(this)) |
---|
88 | setTimeout(function () { Autosize_resize(true) }, 100); |
---|
89 | nu_img = 0; |
---|
90 | }); |
---|
91 | |
---|
92 | //================================================================= |
---|
93 | jQuery(document).live('gallyInterfaceReady', function (e) { |
---|
94 | i = jQuery(this).text(); |
---|
95 | jQuery(this).trigger('ON'); |
---|
96 | } |
---|
97 | |
---|
98 | ); |
---|
99 | // jQuery("#theImage").trigger("OK"); |
---|
100 | jQuery("#theImage").live('Start_right', function (e) { |
---|
101 | if (typeof Zone_image == "undefined") return |
---|
102 | if (nu_img == "") nu_img = 7; |
---|
103 | jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); |
---|
104 | test_w = window.myPamoorama.autoSlideFx.to; |
---|
105 | test_w = window.myPamoorama.autoScrollFx.to; |
---|
106 | nf = jQuery("#pamoorama_thumb").height(); |
---|
107 | jQuery("#pamoorama_thumb img").width(200); |
---|
108 | jQuery("#pamoorama_thumb img").height(nf); |
---|
109 | // 200=window.myPamoorama.imageWidth |
---|
110 | // frame = Zone_image.container.width |
---|
111 | if (Zone_image.container) |
---|
112 | nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; |
---|
113 | else |
---|
114 | nw = (200 * infos_content.width) / window.myPamoorama.imageWidth; |
---|
115 | jQuery("#pamoorama_frame").width(nw); |
---|
116 | |
---|
117 | |
---|
118 | |
---|
119 | }); |
---|
120 | |
---|
121 | jQuery("#theImage").live('Start_left', function (e) { |
---|
122 | if (typeof Zone_image == "undefined") return |
---|
123 | if (nu_img == "") nu_img = 7; |
---|
124 | jQuery(jQuery('.debug').get(nu_img)).trigger('ON'); |
---|
125 | test_w = window.myPamoorama.autoSlideFx.to; |
---|
126 | test_w = window.myPamoorama.autoScrollFx.to; |
---|
127 | nf = jQuery("#pamoorama_thumb").height(); |
---|
128 | jQuery("#pamoorama_thumb img").width(200); |
---|
129 | jQuery("#pamoorama_thumb img").height(nf); |
---|
130 | |
---|
131 | nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth; |
---|
132 | jQuery("#pamoorama_frame").width(nw); |
---|
133 | |
---|
134 | }); |
---|
135 | |
---|
136 | // Custom Event, ON to turn on a debug. |
---|
137 | jQuery('.debug').live('ON', function (e) { |
---|
138 | |
---|
139 | nu_img = jQuery(this).text(); |
---|
140 | jQuery('.debug').trigger('OFF'); |
---|
141 | jQuery(this).addClass('debugOn'); |
---|
142 | |
---|
143 | }); |
---|
144 | |
---|
145 | // On Click = debugs On |
---|
146 | jQuery('.debug').live('click', function (e) { |
---|
147 | i = jQuery(this).text(); |
---|
148 | jQuery(this).trigger('ON'); |
---|
149 | }); |
---|
150 | |
---|
151 | // Custom Event, Turn off a debug |
---|
152 | jQuery('.debug').live('OFF', function (e) { |
---|
153 | jQuery(this).removeClass('debugOn'); |
---|
154 | }); |
---|
155 | |
---|
156 | // on Double Click, remove the debug from the DOM |
---|
157 | jQuery('.debug').live('dblclick', function () { |
---|
158 | jQuery(this).fadeOut(function () { jQuery(this).remove() }); |
---|
159 | }); |
---|
160 | |
---|
161 | // Add another debug to the DOM |
---|
162 | jQuery('#adddebugs').click(function () { |
---|
163 | i = jQuery('.debug').length; |
---|
164 | jQuery('<div>' + i + '</div>') |
---|
165 | .addClass('debug') |
---|
166 | .appendTo('#debugsContainer'); |
---|
167 | }); |
---|
168 | |
---|
169 | |
---|
170 | /********************************* |
---|
171 | * |
---|
172 | ********************************/ |
---|
173 | jQuery("#menuSwitcher,#infoSwitcher").click(function (e) { |
---|
174 | |
---|
175 | setTimeout(function () { Autosize_resize(true) }, 10); |
---|
176 | nu_img = 0; |
---|
177 | }); |
---|
178 | |
---|
179 | |
---|
180 | //=========================================== |
---|
181 | // jQuery("#theImageAndInfos").trigger("ON"); |
---|
182 | //=========================================== |
---|
183 | jQuery("#theImageAndInfos").live('ON', function (e) { |
---|
184 | infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); |
---|
185 | // setTimeout(function () { Autosize_resize(true) }, 100); |
---|
186 | nu_img = 0; |
---|
187 | }); // fin click #theImageAndInfos ON |
---|
188 | jQuery("#theImageAndInfos").resize(function (e) { |
---|
189 | |
---|
190 | nu_img = 0; |
---|
191 | }); |
---|
192 | |
---|
193 | //================================== |
---|
194 | // |
---|
195 | //=================================== |
---|
196 | jQuery('#derivativeCheckedAutosize').click(function () { |
---|
197 | pathnames = jQuery(this).attr("href").split(":"); |
---|
198 | try { |
---|
199 | eval(pathnames[1]); |
---|
200 | } catch (e) { |
---|
201 | n = false; |
---|
202 | } |
---|
203 | }); // fin click derivativeCheckedAutosize |
---|
204 | //==================================================== |
---|
205 | jQuery("#derivativeSwitchBox a").click(function () { |
---|
206 | var theImg = document.getElementById(theMainImage_Id.replace("#", "")); |
---|
207 | if (theImg) { |
---|
208 | pathnames = jQuery(this).attr("href").split(":"); |
---|
209 | |
---|
210 | try { |
---|
211 | eval(pathnames[1]); |
---|
212 | n = true; |
---|
213 | } catch (e) { |
---|
214 | n = false; |
---|
215 | } |
---|
216 | |
---|
217 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
218 | infos_theImage = jQuery("#theImage").infos(); |
---|
219 | theImg.removeAttribute("width"); |
---|
220 | theImg.removeAttribute("height"); |
---|
221 | |
---|
222 | var nw = "100% x 100%".split("x"); |
---|
223 | if (jQuery(this).text().match(RegExp("x", "gi"))) { |
---|
224 | nw = jQuery(this).text().split("(")[1].split(")")[0]; |
---|
225 | nw = nw.split("x"); |
---|
226 | init_img(theImg); |
---|
227 | wx = parseInt(nw[0]); |
---|
228 | wh = parseInt(wx / rapport); |
---|
229 | //jQuery("#theImage").css("height", wh + "px"); |
---|
230 | jQuery(theImg).width(wx); |
---|
231 | jQuery(theImg).height(wh); |
---|
232 | set_cl(useMap == "#Autosize"); |
---|
233 | Set_llbgo(); |
---|
234 | } |
---|
235 | |
---|
236 | } |
---|
237 | |
---|
238 | }); // fin click #derivativeSwitchBox a |
---|
239 | |
---|
240 | jQuery("input").click(function () { |
---|
241 | if (this.name.match(RegExp("_enabled", "gi"))) { |
---|
242 | sel = "[name*=" + this.name + "]"; |
---|
243 | obj = jQuery("tr" + sel); |
---|
244 | |
---|
245 | if (this.checked) |
---|
246 | obj.css({ backgroundColor: "green", color: "white" }); |
---|
247 | else |
---|
248 | obj.css({ backgroundColor: "red", color: "white" }); |
---|
249 | |
---|
250 | return; |
---|
251 | } |
---|
252 | |
---|
253 | |
---|
254 | |
---|
255 | return; |
---|
256 | |
---|
257 | |
---|
258 | |
---|
259 | |
---|
260 | }); |
---|
261 | |
---|
262 | //==================================== |
---|
263 | Autosize_init = function (name, value) { |
---|
264 | img_defaut = { height: options.scaled_height, width: options.scaled_width }; |
---|
265 | img_reelle = { height: options.img_height, width: options.img_width }; |
---|
266 | img_init = { height: options.img_height, width: options.img_width }; // taille initiale |
---|
267 | |
---|
268 | img_finale = img_init; |
---|
269 | rapport = parseInt(img_init.width) / parseInt(img_init.height); |
---|
270 | useMap = infos_theMainImage.useMap; // #mapmedium |
---|
271 | Type_Img = ""; |
---|
272 | nopano = false; |
---|
273 | |
---|
274 | useMap = cookies.pictureMap; // #mapxxx |
---|
275 | typeSave = cookies.typeSave; //picturederiv xxx |
---|
276 | |
---|
277 | |
---|
278 | old_img = cookies.imgSrc; |
---|
279 | old_window_height = cookies.windowHeight || jQuery(window).height(); |
---|
280 | old_window_width = cookies.windowWidth || jQuery(window).width(); |
---|
281 | old_img_h = cookies.imgHeight; |
---|
282 | old_img_w = cookies.imgWidth; |
---|
283 | |
---|
284 | var theImg = document.getElementById(theMainImage_Id.replace("#", "")); |
---|
285 | theImg.useMap = useMap; |
---|
286 | |
---|
287 | |
---|
288 | } // Autosize_init |
---|
289 | //=========================================================================== |
---|
290 | Autosize_resize = function (force, parametres) { |
---|
291 | theImage_init(); |
---|
292 | |
---|
293 | if (Get_dimensions(force, parametres)) { |
---|
294 | |
---|
295 | jQuery(theMainImage_Id).height(Zone_image.image.height); |
---|
296 | jQuery(theMainImage_Id).width(Zone_image.image.width); |
---|
297 | jQuery("#theImageAndInfos").css({ height: "auto" }); |
---|
298 | jQuery("#theImage").css({ height: "auto" }); |
---|
299 | // jQuery("#theImage").width(Zone_image.container.width); |
---|
300 | // jQuery("#theImage").width("auto"); |
---|
301 | Set_Pamoorama(); |
---|
302 | |
---|
303 | set_cl(true); |
---|
304 | } else { |
---|
305 | Set_Pamoorama(); |
---|
306 | set_cl(false); |
---|
307 | } |
---|
308 | Set_llbgo(true); |
---|
309 | return true; |
---|
310 | |
---|
311 | //_____________________________________________________ |
---|
312 | }; // Autosize |
---|
313 | |
---|
314 | Save_cookies = function (parametres) { |
---|
315 | if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" '; |
---|
316 | if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" }); |
---|
317 | if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" }); |
---|
318 | if (parametres.imgSrc) jQuery.cookie('img', parametres.imgSrc, { path: "/" }); |
---|
319 | |
---|
320 | if (parametres.imgHeight) jQuery.cookie('img_h', infos_theMainImage.height, { path: "/" }); |
---|
321 | if (parametres.imgWidth) jQuery.cookie('img_w', infos_theMainImage.width, { path: "/" }); |
---|
322 | if (parametres.windowHeight) jQuery.cookie('window_height', Window_Affichage.height, { path: "/" }); |
---|
323 | if (parametres.windowWidth) jQuery.cookie('window_width', Window_Affichage.width, { path: "/" }); |
---|
324 | } |
---|
325 | |
---|
326 | Get_cookies = function () { |
---|
327 | parametres = { |
---|
328 | typeSave: jQuery.cookie('picture_deriv'), |
---|
329 | pictureMap: jQuery.cookie('picture_map'), |
---|
330 | imgSrc: jQuery.cookie('img'), |
---|
331 | |
---|
332 | imgHeight: jQuery.cookie('img_h'), |
---|
333 | imgWidth: jQuery.cookie('img_w'), |
---|
334 | windowHeight: jQuery.cookie('window_height'), |
---|
335 | windowWidth: jQuery.cookie('window_width') |
---|
336 | } |
---|
337 | return parametres; |
---|
338 | } |
---|
339 | |
---|
340 | /******************************************** |
---|
341 | * window unLOAD |
---|
342 | ********************************************/ |
---|
343 | jQuery(window).unload(function () { |
---|
344 | try { |
---|
345 | if (typeof theMainImage_Id != "undefined") { |
---|
346 | |
---|
347 | useMap = options.useMap; |
---|
348 | pictureMap = jQuery.cookie('picture_map'); |
---|
349 | typeSave = jQuery.cookie('picture_deriv'); |
---|
350 | |
---|
351 | old_img = jQuery.cookie('img'); |
---|
352 | old_window_height = jQuery.cookie('window_height'); |
---|
353 | old_window_width = jQuery.cookie('window_width'); |
---|
354 | old_img_h = jQuery.cookie('img_h'); |
---|
355 | old_img_w = jQuery.cookie('img_w'); |
---|
356 | set_cookies({ |
---|
357 | |
---|
358 | }); |
---|
359 | |
---|
360 | if (typeof Window_Affichage != "undefined") { |
---|
361 | jQuery.cookie('window_height', Window_Affichage.height, { path: "/" }); |
---|
362 | jQuery.cookie('window_width', Window_Affichage.width, { path: "/" }); |
---|
363 | } |
---|
364 | } |
---|
365 | } catch (r) { |
---|
366 | |
---|
367 | } |
---|
368 | |
---|
369 | }); //unload |
---|
370 | |
---|
371 | |
---|
372 | |
---|
373 | |
---|
374 | /******************************************** |
---|
375 | * window LOAD |
---|
376 | ********************************************/ |
---|
377 | jQuery(window).load(function () { |
---|
378 | href = location.href; |
---|
379 | var aff_ok = false; |
---|
380 | if (DEBUG_autosize == "true") { |
---|
381 | for (var i = 0; i < 10; i++) { |
---|
382 | jQuery('#adddebugs').click(); |
---|
383 | } |
---|
384 | jQuery(jQuery('.debug').get(i - 1)).click(); |
---|
385 | } |
---|
386 | |
---|
387 | Autosize_init(); |
---|
388 | //========================================================= |
---|
389 | |
---|
390 | Bandeau_bas = infos_Description_f("#theImage"); |
---|
391 | if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top; |
---|
392 | else Bandeau = 0; |
---|
393 | |
---|
394 | |
---|
395 | if (!theImage_init("#theMainImage")) { |
---|
396 | Autosize_resize(true, options); |
---|
397 | Set_llbgo(true); |
---|
398 | Wait_Affichage(); |
---|
399 | } else { |
---|
400 | set_cl(options.useMap.match(RegExp("Autosize", "gi"))); |
---|
401 | Set_llbgo(); |
---|
402 | } |
---|
403 | |
---|
404 | |
---|
405 | |
---|
406 | |
---|
407 | //================================================================================= |
---|
408 | }); // window.onload |
---|
409 | /*********************************************************** |
---|
410 | * RESIZE |
---|
411 | ***********************************************************/ |
---|
412 | jQuery(window).resize( |
---|
413 | function (event, ui) { |
---|
414 | List_autosize_resize(event, ui); |
---|
415 | Autosize_resize(true, options); |
---|
416 | Wait_Affichage(); |
---|
417 | }); |
---|
418 | |
---|
419 | /***************** |
---|
420 | * changeImgSrc1 |
---|
421 | ******************/ |
---|
422 | changeImgSrc = function (url, typeSave, useMap) { |
---|
423 | var theImg = document.getElementById(theMainImage_Id.replace("#", "")); |
---|
424 | if (theImg) { |
---|
425 | theImg.removeAttribute("width"); |
---|
426 | theImg.removeAttribute("height"); |
---|
427 | // theImg.useMap = "#map" + useMap; |
---|
428 | |
---|
429 | jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden'); |
---|
430 | jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible'); |
---|
431 | options.useMap = useMap; |
---|
432 | if (useMap.match("Autosize")) { |
---|
433 | pictureMap = "#" + "Autosize"; |
---|
434 | } else { |
---|
435 | pictureMap = "#map" + typeSave; |
---|
436 | } |
---|
437 | theImg.src = url; // charge Image |
---|
438 | theImg.useMap = pictureMap; |
---|
439 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
440 | infos_theMainImage.useMap = theImg.useMap; |
---|
441 | Save_cookies({ |
---|
442 | typeSave: typeSave, |
---|
443 | pictureMap: pictureMap, |
---|
444 | imgSrc: url |
---|
445 | }); |
---|
446 | cookies = Get_cookies(); |
---|
447 | |
---|
448 | } |
---|
449 | |
---|
450 | |
---|
451 | } //changeImgSrc1 |
---|
452 | /************************************ |
---|
453 | * |
---|
454 | ************************************/ |
---|
455 | Wait_pamoorama = function () { |
---|
456 | if (jQuery("#pamoorama").length) { |
---|
457 | mypanorama = window.myPamoorama; |
---|
458 | if (!mypanorama) { |
---|
459 | tempo = tempo + 1; |
---|
460 | if (tempo > 10) |
---|
461 | return true; |
---|
462 | setTimeout("Wait_pamoorama()", 500); |
---|
463 | return false; |
---|
464 | } |
---|
465 | if (mypanorama.skipInit == false) { |
---|
466 | setTimeout("Wait_pamoorama()", 500); |
---|
467 | return false; |
---|
468 | } |
---|
469 | //============================================================= |
---|
470 | infos_pamoorama = jQuery("#pamoorama").infos(); |
---|
471 | if (Math.abs(infos_pamoorama.height) < 50) { |
---|
472 | setTimeout("Wait_pamoorama()", 500); |
---|
473 | return false; |
---|
474 | } |
---|
475 | nopano = true; |
---|
476 | theMainImage_Id = "#pamoorama"; |
---|
477 | |
---|
478 | } |
---|
479 | } // Wait_pamoorama |
---|
480 | //==================================================================================== |
---|
481 | Wait_Affichage = function () { |
---|
482 | |
---|
483 | if (typeof fade_in == "undefined") fade_in = 1000; |
---|
484 | fade_in = parseInt(fade_in); |
---|
485 | /* |
---|
486 | if (!Autosize_resize()) { |
---|
487 | setTimeout("Wait_Affichage()", 500); |
---|
488 | return |
---|
489 | } |
---|
490 | nu_img++; |
---|
491 | */ |
---|
492 | if (typeof fade_in == "undefined") fade_in = 0; |
---|
493 | if (fade_in == 0) { |
---|
494 | jQuery("#theImage").css({ opacity: "1" }); |
---|
495 | jQuery("#theImg").css({ opacity: "1" }); |
---|
496 | jQuery("#imageTitleContainer").css({ opacity: "1" }); |
---|
497 | jQuery("#theImageAndTitle").css({ opacity: "1" }); |
---|
498 | } else { |
---|
499 | jQuery("#theImage").animate({ opacity: "1" }, |
---|
500 | fade_in, "swing", |
---|
501 | function (i) { |
---|
502 | jQuery("#theImage").css({ opacity: "1" }); |
---|
503 | jQuery("#theImg").css({ opacity: "1" }); |
---|
504 | jQuery("#imageTitleContainer").css({ opacity: "1" }); |
---|
505 | jQuery("#theImageAndTitle").css({ opacity: "1" }); |
---|
506 | |
---|
507 | if (DEBUG_autosize == "true") { |
---|
508 | |
---|
509 | nu_img--; |
---|
510 | if (nu_img < 1) nu_img = 1; |
---|
511 | |
---|
512 | bp1 = jQuery('.debug').get(nu_img); |
---|
513 | jQuery(bp1).trigger('ON'); |
---|
514 | } |
---|
515 | } |
---|
516 | ); |
---|
517 | |
---|
518 | } |
---|
519 | // if (nu_img > 1) return; |
---|
520 | if (typeof stb != "undefined") |
---|
521 | stb.stop().fadeTo(3500, 0); |
---|
522 | if (typeof theMainImage_Id == "undefined") return true; |
---|
523 | |
---|
524 | if (theMainImage_Id.selector) { |
---|
525 | theMainImage_Id = theMainImage_Id.selector; |
---|
526 | } |
---|
527 | if (theMainImage_Id == null) return; |
---|
528 | |
---|
529 | if (jQuery(theMainImage_Id).length > 0) { |
---|
530 | if (typeof img_h == "undefined") { |
---|
531 | img_h = jQuery(theMainImage_Id).height(); |
---|
532 | img_w = jQuery(theMainImage_Id).width(); |
---|
533 | } |
---|
534 | |
---|
535 | jQuery("#src_img_h").val(img_h); |
---|
536 | jQuery("#src_img_w").val(img_w); |
---|
537 | jQuery("#ret_autosize").val(infos_theMainImage.src); |
---|
538 | if (typeof Window_Affichage == "undefined") return; |
---|
539 | jQuery("#window_height").val(Window_Affichage.height); |
---|
540 | jQuery("#window_width").val(Window_Affichage.width); |
---|
541 | jQuery("#ret_autosize").trigger('ON', { |
---|
542 | width: img_w, |
---|
543 | height: img_h, |
---|
544 | theImage: theMainImage_Id, |
---|
545 | src_img: infos_theMainImage.src, |
---|
546 | window_height: Window_Affichage.height, |
---|
547 | window_width: Window_Affichage.width |
---|
548 | }); |
---|
549 | } |
---|
550 | } // Wait_affichage |
---|
551 | |
---|
552 | |
---|
553 | |
---|
554 | |
---|
555 | |
---|
556 | /*********************** |
---|
557 | * |
---|
558 | **********************/ |
---|
559 | init_img = function (theImg) { |
---|
560 | name_src = theImg.src; |
---|
561 | img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() } |
---|
562 | |
---|
563 | if (theImg.naturalWidth) |
---|
564 | img_init.width = theImg.naturalWidth; |
---|
565 | if (theImg.naturalHeight) |
---|
566 | img_init.height = theImg.naturalHeight; |
---|
567 | |
---|
568 | img_init.rapport = img_init.width / img_init.height; |
---|
569 | Zone_image.height_init = img_init.height; |
---|
570 | Zone_image.width_init = img_init.width; |
---|
571 | Zone_image.rapport = img_init.rapport; |
---|
572 | |
---|
573 | nu_img = 0; |
---|
574 | theMainImage_Id = "#" + theImg.id; |
---|
575 | if (typeof Zone_image.src == "undefined") return; |
---|
576 | return name_src.match(Zone_image.src); |
---|
577 | } |
---|
578 | |
---|
579 | |
---|
580 | /***************************************************** |
---|
581 | * recherche la plus grande image (hauteur ou largeur) |
---|
582 | *****************************************************/ |
---|
583 | Get_Img_Maxi = function (myobj) { |
---|
584 | var w00 = 0; |
---|
585 | var myImg = null; |
---|
586 | |
---|
587 | img = jQuery(theMainImage_Id); |
---|
588 | if (img != null) { |
---|
589 | return; |
---|
590 | |
---|
591 | } |
---|
592 | img = jQuery(myobj); |
---|
593 | |
---|
594 | img = jQuery('img[alt]'); |
---|
595 | |
---|
596 | jQuery(myobj).each(function (i) { |
---|
597 | w0 = img_reelle.width; |
---|
598 | h0 = img_reelle.height; |
---|
599 | if (h0 > w0) w0 = h0; |
---|
600 | if (w0 > w00) { |
---|
601 | if (!this.src.match(RegExp(".png", "gi"))) |
---|
602 | if (!this.src.match(RegExp(thumbnail, "g"))) { |
---|
603 | myImg = this; |
---|
604 | jQuery(myImg).addClass("Image"); |
---|
605 | w00 = w0; |
---|
606 | } |
---|
607 | |
---|
608 | } |
---|
609 | }); |
---|
610 | return myImg; |
---|
611 | } // Get_Img_Maxi |
---|
612 | |
---|
613 | |
---|
614 | /************************************************************* |
---|
615 | * |
---|
616 | **************************************************************/ |
---|
617 | infos_entete = function () { |
---|
618 | infos_imageToolBar = jQuery("#imageToolBar").infos(); |
---|
619 | if (typeof (marge_top) != "undefined") return; |
---|
620 | |
---|
621 | optiontop = 0; |
---|
622 | infos_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
623 | |
---|
624 | infos_thePicturePage = jQuery("#thePicturePage").infos(); |
---|
625 | infos_theImage = jQuery("#theImage").infos(); |
---|
626 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
627 | infos_theImageAndTitle = jQuery("#theImageAndTitle").infos(); |
---|
628 | infos_theImageBox = jQuery("#theImageBox").infos(); |
---|
629 | optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top; |
---|
630 | } |
---|
631 | |
---|
632 | |
---|
633 | |
---|
634 | marge_top = Math.ceil(infos_the_page.top + |
---|
635 | infos_the_page.borderwidth.top + |
---|
636 | infos_theImage.borderwidth.top + |
---|
637 | infos_thePicturePage.margin.top |
---|
638 | ); |
---|
639 | |
---|
640 | img_top = Math.ceil(infos_theImage.top + |
---|
641 | infos_theImage.padding.top + |
---|
642 | infos_theImage.borderwidth.top + |
---|
643 | infos_thePicturePage.margin.top + optiontop); |
---|
644 | result = infos_imageToolBar; |
---|
645 | // result.width = "20%"; |
---|
646 | // result.left = "40%"; |
---|
647 | result.marge_top = marge_top; |
---|
648 | result.img_top = img_top; |
---|
649 | //=== Afficher le titre de l'image sur le cadre === |
---|
650 | |
---|
651 | |
---|
652 | if (infos_llgboh2.top > 0) { |
---|
653 | result.img_top = infos_llgboh2.top; |
---|
654 | |
---|
655 | } |
---|
656 | else if (marges_llgbo > 0) { |
---|
657 | result.img_top -= (8); |
---|
658 | } |
---|
659 | return result; |
---|
660 | } // infos_entete |
---|
661 | /************************************************* |
---|
662 | * Récupère les informations sur la description. |
---|
663 | * |
---|
664 | *************************************************/ |
---|
665 | infos_Description_f = function () { |
---|
666 | // jQuery("#theImage").css({ display: "block" }); |
---|
667 | //====== détection du type d'images ====== |
---|
668 | if (jQuery("#charlie").length > 0) { |
---|
669 | Type_Img = "charlie"; |
---|
670 | } else if (jQuery("#Panorama").length) { |
---|
671 | Type_Img = "panorama"; |
---|
672 | } else if (jQuery("#pamoorama").length) { |
---|
673 | Type_Img = "pamoorama"; |
---|
674 | } else if (jQuery("#map").length) { |
---|
675 | Type_Img = "map"; |
---|
676 | } else if (jQuery("#Panorama").length) { |
---|
677 | Type_Img = "panorama"; |
---|
678 | } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) { |
---|
679 | |
---|
680 | if (jQuery("#theImage" + " object").length > 0) { |
---|
681 | |
---|
682 | type_src = "object"; |
---|
683 | |
---|
684 | } else if (jQuery("#theImage" + " embed").length > 0) { |
---|
685 | |
---|
686 | type_src = "embed"; |
---|
687 | |
---|
688 | } else { |
---|
689 | |
---|
690 | type_src = "iframe"; |
---|
691 | } |
---|
692 | nbf = jQuery("#theImage" + " " + type_src).length; |
---|
693 | frm1 = jQuery("#theImage" + " " + type_src).get(0); |
---|
694 | Type_Img = "charlie"; |
---|
695 | |
---|
696 | //'fb - xfbml - like - button |
---|
697 | |
---|
698 | objs = jQuery("#theImage" + " div").get(0); |
---|
699 | if (jQuery(objs).length > 0) { |
---|
700 | id_0 = jQuery(objs).attr("id"); |
---|
701 | if (id_0 == "") { |
---|
702 | jQuery(objs).attr("id", "charlie"); |
---|
703 | } else { |
---|
704 | if (nbf > 1) { |
---|
705 | jQuery(frm1).attr("id", "charlie"); |
---|
706 | } else { |
---|
707 | Type_Img = "img"; |
---|
708 | } |
---|
709 | } |
---|
710 | } else { |
---|
711 | jQuery(frm1).attr("id", "charlie"); |
---|
712 | } |
---|
713 | |
---|
714 | |
---|
715 | } else if (jQuery("#theImage").find("img").length > 0) { |
---|
716 | Type_Img = "img"; |
---|
717 | } else if (jQuery("#theImage" + "Box").find("img").length > 0) { |
---|
718 | Type_Img = "img"; |
---|
719 | Parent = Parent + "Box"; |
---|
720 | } else if (jQuery("img").length > 0) { |
---|
721 | Type_Img = "img_autre"; |
---|
722 | return; |
---|
723 | } else { |
---|
724 | return; |
---|
725 | } |
---|
726 | //=============== CHARLIE ============================== |
---|
727 | if (jQuery("#charlie").length > 0) { |
---|
728 | jQuery("#charlie").css({ |
---|
729 | paddingTop: "0px", |
---|
730 | marginTop: "0px", |
---|
731 | paddingBottom: "0px", |
---|
732 | marginBottom: "0px" |
---|
733 | }); |
---|
734 | |
---|
735 | } |
---|
736 | //================ LLGBO ====================== |
---|
737 | marges_llgbo = 0; |
---|
738 | options.marges_llgbo = 0; |
---|
739 | if (jQuery(llgbo_id).length > 0) { |
---|
740 | infos_llgbo = jQuery(llgbo_id).infos(); |
---|
741 | if (infos_llgbo.visible == true) { |
---|
742 | if (infos_llgbo.height > 0) { |
---|
743 | infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos(); |
---|
744 | infos_llgboframe31 = jQuery(llgbo_id + " div:first").infos(); |
---|
745 | //============================================= |
---|
746 | ll2 = infos_llgboframe1.width; // llgboframe1 |
---|
747 | ll1 = infos_llgboframe31.general.width; // llgboframe31 |
---|
748 | options.marges_llgbo = (ll1 - ll2); |
---|
749 | infos_llgboh2 = jQuery("#llgboh2").infos(); |
---|
750 | } |
---|
751 | } |
---|
752 | jQuery(llgbo_id).trigger("ON"); |
---|
753 | marges_llgbo = options.marges_llgbo; |
---|
754 | } |
---|
755 | |
---|
756 | // Bandeau_t = infos_entete(); |
---|
757 | // Bandeau = Bandeau_t.img_top; |
---|
758 | infos_theImgContainer = jQuery("#" + "theImgContainer").infos(); |
---|
759 | infos_description = jQuery("#" + "description").infos(); |
---|
760 | //============================================================================= |
---|
761 | |
---|
762 | |
---|
763 | |
---|
764 | if (theme.match(RegExp("luciano", "g"))) { |
---|
765 | |
---|
766 | |
---|
767 | |
---|
768 | |
---|
769 | } else if (Type_Img == "map") { |
---|
770 | |
---|
771 | infos_map = jQuery("#mapPicture").infos(); |
---|
772 | marge_left = infos_map.width; |
---|
773 | |
---|
774 | jQuery("#map").css({ left: marge_left + "px", padding: "0px", |
---|
775 | marginLeft: "0px", |
---|
776 | marginRight: "4px", |
---|
777 | marginTop: "0px", |
---|
778 | marginBottom: "0px", |
---|
779 | position: "relative" |
---|
780 | }); |
---|
781 | |
---|
782 | theMainImage_Id = "#map"; |
---|
783 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
784 | |
---|
785 | |
---|
786 | } else if (jQuery("#charlie").length > 0) { |
---|
787 | infos_charlie = jQuery("#charlie").infos(); |
---|
788 | obj_charlie = jQuery("object"); |
---|
789 | try { |
---|
790 | tp = obj_charlie.attr(); |
---|
791 | } catch (e) { |
---|
792 | tp = obj_charlie.prop(); |
---|
793 | } |
---|
794 | |
---|
795 | if (tp != undefined) { |
---|
796 | if (obj_charlie.length > 0) |
---|
797 | tp = jQuery("object").attr("type") || jQuery("object").prop("type"); |
---|
798 | else |
---|
799 | tp = jQuery("embed").attr("type") || jQuery("embed").prop("type"); |
---|
800 | } |
---|
801 | |
---|
802 | if (tp == 'application/x-shockwave-flash') { |
---|
803 | jQuery("#charlie").css({ |
---|
804 | paddingTop: "0px", |
---|
805 | marginTop: "0px", |
---|
806 | paddingBottom: "30px", |
---|
807 | marginBottom: "0px" |
---|
808 | }); |
---|
809 | } else { |
---|
810 | |
---|
811 | } |
---|
812 | |
---|
813 | var MainImage = jQuery(theMainImage_Id); |
---|
814 | |
---|
815 | if (MainImage.length == 0) { |
---|
816 | theMainImage_Id = "#charlie"; |
---|
817 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
818 | } else { |
---|
819 | |
---|
820 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
821 | |
---|
822 | } |
---|
823 | |
---|
824 | |
---|
825 | } else if (jQuery("#theImage" + " embed").length > 0) { |
---|
826 | if (jQuery(theMainImage_Id).lenght == 0) { |
---|
827 | theMainImage_Id = "#theImage" + " embed"; |
---|
828 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
829 | jQuery("#theImage" + " embed").width({ width: infos_theMainImage.width + "px", height: infos_theMainImage.height + "px" }); |
---|
830 | } else { |
---|
831 | |
---|
832 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
833 | Type_Img == "charlie" |
---|
834 | if (infos_theMainImage.width == 0) { |
---|
835 | |
---|
836 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
837 | |
---|
838 | } |
---|
839 | } |
---|
840 | |
---|
841 | } else if (Type_Img == "pamoorama") { |
---|
842 | if (!nopano) { |
---|
843 | Wait_pamoorama(); |
---|
844 | |
---|
845 | } |
---|
846 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
847 | infos_footer = jQuery("#pamoorama_footer").infos(); |
---|
848 | infos_theMainImage.height += parseInt(infos_theMainImage.height) + parseInt(infos_footer.height); |
---|
849 | |
---|
850 | } else { |
---|
851 | if (jQuery(theMainImage_Id).length == 0) { |
---|
852 | theMainImage_Id = "#theImage" + " img[alt]"; |
---|
853 | } else { |
---|
854 | |
---|
855 | } |
---|
856 | |
---|
857 | |
---|
858 | if (!theMainImage_Id) |
---|
859 | theMainImage_Id = "#theImage"; // sans img ?? |
---|
860 | |
---|
861 | |
---|
862 | } |
---|
863 | //===================================================================================== |
---|
864 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
865 | |
---|
866 | switch (infos_theMainImage.position) { |
---|
867 | case "relative": |
---|
868 | break; |
---|
869 | case "static": |
---|
870 | break; |
---|
871 | case "absolute": |
---|
872 | break; |
---|
873 | case "": |
---|
874 | break; |
---|
875 | default: |
---|
876 | break; |
---|
877 | } |
---|
878 | |
---|
879 | infos_description.marge = { |
---|
880 | bottom: infos_theMainImage.padding.bottom + infos_theMainImage.margin.bottom + infos_theMainImage.borderwidth.bottom, |
---|
881 | top: infos_theMainImage.padding.top + infos_theMainImage.borderwidth.top + infos_theMainImage.margin.top |
---|
882 | } |
---|
883 | |
---|
884 | if (infos_llgbo.height > 0) infos_theMainImage = infos_llgbo; // format de l'image+largeur du cadre |
---|
885 | |
---|
886 | if (theme.match(RegExp("luciano", "g"))) { |
---|
887 | |
---|
888 | infos_theImgContainer = jQuery(theImageAndInfos_id).infos(); |
---|
889 | infos_description.bottom = jQuery("#imageInfo").infos().top; |
---|
890 | infos_description.top = infos_theImgContainer.bottom; |
---|
891 | infos_slidshowToolBar = jQuery("#slidshowToolBar").infos(); |
---|
892 | |
---|
893 | if (infos_slidshowToolBar.height > 0) { |
---|
894 | correction = (infos_slidshowToolBar.height); |
---|
895 | infos_description.top = infos_theMainImage.bottom; |
---|
896 | infos_description.bottom = jQuery("#copyright").infos().top; |
---|
897 | } |
---|
898 | |
---|
899 | //========================================================= |
---|
900 | } else if (theme.match(RegExp("stripped", "gi"))) { |
---|
901 | //options.imageAutosize |
---|
902 | //options.imageMargin |
---|
903 | |
---|
904 | infos_content = jQuery("#content").infos(); |
---|
905 | if (options.imageAutosizeTitle == false) { |
---|
906 | infos_description.top = infos_theImageBox.bottom; |
---|
907 | |
---|
908 | infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top + |
---|
909 | infos_description.borderwidth.top + |
---|
910 | infos_description.borderwidth.bottom + |
---|
911 | options.imageAutosizeMargin * 2 + |
---|
912 | (marges_llgbo / 2) + 4; |
---|
913 | |
---|
914 | } else { |
---|
915 | |
---|
916 | |
---|
917 | infos_description.top = infos_theImageBox.bottom - |
---|
918 | infos_content.top + |
---|
919 | options.imageAutosizeMargin * 2 + |
---|
920 | (marges_llgbo / 2) |
---|
921 | ; |
---|
922 | infos_description.bottom = jQuery("#tabZone").infos().top + |
---|
923 | infos_theImageAndTitle.margin.top; |
---|
924 | if (msie == true) infos_description.bottom -= 4; |
---|
925 | }; |
---|
926 | check_desc_v = true; |
---|
927 | |
---|
928 | } else { |
---|
929 | if (theme.match(RegExp("sobre", "gi"))) { |
---|
930 | infos_description.marge.top = -2; |
---|
931 | } |
---|
932 | infos_description.bottom = infos_theImage.bottom; //482 |
---|
933 | infos_description.top = infos_theMainImage.height + infos_theImage.top; //410+62 |
---|
934 | // infos_description.bottom -= infos_theMainImage.top; |
---|
935 | } |
---|
936 | // |
---|
937 | |
---|
938 | infos_description.height = infos_description.bottom - infos_description.top; |
---|
939 | |
---|
940 | if (options.check_desc_v == false) { |
---|
941 | infos_description.height = 0; |
---|
942 | } |
---|
943 | |
---|
944 | Debug_pos(); |
---|
945 | |
---|
946 | //options.cl_visible=false ; |
---|
947 | return infos_description; |
---|
948 | } //infos_Description_f |
---|
949 | |
---|
950 | //======================================================================================= |
---|
951 | Debug_info = function (index, infos, nom) { |
---|
952 | if (infos.height > 0) { |
---|
953 | message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" + |
---|
954 | "Info nodeName: " + infos.nodeName + "\n" + |
---|
955 | "Info width: " + infos.width + "\n" + |
---|
956 | "Info height: " + infos.height + "\n" + |
---|
957 | "Info top: " + infos.top + "\n" + |
---|
958 | "Info left: " + infos.left + "\n" + |
---|
959 | "Info position: " + infos.position + "\n"; |
---|
960 | myDebug = { id: "Debug" + index, texte: message, |
---|
961 | css: { |
---|
962 | color: "black", |
---|
963 | opacity: "0.5", |
---|
964 | position: "absolute", |
---|
965 | height: infos.height || 100 + "px", |
---|
966 | width: infos.width || 300 + "px", |
---|
967 | left: infos.left || 0 + "px", |
---|
968 | border: "solid 1px green", |
---|
969 | top: infos.top + "px" |
---|
970 | } |
---|
971 | } |
---|
972 | return myDebug; |
---|
973 | } else { |
---|
974 | if (typeof old_messages == "undefined") { |
---|
975 | old_messages = new Array(); |
---|
976 | |
---|
977 | } |
---|
978 | if (infos != "" && infos != "undefined") { |
---|
979 | nc0 = old_messages[index]; |
---|
980 | |
---|
981 | if (typeof nc0 != "undefined") { |
---|
982 | nc0 = old_messages[index].toString().split("<br />"); |
---|
983 | if (nc0.length > 3) nc0.shift(); |
---|
984 | |
---|
985 | old_messages[index] = nc0.join("<br />"); |
---|
986 | } |
---|
987 | old_messages[index] += " : " + nom + " -- > " + infos + "<br />"; |
---|
988 | |
---|
989 | message = browser.browser + old_messages[index]; |
---|
990 | |
---|
991 | myDebug = { id: "Debug" + index, texte: message, |
---|
992 | css: { |
---|
993 | color: "black", |
---|
994 | opacity: "1.0", |
---|
995 | position: "absolute", |
---|
996 | align: "left", |
---|
997 | height: 100 + "px", |
---|
998 | width: 800 + "px", |
---|
999 | left: 300 + "px", |
---|
1000 | border: "solid 1px green", |
---|
1001 | top: 0 + "px" |
---|
1002 | } |
---|
1003 | } |
---|
1004 | } |
---|
1005 | |
---|
1006 | return myDebug; |
---|
1007 | } |
---|
1008 | |
---|
1009 | |
---|
1010 | } |
---|
1011 | //==================================================== |
---|
1012 | function Debug_pos() { |
---|
1013 | return; |
---|
1014 | if (DEBUG_autosize == "true") { |
---|
1015 | |
---|
1016 | jQuery("[id ^='Debug']").show(); |
---|
1017 | /* |
---|
1018 | Debug2 background-color:yellow |
---|
1019 | Debug3 background-color:blue |
---|
1020 | Debug4 background-color:green |
---|
1021 | Debug5 background-color:red |
---|
1022 | |
---|
1023 | */ |
---|
1024 | |
---|
1025 | affiche_debug({ |
---|
1026 | Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"), |
---|
1027 | Debug4: Debug_info(4, infos_description, "infos_description"), |
---|
1028 | Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage") |
---|
1029 | }); |
---|
1030 | } |
---|
1031 | } |
---|
1032 | //========================================================== |
---|
1033 | affiche_debug = function (aff_infos) { |
---|
1034 | jQuery(jQuery("[id ^='Debug']")).each(function (i) { |
---|
1035 | if (aff_infos[this.id]) { |
---|
1036 | if (aff_infos[this.id].css) { |
---|
1037 | jQuery("#" + this.id).css(aff_infos[this.id].css); |
---|
1038 | jQuery("#" + this.id).html(aff_infos[this.id].texte); |
---|
1039 | } |
---|
1040 | } |
---|
1041 | }); |
---|
1042 | return; |
---|
1043 | } |
---|
1044 | //=========================================== |
---|
1045 | // |
---|
1046 | //=========================================== |
---|
1047 | Set_Map = function (nds) { |
---|
1048 | p0 = jQuery("#map").position(); |
---|
1049 | if (!p0) return; |
---|
1050 | |
---|
1051 | infos_map = jQuery("#map").infos(); |
---|
1052 | // if (infos_map.width == (Zone_image.container.width - p0.left)) return ; |
---|
1053 | nds = jQuery("#imageInfos").css("display"); |
---|
1054 | if (nds != "none") { |
---|
1055 | p2 = jQuery("#infoSwitcher").infos(); |
---|
1056 | p0.left += 35; |
---|
1057 | } |
---|
1058 | jQuery("#map").width(Zone_image.container.width - p0.left); |
---|
1059 | jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" }); |
---|
1060 | } |
---|
1061 | |
---|
1062 | jQuery("map [name='mapAutosize'] area").mouseover(function (e) { |
---|
1063 | return; |
---|
1064 | }); |
---|
1065 | //===================================== |
---|
1066 | // |
---|
1067 | //===================================== |
---|
1068 | theImage_init = function (Obj) { |
---|
1069 | if (jQuery("#derivativeSwitchBox").length > 0) { |
---|
1070 | id3 = jQuery("#derivativeCheckedAutosize"); |
---|
1071 | var pi = jQuery("#derivativeSwitchBox > span "); |
---|
1072 | var px = jQuery(".derivativeSizeDetails "); |
---|
1073 | i = 0; |
---|
1074 | n = 0; |
---|
1075 | var pt = new Array(); |
---|
1076 | jQuery("#derivativeSwitchBox a").each(function (i) { |
---|
1077 | href_path = jQuery(this).attr("href"); |
---|
1078 | if (href_path.match(RegExp("auto", "gi"))) return true; |
---|
1079 | pt[i] = href_path.split("'"); |
---|
1080 | }); |
---|
1081 | Calcul_Image(); |
---|
1082 | tw = Zone_image.container.width; |
---|
1083 | th = Zone_image.container.height; |
---|
1084 | n = 0; |
---|
1085 | jQuery(".derivativeSizeDetails").each(function (i) { |
---|
1086 | vn = jQuery(this).text().replace("(", "").replace(")", "").split("x"); |
---|
1087 | h0 = parseInt(vn[1]); |
---|
1088 | w0 = parseInt(vn[0]) |
---|
1089 | if (h0 > th) { |
---|
1090 | n = i; |
---|
1091 | return false; |
---|
1092 | } |
---|
1093 | if (w0 > tw) { |
---|
1094 | n = i; |
---|
1095 | return false; |
---|
1096 | } |
---|
1097 | n++; |
---|
1098 | }); |
---|
1099 | if (n > pt.length - 1) n = pt.length - 1; // format le plus grand |
---|
1100 | if (n < 0) n = 0; // format le plus grand |
---|
1101 | imgSrc = pt[n][1]; |
---|
1102 | last_map = pt[n][5]; |
---|
1103 | var theImg = document.getElementById(theMainImage_Id.replace("#", "")); |
---|
1104 | if (theImg.useMap.match(RegExp("map", "gi"))) return; |
---|
1105 | if (theImg.src.match(RegExp(imgSrc, "gi"))) return; |
---|
1106 | |
---|
1107 | href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "#Autosize" + "')"; |
---|
1108 | jQuery("#linkAutosize").attr("href", href_path); |
---|
1109 | changeImgSrc(imgSrc, last_map, "#Autosize"); |
---|
1110 | } |
---|
1111 | return false; |
---|
1112 | |
---|
1113 | }; |
---|
1114 | |
---|
1115 | //=============================================================== |
---|
1116 | // Fonctions générales |
---|
1117 | //=============================================================== |
---|
1118 | Set_llbgo = function (Force) { |
---|
1119 | if (Force) |
---|
1120 | if (typeof LlgboFr_Resize == "function") LlgboFr_Resize(); |
---|
1121 | // if (typeof updateXY != "function") return; |
---|
1122 | maps = jQuery("map[name^='map']"); |
---|
1123 | maps = jQuery("map[name='Autosize']"); |
---|
1124 | if (maps.length == 0) return; |
---|
1125 | |
---|
1126 | nom_map = 'Autosize'; |
---|
1127 | // nom_map = maps[0].name; |
---|
1128 | maps = jQuery("map[name='" + nom_map + "'] area"); |
---|
1129 | |
---|
1130 | |
---|
1131 | nb_zone = maps.length; |
---|
1132 | infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image |
---|
1133 | var Largeur_zone = (infos_theMainImage.width / nb_zone); |
---|
1134 | var Hauteur_zone = (infos_theMainImage.height); |
---|
1135 | var init_zone = 0; |
---|
1136 | j = 0; |
---|
1137 | maps.each(function (e) { |
---|
1138 | init_zone = Largeur_zone * j; |
---|
1139 | rel = jQuery(this).attr("rel"); |
---|
1140 | title = jQuery(this).attr("title"); |
---|
1141 | alt = jQuery(this).attr("alt"); |
---|
1142 | H = Hauteur_zone; |
---|
1143 | if (rel == "up") { |
---|
1144 | H = Hauteur_zone / 4; |
---|
1145 | } |
---|
1146 | coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone }; |
---|
1147 | jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" }); |
---|
1148 | j++; |
---|
1149 | }); |
---|
1150 | |
---|
1151 | return; |
---|
1152 | } |
---|
1153 | |
---|
1154 | /************************************************* |
---|
1155 | * correction pamoorama |
---|
1156 | *************************************************/ |
---|
1157 | Set_Pamoorama = function () { |
---|
1158 | if (Type_Img == "pamoorama") { |
---|
1159 | if (typeof myPamoorama == "undefined") { |
---|
1160 | return; |
---|
1161 | } |
---|
1162 | |
---|
1163 | Calcul_Image(); |
---|
1164 | infos_pamoorama = jQuery("#pamoorama").infos(); |
---|
1165 | infos_pamoorama_outter = jQuery("#pamoorama_outter").infos(); |
---|
1166 | infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); |
---|
1167 | infos_pamoorama_footer = jQuery("#pamoorama_footer").infos(); |
---|
1168 | infos_pamoorama_frame = jQuery("#pamoorama_frame").infos(); |
---|
1169 | infos_frame = jQuery(myPamoorama.frame).infos(); |
---|
1170 | |
---|
1171 | |
---|
1172 | //==================================================== |
---|
1173 | jQuery("#pamoorama").css({ |
---|
1174 | marginLeft: "auto", |
---|
1175 | marginRight: "auto" |
---|
1176 | // height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur; |
---|
1177 | }); |
---|
1178 | |
---|
1179 | infos_pamoorama_inner = jQuery("#pamoorama_inner").infos(); |
---|
1180 | infos_pamoorama = jQuery("#pamoorama").infos(); |
---|
1181 | |
---|
1182 | |
---|
1183 | |
---|
1184 | |
---|
1185 | marges_w = infos_pamoorama.borderwidth.left + |
---|
1186 | infos_pamoorama.margin.left + |
---|
1187 | infos_pamoorama.borderwidth.right + |
---|
1188 | infos_pamoorama.margin.right; |
---|
1189 | |
---|
1190 | marges_h = 10 + |
---|
1191 | infos_pamoorama.borderwidth.top + |
---|
1192 | infos_pamoorama.margin.top + |
---|
1193 | infos_pamoorama.borderwidth.bottom + |
---|
1194 | infos_pamoorama.margin.bottom; |
---|
1195 | marges_h += infos_pamoorama_footer.borderwidth.top + |
---|
1196 | infos_pamoorama_footer.margin.top + |
---|
1197 | infos_pamoorama_footer.borderwidth.bottom + |
---|
1198 | infos_pamoorama_footer.margin.bottom; |
---|
1199 | |
---|
1200 | jQuery("#pamoorama").css({ |
---|
1201 | width: "" |
---|
1202 | }); |
---|
1203 | |
---|
1204 | outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h; |
---|
1205 | Zoom_pano = outter_height / Zone_image.height_init; |
---|
1206 | |
---|
1207 | new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano), |
---|
1208 | width: Math.ceil(Zone_image.width_init * Zoom_pano) |
---|
1209 | } |
---|
1210 | |
---|
1211 | jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%" |
---|
1212 | }); |
---|
1213 | |
---|
1214 | // jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano); |
---|
1215 | // jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano); |
---|
1216 | |
---|
1217 | |
---|
1218 | //---------- test largeur image |
---|
1219 | new_width = Zone_image.container.width; |
---|
1220 | if (new_width > new_image.width) { |
---|
1221 | new_width = new_image.width; |
---|
1222 | jQuery("#pamoorama_outter").css({ |
---|
1223 | position: 'absolute', |
---|
1224 | align: "center", |
---|
1225 | margin: "auto" |
---|
1226 | }); |
---|
1227 | } |
---|
1228 | outter_width = new_width; |
---|
1229 | |
---|
1230 | |
---|
1231 | // jQuery("#pamoorama_thumb").width(200 / Zone_image.zoom); |
---|
1232 | |
---|
1233 | jQuery("#pamoorama_outter").css({ |
---|
1234 | |
---|
1235 | align: 'center', |
---|
1236 | margin: 'auto', |
---|
1237 | width: outter_width + "px", |
---|
1238 | height: outter_height + "px" |
---|
1239 | }); |
---|
1240 | //============= Mise à l'echelle ================== |
---|
1241 | jQuery("#pamoorama_footer").css({ |
---|
1242 | width: Zone_image.container.width + "px" |
---|
1243 | }); |
---|
1244 | |
---|
1245 | window.myPamoorama.options.width = Math.ceil(Zone_image.container.width); |
---|
1246 | //================================================================== |
---|
1247 | new_max_left = new_image.width - outter_width; |
---|
1248 | // jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano); |
---|
1249 | // jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano); |
---|
1250 | |
---|
1251 | |
---|
1252 | window.myPamoorama.outter.scrollTo(new_max_left, 0); |
---|
1253 | |
---|
1254 | window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0); |
---|
1255 | window.myPamoorama.ratio = Math.ceil(new_image.width / 200); |
---|
1256 | window.myPamoorama.imageWidth = new_image.width; |
---|
1257 | window.myPamoorama.imageHeight = new_image.height; |
---|
1258 | nf = jQuery("#pamoorama_thumb").height(); |
---|
1259 | jQuery("#pamoorama_thumb img").width(200); |
---|
1260 | jQuery("#pamoorama_thumb img").height(nf); |
---|
1261 | // 200=window.myPamoorama.width |
---|
1262 | // frame = Zone_image.container.width |
---|
1263 | |
---|
1264 | nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth; |
---|
1265 | jQuery("#pamoorama_frame").width(nw); |
---|
1266 | jQuery("#pamoorama").css({ |
---|
1267 | width: "auto", height: "auto" |
---|
1268 | }); |
---|
1269 | |
---|
1270 | } // test img |
---|
1271 | } // Set_Pamoorama |
---|
1272 | /*********************************************************/ |
---|
1273 | |
---|
1274 | Toggle_bp = function () { |
---|
1275 | options.cl_visible = !options.cl_visible; |
---|
1276 | Autosize_resize(); |
---|
1277 | Wait_Affichage(); |
---|
1278 | |
---|
1279 | } |
---|
1280 | //==================================== |
---|
1281 | // |
---|
1282 | //==================================== |
---|
1283 | set_cl = function (Valid) { |
---|
1284 | if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false; |
---|
1285 | |
---|
1286 | if (typeof options.cl_visible == "undefined") return; |
---|
1287 | if (typeof src1 == "undefined") return; |
---|
1288 | |
---|
1289 | if (options.cl_visible) src = src1; |
---|
1290 | else src = src2; |
---|
1291 | |
---|
1292 | if (options.cl_visible) { |
---|
1293 | src_info = src3; |
---|
1294 | src_infos_1 = src3; |
---|
1295 | } |
---|
1296 | else { |
---|
1297 | src_info = src4; |
---|
1298 | src_infos_1 = src5; |
---|
1299 | } |
---|
1300 | if (Valid) { |
---|
1301 | if (typeof Zone_image.image != "undefined") { |
---|
1302 | Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init); |
---|
1303 | zoom_cl = parseInt(100 * Zone_image.zoom); |
---|
1304 | jQuery('#zoom ').val(zoom_cl); |
---|
1305 | |
---|
1306 | zoom_cl = jQuery('#zoom ').val(); |
---|
1307 | |
---|
1308 | jQuery('#bp_cla').attr('alt', src_info); |
---|
1309 | jQuery('#bp_cla').attr('title', src_info); |
---|
1310 | jQuery('#bp_cla').attr('Stitle', src_info); |
---|
1311 | jQuery('#bp_cla').attr('Stip', zoom_cl + "%"); |
---|
1312 | jQuery('#bp_cla span').text(zoom_cl + "%"); |
---|
1313 | color_back = jQuery('#imageToolBar').css("backgroundColor"); |
---|
1314 | if (color_back.match(new RegExp("rgb", "gi"))) { |
---|
1315 | color_back = color_back.split("(")[1].split(")")[0].split(","); |
---|
1316 | color_back = "rgb(" + Math.abs(255 - color_back[0]) + "," |
---|
1317 | + Math.abs(255 - color_back[1]) + "," |
---|
1318 | + Math.abs(255 - color_back[2]) + ")"; |
---|
1319 | |
---|
1320 | } |
---|
1321 | else if (color_back.match(new RegExp("#", "gi"))) |
---|
1322 | color_back = Math.abs("#65536" - color_back); |
---|
1323 | else |
---|
1324 | color_back = jQuery('body').css("color"); |
---|
1325 | |
---|
1326 | |
---|
1327 | jQuery('#bp_cla span').css("color", color_back); |
---|
1328 | } |
---|
1329 | } else { |
---|
1330 | src = src6; |
---|
1331 | } |
---|
1332 | if (Zone_image.image) |
---|
1333 | jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")"); |
---|
1334 | bp_scr = jQuery('#bp_img_cla'); |
---|
1335 | |
---|
1336 | if (bp_scr.length > 0) { |
---|
1337 | src_enc = bp_scr.attr("src"); |
---|
1338 | if (!src_enc.match(src)) { |
---|
1339 | bp_scr.get(0).src = src; |
---|
1340 | jQuery('#bp_img_cla').attr('alt', src_info); |
---|
1341 | jQuery('#bp_img_cla').attr('title', src_info); |
---|
1342 | } |
---|
1343 | } |
---|
1344 | } |
---|
1345 | //==================================== |
---|
1346 | // |
---|
1347 | //==================================== |
---|
1348 | Calcul_Image = function () { |
---|
1349 | // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage |
---|
1350 | // + infos_imageInfos(red) |
---|
1351 | infos_window = jQuery(window).infos(); |
---|
1352 | infos_body = jQuery("body").infos(); // thePicturePage |
---|
1353 | infos_the_page = jQuery("#the_page").infos(); |
---|
1354 | // theHeader |
---|
1355 | // |
---|
1356 | infos_menubar = jQuery("#menubar").infos(); |
---|
1357 | infos_menubar_dl = jQuery("#menubar dl").infos(); |
---|
1358 | infos_content = jQuery("#content").infos(); |
---|
1359 | // imageHeaderBar |
---|
1360 | // imageToolBar imageInfoBar |
---|
1361 | infos_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
1362 | infos_imageToolBar = jQuery("#imageToolBar").infos(); |
---|
1363 | //theImageAndTitle |
---|
1364 | infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); |
---|
1365 | if (infos_theImageAndInfos.width == 0) |
---|
1366 | infos_theImageAndInfos = jQuery("#theImageAndTitle").infos(); |
---|
1367 | infos_theImage = jQuery("#theImage").infos(); |
---|
1368 | /**************************************** |
---|
1369 | * marginl r 10 10,borderwidth 5 5, padding 10 10 |
---|
1370 | * infos_theImage width 849 , (+padding) out 869,(+border) ext 879 ,(+marge) general 899 |
---|
1371 | * general marges width 50 l25+r25, |
---|
1372 | ****************************************/ |
---|
1373 | |
---|
1374 | infos_imageInfos = jQuery("#imageInfos").infos(); |
---|
1375 | infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image |
---|
1376 | infos_theMainImage.src = jQuery(theMainImage_Id).attr("src"); |
---|
1377 | |
---|
1378 | // commentContent |
---|
1379 | // copyright |
---|
1380 | |
---|
1381 | pos_top = options.pos_top; |
---|
1382 | pos_top = options.pos_top + infos_llgbo.top |
---|
1383 | |
---|
1384 | container = { |
---|
1385 | height: infos_window.height - pos_top, |
---|
1386 | width: infos_content.width |
---|
1387 | } |
---|
1388 | marge_left = infos_theImage.general.marges.left; |
---|
1389 | marge_right = infos_theImage.general.marges.right; |
---|
1390 | marge_top = infos_theImage.general.marges.top + infos_content.general.marges.top + 2; |
---|
1391 | marge_bottom = infos_theImage.general.marges.bottom + Math.ceil(options.marge_basse) + infos_content.general.marges.bottom; ; |
---|
1392 | |
---|
1393 | //========================================================== |
---|
1394 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
1395 | infos_the_page.margin.left = 20; //taille fleche |
---|
1396 | infos_the_page.margin.right = 20; |
---|
1397 | } |
---|
1398 | |
---|
1399 | |
---|
1400 | if (theme.match(RegExp("elegant", "gi"))) { |
---|
1401 | jQuery("#imageInfos").css({ position: "absolute", right: 0, margin: "auto" |
---|
1402 | , top: 0 |
---|
1403 | }); |
---|
1404 | |
---|
1405 | |
---|
1406 | // marge_right += infos_content.general.marges.right; |
---|
1407 | if (infos_imageInfos.visible == true) { |
---|
1408 | marge_right += infos_imageInfos.width + 2; |
---|
1409 | |
---|
1410 | } else { |
---|
1411 | marge_right += 15; |
---|
1412 | |
---|
1413 | } |
---|
1414 | marge_left += 5; |
---|
1415 | marge_top += 20; |
---|
1416 | |
---|
1417 | } else if (theme.match(RegExp("stripped", "gi"))) { |
---|
1418 | |
---|
1419 | } else if (theme.match(RegExp("simple", "gi"))) { |
---|
1420 | |
---|
1421 | |
---|
1422 | } else if (theme.match(RegExp("OS", "gi"))) { |
---|
1423 | |
---|
1424 | } else if (theme.match(RegExp("pur", "gi"))) { |
---|
1425 | |
---|
1426 | marge_right += 25; |
---|
1427 | |
---|
1428 | } else { |
---|
1429 | // jQuery("#menuSwitcher").hide(); |
---|
1430 | |
---|
1431 | margeLeft = infos_content.margin.left; |
---|
1432 | if (infos_menubar_dl.visible == true) { |
---|
1433 | margeLeft += infos_body.general.marges.width + infos_menubar.general.width; |
---|
1434 | } |
---|
1435 | else |
---|
1436 | |
---|
1437 | margeLeft += infos_thePicturePage.general.marges.width; |
---|
1438 | // container.width -= margeLeft; |
---|
1439 | |
---|
1440 | |
---|
1441 | } |
---|
1442 | |
---|
1443 | |
---|
1444 | |
---|
1445 | //========== Format Image ============== |
---|
1446 | retrait_img_h = Math.ceil(options.marges_llgbo || 0) |
---|
1447 | + infos_theMainImage.general.marges.height |
---|
1448 | ; |
---|
1449 | //=============================================================== |
---|
1450 | retrait_img = Math.ceil(infos_theMainImage.general.marges.width); |
---|
1451 | retrait_img += Math.ceil(options.marges_llgbo || 0); |
---|
1452 | retrait_img += 0; |
---|
1453 | |
---|
1454 | //================== Limite Format Image ===================== |
---|
1455 | image_max = { |
---|
1456 | height: container.height - marge_top - marge_bottom - retrait_img_h, |
---|
1457 | width: container.width - marge_left - marge_right - retrait_img |
---|
1458 | } |
---|
1459 | //================================================================ |
---|
1460 | if (typeof Zone_image.height_init == "undefined") { |
---|
1461 | init_img(theImg); |
---|
1462 | Zone_image.width_init = img_init.width; |
---|
1463 | Zone_image.height_init = img_init.height; |
---|
1464 | Zone_image.height_init = Math.ceil(img_init.height); |
---|
1465 | Zone_image.rapport_init = Math.ceil(img_init.width / Zone_image.height_init); |
---|
1466 | rapport = Zone_image.rapport_init; |
---|
1467 | } |
---|
1468 | |
---|
1469 | theMainImage_str = theMainImage_Id.replace("#", ""); |
---|
1470 | useMap_en_cours = jQuery(theMainImage_Id).attr("useMap"); |
---|
1471 | |
---|
1472 | var theImg = document.getElementById(theMainImage_str); |
---|
1473 | if (theImg) { |
---|
1474 | if (useMap_en_cours.match(RegExp("map", "gi"))) { |
---|
1475 | image_max.height = jQuery(theImg).height() - retrait_img_h; |
---|
1476 | image_max.width = jQuery(theImg).width() - retrait_img; |
---|
1477 | width_theMainImage = image_max.width; |
---|
1478 | height_theMainImage = image_max.height; |
---|
1479 | } else { |
---|
1480 | //========================= |
---|
1481 | // test débordement |
---|
1482 | //========================= |
---|
1483 | rapport = Zone_image.rapport_init; |
---|
1484 | width_theMainImage = Math.ceil(image_max.width); |
---|
1485 | height_theMainImage = Math.ceil(width_theMainImage / rapport); |
---|
1486 | |
---|
1487 | container.height_interne = container.height - marge_top - marge_bottom; |
---|
1488 | container.width_interne = container.width - marge_left - marge_right; |
---|
1489 | |
---|
1490 | if (height_theMainImage > container.height_interne) { |
---|
1491 | image_max.height = container.height_interne; |
---|
1492 | image_max.width = image_max.height * rapport; |
---|
1493 | width_theMainImage = Math.ceil(image_max.width); |
---|
1494 | height_theMainImage = Math.ceil(image_max.height); |
---|
1495 | } |
---|
1496 | if (width_theMainImage > container.width_interne) { |
---|
1497 | image_max.width = container.width_interne; |
---|
1498 | image_max.height = image_max.height / rapport; |
---|
1499 | width_theMainImage = Math.ceil(image_max.width); |
---|
1500 | height_theMainImage = Math.ceil(image_max.height); |
---|
1501 | |
---|
1502 | } else if (width_theMainImage > container.width) { |
---|
1503 | |
---|
1504 | } else { |
---|
1505 | |
---|
1506 | } |
---|
1507 | } |
---|
1508 | //=============================================================== |
---|
1509 | } |
---|
1510 | if (Type_Img != "pamoorama") { |
---|
1511 | |
---|
1512 | } |
---|
1513 | |
---|
1514 | //================================================= |
---|
1515 | rapport = Zone_image.rapport_init; |
---|
1516 | |
---|
1517 | height_theMainImage = Math.ceil(width_theMainImage / rapport); |
---|
1518 | container.height = height_theMainImage + retrait_img_h + infos_theImage.general.marges.top + pos_top; |
---|
1519 | |
---|
1520 | //================================================================ |
---|
1521 | Zone_image.image = { |
---|
1522 | width: width_theMainImage, |
---|
1523 | height: height_theMainImage |
---|
1524 | }; |
---|
1525 | |
---|
1526 | Zone_image.container = { |
---|
1527 | width: container.width, |
---|
1528 | height: container.height |
---|
1529 | |
---|
1530 | }; |
---|
1531 | //================================================================= |
---|
1532 | |
---|
1533 | Zone_image.src = jQuery(theMainImage_Id).attr("src"); |
---|
1534 | |
---|
1535 | |
---|
1536 | Zone_image.zoom = Zone_image.image.height / Zone_image.height_init; |
---|
1537 | |
---|
1538 | } |
---|
1539 | |
---|
1540 | /********************************************* |
---|
1541 | * Calcul l es dimensions. |
---|
1542 | *********************************************/ |
---|
1543 | Get_dimensions = function (force, parametres) { |
---|
1544 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
1545 | Zone_image.src = infos_theMainImage.src; |
---|
1546 | if (typeof rapport == "undefined") return; |
---|
1547 | if (force && force == true) old_window.width = 0; |
---|
1548 | |
---|
1549 | |
---|
1550 | if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi"))) |
---|
1551 | infos_theMainImage.useMap = "#Autosize"; |
---|
1552 | |
---|
1553 | useMap = options.useMap; |
---|
1554 | |
---|
1555 | if (theme.match("simple")) useMap = "#Autosize"; |
---|
1556 | if (typeof useMap == "") useMap = "#Autosize"; |
---|
1557 | if (options.useMap) { |
---|
1558 | // useMap = options.useMap; |
---|
1559 | } |
---|
1560 | if (useMap) { |
---|
1561 | if (!useMap.match(RegExp("Autosize", "gi"))) { |
---|
1562 | return; |
---|
1563 | } |
---|
1564 | } |
---|
1565 | |
---|
1566 | if (options.imageAutosize) { |
---|
1567 | return; //stripped |
---|
1568 | } |
---|
1569 | |
---|
1570 | if (typeof options.cl_visible == "undefined") return; |
---|
1571 | if (!options.cl_visible == true) { return; } |
---|
1572 | //====================================================== |
---|
1573 | |
---|
1574 | var chk = eval("options." + user_status + "_enabled"); |
---|
1575 | if (chk == "") { return; } |
---|
1576 | |
---|
1577 | if (!options.useMap.match(RegExp("Autosize", "gi"))) { |
---|
1578 | |
---|
1579 | return; |
---|
1580 | } |
---|
1581 | |
---|
1582 | //================================================================= |
---|
1583 | infos_widow = jQuery(window).infos(); |
---|
1584 | var winwidth = infos_body.width; |
---|
1585 | var winheight = infos_body.height; |
---|
1586 | if (Type_Img == "pamoorama") { |
---|
1587 | theMainImage_Id = "#pamoorama"; |
---|
1588 | Calcul_Image(); |
---|
1589 | } else { |
---|
1590 | Calcul_Image(); |
---|
1591 | } |
---|
1592 | img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; |
---|
1593 | //================================================================= |
---|
1594 | old_window = jQuery(window).infos(); |
---|
1595 | //========= Récupération des informations ============= |
---|
1596 | var Licence = jQuery(".licencetag"); |
---|
1597 | infos_Licence = jQuery(".licencetag").infos(); |
---|
1598 | //================================================================= |
---|
1599 | switch (Type_Img) { |
---|
1600 | case "map": |
---|
1601 | Set_Map(true); |
---|
1602 | break |
---|
1603 | case "panorama": |
---|
1604 | if (!theMainImage_Id) { |
---|
1605 | theMainImage_Id = "#theMainImage"; |
---|
1606 | if (theMainImage_Id.length > 0) |
---|
1607 | return; |
---|
1608 | theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]"); |
---|
1609 | |
---|
1610 | if (theMainImage_Id.length > 0) |
---|
1611 | theMainImage_Id = theMainImage_Id[0]; |
---|
1612 | else |
---|
1613 | theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]"); |
---|
1614 | } |
---|
1615 | infos_theImage = jQuery(theMainImage_Id).infos(); |
---|
1616 | infos_the_page = jQuery("#the_page").infos(); |
---|
1617 | jQuery("#theImage").height(infos_theImage.height); |
---|
1618 | img_finale.height = infos_theImage.height; |
---|
1619 | break |
---|
1620 | case "img": |
---|
1621 | |
---|
1622 | if (!theMainImage_Id) return; |
---|
1623 | if (theme.match(RegExp("luciano", "g"))) { |
---|
1624 | |
---|
1625 | } |
---|
1626 | |
---|
1627 | infos_the_page = jQuery("#the_page").infos(); |
---|
1628 | |
---|
1629 | |
---|
1630 | break |
---|
1631 | case "img_autre": |
---|
1632 | if (!theMainImage_Id) { |
---|
1633 | if (DEBUG_autosize == "true") alert("The_MainImage=null"); |
---|
1634 | return; |
---|
1635 | |
---|
1636 | } |
---|
1637 | infos_theImage = jQuery(theMainImage_Id).infos(); |
---|
1638 | infos_the_page = jQuery("#the_page").infos(); |
---|
1639 | |
---|
1640 | |
---|
1641 | break |
---|
1642 | case "embed": |
---|
1643 | // |
---|
1644 | if (infos_theMainImage.width == 0) |
---|
1645 | infos_theMainImage = jQuery("#thePicturePage").infos(); |
---|
1646 | if (infos_theMainImage.width == 0) |
---|
1647 | infos_theMainImage = jQuery("#the_page").infos(); |
---|
1648 | infos_theImage = infos_theMainImage; |
---|
1649 | infos_the_page = jQuery("#the_page").infos(); |
---|
1650 | Bandeau_bas.height = Bandeau_bas.top; |
---|
1651 | |
---|
1652 | iph1 = jQuery("#theImage div").infos(); |
---|
1653 | if ((winheight - iph1.bottom) > 0) |
---|
1654 | Bandeau_bas.height = (winheight - iph1.bottom) + 50; |
---|
1655 | else |
---|
1656 | Bandeau_bas.height = 50; |
---|
1657 | |
---|
1658 | |
---|
1659 | if (rapport < 0) { |
---|
1660 | img_height = infos_theMainImage.height; |
---|
1661 | img_width = infos_theMainImage.width; |
---|
1662 | img_reelle.height = img_height; |
---|
1663 | img_reelle.width = img_width; |
---|
1664 | } |
---|
1665 | |
---|
1666 | break |
---|
1667 | case "charlie": |
---|
1668 | img_reelle = { height: img_height, width: img_width }; |
---|
1669 | infos_theMainImage = jQuery(theMainImage_Id).infos(); ; |
---|
1670 | infos_the_page = jQuery("#the_page").infos(); |
---|
1671 | if (rapport < 0) { |
---|
1672 | img_height = parseInt(infos_theMainImage.height); |
---|
1673 | img_width = parseInt(infos_theMainImage.width); |
---|
1674 | img_reelle.height = parseInt(infos_theMainImage.height); |
---|
1675 | img_reelle.width = parseInt(infos_theMainImage.width); |
---|
1676 | } |
---|
1677 | break |
---|
1678 | |
---|
1679 | |
---|
1680 | case "pamoorama": |
---|
1681 | img_reelle = { height: img_height, width: img_width }; |
---|
1682 | //========================================================= |
---|
1683 | img_reelle.height = img_height; |
---|
1684 | img_reelle.width = Zone_Affichage.width; |
---|
1685 | if (typeof myPamoorama != "undefined") theMainImage_Id = myPamoorama.image; |
---|
1686 | infos_theImage = jQuery("#pamoorama").infos(); |
---|
1687 | infos_theImage.height = infos_theImage.height; |
---|
1688 | infos_the_page = jQuery("#the_page").infos(); |
---|
1689 | break |
---|
1690 | } |
---|
1691 | |
---|
1692 | img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; |
---|
1693 | return true; |
---|
1694 | |
---|
1695 | //================= Vérification Taille image minimun autorisée ======== |
---|
1696 | MinWidth = jQuery(theMainImage_Id).css("minWidth"); |
---|
1697 | if (MinWidth == "0px") |
---|
1698 | MinWidth = options.mini_width; |
---|
1699 | MinHeight = jQuery(theMainImage_Id).css("minHeight"); |
---|
1700 | if (MinHeight == "0px") |
---|
1701 | MinHeight = options.mini_height; |
---|
1702 | |
---|
1703 | MaxWidth = jQuery(theMainImage_Id).css("maxWidth"); |
---|
1704 | if (MaxWidth == "0px") |
---|
1705 | MaxWidth = winwidth; |
---|
1706 | MaxHeight = jQuery(theMainImage_Id).css("maxHeight"); |
---|
1707 | if (MaxHeight == "0px") |
---|
1708 | MaxHeight = winheight; |
---|
1709 | |
---|
1710 | //=============== Vérification taille minimale autorizée ====================== |
---|
1711 | var miniWidth = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width); |
---|
1712 | var miniHeight = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height); |
---|
1713 | if (winwidth < options.mini_width2) mini_width2 = winwidth; |
---|
1714 | |
---|
1715 | var miniWidth2 = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width2); |
---|
1716 | var miniHeight2 = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height2); |
---|
1717 | |
---|
1718 | |
---|
1719 | var maxWidth = jQuery(theMainImage_Id).Get_Val_int(MaxWidth, winwidth, "0"); |
---|
1720 | maxHeight = jQuery(theMainImage_Id).Get_Val_int(MaxHeight, winheight, "0"); |
---|
1721 | |
---|
1722 | mini_width = parseInt(miniWidth); |
---|
1723 | mini_height = parseInt(miniHeight); |
---|
1724 | img_reelle.width = parseInt(img_reelle.width); |
---|
1725 | if (img_reelle.width < mini_width) |
---|
1726 | return; |
---|
1727 | img_reelle.height = parseInt(img_reelle.height); |
---|
1728 | if (img_reelle.height < parseInt(mini_height)) |
---|
1729 | return; |
---|
1730 | |
---|
1731 | |
---|
1732 | |
---|
1733 | |
---|
1734 | //================================================= |
---|
1735 | if (Zone_image.image.height < options.mini_height2) |
---|
1736 | Zone_image.image.height = options.mini_height2; |
---|
1737 | if (Zone_image.image.width < options.mini_width2) |
---|
1738 | Zone_image.image.width = options.mini_width2; |
---|
1739 | //================================================== |
---|
1740 | // Image_width largeur à atteindre |
---|
1741 | // Calcul du rapport d'agrandissement |
---|
1742 | echelle_max = parseFloat(options.echelle_max, '3'); |
---|
1743 | if (Zone_image.zoom > echelle_max) { |
---|
1744 | Zone_image.zoom = echelle_max; |
---|
1745 | Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom); |
---|
1746 | if (rapport > 0) |
---|
1747 | Zone_image.image.height = parseInt(Zone_image.width_init / rapport); |
---|
1748 | } |
---|
1749 | //============================================================= |
---|
1750 | var height_user = eval("options." + user_status + "_height"); |
---|
1751 | var width_user = eval("options." + user_status + "_width"); |
---|
1752 | var reg1 = new RegExp("%", "g"); |
---|
1753 | //============================================================= |
---|
1754 | if (height_user.match(reg1)) |
---|
1755 | Image_height = Zone_image.height_init * parseInt(height_user) / 100; |
---|
1756 | else |
---|
1757 | Image_height = parseInt(height_user); |
---|
1758 | //============================================================== |
---|
1759 | |
---|
1760 | Image_width = parseInt(Image_height * rapport); |
---|
1761 | |
---|
1762 | //====================================================================== |
---|
1763 | img_finale = { width: Zone_image.image.width, height: Zone_image.image.height }; |
---|
1764 | return true; |
---|
1765 | |
---|
1766 | |
---|
1767 | |
---|
1768 | |
---|
1769 | |
---|
1770 | |
---|
1771 | |
---|
1772 | //=================================================== |
---|
1773 | |
---|
1774 | img_finale.height = Image_height; |
---|
1775 | img_finale.width = Image_width; |
---|
1776 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
1777 | img_finale.width -= (llgboframe.top * 2); |
---|
1778 | if (rapport > 0) img_finale.height = (img_finale.width / rapport); |
---|
1779 | else img_finale.height -= (llgboframe.top * 2); |
---|
1780 | |
---|
1781 | } |
---|
1782 | zoom = echelle; |
---|
1783 | if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) { |
---|
1784 | //=============LLGBO2 =========================== |
---|
1785 | t1 = llgboframe; |
---|
1786 | if (!theMainImage_Id.src) { |
---|
1787 | theMainImage_Id = jQuery(llgbo_id).find("img").get(0) |
---|
1788 | if (!theMainImage_Id.src) { |
---|
1789 | theMainImage_Id = jQuery("#theImage").find("div").get(0) |
---|
1790 | } |
---|
1791 | } |
---|
1792 | if (theMainImage_Id.src) { |
---|
1793 | wingbo = img_finale.width; |
---|
1794 | heightgbo = img_finale.height; |
---|
1795 | if (Type_Img == "panorama") { |
---|
1796 | heightgbo = infos_theImage.height; |
---|
1797 | img_finale.height = infos_theImage.height; |
---|
1798 | } |
---|
1799 | |
---|
1800 | |
---|
1801 | |
---|
1802 | |
---|
1803 | // jQuery("#theImage").height(heightgbo + marges_llgbo / 2); |
---|
1804 | } |
---|
1805 | } |
---|
1806 | |
---|
1807 | //================ Zone affichage ========================= |
---|
1808 | |
---|
1809 | // jQuery("#theImage").css("top", "0px"); |
---|
1810 | jQuery("#standard").css("top", 0 + "px"); |
---|
1811 | jQuery("#comments").css("top", 0 + "px"); |
---|
1812 | //========== Image Remise à l'échelle ======================= |
---|
1813 | |
---|
1814 | img_finale.height = parseInt(img_finale.height); |
---|
1815 | img_finale.width = parseInt(img_finale.width); |
---|
1816 | //========================================================================= |
---|
1817 | //=== cadre = theImage |
---|
1818 | if (theme.match(RegExp("simple", "gi"))) { |
---|
1819 | jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black |
---|
1820 | jQuery("#theImage").css({ width: Zone_Affichage.width + "px", |
---|
1821 | marginLeft: "auto" |
---|
1822 | }); |
---|
1823 | |
---|
1824 | } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) { |
---|
1825 | jQuery("#theImage").css({ width: "auto", marginLeft: "auto" }); |
---|
1826 | } else if (theme.match(RegExp("saruka", "gi"))) { |
---|
1827 | |
---|
1828 | jQuery("#theImage").css({ width: Zone_Affichage.width + "px" }); |
---|
1829 | } else if (theme.match(RegExp("elegant", "gi"))) { |
---|
1830 | |
---|
1831 | // jQuery("#theImage").css("width", "auto"); |
---|
1832 | jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur |
---|
1833 | |
---|
1834 | } else { |
---|
1835 | jQuery("#theImage").css("width", "auto"); |
---|
1836 | |
---|
1837 | } |
---|
1838 | // ; |
---|
1839 | |
---|
1840 | if (Type_Img == "panorama" || Type_Img == "pamoorama") { |
---|
1841 | img_finale.height = infos_theImage.height; |
---|
1842 | Zone_Affichage.height = img_finale.height; |
---|
1843 | |
---|
1844 | } |
---|
1845 | |
---|
1846 | if (typeof (gmaps) != "undefined") { |
---|
1847 | Gmap_ = gmaps.maps[0]; |
---|
1848 | if (Gmap_.sizeMode == 'A') { |
---|
1849 | jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" }); |
---|
1850 | |
---|
1851 | } |
---|
1852 | } |
---|
1853 | //============= flv,mov,mpg ok |
---|
1854 | /* wmv nok |
---|
1855 | * avi nok |
---|
1856 | //=========================================== |
---|
1857 | */ |
---|
1858 | if (Type_Img == "charlie") { |
---|
1859 | t1 = jQuery("#charlie").infos(); |
---|
1860 | |
---|
1861 | /**/ |
---|
1862 | |
---|
1863 | pdf = 0; |
---|
1864 | jQuery("#charlie div").each(function (i) { |
---|
1865 | |
---|
1866 | |
---|
1867 | p1 = jQuery(this).infos(); |
---|
1868 | pdf += p1.padding.right + p1.padding.left; |
---|
1869 | }); |
---|
1870 | img_finale.width -= pdf; |
---|
1871 | |
---|
1872 | jQuery("#charlie").css({ |
---|
1873 | width: img_finale.width + pdf + "px", |
---|
1874 | height: img_finale.height + "px", |
---|
1875 | marginLeft: "auto" |
---|
1876 | }); |
---|
1877 | |
---|
1878 | |
---|
1879 | if (MainImage.length > 0) { |
---|
1880 | img_finale.height = parseInt(img_finale.width / rapport); |
---|
1881 | img_finale.height -= 30; |
---|
1882 | img_finale.width = rapport * img_finale.height; |
---|
1883 | |
---|
1884 | |
---|
1885 | MainImage.width(img_finale.width); |
---|
1886 | MainImage.height(img_finale.height); |
---|
1887 | jQuery("#embedplayer").width(300); |
---|
1888 | jQuery("#embedplayer").height(15); |
---|
1889 | } else { |
---|
1890 | jQuery("#player").css("width", img_finale.width + "px"); |
---|
1891 | jQuery("#player").css("height", img_finale.height + "px"); |
---|
1892 | |
---|
1893 | jQuery("#embedplayer").css("width", img_finale.width + "px"); |
---|
1894 | jQuery("#embedplayer").css("height", img_finale.height + "px"); |
---|
1895 | |
---|
1896 | jQuery("embed").css({ width: img_finale.width + "px", |
---|
1897 | height: img_finale.height + "px" |
---|
1898 | }); |
---|
1899 | jQuery("object").css({ width: img_finale.width + "px", |
---|
1900 | height: img_finale.height + "px" |
---|
1901 | }); |
---|
1902 | jQuery("video").css({ width: img_finale.width + "px", |
---|
1903 | height: img_finale.height + "px" |
---|
1904 | }); |
---|
1905 | |
---|
1906 | |
---|
1907 | |
---|
1908 | jQuery("video").height(img_finale.height); |
---|
1909 | jQuery("video").width(img_finale.width); |
---|
1910 | |
---|
1911 | jQuery("object").width(img_finale.width); |
---|
1912 | jQuery("object").height(img_finale.height); |
---|
1913 | //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //?? |
---|
1914 | |
---|
1915 | jQuery(theMainImage_Id).height(img_finale.height); |
---|
1916 | jQuery("#theImage").css("height", "auto"); |
---|
1917 | } |
---|
1918 | |
---|
1919 | |
---|
1920 | } else if (Type_Img == "embed") { |
---|
1921 | |
---|
1922 | if (MainImage.length > 0) { |
---|
1923 | img_finale.height = parseInt(img_finale.width / rapport); |
---|
1924 | img_finale.height -= 30; |
---|
1925 | img_finale.width = rapport * img_finale.height; |
---|
1926 | |
---|
1927 | |
---|
1928 | MainImage.width(img_finale.width); |
---|
1929 | MainImage.height(img_finale.height); |
---|
1930 | jQuery("#embedplayer").width(300); |
---|
1931 | jQuery("#embedplayer").height(15); |
---|
1932 | } else { |
---|
1933 | jQuery("#theImage").css("height", "auto"); |
---|
1934 | jQuery("embed").css("height", img_finale.height); |
---|
1935 | jQuery("object").css({ height: img_finale.height + "px" }); |
---|
1936 | |
---|
1937 | jQuery("object").width(img_finale.width); |
---|
1938 | jQuery("object").height(img_finale.height); |
---|
1939 | } |
---|
1940 | |
---|
1941 | } else if (Type_Img == "panorama") { |
---|
1942 | if (typeof asp_options != "undefined") |
---|
1943 | n = asp_options; |
---|
1944 | n1 = jQuery("#Panorama div").width(); |
---|
1945 | jQuery(".panorama-viewport").css("margin", "auto"); |
---|
1946 | n = infos_imageToolBar; |
---|
1947 | |
---|
1948 | |
---|
1949 | } else if (Type_Img == "pamoorama") { |
---|
1950 | Set_Pamoorama(); |
---|
1951 | |
---|
1952 | |
---|
1953 | |
---|
1954 | |
---|
1955 | } else if (theMainImage_Id != null && theMainImage_Id.src) { |
---|
1956 | //--- background ?? --- |
---|
1957 | jQuery(theMainImage_Id).height(img_finale.height); |
---|
1958 | jQuery(theMainImage_Id).width(img_finale.width); |
---|
1959 | jQuery(theMainImage_Id).css({ height: img_finale.height + "px ", |
---|
1960 | width: img_finale.width + "px " |
---|
1961 | }); |
---|
1962 | |
---|
1963 | |
---|
1964 | } else { |
---|
1965 | //===map ? luciano === |
---|
1966 | // jQuery(theMainImage_Id).css({ height: img_finale.height + "px ", width: img_finale.width + "px }); |
---|
1967 | // jQuery(theMainImage_Id).height(img_finale.height ); |
---|
1968 | // jQuery(theMainImage_Id).width(img_finale.width ); |
---|
1969 | // jQuery(theMainImage_Id).attr({ width: img_finale.width }); |
---|
1970 | h = img_finale.height; |
---|
1971 | h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom; |
---|
1972 | h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top); |
---|
1973 | |
---|
1974 | jQuery(theMainImage_Id).attr({ height: h - 3 }); //image |
---|
1975 | if (theme.match(RegExp("elegant", "gi"))) { |
---|
1976 | return true; |
---|
1977 | |
---|
1978 | } |
---|
1979 | if (theme.match(RegExp("luciano", "g"))) { |
---|
1980 | imgl = 180; |
---|
1981 | l = Zone_Affichage.left; |
---|
1982 | |
---|
1983 | jQuery(".imageNumber").css({ left: l + "px" |
---|
1984 | |
---|
1985 | }); |
---|
1986 | jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ", |
---|
1987 | width: (img_finale.width - imgl) + "px ", marginTop: "0px" |
---|
1988 | }) |
---|
1989 | } |
---|
1990 | |
---|
1991 | } |
---|
1992 | |
---|
1993 | var theImg = document.getElementById(theMainImage_Id.replace("#", "")); |
---|
1994 | if (theImg) { |
---|
1995 | theImg.removeAttribute("width"); |
---|
1996 | theImg.removeAttribute("height"); |
---|
1997 | jQuery(theMainImage_Id).css("width", img_finale.width + "px"); |
---|
1998 | } |
---|
1999 | |
---|
2000 | jQuery("#navThumbPrev").css({ overflow: "hidden" }); |
---|
2001 | jQuery("#navThumbNext").css({ overflow: "hidden" }); |
---|
2002 | n = typeof inittoolbar; |
---|
2003 | if (Type_Img == "map") { |
---|
2004 | jQuery("#navThumbNext").css({ display: 'none' }); |
---|
2005 | jQuery("#navThumbPrev").css({ display: 'none' }); |
---|
2006 | jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px", |
---|
2007 | width: winwidth + "px", |
---|
2008 | height: winheight + "px" |
---|
2009 | }); |
---|
2010 | //mapPicture |
---|
2011 | } |
---|
2012 | try { |
---|
2013 | if (theme.match(RegExp("gally", "gi"))) { |
---|
2014 | if (typeof inittoolbar == "function") { |
---|
2015 | if (typeof (currentTab) == "undefined") inittoolbar(); |
---|
2016 | else initializeImageMode("resize"); |
---|
2017 | } else { |
---|
2018 | tp = gallyPP.getImageProp(); |
---|
2019 | if (typeof (GallyPP) == "function") |
---|
2020 | gallyPP = new GallyPP(); |
---|
2021 | |
---|
2022 | iph = jQuery("#imageHeaderBar").infos(); |
---|
2023 | jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" }); |
---|
2024 | jQuery("#theImage").width(winwidth); |
---|
2025 | } |
---|
2026 | //=========================================================================== |
---|
2027 | if (jQuery("#navThumbPrev").length > 0) { |
---|
2028 | jQuery("#navThumbPrevContainer").css({ left: "0px" |
---|
2029 | }); |
---|
2030 | } |
---|
2031 | if (jQuery("#navThumbNext").length > 0) { |
---|
2032 | jQuery("#navThumbNextContainer").css({ left: "0px" |
---|
2033 | }); |
---|
2034 | } |
---|
2035 | //============================================================================= |
---|
2036 | if (!theme.match(RegExp("lapis", "gi"))) { |
---|
2037 | if (typeof initializeImageMode == "function") { |
---|
2038 | initializeImageMode("resize"); |
---|
2039 | } |
---|
2040 | |
---|
2041 | } |
---|
2042 | |
---|
2043 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
2044 | |
---|
2045 | jQuery("#imageToolBar").css({ position: "static" }); |
---|
2046 | |
---|
2047 | infos_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
2048 | if (infos_imageInfoBar.bottom < infos_theMainImage.bottom) { |
---|
2049 | // jQuery("#imageInfoBar").height(infos_theMainImage.bottom); |
---|
2050 | } |
---|
2051 | |
---|
2052 | } else { |
---|
2053 | |
---|
2054 | // jQuery("#imageToolBar").css("position", "static"); |
---|
2055 | } |
---|
2056 | } catch (e) { |
---|
2057 | |
---|
2058 | } |
---|
2059 | zoom = img_finale.height / img_height; |
---|
2060 | h0 = jQuery("#content").height(); |
---|
2061 | if (h0 == null) { |
---|
2062 | h0 = winheight - Zone_Affichage.top; |
---|
2063 | } |
---|
2064 | h1 = (h0 - img_finale.height) / 2; |
---|
2065 | // jQuery("#theImage").css({ marginTop: h1 + "px" }); |
---|
2066 | |
---|
2067 | zoom = parseInt(zoom * 100); |
---|
2068 | jQuery('#zoom ').val(zoom); |
---|
2069 | |
---|
2070 | |
---|
2071 | |
---|
2072 | // --- réglage de la hauteur de page en fonction du copyright----------- |
---|
2073 | if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos(); |
---|
2074 | |
---|
2075 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
2076 | var TitleBox = jQuery("#imageTitleContainer"); |
---|
2077 | if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); |
---|
2078 | } else { |
---|
2079 | |
---|
2080 | } |
---|
2081 | |
---|
2082 | |
---|
2083 | /* |
---|
2084 | if (!theme.match(RegExp("luciano", "gi"))) { |
---|
2085 | jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); |
---|
2086 | jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); |
---|
2087 | jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); |
---|
2088 | } |
---|
2089 | */ |
---|
2090 | infos_frame = jQuery("#theImage").infos(); |
---|
2091 | if (theme.match(RegExp("stripped", "gi"))) { |
---|
2092 | /* |
---|
2093 | infos_theImageBox = jQuery("#theImageAndTitle").infos(); |
---|
2094 | p1 = jQuery(".randomButtons").infos(); |
---|
2095 | p2 = jQuery("#imageHeaderBar").infos(); |
---|
2096 | p3 = infos_content.top; |
---|
2097 | p1 = options.imageAutosizeTitle; |
---|
2098 | |
---|
2099 | jQuery("#theImage").width("width", infos_theImageBox.width + "px"); |
---|
2100 | //jQuery("#theImageAndTitle").css("position", "relative"); |
---|
2101 | jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px", |
---|
2102 | paddingTop: "0px", textAalign: "center", marginLeft: "auto" |
---|
2103 | }); |
---|
2104 | |
---|
2105 | jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px", |
---|
2106 | paddingTop: "0px", marginLeft: "auto" |
---|
2107 | }); */ |
---|
2108 | t1 = infos_theImageBox.top; |
---|
2109 | l1 = infos_theImageBox.left; |
---|
2110 | // infos_theImageBox = jQuery("#theImage").infos(); |
---|
2111 | |
---|
2112 | } else { |
---|
2113 | |
---|
2114 | t1 = infos_frame.top; |
---|
2115 | l1 = infos_frame.left; |
---|
2116 | infos_theImageBox = jQuery("#theImage").infos(); //theImage |
---|
2117 | } |
---|
2118 | infos_theImageBox.margin.margin = infos_frame.margin.margin; |
---|
2119 | infos_theImageBox.top = t1; |
---|
2120 | infos_theImageBox.left = l1; |
---|
2121 | // infos_theImageBox.position = "absolute"; |
---|
2122 | |
---|
2123 | Window_Affichage = infos_theImageBox; |
---|
2124 | if (DEBUG_autosize == "_true") { |
---|
2125 | // jQuery("#theImage").css("border", "solid green"); |
---|
2126 | |
---|
2127 | jQuery("#Debug5").css({ background: "red", |
---|
2128 | position: "absolute", |
---|
2129 | border: "green solid 2px", |
---|
2130 | textAlign: align_auto, |
---|
2131 | margin: "auto", |
---|
2132 | top: Window_Affichage.top + "px", |
---|
2133 | left: Window_Affichage.left + "px", |
---|
2134 | width: Window_Affichage.width + "px", |
---|
2135 | height: Window_Affichage.height + "px" |
---|
2136 | }); //red |
---|
2137 | jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green |
---|
2138 | } |
---|
2139 | |
---|
2140 | //Wait_Affichage(); |
---|
2141 | |
---|
2142 | return true; |
---|
2143 | } // Get_dimensions |
---|
2144 | |
---|
2145 | |
---|
2146 | //========================================================= |
---|
2147 | theMainImage_Id = "#theMainImage"; |
---|
2148 | if (typeof (options) == "undefined") { |
---|
2149 | options = { imageAutosize: false } |
---|
2150 | } |
---|
2151 | options = jQuery.extend(Autosize_options, options); |
---|
2152 | var defaults = { |
---|
2153 | useMap: '#Autosize', |
---|
2154 | imageAutosizeMargin: 0, |
---|
2155 | imageAutosize: false, |
---|
2156 | marge_basse: options.imageAutosizeMargin || 0, |
---|
2157 | DEBUG_autosize: false |
---|
2158 | }; |
---|
2159 | |
---|
2160 | options = jQuery.extend(defaults, options); |
---|
2161 | jQuery("#form_autosize_picture").addClass("Autosize_margin"); |
---|
2162 | //===== marges suplémentaires en fonction theme === |
---|
2163 | options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top")); |
---|
2164 | options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom")); |
---|
2165 | options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left")); |
---|
2166 | options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right")); |
---|
2167 | |
---|
2168 | |
---|
2169 | DEBUG_autosize = options.DEBUG_autosize; |
---|
2170 | cookies = Get_cookies(); |
---|
2171 | |
---|
2172 | //============= Gestion Maps ================ |
---|
2173 | nom_map = "Autosize"; |
---|
2174 | a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]"); |
---|
2175 | a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]"); |
---|
2176 | a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]"); |
---|
2177 | |
---|
2178 | new_html = '<map name="Autosize" >'; |
---|
2179 | |
---|
2180 | var theme = options.theme; |
---|
2181 | nb_zone = jQuery("div .navigationButtons a").length; |
---|
2182 | var infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image |
---|
2183 | var Largeur_zone = (infos_theMainImage.width / nb_zone); |
---|
2184 | var Hauteur_zone = (infos_theMainImage.height); |
---|
2185 | var init_zone = 0; |
---|
2186 | j = 0; |
---|
2187 | jQuery("div .navigationButtons a").each(function (e) { |
---|
2188 | Hauteur_zone = (infos_theMainImage.height); |
---|
2189 | title = jQuery(this).attr("title"); |
---|
2190 | h_ref = jQuery(this).attr("href"); |
---|
2191 | init_zone = Largeur_zone * j; |
---|
2192 | if (title.match(":")) { |
---|
2193 | if (j == 0) |
---|
2194 | rel = "prev"; |
---|
2195 | else |
---|
2196 | rel = "next"; |
---|
2197 | } else { |
---|
2198 | rel = "up"; |
---|
2199 | Hauteur_zone = Hauteur_zone / 4; |
---|
2200 | } |
---|
2201 | coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone; |
---|
2202 | new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />'; |
---|
2203 | |
---|
2204 | j++; |
---|
2205 | }); |
---|
2206 | new_html += '</map>'; |
---|
2207 | jQuery("#theImage map:last").after(new_html); |
---|
2208 | |
---|
2209 | //=================== Gestion liste photos size ============================ |
---|
2210 | us = 0; |
---|
2211 | var user_status = options.user_status; |
---|
2212 | var type_size = eval("options." + user_status + "_type"); //limite taille |
---|
2213 | var type_size_maxi = eval("options." + user_status + "_type"); //limite taille |
---|
2214 | |
---|
2215 | n = 0; |
---|
2216 | |
---|
2217 | var pt = new Array(); |
---|
2218 | jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden'); |
---|
2219 | jQuery("#derivativeSwitchBox a").css('visibility', 'hidden'); |
---|
2220 | |
---|
2221 | jQuery("#derivativeSwitchBox a").each(function (i) { |
---|
2222 | href_path = jQuery(this).attr("href"); |
---|
2223 | pt[i] = href_path.split("'"); |
---|
2224 | tsz = pt[i][5]; |
---|
2225 | jQuery(this).css('visibility', 'visible'); |
---|
2226 | //--- recherche limite --- |
---|
2227 | if (tsz.match(RegExp(type_size_maxi, "gi"))) { |
---|
2228 | return false; |
---|
2229 | } |
---|
2230 | //--- type en cours --- |
---|
2231 | if (tsz.match(RegExp("^" + options.type_size, "gi"))) { |
---|
2232 | us = n; |
---|
2233 | } |
---|
2234 | |
---|
2235 | n++; |
---|
2236 | }); |
---|
2237 | |
---|
2238 | jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible'); |
---|
2239 | |
---|
2240 | |
---|
2241 | |
---|
2242 | //=================== |
---|
2243 | // VARIABLES |
---|
2244 | //=================== |
---|
2245 | var theMainImage_Id = "#theMainImage"; |
---|
2246 | type_src = "div"; |
---|
2247 | old_window = { width: 0, height: 0 }; |
---|
2248 | List_autosize = new Array(); |
---|
2249 | nu_img = 0; |
---|
2250 | tempo = 0; |
---|
2251 | //==================================================== |
---|
2252 | var infos_thePicturePage = jQuery("#thePicturePage").infos(); |
---|
2253 | var infos_theImageAndInfos; |
---|
2254 | |
---|
2255 | var theImageAndInfos_id = "#theImageAndInfos"; |
---|
2256 | if (options.theme.match(RegExp("simple", "gi"))) { |
---|
2257 | theImageAndInfos_id = "#content"; |
---|
2258 | |
---|
2259 | jQuery(theMainImage_Id).attr("position", "static"); |
---|
2260 | |
---|
2261 | |
---|
2262 | } else { |
---|
2263 | infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general |
---|
2264 | if (infos_theImageAndInfos.visible == true) |
---|
2265 | theImageAndInfos_id = "#theImageAndInfos"; |
---|
2266 | else |
---|
2267 | theImageAndInfos_id = "#imageContainer"; |
---|
2268 | } |
---|
2269 | |
---|
2270 | infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general |
---|
2271 | |
---|
2272 | var infos_theImage = jQuery("#theImage").infos(); // Container |
---|
2273 | infos_theMainImage = jQuery(theMainImage_Id).infos(); // Image |
---|
2274 | |
---|
2275 | if (infos_theMainImage.width == 0) { |
---|
2276 | infos_theMainImage = jQuery("#theImage img").infos(); |
---|
2277 | if (infos_theMainImage.id == "") |
---|
2278 | jQuery("#theImage img").attr("id", "theMainImage"); |
---|
2279 | infos_theMainImage = jQuery(theMainImage_Id).infos(); |
---|
2280 | } |
---|
2281 | |
---|
2282 | var infos_imageInfos = jQuery("#imageInfos").infos(); // Informations |
---|
2283 | |
---|
2284 | |
---|
2285 | var infos_the_page = jQuery("#the_page").infos(); |
---|
2286 | var infos_content = jQuery("#content").infos(); |
---|
2287 | var infos_titrePage = jQuery("#titrePage").infos(); |
---|
2288 | var infos_imageInfoBar = jQuery("#imageInfoBar").infos(); |
---|
2289 | var infos_theHeader = jQuery("#theHeader").infos(); |
---|
2290 | var infos_imageToolBar = jQuery("#imageToolBar").infos(); |
---|
2291 | var infos_imageHeaderBar = jQuery("#imageHeaderBar").infos(); |
---|
2292 | var infos_body = jQuery("body").infos(); |
---|
2293 | var llgbo_id = "#llgbo0"; |
---|
2294 | |
---|
2295 | var infos_llgbo = jQuery(llgbo_id).infos(); |
---|
2296 | var infos_llgboh2 = jQuery("#llgboh2").infos(); |
---|
2297 | |
---|
2298 | var marges_llgbo = 0; |
---|
2299 | var Zone_image = { |
---|
2300 | width_init: options.img_width, |
---|
2301 | height_init: options.img_height, |
---|
2302 | rapport_init: options.img_width / options.img_height |
---|
2303 | }; |
---|
2304 | |
---|
2305 | var Type_Img = ""; |
---|
2306 | |
---|
2307 | |
---|
2308 | |
---|
2309 | pos_top = jQuery(theImageAndInfos_id).position(); |
---|
2310 | pos_top = pos_top.top - infos_theImageAndInfos.general.marges.top; |
---|
2311 | pos_top += infos_content.general.marges.top; |
---|
2312 | pos_top += infos_theImage.general.marges.top; |
---|
2313 | options.pos_top = pos_top; |
---|
2314 | |
---|
2315 | |
---|
2316 | old_window = { width: 0, height: 0 }; |
---|
2317 | |
---|
2318 | |
---|
2319 | //==== en cours ============ |
---|
2320 | n = pt.length - 1; |
---|
2321 | if (n >= 0) { |
---|
2322 | imgSrc = pt[n][1]; |
---|
2323 | last_map = pt[n][5]; |
---|
2324 | |
---|
2325 | imgSrc = pt[us][1]; |
---|
2326 | last_map = pt[us][5]; |
---|
2327 | |
---|
2328 | new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >✔ </span>'; |
---|
2329 | new_html += '<a id="linkAutosize" href="javascript:changeImgSrc(\'' + imgSrc + '\', \'' + last_map + '\', \'' + type_size + '\') ">'; |
---|
2330 | new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span> </a>'; |
---|
2331 | if (type_size.match(RegExp("Autosize", "gi"))) { |
---|
2332 | jQuery("#derivativeSwitchBox br:last").before(new_html); |
---|
2333 | } |
---|
2334 | |
---|
2335 | useMap = cookies.pictureMap; // #mapxxx |
---|
2336 | if (useMap == "#Autosize" && type_size_maxi == "Autosize") { |
---|
2337 | |
---|
2338 | } else { |
---|
2339 | useMap = last_map; |
---|
2340 | } |
---|
2341 | |
---|
2342 | typeSave = cookies.typeSave; //picturederiv xxx |
---|
2343 | options.type_size = useMap.replace("#", ""); |
---|
2344 | |
---|
2345 | type_size = options.type_size; |
---|
2346 | cookies.pictureMap = useMap; // #mapxxx |
---|
2347 | cookies.typeSave = last_map; //picturederiv xxx |
---|
2348 | cookies.imgSrc = imgSrc; |
---|
2349 | |
---|
2350 | changeImgSrc(imgSrc, last_map, type_size); |
---|
2351 | |
---|
2352 | |
---|
2353 | } |
---|
2354 | |
---|
2355 | |
---|
2356 | }); // ready |
---|
2357 | |
---|
2358 | //===================================================================== |
---|
2359 | // |
---|
2360 | // Fonctions supplémentaires |
---|
2361 | // |
---|
2362 | //===================================================================== |
---|
2363 | function Autosize_resize(Obj) { |
---|
2364 | conf = jQuery(Obj).get(0).conf; |
---|
2365 | Obj = jQuery(Obj).get(0).obj; |
---|
2366 | myWindow = jQuery("#" + conf.parent).infos(); |
---|
2367 | if (myWindow.width == 0) myWindow = jQuery(window).infos(); |
---|
2368 | marge_basse = 0; |
---|
2369 | if (conf.MargeBasse) |
---|
2370 | marge_basse = jQuery(Obj).Get_Val_int(conf.MargeBasse); |
---|
2371 | marge_top = 0; |
---|
2372 | if (conf.MargeHaute) |
---|
2373 | marge_top = jQuery(Obj).Get_Val_int(conf.MargeHaute); |
---|
2374 | infos_Obj = jQuery(Obj).infos(); |
---|
2375 | h1_left = jQuery(Obj).absoluteLeft(); |
---|
2376 | h1_top = jQuery(Obj).absoluteTop(); |
---|
2377 | |
---|
2378 | if (h1_top < infos_Obj.height) |
---|
2379 | h1 = (myWindow.height - h1_top - marge_basse - marge_top); |
---|
2380 | else |
---|
2381 | h1 = (myWindow.height - marge_basse); |
---|
2382 | rap = infos_Obj.height / infos_Obj.width; |
---|
2383 | w2 = parseInt(h1 / rap); |
---|
2384 | if (w2 < infos_Obj.width) |
---|
2385 | marginLeft = infos_Obj.left + parseInt((infos_Obj.width - w2) / 2) + "px"; |
---|
2386 | else |
---|
2387 | marginLeft = "auto"; |
---|
2388 | jQuery(Obj).css({ width: "auto", marginTop: marge_top, |
---|
2389 | marginLeft: "auto", marginBottom: 0 + "px", |
---|
2390 | verticalAlign: "middle", textAlign: "center" |
---|
2391 | }); |
---|
2392 | jQuery(Obj).height(h1); |
---|
2393 | //============================================================= |
---|
2394 | if (conf.ResizePicture == "true") |
---|
2395 | imgs = jQuery(Obj).find("img"); |
---|
2396 | else |
---|
2397 | imgs = jQuery(Obj).find("img"); |
---|
2398 | Parent = Obj; |
---|
2399 | |
---|
2400 | Obj_w = jQuery(Obj).width(); |
---|
2401 | Obj_h = jQuery(Obj).height(); |
---|
2402 | if (imgs.length > 0) { |
---|
2403 | jQuery(imgs).each(function (i) { |
---|
2404 | img = jQuery(this); |
---|
2405 | h1_top = jQuery(img).absoluteTop() - h1_top; |
---|
2406 | h1_bottom = Obj_h - h1_top; |
---|
2407 | infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine |
---|
2408 | img_rap = conf.rap[i]; |
---|
2409 | if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap); |
---|
2410 | h1 -= h1_top; |
---|
2411 | if (h1 > Obj_h - h1_top) { |
---|
2412 | h1 = Obj_h - h1_top; |
---|
2413 | } |
---|
2414 | w2 = parseInt(h1 * img_rap); |
---|
2415 | if (w2 > 0 && h1 > 0 && img.length > 0) { |
---|
2416 | img.height(h1); |
---|
2417 | img.width(w2); |
---|
2418 | } |
---|
2419 | }); |
---|
2420 | } else { |
---|
2421 | imgs = jQuery(Obj).children(); |
---|
2422 | jQuery(imgs).each(function (i) { |
---|
2423 | if (this.height > 0) { |
---|
2424 | h1_top = jQuery(this).absoluteTop() - h1_top; |
---|
2425 | h1_bottom = Obj_h - h1_top; |
---|
2426 | infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine |
---|
2427 | img_rap = conf.rap[i]; |
---|
2428 | if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap); |
---|
2429 | h1 -= h1_top; |
---|
2430 | if (h1 > Obj_h - h1_top) { |
---|
2431 | h1 = Obj_h - h1_top; |
---|
2432 | } |
---|
2433 | w2 = parseInt(h1 * img_rap); |
---|
2434 | if (w2 > Obj_w) { |
---|
2435 | w2 = Obj_w; |
---|
2436 | } |
---|
2437 | |
---|
2438 | if (w2 > 0 && h1 > 0) { |
---|
2439 | this.height = (h1); |
---|
2440 | this.width = (w2); |
---|
2441 | } |
---|
2442 | |
---|
2443 | } |
---|
2444 | name = this.name; |
---|
2445 | }); |
---|
2446 | |
---|
2447 | |
---|
2448 | |
---|
2449 | } |
---|
2450 | |
---|
2451 | } |
---|
2452 | |
---|
2453 | |
---|
2454 | /******************************************************** |
---|
2455 | * List_autosize_resize |
---|
2456 | ********************************************************/ |
---|
2457 | function List_autosize_resize(event, ui) { |
---|
2458 | if (typeof wait_resize == "undefined") wait_resize = false; |
---|
2459 | if (wait_resize == true) return; |
---|
2460 | wait_resize = true; |
---|
2461 | if (List_autosize.length == 0) return; |
---|
2462 | for (i = 0; i < List_autosize.length; i++) { |
---|
2463 | Autosize_resize(jQuery(List_autosize[i])); |
---|
2464 | } |
---|
2465 | wait_resize = false; |
---|
2466 | return true; |
---|
2467 | } |
---|
2468 | |
---|
2469 | |
---|
2470 | |
---|
2471 | |
---|
2472 | |
---|
2473 | /**/ |
---|