Changeset 8093 for extensions/Autosize


Ignore:
Timestamp:
Dec 12, 2010, 5:10:17 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] compatibility with theme simple


Location:
extensions/Autosize
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r8074 r8093  
    265265                     if (info_ToolBar.width > 0)
    266266                         marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
     267                     else if (info_the_page.width>0)
     268                         marge = (Zone_Affichage.width - info_the_page.width) / 2;
    267269
    268270                     var marge_right = marge;
  • extensions/Autosize/js/conflit.js

    r8070 r8093  
    7171var Fn;
    7272function conflit(element, nc) {
    73     //--- cl_conflit   
     73    //--- cl_conflit
     74if (typeof MooTools=="undefined" && typeof  Prototype=="undefined" ) {
     75       ret_element = jQuery(element);
     76        return ret_element;
     77    }
     78    //====================================================
    7479    if (typeof (element) == "string") {
    7580        if (element.match("^#|.ui", "gi")) {
     
    7782            return ret_element;
    7883        }
    79     }
     84   
     85    }
     86
    8087    var retour = (getStackTrace());
    8188    Fn = retour.fn;
    8289    retour = retour.state;
    8390
    84     n = document;
    85     v = window;
    8691    var ret_element = "";
    8792    if (retour.match(RegExp("jQuery", "gi"))) {
     
    8994    }
    9095    else if (retour.match(RegExp("rv_gmaps", "gi"))) {
    91         ret_element = jQuery().$Prototype(element);
     96    try{
     97        ret_element = myjQuery().$Prototype(element);
     98        }
     99        catch(e)
     100        {
     101
     102         ret_element = myjQuery().$Prototype(element);
     103
     104        }
    92105    } else if (retour.match(RegExp("GMaps", "gi"))) {     
    93106
     
    100113
    101114        }
    102         nbpa += 1;
     115       
    103116
    104117    } else if (retour.match(RegExp("luciano", "gi"))) {
     
    113126    if (ret_element != "")
    114127        return ret_element;
    115 
     128       
     129    n = document;
     130    v = window;
     131         nbpa += 1;
    116132    if (typeof (element) == "string") {
    117133        if (element.match("^#|.ui", "gi")) {
     
    126142        }
    127143    } else if (element == document) {
     144
     145        ret_element = jQuery(element);
     146        return ret_element;
     147
     148
     149    } else if (element == window) {
    128150
    129151        ret_element = jQuery(element);
     
    236258//======== prototype.js =====================
    237259if (arguments.length > 1) {
    238 for (var i = 0, elements = [], length = arguments.length; i < length; i++)
    239 elements.push($(arguments[i]));
    240 return elements;
     260    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
     261        elements.push($(arguments[i]));
     262        return elements;
    241263}
    242264if (typeof element == "string")
    243 element = document.getElementById(element);
    244 
    245 return Element.extend(element);
    246 
    247 try {
    248 new_element = Element.extend(element);
    249 } catch (e) {
    250 return new_element;
    251 }
    252 return new_element;
     265    element = document.getElementById(element);
     266
     267//return Element.extend(element);
     268
     269    try {
     270        new_element = Element.extend(element);
     271    } catch (e) {
     272        return new_element;
     273    }
     274    return new_element;
    253275}
    254276//=========================================================
     
    475497}
    476498//====================================
    477 
    478  
    479 $_0= $;
    480 function $(element, nc0) {
    481     a = conflit(element, nc0);
    482     return a;
    483 }
    484 if (typeof ($.ajax) != "function") {
    485     $.ajax = function (origSettings) {
    486         jQuery.ajax(origSettings);
    487     }
    488 
    489 
    490     $.parseJSON = function (msg) {
    491         return jQuery.parseJSON(msg);
    492     }
    493 
    494 
    495 }
    496 //============================================
    497 /* url (String): URl de la page à charger
    498 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
    499 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
    500 * type (String): (optionnel) format des données renvoyées à la fonction de callback
    501 */
    502 if (typeof ($.get) != "function") {
    503     $.get = function ( a, b, c, d) {
    504         return jQuery.get(a, b, c,d );
    505     }
    506 }
    507  
     499test_conflit = false;
     500 librairies =new Array;
     501
     502
    508503
    509504$_ = $;
     
    520515
    521516}
     517
     518(function ($) {
     519    $(document).ready(function () {   
     520          //=================================================
     521          if (typeof  jQuery.fn.infos !="function")
     522          {
     523               jQuery=myjQuery;
     524               $=my$ ;
     525               }
     526        });
     527
     528})(jQuery);
     529
     530if(test_conflit!=true)
     531{
     532//--------------------------------------------------------------
     533$_0 = $;
    522534 
     535        function $(element, nc0) {
     536            if (typeof  jQuery.fn.infos !="function") 
     537             if (typeof  myjQuery !="undefined")
     538                 jQuery=myjQuery;   
     539             a = conflit(element, nc0);
     540            return a;
     541        }
     542       
     543        if (typeof ($.ajax) != "function") {
     544            $.ajax = function (origSettings) {
     545                jQuery.ajax(origSettings);
     546            }
     547
     548
     549            $.parseJSON = function (msg) {
     550                return jQuery.parseJSON(msg);
     551            }
     552
     553
     554        }
     555        //============================================
     556        /* url (String): URl de la page à charger
     557        * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
     558        * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
     559        * type (String): (optionnel) format des données renvoyées à la fonction de callback
     560        */
     561        if (typeof ($.get) != "function") {
     562            $.get = function ( a, b, c, d) {
     563                return jQuery.get(a, b, c,d );
     564            }
     565        }
     566 
     567}
     568//--------------------------------------------------------------
  • extensions/Autosize/js/jquery.dimensions.js

    r7912 r8093  
    3232                        borr = name == 'Height' ? 'Bottom' : 'Right';
    3333                    options = options || false;
    34                     options = jQuery.extend({ margin: options } );
     34                    options = jQuery.extend({ margin: options });
    3535
    3636                    var val = this.is(':visible') ? this[0]['offset' + name] :
     
    299299    };
    300300
    301 
     301    myjQuery = jQuery;
     302    my$ = $;
    302303
    303304})(jQuery);
  • extensions/Autosize/main.inc.php

    r8074 r8093  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.4.2.2
     4Version: 1.4.2.3
    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
  • extensions/Autosize/template/conflit.tpl

    r8057 r8093  
    33  <!--- Ajout scripts {$AUTOSIZE_PATH}--->   
    44{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"  now=1}<!--- RECHARGE DE {$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --->
     5{known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}<!---{$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} --->
     6 {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}<!--- {$AUTOSIZE_PATH|@cat:"js/conflit.js"} --->
     7
    58<script type="text/javascript">
    69    var DEBUG = '{$DEBUG}';
    710</script>
    8 {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}<!--- {$AUTOSIZE_PATH|@cat:"js/conflit.js"} --->
    9 {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"}<!---{$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} --->
     11
    1012<!--- fin Ajout scripts  --->
    1113<script type="text/javascript">
     
    2527</script>
    2628<!---FIN Autosize/template/confilt.tpl (/head) --->     
    27 {/html_head} 
     29{/html_head}
    2830<!---{$ROOT_URL} --- {$AUTOSIZE_PATH}template/confilt.tpl (body) ---> 
    2931<!---FIN {$ROOT_URL} --- {$AUTOSIZE_PATH}template/confilt.tpl (body) --->       
Note: See TracChangeset for help on using the changeset viewer.