Changeset 12527


Ignore:
Timestamp:
Oct 28, 2011, 4:44:20 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix buggs

Location:
extensions/Autosize
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r11961 r12527  
    2929                global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    3030 
    31   header ('X-UA-Compatible: n=7')  ;
    32    header ('X-UA-Compatible: IE=Edge')  ;
     31 // header ('X-UA-Compatible: n=7')  ;
     32 // header ('X-UA-Compatible: IE=Edge')  ;
    3333  if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ;
    3434
     
    5050$DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;
    5151//=================================================================================================
    52 
    5352    $autosize_parametres =       cl_autosize_Get_Options() ;                   
    5453    $theme=$user['theme'];
     
    6463        'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH)  ,
    6564        'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    66         'Version_pwg' => PHPWG_VERSION
     65        'Version_pwg' => PHPWG_VERSION       
    6766         )
    6867    );
     
    7271 //===========================================================
    7372 /*
    74   * cl_autosize_script_2(admin)
     73  * cl_autosize_script_2()
    7574 */
    7675 static public function cl_autosize_script_2()
     
    9089                        $theme=$user['theme'];
    9190                        if ($ma_page=='thePiwiShackControllerPage') return ;
    92                        
     91
     92
    9393$img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
    9494$img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
     
    9696$img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480;
    9797$img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320;
     98
     99
     100
     101
    98102$src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width               ;
    99103$src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height              ;
     104if(isset($_COOKIE['img_w'])){
     105$src_img_w=$_COOKIE['img_w'];
     106$src_img_h=$_COOKIE['img_h'];
     107}
     108
    100109$window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;
    101110$window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width    ;
     
    107116            'window_height' =>$window_height,
    108117            'window_width' => $window_width
     118
    109119          );
    110120
     
    122132                                        )
    123133                                                );
    124                                                  
     134
    125135                        $autoscript="<script type='text/javascript'>
    126136                        /* cl_autosize_script_2 */
    127137                        if (typeof (save_framework) == 'function')
    128                            save_framework('".$ma_page."');
     138                           save_framework('".$ma_page."');     
    129139                        </script>";
    130140         
     
    179189                                                $template->assign('cl_autosize_button',
    180190                                                array(  'cl_autosize_info' => 'cl_autosize_info' ,
     191            'cl_autosize_info_1' => 'cl_autosize_info_' , 
    181192                                                                    'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
    182193                                                                    'URL' => $_SERVER['REQUEST_URI'] ,
  • extensions/Autosize/css/autosize.css

    r12078 r12527  
    8080}
    8181#form_autosize_picture {
    82   z-index: -100;
    83   display: none;
    84   visibility: hidden;
    85   position:fixed;
    86   top:-200px;
     82
    8783}
    8884.Image {
  • extensions/Autosize/js/Affiche_script.js

    r12060 r12527  
    11Parent = "#theImage";
     2// problème avec GMaps+diaporama:
     3// corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
    24function Toggle_bp() {
    3     cl_visible = !cl_visible;
     5  cl_visible = !cl_visible;
    46  set_cl();
    57  jQuery().newResize();
     
    810  function set_cl(){
    911  if (typeof cl_visible == "undefined") return;
    10     if (typeof src1 == "undefined") return;
     12  if (typeof src1 == "undefined") return;
     13
    1114    if (cl_visible) src = src1;
    1215    else src = src2;
    13     if (cl_visible) src_info = src3;
    14     else src_info = src4;
     16
     17    if (cl_visible) {
     18      src_info = src3;
     19      src_info_1 = src3;
     20    }
     21    else {
     22      src_info = src4;
     23      src_info_1 = src5;
     24    }
    1525
    1626    jQuery('#bp_cla').attr('alt', src_info);
     
    1929    jQuery('#bp_cla').attr('Stitle', src_info);
    2030    jQuery('#bp_cla').attr('Stip', " ");
    21 
     31    zoom = jQuery('#zoom ').val();
     32    jQuery('#bp_cla').text(src_info_1);
     33    jQuery('#bp_cla span').text(zoom+"%" );
    2234    bp_scr = jQuery('#bp_img_cla');
    2335
    2436    if (bp_scr.length > 0) {
    25       bp_scr.get(0).src = src;
    26     jQuery('#bp_img_cla').attr('alt', src_info);
    27     jQuery('#bp_img_cla').attr('title', src_info);
     37        bp_scr.get(0).src = src;
     38        jQuery('#bp_img_cla').attr('alt', src_info);
     39        jQuery('#bp_img_cla').attr('title', src_info);   
    2840    }
    2941
     
    6678//==========================================================================
    6779function Wait_Affichage() {
    68   href = location.href;
    69 
    70   jQuery.post(href, function (data) { });
    71    // alert("Data Loaded: " + data); 
     80 
    7281  if (typeof fade_in == "undefined") fade_in = 1000;
    7382    fade_in = parseInt(fade_in);
     
    8392        jQuery(Parent).css({ opacity: "1" });
    8493    } else {
    85         jQuery(Parent).animate({ opacity: "1" },
     94    jQuery(Parent).animate({ opacity: "1" },
    8695                                         fade_in, "swing",
    8796                                         function (i) {
    88                                              jQuery(Parent).css({ opacity: "1" });
    89                                              if (DEBUG_autosize == "true") {
    90                                                  bp1 = jQuery('.debug').get(nu_img);
    91                                                  if (!bp1) nu_img = 0;
    92                                                  bp1 = jQuery('.debug').get(nu_img);
    93                                                  jQuery(bp1).trigger('ON');
    94                                              }
     97                                           jQuery(Parent).css({ opacity: "1" });
     98                                       if (DEBUG_autosize == "true") {
     99
     100                                         nu_img--;
     101                                         if (nu_img < 1) nu_img = 1;
     102
     103                                         bp1 = jQuery('.debug').get(nu_img);
     104                                         jQuery(bp1).trigger('ON');
     105                                       }
    95106                                         }
    96107                                       );
    97108
    98     }
     109                                       }
     110
     111
    99112    //   if (nu_img > 1) return;
    100113  if (typeof theImg == "undefined") return true;
     
    118131    jQuery("#window_height").val(Window_Affichage.height);
    119132    jQuery("#window_width").val(Window_Affichage.width);
    120     jQuery("#ret_autosize").trigger('ON', { width: img_w,
     133
     134    jQuery("#ret_autosize").trigger('ON', {
     135        width: img_w,
    121136        height: img_h,
    122137        theImage: theImg,
     
    231246    //===============================================
    232247jQuery.extend(jQuery.expr[':'], {
    233     // Nom du sélecteur personnalisé
    234     Autosize: function (a) {
     248  // Nom du sélecteur personnalisé
     249  Autosize: function (a) {
    235250    nd = a.nodeName;
    236         n1 = a.className;
    237         // personal_block
    238         if (n1.match(RegExp("autosize", "gi"))) {
     251    n1 = a.className;
     252    // personal_block
     253    if (n1.match(RegExp("autosize", "gi"))) {
    239254      //   autosize = "MargeBasse:30px; ResizePicture:false"
    240             infconf = jQuery(a).attr("autosize");
    241             n1 = typeof infconf;
    242             conf = { MargeBasse: 0, NoPicture: false }
    243             if (n1 == "undefined") {
    244 
    245             } else {
    246                 tableau = infconf.split(";");
    247                 for (var i = 0; i < tableau.length; i++) {
    248                     tableau2 = tableau[i].split(":");
    249                     conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]);
    250                 }
    251                 imgs = jQuery(a).find("img");
    252                 rap = new Array();
    253                 width = new Array();
    254                 height = new Array();
     255      infconf = jQuery(a).attr("autosize");
     256      n1 = typeof infconf;
     257      conf = { MargeBasse: 0, NoPicture: false }
     258      if (n1 == "undefined") {
     259
     260      } else {
     261        tableau = infconf.split(";");
     262        for (var i = 0; i < tableau.length; i++) {
     263          tableau2 = tableau[i].split(":");
     264          conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]);
     265        }
     266        imgs = jQuery(a).find("img");
     267        rap = new Array();
     268        width = new Array();
     269        height = new Array();
    255270        if (imgs.length > 0)
    256                 jQuery(imgs).each(function (i) {
    257                     img = jQuery(this);
    258                     rap.push((img.width() / img.height()));
    259                     width.push(img.width());
    260                     height.push(img.height());
    261                 });
     271          jQuery(imgs).each(function (i) {
     272            img = jQuery(this);
     273            rap.push((img.width() / img.height()));
     274            width.push(img.width());
     275            height.push(img.height());
     276          });
    262277        else {
    263278          imgs = jQuery(a).children();
    264279          jQuery(imgs).each(function (i) {
    265             if (this.height>0) {
     280            if (this.height > 0) {
    266281              rap.push(this.width / this.height);
    267282              width.push(this.width);
     
    274289        }
    275290
    276                 conf['rap'] = rap;
    277                 conf['width'] = width;
    278                 conf['height'] = height;
    279 
    280                 List_autosize.push({ obj: a, conf: conf });
    281         jQuery(a).css({ opacity:0 });
    282             }
    283         }
    284         //  Css = jQuery(a).getStyles(a);
    285         return false;
    286 
    287     },
    288     Set_Class: function (a) {
     291        conf['rap'] = rap;
     292        conf['width'] = width;
     293        conf['height'] = height;
     294
     295        List_autosize.push({ obj: a, conf: conf });
     296        jQuery(a).css({ opacity: 0 });
     297      }
     298    }
     299    //  Css = jQuery(a).getStyles(a);
     300    return false;
     301
     302  },
     303  Set_Class: function (a) {
    289304    nd = a.nodeName;
    290305    if (nd == "DIV") {
    291     XBrowserAddHandler(a,'onpropertychange', onPropertyChange);
    292     //jQuery(a).find("img:nth-child(1)").css("border","Solid 5px green");
    293     img = jQuery(a).children("img");
    294     if (img.length == 0) img = jQuery(a).find("a").children("img");
    295     if (img.length > 0)
    296     if (img.length == 1) {
    297     if (img[0].src.match(RegExp(".png", "g")))
    298     return;
    299    // img[0].attachEvent('onpropertychange', onPropertyChange);
    300     XBrowserAddHandler(img[0],'onpropertychange', onPropertyChange);
    301     jQuery(img).addClass("Image");
    302     //jQuery(img).attr("autosize", "MargeBasse:0px; ResizePicture:true");
    303     }
    304     }
    305     }
     306      XBrowserAddHandler(a, 'onpropertychange', onPropertyChange);
     307      //jQuery(a).find("img:nth-child(1)").css("border","Solid 5px green");
     308      img = jQuery(a).children("img");
     309      if (img.length == 0) img = jQuery(a).find("a").children("img");
     310      if (img.length > 0)
     311        if (img.length == 1) {
     312          if (img[0].src.match(RegExp(".png", "g")))
     313            return;
     314          // img[0].attachEvent('onpropertychange', onPropertyChange);
     315          XBrowserAddHandler(img[0], 'onpropertychange', onPropertyChange);
     316          jQuery(img).addClass("Image");
     317          //jQuery(img).attr("autosize", "MargeBasse:0px; ResizePicture:true");
     318        }
     319    }
     320  }
    306321});
    307322function XBrowserAddHandler(target,eventName,handlerName){
     
    386401jQuery(document).ready(
    387402     function (jQuery) {
    388        jQuery(':Autosize');
     403       // jQuery(':Autosize');
    389404       jQuery(window).unload(function () {
    390405         try {
     
    396411
    397412             if (typeof Window_Affichage != "undefined") {
    398              jQuery.cookie('window_height', Window_Affichage.height);
    399              jQuery.cookie('window_width', Window_Affichage.width);
    400            }
     413               jQuery.cookie('window_height', Window_Affichage.height);
     414               jQuery.cookie('window_width', Window_Affichage.width);
     415             }
    401416           }
    402417         } catch (r) {
     
    410425       ********************************************/
    411426       jQuery(window).load(function () {
    412          jQuery(':Set_Class');
     427
     428         href = location.href;
     429         var aff_ok = false;
     430       /*
     431         jQuery.post(href, function (data) {
     432           nu_img--;
     433           if (nu_img < 0) nu_img = 9;
     434           jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     435           //alert("Data Loaded: " + data);
     436           Wait_Affichage();
     437         });
     438*/
     439         // jQuery(':Set_Class');
    413440         if (typeof img_width == "undefined") {
    414441           if (List_autosize.length == 0) return;
     
    457484         var old_window = { width: 0, height: 0 };
    458485
    459          Bandeau_bas = Info_Description_f(Parent);       
     486         Bandeau_bas = Info_Description_f(Parent);
    460487         if (typeof Bandeau_bas == "undefined") {
    461  
     488
    462489         }
    463490         if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
     
    519546           set_cl();
    520547           if (typeof options != "undefined")
    521              if (options.imageAutosize)
     548             if (options.imageAutosize) {
     549               Wait_Affichage();
    522550               return true; //stripped
    523            if (DEBUG_autosize == "true") {
    524              nu_img += 1;
    525 
    526              bp1 = jQuery('.debug').get(nu_img);
    527              if (!bp1) nu_img = 0;
    528              bp1 = jQuery('.debug').get(nu_img);
    529 
    530              jQuery(bp1).trigger('ON');
    531            }
     551             }
     552
     553
    532554           if (typeof cl_visible == "undefined") return true;
    533555           if (!cl_visible == true) { return true; }
     
    551573
    552574           var Cadre = jQuery(Parent).get(0);
    553        
     575
    554576           //===============  Information cadre ======
    555577           var info_the_page = jQuery("#the_page").infos();
     
    588610           }
    589611
    590            if(jQuery('#_Comment, ').length==0)
     612           if (jQuery('#_Comment, ').length == 0)
    591613             jQuery('.imageComment, ').wrapAll('<div id="_Comment"  />');
    592614
     
    611633             if (theme.match(RegExp("stripped", "gi"))) {
    612634
    613                marge = (info_the_page.width - info_HeaderBar.width) / 2;
     635               info_imageHeaderBar = jQuery("#imageHeaderBar").infos();
     636               marge = (info_the_page.width - info_content.width) / 2;
    614637               marge_right = marge + 2;
    615638               marge_left = marge + 2;
     
    688711               //the theMainImage ??
    689712               if (!theImg) {
    690                theImg = jQuery("#theMainImage");
    691                if (theImg.length > 0)
    692                  return;
    693                theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
     713                 theImg = jQuery("#theMainImage");
     714                 if (theImg.length > 0)
     715                   return;
     716                 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
    694717                 // return;
    695                if (theImg.length > 0)
    696                  theImg = theImg[0];
    697                else
    698                  theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
     718                 if (theImg.length > 0)
     719                   theImg = theImg[0];
     720                 else
     721                   theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
    699722               }
    700723               info_theImage = jQuery(theImg).infos();
     
    710733                 theImg = jQuery("#the_page #theImg");
    711734               }
    712                info_theImage = jQuery(theImg).infos();
     735
    713736               info_the_page = jQuery("#the_page").infos();
    714737
     
    857880           info_Licence = jQuery(".licencetag").infos();
    858881
    859            jQuery(Parent + " #theImg IMG").css("marginTop", "0px");
     882           var MainImage = jQuery("#theMainImage");
     883
     884           if (MainImage.length == 0) jQuery(Parent + " #theImg IMG").css("marginTop", "0px");
     885
    860886           //========== Correction en fonction du thème =============================
    861887           var correction = 0;
     
    889915
    890916           h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
    891            if (typeof Bandeau_t != "undefined") Bandeau = Bandeau_t.img_top|0;
     917           if (typeof Bandeau_t != "undefined") Bandeau = Bandeau_t.img_top | 0;
    892918           Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h;
    893919           //=========================================================================
     
    897923             Zone_Affichage.width = mini_width2;
    898924           //=========================================================================
    899            if (typeof (Bandeau_bas) != "undefined") {           
     925           if (typeof (Bandeau_bas) != "undefined") {
    900926             if (Bandeau_bas.height < Zone_Affichage.height) Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
    901                         } else {
     927           } else {
    902928           }
    903929
     
    11221148
    11231149
    1124 
    1125              jQuery("#player").css("width", img_finale.width + "px");
    1126              jQuery("#player").css("height", img_finale.height);
    1127 
    1128              jQuery("#embedplayer").css("width", img_finale.width);
    1129              jQuery("#embedplayer").css("height", img_finale.height);
    1130 
    1131              jQuery("embed").css("height", img_finale.height);
    1132 
    1133              jQuery("video").height(img_finale.height);
    1134              jQuery("video").width(img_finale.width);
    1135 
    1136              jQuery("video").css({ height: img_finale.height+"px" });
    1137              jQuery("object").css({ height: img_finale.height+"px" });
    1138 
    1139              jQuery("object").width(img_finale.width);
    1140              jQuery("object").height(img_finale.height);
    1141 
    1142              jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
    1143              jQuery(theImg).height(img_finale.height);
    1144 
    1145              jQuery(Cadre).css("height", "auto"); 
     1150             if (MainImage.length > 0) {
     1151               img_finale.height = parseInt(img_finale.width / rapport);
     1152               img_finale.height -= 30;
     1153               img_finale.width = rapport * img_finale.height;
     1154
     1155
     1156               MainImage.width(img_finale.width);
     1157               MainImage.height(img_finale.height);
     1158               jQuery("#embedplayer").width(300);
     1159               jQuery("#embedplayer").height(15);
     1160             } else {
     1161               jQuery("#player").css("width", img_finale.width + "px");
     1162               jQuery("#player").css("height", img_finale.height);
     1163               jQuery("#embedplayer").css("width", img_finale.width);
     1164               jQuery("#embedplayer").css("height", img_finale.height);
     1165               jQuery("embed").css("height", img_finale.height);
     1166               jQuery("video").height(img_finale.height);
     1167               jQuery("video").width(img_finale.width);
     1168               jQuery("video").css({ height: img_finale.height + "px" });
     1169               jQuery("object").css({ height: img_finale.height + "px" });
     1170               jQuery("object").width(img_finale.width);
     1171               jQuery("object").height(img_finale.height);
     1172               jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
     1173               jQuery(theImg).height(img_finale.height);
     1174               jQuery(Cadre).css("height", "auto");
     1175             }
     1176
     1177
    11461178           } else if (Type_Img == "embed") {
    11471179
    1148              jQuery(Cadre).css("height", "auto");
    1149              jQuery("embed").css("height", img_finale.height);
    1150              jQuery("object").css({ height: img_finale.height + "px" });
    1151 
    1152              jQuery("object").width(img_finale.width);
    1153              jQuery("object").height(img_finale.height);
     1180             if (MainImage.length > 0) {
     1181               img_finale.height = parseInt(img_finale.width / rapport);
     1182               img_finale.height -= 30;
     1183               img_finale.width = rapport * img_finale.height;
     1184
     1185
     1186               MainImage.width(img_finale.width);
     1187               MainImage.height(img_finale.height);
     1188               jQuery("#embedplayer").width(300);
     1189               jQuery("#embedplayer").height(15);
     1190             } else {
     1191               jQuery(Cadre).css("height", "auto");
     1192               jQuery("embed").css("height", img_finale.height);
     1193               jQuery("object").css({ height: img_finale.height + "px" });
     1194
     1195               jQuery("object").width(img_finale.width);
     1196               jQuery("object").height(img_finale.height);
     1197             }
    11541198
    11551199           } else if (Type_Img == "panorama") {
     
    13041348           zoom = parseInt(zoom * 100);
    13051349           jQuery('#zoom ').val(zoom);
    1306            jQuery('#bp_cla').text(zoom + "%");
    1307 
     1350           jQuery('#bp_cla span').text(zoom + "%");
    13081351           //  --- réglage de la hauteur de page en fonction du copyright-----------
    13091352           if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
     
    13261369           info_frame = jQuery(Cadre).infos();
    13271370           if (theme.match(RegExp("stripped", "gi"))) {
     1371             /*
    13281372             info_theImageBox = jQuery("#theImageAndTitle").infos();
    13291373             p1 = jQuery(".randomButtons").infos();
    13301374             p2 = jQuery("#imageHeaderBar").infos();
     1375             p3 = info_content.top;
     1376             p1 = options.imageAutosizeTitle;
     1377
    13311378             jQuery("#theImage").width("width", info_theImageBox.width + "px");
    1332              jQuery("#theImageAndTitle").css("position", "relative");
    1333              jQuery("#theImageAndTitle").css({ marginTop: "0px",
    1334                paddingTop: (p1.top) + "px"
     1379             //jQuery("#theImageAndTitle").css("position", "relative");
     1380             jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px",
     1381             paddingTop: "0px", textAalign: "center", marginLeft: "auto"
    13351382             });
     1383
     1384             jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px",
     1385             paddingTop: "0px", marginLeft: "auto"
     1386             }); */
    13361387             t1 = info_theImageBox.top;
    13371388             l1 = info_theImageBox.left;
     
    13511402
    13521403           Window_Affichage = info_theImageBox;
    1353            if (DEBUG_autosize == "true") {
     1404           if (DEBUG_autosize == "_true") {
    13541405             //   jQuery(Cadre).css("border", "solid green");
    13551406
     
    13911442    var w00 = 0;
    13921443    var myImg = null;
    1393     img = jQuery(myobj);
     1444 
     1445    img = jQuery("#theMainImage");
     1446    if (img != null) {
     1447return;
     1448
     1449    } 
     1450     img = jQuery(myobj);
    13941451
    13951452    img = jQuery('img[alt]');
     
    15861643
    15871644      } else if (jQuery("#charlie").length > 0) {
    1588       info_charlie = jQuery("#charlie").infos();
    1589      if (jQuery("object").attr("type") == 'application/x-shockwave-flash') {
     1645        info_charlie = jQuery("#charlie").infos();
     1646        obj_charlie = jQuery("object");
     1647        try {
     1648          tp = obj_charlie.attr();
     1649        } catch (e) {
     1650          tp = obj_charlie.prop();
     1651        }
     1652
     1653        if (tp!=undefined) {
     1654          if (obj_charlie.length > 0)
     1655            tp = jQuery("object").attr("type") || jQuery("object").prop("type");
     1656          else
     1657            tp = jQuery("embed").attr("type") || jQuery("embed").prop("type");
     1658        }
     1659
     1660     if (tp == 'application/x-shockwave-flash') {
    15901661          jQuery("#charlie").css({
    15911662            paddingTop: "0px",
     
    16021673          });
    16031674        }
    1604         theImg = jQuery("#charlie");
    1605         info_img = jQuery(theImg).infos();
     1675
     1676        var MainImage = jQuery("#theMainImage");
     1677
     1678        if (MainImage.length == 0) {
     1679          theImg = jQuery("#charlie");
     1680          info_img = jQuery(theImg).infos();
     1681        } else {
     1682          theImg = jQuery("#theMainImage");
     1683          info_img = jQuery(theImg).infos();
     1684         
     1685        }
    16061686 
    16071687 
    16081688    } else if (jQuery(Parent + " embed").length > 0) {
    1609 
    1610         theImg = jQuery(Parent + " embed");
    1611      
    1612         info_img = jQuery(theImg).infos();
    1613            jQuery(Parent + " embed").width({ width: info_img.width+"px", height: info_img.height + "px" });
    1614 
     1689    if (jQuery("#theMainImage").lenght == 0) {
     1690      theImg = jQuery(Parent + " embed");
     1691      info_img = jQuery(theImg).infos();
     1692      jQuery(Parent + " embed").width({ width: info_img.width + "px", height: info_img.height + "px" });
     1693    } else {
     1694      theImg = jQuery("#theMainImage");
     1695      info_img = jQuery(theImg).infos();
     1696      Type_Img == "charlie"
     1697    }
    16151698
    16161699    } else if (Type_Img == "pamoorama") {
     
    16241707        info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
    16251708
    1626     } else {
    1627         theImg = jQuery(Parent + " img[alt]");
     1709      } else {
     1710        var MainImage = jQuery("#theMainImage");
     1711
     1712        if (MainImage.length == 0) {
     1713          theImg = jQuery(Parent + " img[alt]");
     1714        } else {
     1715          theImg = jQuery("#theMainImage");   
     1716        }
    16281717
    16291718        //theImg = Get_Img_Maxi(theImg);
     
    16781767    } else if (theme.match(RegExp("stripped", "gi"))) {
    16791768        //options.imageAutosize
    1680         //options.imageMargin
     1769          //options.imageMargin
     1770          jQuery("#content").css({paddingTop:"5px"});
     1771    info_content = jQuery("#content").infos();
    16811772        if (options.imageAutosizeTitle == false) {
    1682             info_description.top =   info_theImageBox.bottom;
     1773            info_description.top =   info_theImageBox.bottom ;
    16831774
    16841775            info_description.bottom =info_HeaderBar.margin.top+ info_description.top +
     
    16911782
    16921783
    1693             info_description.top = info_theImageBox.bottom +
    1694                         jQuery("#content").infos().top +
     1784            info_description.top = info_theImageBox.bottom -
     1785                        info_content.top +
    16951786                        options.imageAutosizeMargin * 2  +
    16961787                        (marges_llgbo / 2)
     
    17591850//====================================================
    17601851function Debug_pos() {
     1852  return;
    17611853    if (DEBUG_autosize == "true") {
    17621854
     
    17971889  //'gallyInterfaceReady'
    17981890
    1799     jQuery('#pamoorama').live('ON', function (e) {
    1800         jQuery(jQuery('.debug').get(1)).trigger('ON');
    1801     if (typeof Bandeau_bas=="undefined" || Bandeau_bas.width == 0) {
    1802         Bandeau_bas = Info_Description_f(Parent);
    1803         Bandeau = Bandeau_bas.top;
    1804         old_window = { width: 0, height: 0 };
     1891  jQuery('#pamoorama').live('ON', function (e) {
     1892    jQuery(jQuery('.debug').get(1)).trigger('ON');
     1893    if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
     1894      Bandeau_bas = Info_Description_f(Parent);
     1895      Bandeau = Bandeau_bas.top;
     1896      old_window = { width: 0, height: 0 };
    18051897      jQuery(window).resize();
    18061898
    18071899    }
    18081900
    1809        // Wait_Affichage();
    1810     });
    1811 
    1812     jQuery(Parent).live('ON', function (e) {
    1813         jQuery(jQuery('.debug').get(1)).trigger('ON');
    1814     Wait_Affichage();
    1815     });
    1816 
    1817     // Custom Event, ON to turn on a debug.
    1818     jQuery('.debug').live('ON', function (e) {
    1819 
    1820         jQuery('.debug').trigger('OFF');
    1821         jQuery(this).addClass('debugOn');
    1822     });
    1823 
    1824     // On Click = debugs On
    1825     jQuery('.debug').live('click', function (e) {
    1826 
    1827         jQuery(this).trigger('ON');
    1828     });
    1829 
    1830     // Custom Event, Turn off a debug
    1831     jQuery('.debug').live('OFF', function (e) {
    1832 
    1833         jQuery(this).removeClass('debugOn');
    1834     });
    1835 
    1836     // on Double Click, remove the debug from the DOM
    1837     jQuery('.debug').live('dblclick', function () {
    1838 
    1839         jQuery(this).fadeOut(function () { $(this).remove() });
    1840     });
    1841 
    1842     // Add another debug to the DOM
    1843     jQuery('#adddebugs').click(function () {
    1844         jQuery('<div></div>')
     1901    // Wait_Affichage();
     1902  });
     1903
     1904
     1905
     1906  jQuery('#ret_autosize').live('ON', function (e) {
     1907    if (nu_img == "") nu_img = 8 ;
     1908    jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     1909
     1910  });
     1911
     1912  jQuery(Parent).live('ON', function (e) {
     1913    if (nu_img == "") nu_img = 7;
     1914    jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     1915    // Wait_Affichage();
     1916  });
     1917  // Custom Event, ON to turn on a debug.
     1918  jQuery('.debug').live('ON', function (e) {
     1919 
     1920    nu_img = jQuery(this).text();
     1921    jQuery('.debug').trigger('OFF');
     1922    jQuery(this).addClass('debugOn');
     1923   
     1924  });
     1925
     1926  // On Click = debugs On
     1927  jQuery('.debug').live('click', function (e) {
     1928    i = jQuery(this).text();
     1929    jQuery(this).trigger('ON');
     1930  });
     1931
     1932  // Custom Event, Turn off a debug
     1933  jQuery('.debug').live('OFF', function (e) {
     1934    jQuery(this).removeClass('debugOn');
     1935  });
     1936
     1937  // on Double Click, remove the debug from the DOM
     1938  jQuery('.debug').live('dblclick', function () {
     1939    jQuery(this).fadeOut(function () { jQuery(this).remove() });
     1940  });
     1941
     1942  // Add another debug to the DOM
     1943  jQuery('#adddebugs').click(function () {
     1944    i = jQuery('.debug').length;
     1945    jQuery('<div>' + i + '</div>')
    18451946            .addClass('debug')
    18461947            .appendTo('#debugsContainer');
    1847     });
    1848      
    1849     // Add 10 testing debugs to start with
    1850       jQuery(window).load(function () {
    1851             DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false";
    1852         if (DEBUG_autosize == "true") {
    1853             for (var i = 0; i < 10; i++) {
    1854                 jQuery('#adddebugs').click();
    1855             }
    1856             jQuery(jQuery('.debug').get(8)).click();
    1857 
    1858          
    1859 
    1860         }
    1861     }); //on load
     1948  });
     1949
     1950  // Add 10 testing debugs to start with
     1951  jQuery(window).load(function () {
     1952    DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false";
     1953    if (DEBUG_autosize == "true") {
     1954      for (var i = 0; i < 10; i++) {
     1955        jQuery('#adddebugs').click();
     1956      }
     1957      jQuery(jQuery('.debug').get(i - 1)).click();
     1958    }
     1959
     1960  }); //on load
    18621961});
  • extensions/Autosize/js/conflit.js

    r11461 r12527  
    522522
    523523librairies = new Array;
    524 $_ = $;
     524 
    525525function save_framework(page) {
    526526    // theGategoryPage,theRegisterPage
     
    559559  }
    560560
    561   $_2 = $;
     561 
    562562  return
    563563}
    564564
    565565(function ($) {
    566   $(document).ready(function () {
     566  jQuery(document).ready(function () {
    567567    //=================================================
    568568    if (typeof jQuery.fn.infos != "function") {
     
    571571    }
    572572  });
    573 
    574 })(jQuery);
    575 
    576 
    577 //--------------------------------------------------------------
    578 $_0 = $;
    579573    function $(element, nc0) {
    580574        if (typeof jQuery.fn.infos != "function")
     
    584578        return a;
    585579    }
     580})(jQuery);
     581
     582 
     583//--------------------------------------------------------------
    586584//=== ajout des fonctions jQuery ===
    587     jQuery.extend($, jQuery);
     585    if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
     586   //   $ = jQuery.noConflict();
     587   //   jQuery.extend($, jQuery);
     588    } else {
     589 
     590
     591    /* */
     592    }
  • extensions/Autosize/js/conflit_2.js

    r11461 r12527  
    22  //=== ajout des fonctions jQuery ===
    33if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
    4     $mootools = window.$;
     4   
    55  } else {
    66    if (typeof jQuery != 'undefined') {
  • extensions/Autosize/language/fr_FR/plugin.lang.php

    r10845 r12527  
    11<?php
    22global $lang;
     3$lang['cl_autosize_info_1'] = "Affichage auto.";
    34
    45$lang['cl_autosize_hlp_line3'] = "Si la taille originale de la photo à afficher est inférieure à cette valeur, le redimensionnement automatique sera inhibé. "  ;
  • extensions/Autosize/main.inc.php

    r11461 r12527  
    3434add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    3535
    36 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20  ,  2);     
     36add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20  ); 
    3737add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21  );
    3838
  • extensions/Autosize/template/autosize.tpl

    r11961 r12527  
    1010    var img_width='{$IMG_WIDTH }';
    1111    var img_height = '{ $IMG_HEIGHT }';
     12
     13    var cookie_width='{$COOKIE_WIDTH }';
     14    var cookie_height = '{ $COOKIE_HEIGHT }';
     15
    1216
    1317    var marge_basse='{ $MARGE_BASSE }';
     
    5862.debug {
    5963    display: inline-block;
    60     width: 45px;
    61     height: 45px;
     64    width: 12px;
     65    height:12px;
    6266    background-color: black;
    6367    margin: 2px;
    6468}
     69
    6570.debugOn {
    6671    background-color: yellow;
    6772    border: solid 1px black;
    68     width: 43px;
    69     height: 43px;
    7073}
    7174
     
    8891<div id="Debug5"  align=center style="color:black;z-index:2000;position:absolute; background-color:red; top:100px;left:0px;width:300px;margin:auto;"></div>
    8992 <div id="Debug6"  align=center style="display:none"></div>
    90 <p><button id="adddebugs">Add a debug</button></p>
    9193
    92 <div id="debugsContainer"><div class="debug"></div></div>
     94
     95<div id="debugsContainer"><button id="adddebugs"  style="display:none">Add a debug</button>
     96<div class="debug"></div>
     97</div>
    9398    {/literal}
    9499    {else}
     
    100105
    101106
    102 
    103   <form action='' method='post' name='form_autosize_picture' id='form_autosize_picture'  type='submit'  >
    104 <input id='ret_autosize' name='ret_autosize' type='submit' value='' />
    105 <input id='src_img_h' name='src_img_h' type='text' value='' />
    106 <input id='src_img_w' name='src_img_w'  type='text' value='' />
    107 <input id='window_height' name='window_height' type='text' value='' />
    108 <input id='window_width'  name='window_width' type='text' value='' />
    109 <input id='zoom'  name='zoom' type='text' value='100%' />
    110 </form >
     107<div style="display:none">
     108<form action='' method='post' name='form_autosize_picture' id='form_autosize_picture'  type='submit'  >
     109<input id='ret_autosize' name='ret_autosize' type='hidden' value='' />
     110<input id='src_img_h' name='src_img_h' type='hidden' value='' />
     111<input id='src_img_w' name='src_img_w'  type='hidden' value='' />
     112<input id='window_height' name='window_height' type='hidden' value='' />
     113<input id='window_width'  name='window_width' type='hidden' value='' />
     114<input id='zoom'  name='zoom' type='hidden' value='' />
     115</form ></div>
  • extensions/Autosize/template/conflit.tpl

    r11461 r12527  
    66    var cl_plugin = '{$name}';
    77    var Version_pwg='{$Version_pwg}';
     8
     9    var Cookie_width='{$COOKIE_WIDTH }';
     10    var Cookie_height = '{$COOKIE_HEIGHT }';
     11
    812{if $DEBUG_autosize == "true"}
    913    var cl_query = '{$autosize_parametres->query}';
  • extensions/Autosize/template/picture.tpl

    r11961 r12527  
    1414    title="{'cl_autosize_info_2'|@translate}"
    1515    alt="{'cl_autosize_info_2'|@translate}" />
    16     <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/>{$zoom}
     16    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/><span>
     17    </span>
    1718  </a>
    1819
     
    5152 var src3="{'cl_autosize_info_2'|@translate}";
    5253 var src4 = "{'cl_autosize_info'|@translate}";
     54 var src5 = "{'cl_autosize_info_1'|@translate}";
    5355 </script>
Note: See TracChangeset for help on using the changeset viewer.