Changeset 7536


Ignore:
Timestamp:
Nov 1, 2010, 10:25:51 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] save.

Location:
extensions/Autosize
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/admin/template/admin.tpl

    r7394 r7536  
    11{html_head}
    22 <script type="text/javascript">
     3     var DEBUG = '{$DEBUG}';
    34     var thumbnail = '{$thumbnail}';
    45     var theme = '{$theme}';
  • extensions/Autosize/autosize.inc.php

    r7394 r7536  
    2020// | USA.                                                                  |
    2121// +-----------------------------------------------------------------------+
    22 if (!defined('AUTOSIZE_PATH'))
    23 define('AUTOSIZE_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
     22if (!defined('AUTOSIZE_PATH'))
     23define(
     24  'AUTOSIZE_PATH',
     25   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
     26);
    2427
    2528class autosize_controler {
     
    3639                load_language('lang', AUTOSIZE_PATH);
    3740                $my_path = dirname(__FILE__).'/';
     41
    3842                if (isset( $page['body_id'])  ) {
    3943                if ( $page['body_id']=='thePicturePage'  ) {
     
    4145                               
    4246                                $autosize_parametres = cl_autosize_Get_Options();
    43                                 include (AUTOSIZE_PATH."include/affiche.php");   
     47                                include (AUTOSIZE_PATH."include/affiche.php"); 
     48                                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
     49                                $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ;
     50                               
    4451                                if($autosize_parametres->check_icon_v == 'on'){
     52                                 
    4553                                $template->assign('cl_autosize_button',
    46                                  array(
     54                                 array( 
    4755                                                'cl_autosize_info' => 'cl_autosize_info' ,
    4856                                                'cl_autosize_info_2' => 'cl_autosize_info_2' ,   
     
    5159                                                'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png'
    5260                                        )
     61
    5362                                        );
    5463 
     
    5665                                $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
    5766                                }
     67                                 
     68
    5869                                $template->set_filenames(
    5970                                                array('autosize_content'=> $my_path.'template/autosize.tpl')
    6071                                        );
    61                                        
     72                   $template->assign(
     73                                                array('DEBUG' => $debug   ,
     74                                                'cl_visible' =>  $cl_visible
     75                                                )
     76                                                 );             
     77                                                                       
    6278                                return $template->parse( 'autosize_content', false);
    6379                        }
     
    117133        {
    118134           global  $template,$user,$conf ;
    119 
    120  
    121                 $my_path = dirname(__FILE__).'/';
     135 
     136                 
     137
     138                $my_path =  basename(dirname(__FILE__)).'/' ;
     139        $my_path = dirname(__FILE__).'/';
    122140                $template->set_filenames(
    123                      array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
    124                       );
    125                  
     141                     array('autosize_init'=>$my_path. "template/conflit.tpl" 
     142                         )
     143                      );                 
    126144                $template->assign(
    127                                                 array(
    128                                                 'AUTOSIZE_PATH' => $my_path,
    129 
    130                                                                                         )
     145                                                array('AUTOSIZE_ROOT' => AUTOSIZE_PATH)
    131146                                                 );
    132147
    133                    return $template->parse( 'autosize_cl_init', false);
     148                   return $template->parse( 'autosize_init', false);
    134149
    135150       
     
    141156 
    142157           global  $template,$user,$conf ;
    143                         $my_path = dirname(__FILE__).'/';
     158                        $my_path = realpath(AUTOSIZE_PATH .'/');
     159                       
    144160                        $template->set_filenames(
    145                      array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
     161                     array('autosize_cl_init'=> $my_path.'template/conflit.tpl')
    146162                      );
    147163 /*
  • extensions/Autosize/js/Affiche_script.js

    r7458 r7536  
    1 var cl_visible = true;
     1
    22function Toggle_bp() {
    33    cl_visible = !cl_visible;
     
    2020
    2121jQuery(document).ready(
     22
    2223      function (jQuery) {
     24         
     25
     26          if (DEBUG == "false") {
     27              jQuery("#Debug").hide();
     28              jQuery("#Debug1").hide();
     29              jQuery("#Debug2").hide();
     30          }
    2331          var img_top = "0";
    2432
     
    3038          var marges_llgbo = 0;
    3139          if (llgboframe.length > 0) {
    32 
    33               marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth();
     40              ll1 = jQuery(llgboframe).info();
     41              ll2 = jQuery("#gbo div:last").info();
     42              marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
    3443          }
    3544
     
    4756
    4857
    49 
     58          //=============================================================
    5059          function cl_Timer() {
    5160              //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
     
    6473              setTimeout("cl_Timer()", 500);
    6574          }
     75          //=============================================================
    6676          function onPropertyChange(e) {
    6777              var el = e.srcElement;
     
    8999          */
    90100          function Info_entete(Parent) {
     101         
    91102              var info_imageToolBar = jQuery("#imageToolBar").info();
    92103              if (info_imageToolBar.position == "absolute") {
     
    97108
    98109              if (info_theImage.position == "relative") {
    99                   //--- passage absolute ==> static ===/
     110                  //--- passage relative ==> static ===/
    100111                  jQuery("#theImage").css("position", "static");
    101112                  info_theImage = jQuery("#theImage").info();
     
    108119
    109120              }
    110 
     121 
    111122              marge_top = Info_the_page.top +
    112123                                     Info_the_page.borderwidth.top +
     
    122133          */
    123134          function Info_description(Parent) {
    124               jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "
    125               });
     135
     136
    126137              //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
    127138
     
    136147                      marginRight: "auto",
    137148                      marginTop: "0px",
    138                       marginBottom: "0px"
     149                      marginBottom: "0px", position: "absolute", top: Bandeau + "px"
    139150                  });
    140151              } else {
    141                   jQuery("#" + Parent).css({ padding: "0px",
    142                       marginLeft: "auto",
    143                       marginRight: "auto",
    144                       marginTop: "0px",
    145                       marginBottom: "0px"
     152
     153                  /*   jQuery("#" + Parent).css({ padding: "0px",
     154                  marginLeft: "auto",
     155                  marginRight: "auto",
     156                  marginTop: "0px",
     157                  marginBottom: "0px"
    146158                  });
    147               }
     159                  */
     160
     161              }
     162
     163
     164              //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
     165
    148166
    149167              if (theme.match(RegExp("luciano", "g"))) {
    150                   info_img = jQuery("#" + Parent + " #theImg").info();
     168                  info_img = jQuery("#" + Parent + " #theImg img").info();
     169
    151170              } else {
    152171
     
    165184              //=============================================================================
    166185              info_desc = jQuery("#" + Parent + " p:first").info();
     186              if (info_desc.bottom < info_img.bottom)
     187                  info_desc.bottom = info_img.bottom;
     188
    167189              //  if (info_desc.top > info_img.bottom)
    168190              //     info_description.top = info_desc.top;
    169191
    170 
     192              if (jQuery("#Panorama").length) {
     193                  Type_Img = "panorama";
     194                  //  cl_visible = false;
     195
     196              }
    171197              info_table = jQuery(".infoTable").info();
    172198
     
    180206              if (info_licencetag.bottom > 0) {
    181207                  jQuery(".licencetag").css("border", "solid 5px transparent");
    182                   if (info_licencetag.bottom > info_licencetag.height)
    183                       info_description.bottom = info_licencetag.bottom - 3;
     208                  if (info_licencetag.bottom > info_description.bottom) {
     209                      info_description.bottom = info_licencetag.bottom;
     210                  }
    184211                  else
    185                       info_description.bottom -= info_licencetag.padding.top + info_table.margin.top;
     212                      info_description.bottom += info_table.margin.top + info_table.padding.top;
    186213
    187214              }
     
    217244                  }
    218245              }
     246
     247              if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
     248
    219249              info_description.height = info_description.bottom - info_description.top;
    220250
    221               if (0) {
     251
     252              if (DEBUG == "true") {
     253
    222254                  /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
    223255       
    224                   jQuery("#Debug").hide();
    225                   jQuery("#Debug1").hide();
    226                   jQuery("#Debug2").hide();
     256
    227257                  info_description.width = "800";
    228258                  */
    229 
     259                  jQuery("#Debug").css('display', 'block');
     260                  jQuery("#Debug1").show();
     261                  jQuery("#Debug2").show();
    230262                  Bandeau_bas = info_description;
    231263
     
    257289                  });
    258290                  jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
    259                   //  cl_visible = false;
     291
    260292              }
    261293
     
    285317              jQuery().recentrage_widget();
    286318          })
    287 
     319          jQuery("#icon_gmaps").bind('click', function () {
     320              jQuery().recentrage_widget();
     321          })
    288322
    289323
     
    315349          jQuery(window).resize(function (event, ui) {
    316350              if (typeof (event) == 'undefined') return;
    317               if (!cl_visible) return;
     351              if (!cl_visible == true) return;
    318352              if (eval(user_status + "_enabled") == "") return;
    319353              var chk = eval(user_status + "_enabled");
     
    334368              //===========================================================================
    335369
    336 
    337               var Cadre = jQuery("#theImage").get(0);
    338370
    339371              var Type_Img = "";
     
    349381              } else if (jQuery("#Panorama").length) {
    350382                  Type_Img = "panorama";
    351               } else if (jQuery(Cadre).find("img").length > 0) {
     383              } else if (jQuery("#theImage").find("img").length > 0) {
    352384                  Type_Img = "img";
    353385              } else if (jQuery("img").length > 0) {
     
    360392
    361393
     394              var Cadre = jQuery("#theImage").get(0);
    362395              var info_Cadre = jQuery(Cadre).info();
    363396              //===============  Information cadre ======
     
    379412              var info_theHeader = jQuery("#theHeader").info();
    380413
    381               var marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
     414
     415              var marge = 0;
     416              if (info_ToolBar.width > 0)
     417                  marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
    382418
    383419              var marge_right = marge;
     
    394430
    395431              winwidth -= (marge_right + marge_left);
     432
    396433
    397434
     
    454491
    455492                  case "panorama":
    456 
    457                       var w00 = 0;
    458                       jQuery("#Panorama img").each(function (i) {
    459                           w0 = this.width;
    460                           if (w0 > w00) {
    461                               TheImg = this;
    462                               n = TheImg.nameProp;
    463                               w00 = w0;
    464                           }
    465                       });
    466 
     493                      // return;
     494
     495
     496                      TheImg = Get_Img_Maxi("#Panorama img");
    467497                      info_theImage = jQuery(TheImg).info();
    468498                      info_the_page = jQuery("#the_page").info();
     
    472502
    473503                      if (!TheImg) return;
     504                      if (theme.match(RegExp("luciano", "g"))) {
     505                          TheImg = jQuery("#the_page #theImg");
     506                      }
    474507                      info_theImage = jQuery(TheImg).info();
    475508                      info_the_page = jQuery("#the_page").info();
     
    573606              var Licence = jQuery(".licencetag");
    574607              info_Licence = jQuery(".licencetag").info();
    575               //==================================================================================
     608
    576609              jQuery("#theImage #theImg IMG").css("marginTop", "0px")
    577 
     610              //========== Correction en fonction du thème =============================
    578611              var correction = 0;
    579612              if (theme.match(RegExp("sobre", "g"))) {
     
    584617                  correction += 0; //??
    585618              } else if (theme.match(RegExp("luciano", "g"))) {
    586                   correction += 0; //??
     619                  correction = 0; //??
     620
    587621              } else if (theme.match(RegExp("simple", "g"))) {
    588622                  correction += 0; //??
     
    682716
    683717                  t1 = jQuery(llgboframe).info();
    684 
    685 
     718                  if (!TheImg.src) {
     719                      TheImg = jQuery(TheImg).find("img").get(0)
     720                  }
    686721                  if (TheImg.src) {
    687722
     
    689724                      Image_height -= marges_llgbo; // réduction frame
    690725                      if (rapport > 1) {
    691                           jQuery("#gbo").outerWidth(Image_width);
    692                           jQuery("#gbo").css("width", Image_width + "px");
    693 
     726                          if (Image_width > winwidth) {
     727                              jQuery("#gbo").outerWidth(winwidth);
     728                              jQuery("#gbo").css("width", winwidth + "px");
     729                          }
     730                          else {
     731                              jQuery("#gbo").outerWidth(Image_width);
     732                              jQuery("#gbo").css("width", Image_width + "px");
     733                          }
    694734
    695735                          t1 = jQuery("#gbo div:last").info();
    696736
    697                           Image_width = jQuery("#gbo div:last").innerWidth();
     737                          Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
    698738                          Image_height = parseInt(Image_width / rapport);
    699739
    700740                          jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
    701741                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    702                           if ( jQuery.browser.msie) {
    703                               jQuery("#gbo").css("paddingBottom", 18 + "px");
     742                          if (jQuery.browser.msie) {
     743                              jQuery("#gbo").css("paddingBottom", 17 + "px");
    704744                          }
    705745
     
    707747                          Image_height -= 4;
    708748                          Image_width -= 4;
     749                          if (Image_width > winwidth) {
     750                              jQuery("#gbo").outerWidth(winwidth);
     751                              jQuery("#gbo").css("width", winwidth + "px");
     752                          }
     753                          else {
     754                              jQuery("#gbo").outerWidth(Image_width);
     755                              jQuery("#gbo").css("width", Image_width + "px");
     756                          }
     757
    709758                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
     759                          jQuery("#gbo").height(Image_height + marges_llgbo);
     760
    710761                          jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
    711 
    712                           Image_width = jQuery("#gbo div:last").innerWidth();
    713                           Image_height = parseInt(Image_width / rapport);
     762                          jQuery("#gbo").width(Image_width + marges_llgbo);
     763
     764
     765
     766                          if (jQuery.browser.msie) {
     767                              jQuery("#gbo").css("paddingBottom", 17 + "px");
     768                          }
    714769
    715770                      }
    716 
     771                      //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
     772                      a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
    717773                      a1 = jQuery("area[rel=prev]");
    718774                      a2 = jQuery("area[rel=next]");
    719 
     775                      a3 = jQuery("area[rel=up]");
     776                      nb_zone = 3;
    720777                      if (a1.length == 0) {
    721                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
    722                           jQuery("area[rel=up]").attr({ coords: "'" + 0 + ",0," + Image_width / 2 + "," + Image_height + "'" });
    723                           jQuery("area[rel=next]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width) + "," + Image_height + "'" });
    724 
    725                       } else if (a2.length == 0) {
    726                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 2 + "," + Image_height + "'" });
    727                           jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width * 2) / 2 + "," + Image_height + "'" });
    728                           jQuery("area[rel=next]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
    729 
     778                          nb_zone -= 1;
     779                      }
     780                      if (a2.length == 0) {
     781                          nb_zone -= 1;
     782                      }
     783
     784
     785                      var Largeur_zone = (Image_width / nb_zone);
     786                      var Hauteur_zone = (Image_height);
     787                      var init_zone = 0;
     788
     789                      if (a1.length > 0) {
     790                          coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
     791
     792                          jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     793                          init_zone += Largeur_zone;
     794                      }
     795
     796                      coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     797
     798                      if (a0.length > 0) {
     799                          jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
     800                          jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
    730801                      } else {
    731 
    732                           jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 3 + "," + Image_height + "'" });
    733                           jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 3 + ",0," + (Image_width * 2) / 3 + "," + Image_height + "'" });
    734                           jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * 2) / 3 + ",0," + (Image_width) + "," + Image_height + "'" });
     802                          jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
    735803                      }
    736 
     804                      init_zone += Largeur_zone;
     805
     806                      if (a2.length > 0) {
     807                          coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     808                          jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     809                      }
     810
     811
     812
     813
     814
     815                      /*
     816                      jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / nb_zone + "," + Image_height + "'" });
     817                      jQuery("area[rel=up]").attr({ coords: "'" + Image_width * (nb_zone - 1) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + "," + Image_height + "'" });
     818                      jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * (nb_zone - 1)) / (nb_zone + 1) + ",0," + (Image_width * (nb_zone + 1)) / (nb_zone + 1) + "," + Image_height + "'" });
     819                      */
    737820
    738821                  }
     
    742825              //  Image_height, Image_width = valeur a atteindre.
    743826              if (theme.match(RegExp("luciano", "g"))) {
     827                  //---- information en dehors du cadre
    744828                  Zone_Affichage.height -= Bandeau_bas.height;
    745829                  jQuery(Cadre).height(Zone_Affichage.height);
     
    749833              //=========================================================
    750834
    751               jQuery(Cadre).css("top", "0px");
     835              //  jQuery(Cadre).css("top", "0px");
    752836              jQuery("#standard").css("top", 0 + "px");
    753837              jQuery("#comments").css("top", 0 + "px");
     
    794878              } else if (Type_Img == "panorama") {
    795879
    796                   //      jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
    797                   jQuery(TheImg).height(img_finale.height);
    798                   jQuery(TheImg).width(img_finale.width);
     880                  // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
     881                  // jQuery(TheImg).height(img_finale.height);
     882                  // jQuery(TheImg).width(img_finale.width);
    799883                  jQuery("#Panorama div").height(Image_height);
    800884                  //  class=simple_panorama
     
    854938                  jQuery(TheImg).css("height", img_finale.height + "px");
    855939                  jQuery(TheImg).css("width", img_finale.width + "px");
     940
    856941              }
    857942
     
    889974                      if (jQuery("#navThumbPrev").length > 0) {
    890975                          jQuery("#navThumbPrev").css({ height: info_img.height + "px",
    891                               top: info_img.top 
     976                              top: info_img.top
    892977                          });
    893978                      }
    894979                      if (jQuery("#navThumbNext").length > 0) {
    895980                          jQuery("#navThumbNext").css({ height: info_img.height + "px",
    896                               top: info_img.top 
     981                              top: info_img.top
    897982                          });
    898983                      }
     
    902987                  } else {
    903988
    904                       jQuery("#imageToolBar").css("position", "static");
     989                      //    jQuery("#imageToolBar").css("position", "static");
    905990                  }
    906991              } catch (e) {
     
    9461031
    9471032      } // function
    948 );                                                                                                                                                                                                                                                                                                                                                                                         // ready
     1033);                                                                                                                                                                                                                                                                                                                                                                                                                                // ready
    9491034    /*
    9501035*
  • extensions/Autosize/js/conflit.js

    r7394 r7536  
    1 //==== remplace $(... avec jQuery( ====
     1//==== autosize  remplace $(... avec jQuery( ====
    22var d1 = 0;
    33var init_tb = 0;
    4 function addEvent2(obj, type, fn) {
    5     if (obj.addEventListener) {
    6         obj.addEventListener(type, fn, false);
    7         EC.add(obj, type, fn);
    8     }
    9     else if (obj.attachEvent) {
    10         obj["e" + type + fn] = fn;
    11         obj[type + fn] = function () {
    12             obj["e" + type + fn](window.event);
    13         }
    14         obj.attachEvent("on" + type, obj[type + fn]);
    15         EC.add(obj, type, fn);
    16     }
    17     else {
    18         obj["on" + type] = obj["e" + type + fn];
     4/*
     5function $(element, nc) {
     6    if (MooTools.version == "1.2.4") {
     7        MooTools_version = "Luciano"; // luciano
     8        return  jQuery().$Luciano(element, nc);
    199    }
    2010}
    21 function $(element, nc) {
    22     //============== détection framework ==================
    23    
    24 
    25     var tp1 = typeof (MooTools);
    26     var MooTools_version = "0";
    27 
    28     if (tp1 != "undefined") {
    29         if (MooTools.version == "1.2.4") {
    30             MooTools_version = "Luciano"; // luciano
    31             ret_Luciano = jQuery().$Luciano(element, nc);
    32         }
    33 
    34     if (MooTools.version == "1.11") {
    35         MooTools_version = "pamoorama"; //pamoorama
    36         try {
    37            
    38         } catch (e) {
    39        
    40         };
    41         }
    42 
    43 
     11*/
     12jQuery(window).load(function () {
     13    if (jQuery("#theImage").css("position") == "relative") {
     14        //==== compatibilité Gally/LLGBO ===
     15        //--- passage relative ==> static ===/
     16        jQuery("#theImage").css("position", "static");
    4417    }
    45 
    46     tp1 = typeof (Prototype);
    47    var Prototype_Version = '0';
    48    if (tp1 != "undefined") {
    49        if (Prototype.Version == '1.6.0.2') {
    50            Prototype_Version = '1602';
    51          
    52        } else if (Prototype.Version == '1.6.1') {
    53           Prototype_Version = '161';
    54          
    55        } else if (Prototype.Version == '1.0.0.0') {
    56           Prototype_Version = '1';
    57        
    58        }
    59    }
    60      //===================================================
    61    var  jq = jQuery(element).selector;
    62    var  new_element = jQuery(element);
    63    //div.gmapsPopup div.ui-dialog-titlebar
    64    if (jq.match(/GMaps/) || jq.match(/gmaps/)) {   
    65        if (jq == "#iGMapsIconContent") {           
    66            setTimeout('jQuery().recentrage_widget()', 0);
    67        }
    68        if (new_element.length > 0) return new_element;
    69        return new_element;
    70        }
    71        if (Prototype_Version == "0" && MooTools_version == "0") {   
    72       return new_element;
    73     }
    74 //=======================================================================================
    75     if (arguments.caller && arguments.caller.length > 0) {
    76         if (arguments.caller.length > 1) {
    77             if (element == "pamoorama") {
    78                 return jQuery().$Pamoorama(element);
    79             }
    80             arg = arguments.caller[1];
    81             if (typeof (arg) != "undefined" && typeof (arg) != undefined) {
    82                 //=========== options rv_maps prototype.js ===================================   
    83 
    84                 if (Prototype_Version != '0')
    85                     switch (arg) {
    86                     case "dom:loaded":
    87                         return element;
    88                         return jQuery().$Protype(element);
    89                         break;
    90                     case "load":
    91                         return jQuery().$Protype(element);
    92                         break;
    93                     case "unload":
    94                         return jQuery().$Protype(element);
    95                         break;
    96                     case "prototype_event_registry":
    97 
    98                         try {
    99                             new_element = jQuery().$Protype(element);
    100                         } catch (e) {
    101                             new_element = null;
    102                         }
    103 
    104 
    105                         return new_element;
    106                         break;
    107                     case "readystatechange":
    108                         try {
    109                             new_element = jQuery().$Protype(element);
    110                         } catch (e) {
    111                             new_element = null;
    112                         }
    113 
    114                         return new_element;
    115                         break;
    116                 }
    117 
    118                 if (MooTools_version == 'pamoorama' && typeof (arg) != undefined)
    119                 //=========== options pamoorama =================================== 
    120                 {
    121                     var reg1 = new RegExp("pamoorama", "g");
    122                     switch (arg) {
    123                         case "bottom":
    124                             return jQuery().$Pamoorama(element);
     18    tp = typeof (Browser);
     19    if (tp !="undefined")
     20        if (Browser.loaded == true) {
     21            n = Browser;
     22        }
     23
     24    function $(element, nc) {
     25        //============== détection framework ==================
     26
     27
     28        var tp1 = typeof (MooTools);
     29        var MooTools_version = "0";
     30
     31        if (tp1 != "undefined") {
     32            if (MooTools.version == "1.2.4") {
     33                MooTools_version = "Luciano"; // luciano
     34                ret_Luciano = jQuery().$Luciano(element, nc);
     35            }
     36
     37            if (MooTools.version == "1.11") {
     38                MooTools_version = "pamoorama"; //pamoorama
     39                try {
     40
     41                } catch (e) {
     42
     43                };
     44            }
     45
     46
     47        }
     48
     49        tp1 = typeof (Prototype);
     50        var Prototype_Version = '0';
     51        if (tp1 != "undefined") {
     52            if (Prototype.Version == '1.6.0.2') {
     53                Prototype_Version = '1602';
     54
     55            } else if (Prototype.Version == '1.6.1') {
     56                Prototype_Version = '161';
     57
     58            } else if (Prototype.Version == '1.0.0.0') {
     59                Prototype_Version = '1';
     60
     61            }
     62        }
     63        //===================================================
     64        var jq = jQuery(element).selector;
     65        var new_element = jQuery(element);
     66        //div.gmapsPopup div.ui-dialog-titlebar
     67        if (jq.match(/GMaps/) || jq.match(/gmaps/)) {
     68            if (jq == "#iGMapsIconContent") {
     69                setTimeout('jQuery().recentrage_widget()', 0);
     70            }
     71            if (new_element.length > 0) return new_element;
     72            return new_element;
     73        }
     74        if (Prototype_Version == "0" && MooTools_version == "0") {
     75            return new_element;
     76        }
     77        //=======================================================================================
     78        if (arguments.caller && arguments.caller.length > 0) {
     79            if (arguments.caller.length > 1) {
     80                if (element == "pamoorama") {
     81                    return jQuery().$Pamoorama(element);
     82                }
     83                arg = arguments.caller[1];
     84                if (typeof (arg) != "undefined" && typeof (arg) != undefined) {
     85                    //=========== options rv_maps prototype.js ===================================   
     86
     87                    if (Prototype_Version != '0')
     88                        switch (arg) {
     89                        case "dom:loaded":
     90                            return element;
     91                            return jQuery().$Prototype(element);
    12592                            break;
    126                         case "left":
    127                             return jQuery().$Pamoorama(element);
     93                        case "load":
     94                            return jQuery().$Prototype(element);
     95                            break;
     96                        case "unload":
     97                            return jQuery().$Prototype(element);
    12898                            break;
    12999                        case "prototype_event_registry":
    130                             return jQuery().$Pamoorama(element);
     100
     101                            try {
     102                                new_element = jQuery().$Prototype(element);
     103                            } catch (e) {
     104                                new_element = null;
     105                            }
     106
     107
     108                            return new_element;
    131109                            break;
    132110                        case "readystatechange":
    133                             return jQuery().$Pamoorama(element);
    134                             break;
    135 
    136                         default:
    137                             if (arg.area) {
    138                                 return jQuery().$Pamoorama(element);
    139                             } else
    140                                 if (arg.velocity) {
    141                                     return jQuery().$Pamoorama(element);
    142                                 } else if (arg.src) {
    143                                     return jQuery().$Pamoorama(element);
    144                                 } else if (arg.modifiers) {
    145                                     return jQuery().$Pamoorama(element);
    146                                 } else if (arg.limit) {
    147                                     return jQuery().$Pamoorama(element);
    148                                 } else if (arg.duration) {
    149                                     return jQuery().$Pamoorama(element);
    150                                 } else if (arg.id) {
    151                                     switch (arg.id) {
    152                                         case "pamoorama_footer":
    153                                             return jQuery().$Pamoorama(element);
    154                                             break;
    155                                         case "pamoorama_outter":
    156                                             return jQuery().$Pamoorama(element);
    157                                             break;
    158                                         case "pamoorama_inner":
    159                                             return jQuery().$Pamoorama(element);
    160                                             break;
    161 
    162                                         default:
    163                                             return jQuery().$Pamoorama(element);
    164                                             break;
    165 
    166                                     }
    167                                 } else if (arg.src) {
    168                                     return jQuery().$Pamoorama(element);
    169 
     111                            try {
     112                                new_element = jQuery().$Prototype(element);
     113                            } catch (e) {
     114                                new_element = null;
     115                                try {
     116                                    new_element = jQuery().$Luciano(element, nc);
     117                                    new_element = jQuery(element).get(0);
     118                                } catch (e) {
     119                                    new_element = null;
    170120                                }
    171                             //=======================================================
     121
     122                            }
     123
    172124                            return new_element;
    173125                            break;
    174 
    175                     }
    176                 } else if (MooTools_version == 'Luciano') { //=========== options luciano ===================================
     126                    }
     127
     128                    if (MooTools_version == 'pamoorama' && typeof (arg) != undefined)
     129                    //=========== options pamoorama =================================== 
     130                    {
     131                        var reg1 = new RegExp("pamoorama", "g");
     132                        switch (arg) {
     133                            case "bottom":
     134                                return jQuery().$Pamoorama(element);
     135                                break;
     136                            case "left":
     137                                return jQuery().$Pamoorama(element);
     138                                break;
     139                            case "prototype_event_registry":
     140                                return jQuery().$Pamoorama(element);
     141                                break;
     142                            case "readystatechange":
     143                                return jQuery().$Pamoorama(element);
     144                                break;
     145
     146                            default:
     147                                if (arg.area) {
     148                                    return jQuery().$Pamoorama(element);
     149                                } else
     150                                    if (arg.velocity) {
     151                                        return jQuery().$Pamoorama(element);
     152                                    } else if (arg.src) {
     153                                        return jQuery().$Pamoorama(element);
     154                                    } else if (arg.modifiers) {
     155                                        return jQuery().$Pamoorama(element);
     156                                    } else if (arg.limit) {
     157                                        return jQuery().$Pamoorama(element);
     158                                    } else if (arg.duration) {
     159                                        return jQuery().$Pamoorama(element);
     160                                    } else if (arg.id) {
     161                                        switch (arg.id) {
     162                                            case "pamoorama_footer":
     163                                                return jQuery().$Pamoorama(element);
     164                                                break;
     165                                            case "pamoorama_outter":
     166                                                return jQuery().$Pamoorama(element);
     167                                                break;
     168                                            case "pamoorama_inner":
     169                                                return jQuery().$Pamoorama(element);
     170                                                break;
     171
     172                                            default:
     173                                                return jQuery().$Pamoorama(element);
     174                                                break;
     175
     176                                        }
     177                                    } else if (arg.src) {
     178                                        return jQuery().$Pamoorama(element);
     179
     180                                    }
     181                                //=======================================================
     182                                return new_element;
     183                                break;
     184
     185                        }
     186                    } else if (MooTools_version == 'Luciano') { //=========== options luciano ===================================
     187                        //=== theme Luciano ====
     188                        return ret_Luciano;
     189                    }
     190
     191                }
     192            }
     193        }
     194
     195        //==================================================
     196        tpe = typeof (element);
     197        if (Prototype_Version != '0') {
     198            if (tpe == "string") {
     199                //=== rvmaps === //
     200                if (element.match(/[a-z]_[a-z]/)) {
     201
     202                    return jQuery().$Prototype(element);
     203                }
     204                id = "window_" + new Date().getTime();
     205                reg1 = new RegExp("^window_", "g");
     206                if (element.match(reg1, "g")) {
     207
     208                    if (element.match(/_[a-z]/)) {
     209                        return jQuery().$Prototype(element);
     210                    }
     211                    return null;
     212                }
     213            }
     214        }
     215        //========== test jQuery ? ==============
     216
     217        if (jq.match(RegExp("^#", "g")) || jq == "html") {
     218            return new_element;
     219        }
     220        if (tpe == "undefined") {
     221            return jQuery();
     222        }
     223        //==== mootools ====
     224        if (MooTools_version == "Luciano" && tpe == "string") {
     225            //=== theme Luciano ====
     226            new_element = jQuery().$Luciano(element, nc);
     227            if (element == "order") return new_element;
     228            if (element == "themeSelect") return new_element;
     229            if (element == "languageSelect") return new_element;
     230            if (element == 'linkPrev') return new_element;
     231            if (element == 'linkNext') return new_element;
     232            if (element == 'rateForm') return new_element;
     233        }
     234
     235        if (MooTools_version == 'pamoorama')
     236        //=========== options pamoorama =================================== 
     237        {
     238
     239            if (tpe == "string")
     240                switch (jq) {
     241                case "ie_ready":
     242                    return jQuery().$Pamoorama(element);
     243                    break;
     244                case "pamoorama":
     245                    return jQuery().$Pamoorama(element);
     246                    break;
     247                case ".tab a":
     248                    return jQuery(element);
     249                    break;
     250
     251            } else if (tpe == "boolean") {
     252                return jQuery().$Pamoorama(element);
     253            }
     254            el = element.nodeName;
     255            if (el == "DIV") return jQuery().$Pamoorama(element);
     256            if (el == "IMG") return jQuery().$Pamoorama(element);
     257            if (el == "#document") return jQuery(element);
     258            if (el == "BODY") {
     259                try { return jQuery().$Pamoorama(element) } catch (e) {
     260                    return jQuery(element);
     261                };
     262
     263            }
     264            if (element == window)
     265                return new_element;
     266            jQuery().$Pamoorama(element);
     267        }
     268        obj_panorama = jQuery("#Panorama");
     269        if (obj_panorama.length > 0 && jq != "rateForm" && jq != "order" && jq != "themeSelect") {
     270            if (tpe == "object")
     271                if (Prototype_Version != '0') {
     272                    //=== rvmaps ===
     273                    try {
     274                        elem_retour = jQuery().$Prototype(element);
     275                        return elem_retour;
     276                    } catch (e) {
     277
     278                    }
     279                }
     280
     281            if (new_element.length < 2) return new_element;
     282            if (new_element.length == 2) return jQuery(element).get(1);
     283            if (new_element.length == 3) return jQuery(element).get(2);
     284
     285        }
     286        afq = jQuery(document).data("initialized"); //2
     287        if (element == window && afq != 1)
     288            if (init_tb == 1) {
     289                init_tb = 2;
     290                return new_element;
     291            }
     292
     293
     294        //========= ????  ===================
     295        if (new_element != null) {
     296            if (typeof (new_element.context) != "undefined") {
     297                if (afq != 1 && afq != undefined) {
     298                    if (init_tb != 2) init_tb = 1;
     299                    return new_element;
     300                }
     301                if (new_element.context.loaded) {
    177302                    //=== theme Luciano ====
    178                     return ret_Luciano;
    179                 }
    180 
    181             }
    182         }
    183     }
    184 
    185      //==================================================
    186      tpe = typeof (element);
    187       if (Prototype_Version != '0') {
    188           if (tpe == "string") {   
    189            //=== rvmaps === //
    190               if (element.match(/[a-z]_[a-z]/)) {
    191                  
    192                   return jQuery().$Protype(element);
    193               }
    194           id = "window_" + new Date().getTime();
    195               reg1 = new RegExp("^window_", "g");
    196               if (element.match(reg1, "g")) {
    197                  
    198                   if (element.match(/_[a-z]/)) {
    199                       return jQuery().$Protype(element);
    200                   }
    201                   return null;
    202               }
    203           }
    204      }
    205     //========== test jQuery ? ==============
    206 
    207     if (jq.match(RegExp("^#", "g")) || jq == "html") {
    208         return new_element;
    209     }
    210      if (tpe == "undefined") {
    211         return jQuery();
    212     }
    213     //==== mootools ====
    214     if (MooTools_version == "Luciano" && tpe=="string") {
    215         //=== theme Luciano ====
    216         new_element = jQuery().$Luciano(element, nc);
    217         return new_element;
    218 
    219     }
    220 
    221     if (MooTools_version == 'pamoorama')
    222     //=========== options pamoorama =================================== 
    223     {
    224      
    225     if (tpe=="string")
    226         switch (jq) {
    227             case "ie_ready":
    228                 return jQuery().$Pamoorama(element);
    229                 break;
    230             case "pamoorama":
    231                 return jQuery().$Pamoorama(element);
    232                 break;
    233             case ".tab a":
    234                 return jQuery(element);
    235                 break;
    236 
    237         }else if(tpe=="boolean")
    238         {
    239             return jQuery().$Pamoorama(element);
    240         }
    241         el = element.nodeName;
    242         if (el == "DIV") return jQuery().$Pamoorama(element);
    243         if (el == "IMG") return jQuery().$Pamoorama(element);
    244         if (el == "#document") return jQuery(element) ;
    245         if (el == "BODY") {
    246             try { return jQuery().$Pamoorama(element) } catch (e) {
    247   return jQuery(element);
    248             };
    249          
    250         }
    251         if (element == window)
    252             return new_element;
    253        jQuery().$Pamoorama(element);
    254     }
    255     obj_panorama = jQuery("#Panorama");
    256     if (obj_panorama.length > 0 && jq != "rateForm" && jq != "order" && jq != "themeSelect") {
    257         if (tpe == "object")
    258             if (Prototype_Version != '0') {
    259                 //=== rvmaps ===
    260                 try { elem_retour=jQuery().$Protype(element);
    261                     return elem_retour;
    262                 } catch (e) {
    263                      
    264                 }
    265             }
    266 
    267         if (new_element.length < 2) return new_element;
    268         if (new_element.length == 2) return jQuery(element).get(1);
    269         if (new_element.length == 3) return jQuery(element).get(2);
    270 
    271     }
    272     afq = jQuery(document).data("initialized"); //2
    273     if (element == window && afq != 1)
    274         if (init_tb == 1) {
    275             init_tb = 2;
    276             return new_element;
    277         }
    278 
    279     if (new_element.context && afq != 1 && afq != undefined) {
    280         if (init_tb != 2) init_tb = 1;
    281         return new_element;
    282     }
    283     //========= ????  ===================
    284     if (new_element.context)
    285         if (new_element.context.loaded) {
    286     //=== theme Luciano ====
    287         if (MooTools_version == "Luciano")  return ret_Luciano;
    288         //=== theme gally ? ====
    289         if (Prototype_Version != '0') {
    290             //=== rvmaps ===
    291             try {
    292                 return jQuery(element);
    293             } catch (e) {
    294                return jQuery().$Protype(element);
    295             }
    296         }
    297         }
    298     init_tb = 0;
    299     //================================================================
     303                    if (MooTools_version == "Luciano") {
     304                        try {
     305                            ret_el = jQuery().$Prototype(element);
     306                            return ret_el;
     307                        } catch (e) {
     308                            jQuery("#Debug").text(e.message);
     309                            return ret_Luciano;
     310                        }
     311                    }
     312                    //=== theme gally ? ====
     313                    if (Prototype_Version != '0') {
     314                        //=== rvmaps ===
     315                        try {
     316                            return jQuery(element);
     317                        } catch (e) {
     318                            return jQuery().$Prototype(element);
     319                        }
     320                    }
     321                }
     322            }
     323        }
     324        init_tb = 0;
     325        //================================================================
    300326
    301327        //==== mootools ====
    302328        if (MooTools_version == "Luciano") {
    303329            //=== theme Luciano ====
     330            tp = this;
    304331            new_element = ret_Luciano;
    305             tp = new_element.nodeName + new_element.nodeType;
    306             if (tp == "DIV1") return new_element;
    307             tp = element.nodeName + element.nodeType;
    308             return new_element;
    309 
     332            //$(this.options.container)
     333            if (new_element != null) {
     334                if (new_element.nodeName) {
     335                    tp = new_element.nodeName + new_element.nodeType;
     336                    if (tp == "DIV1") return new_element;
     337                    if (tp == "SELECT1") return new_element;
     338                    tp = element.nodeName + element.nodeType;
     339                    return new_element;
     340                }
     341
     342            }
    310343        } else if (MooTools_version == "pamoorama") {
    311344            //=== paMOOramics ===
     
    314347        }
    315348
    316     //=================================================================
    317 
    318     if (Prototype_Version != '0') {
    319         //=== rvmaps ===
    320         try {
    321             return jQuery().$Protype(element);
    322         } catch (e) {
    323             return jQuery(element);
    324         }
     349        //=================================================================
     350
     351        if (Prototype_Version != '0') {
     352            //=== rvmaps ===
     353            try {
     354                return jQuery().$Prototype(element);
     355            } catch (e) {
     356                return jQuery(element);
     357            }
     358        }
     359        return jQuery(element);
     360
    325361    }
    326     return jQuery(element);
    327 
    328 }
    329 
     362});
    330363//=========================================================
    331364(function ($) {
     
    389422    },
    390423    //===================================================
    391     $Protype: function (element) {
     424    $Prototype: function (element) {
    392425        //======== prototype.js =====================
    393426        if (arguments.length > 1) {
  • extensions/Autosize/main.inc.php

    r7458 r7536  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.2.7
     4Version: 1.2.8
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
     
    1515$autosize_controler = new autosize_controler();
    1616
    17 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 45 );
     17
     18add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 );
    1819
    1920
    2021add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    21 add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),40 );
     22
     23//add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script'),40 );
     24add_event_handler('loc_begin_index', array(&$autosize_controler, 'cl_autosize_script'),51 );
     25//add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),40 );
    2226
    2327?>
  • extensions/Autosize/template/autosize.tpl

    r7394 r7536  
    11 {* $Id: autosize/template/picture.tpl  *}
    2  <!-- autosize/template/picture.tpl  -->   
     2   
     3 {html_head}
     4<!-- autosize/template/picture.tpl  -->
     5    {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1}
     6    {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
     7    {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}
    38
    4   {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1}
    5   {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
    6    {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}
    79{*jQuery is always available by default*}
    8  <script type="text/javascript">
     10
     11 <script type="text/javascript"> 
     12    var cl_visible = "{$cl_visible}" =="true";
     13    var DEBUG = '{$DEBUG}';
    914    var thumbnail = '{$thumbnail}';
    1015    var theme = '{$theme}';
     
    4853     </script>
    4954
     55{known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"}
     56
     57 <!--  << autosize/template/picture.tpl   -->
     58{/html_head} 
    5059
    5160
    52  <!--  << autosize/template/picture.tpl   -->
     61{if $DEBUG == "true"}
     62  {assign var="visible" value="block"}
    5363
     64
     65 
    5466<!---  autosize/template/picture.tpl  body --->
    55 {known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"}
    56  <!--  << autosize/template/picture.tpl body  -->
    57  {html_head} 
    58   {/html_head} 
    5967  <div id="Debug"  align=center style="color:black;z-index:2000;position:absolute; background-color:Beige; top:0px;left:0px;width:800px;margin:auto;"></div>
    6068   <div id="Debug1"  align=center style="color:black;z-index:2000;position:absolute; background-color:Beige; top:0px;left:0px;width:800px;margin:auto;"></div>
    6169  <div id="Debug2"  align=center style="color:black;z-index:2000;position:absolute; background-color:Beige; top:0px;left:0px;width:800px;margin:auto;"></div>
     70 {else}
     71  {assign var="visible" value="none"} {/if}<!--  << autosize/template/picture.tpl body  -->
  • extensions/Autosize/template/picture.tpl

    r7193 r7536  
    1919 var src2="{$cl_autosize_button.ICON2}";
    2020 var src3="{'cl_autosize_info_2'|@translate}";
    21  var src4="{'cl_autosize_info'|@translate}";
    22 
     21 var src4 = "{'cl_autosize_info'|@translate}";
    2322
    2423 </script>
Note: See TracChangeset for help on using the changeset viewer.