Changeset 7618


Ignore:
Timestamp:
Nov 4, 2010, 10:07:40 AM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] Improvement compatibility Gmaps, rvmaps,pamooramic.

Location:
extensions/Autosize/js
Files:
2 edited

Legend:

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

    r7606 r7618  
    2323function wait_Timer() {
    2424    old_w = 0
     25 
    2526    if (DEBUG == "true") {
    2627        info_pamoorama_outter = jQuery("#pamoorama_outter").info();
     
    2930            position: "absolute",
    3031            border: "solid 1px green",
    31             top: 100 + "px",
     32            top: 400 + "px",
    3233            width: (200) + "px",
    33             height: 200 + "px"
     34            height: 400 + "px"
    3435        });
    3536        jQuery("#Debug1").text("Debug1:info : " + info_pamoorama_outter.width +
     
    3738    );
    3839    }
    39     jQuery(window).resize();
    40  
     40    if (jQuery("#pamoorama").length>0)
     41        if (info_pamoorama_outter.height == 0) {
     42       
     43            setTimeout('wait_Timer()', 300);
     44            return
     45        }
     46       jQuery(window).resize();
     47       jQuery("#theImage").css({       filter: 'alpha(opacity:100)',opacity:1 });
    4148
    4249}
     
    6168
    6269      function (jQuery) {
     70          jQuery("#theImage").css({ filter: 'alpha(opacity:10)', opacity: "0.1" });
     71
     72          jQuery(window).load(function () {
     73              setTimeout('wait_Timer()', 600);
     74             
     75             // jQuery("#theImage").get(0).attachEvent('onpropertychange', onPropertyChange);
     76          }
     77         );
    6378
    6479
     
    362377          * window .resize
    363378          */
    364           jQuery(window).resize();
    365           setTimeout('jQuery(window).resize()', 300);
     379
    366380
    367381          jQuery(window).resize(function (event, ui) {
     
    370384              if (eval(user_status + "_enabled") == "") return;
    371385              var chk = eval(user_status + "_enabled");
    372 
    373386
    374387
     
    10851098
    10861099      } // function
    1087 );                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // ready
     1100);                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // ready
    10881101    /*
    10891102*
  • extensions/Autosize/js/conflit.js

    r7606 r7618  
    33var init_tb = 0;
    44
    5 
    65function $(element, nc) {
    7      
     6    nc = this;
     7 //   element, key, defaultValue
    88                  return conflit(element, nc);
    99              }
     
    4444        var tp1 = typeof (MooTools);
    4545        var MooTools_version = "0";
     46        ret_mootool=jQuery(element) ;
     47        ret_Luciano =ret_mootool ;
     48        ret_pamoorama = ret_mootool;
    4649
    4750        if (tp1 != "undefined") {
     
    4952            if (MooTools.version == "1.2.4") {
    5053                MooTools_version = "Luciano"; // luciano
    51                 ret_Luciano = jQuery().$Luciano(element, nc);
     54              ret_Luciano = jQuery().$Luciano(element, nc) ;
    5255            }
    5356
    5457            if (MooTools.version == "1.11") {
    5558                MooTools_version = "pamoorama"; //pamoorama
     59                ret_pamoorama =  jQuery().$Pamoorama(element)
    5660            }
    5761
     
    6165        tp1 = typeof (Prototype);
    6266        var Prototype_Version = '0';
     67        ret_proto=jQuery();
    6368        if (tp1 != "undefined") {
    6469            if (Prototype.Version == '1.6.0.2') {
    6570                Prototype_Version = '1602';
    66 
     71                 ret_proto=jQuery().$Prototype(element) ;
    6772            } else if (Prototype.Version == '1.6.1') {
    6873                Prototype_Version = '161';
    69 
     74                 ret_proto=jQuery().$Prototype(element) ;
    7075            } else if (Prototype.Version == '1.0.0.0') {
    7176                Prototype_Version = '1';
    72 
     77                ret_proto=jQuery().$Prototype(element) ;
    7378            }
    7479        }
    7580        //===================================================
     81       
     82     
    7683        var jq = jQuery(element).selector;
    77         var new_element = jQuery(element);
     84        var ret_el ={  prototype : ret_proto,
     85                        pamoorama : ret_pamoorama,
     86                        jquery :     jQuery(element),
     87                        Luciano: ret_Luciano
     88                    };
     89
     90                    if (element == window) {
     91                        if (typeof (Gmaps_status) != "undefined") {
     92                        if (Gmaps_status )
     93                            return ret_el.jquery;
     94                        }
     95                         
     96                        if (Prototype_Version != "0") return ret_el.prototype; //rv_gmaps
     97                        if (MooTools_version == "pamoorama") return ret_el.pamoorama;
     98                        return ret_el.jquery;
     99                        j = nc;
     100
     101                    }
     102
     103        //===================================================
    78104        //div.gmapsPopup div.ui-dialog-titlebar
    79         if (jq.match(/GMaps/) || jq.match(/gmaps/)) {
     105                    if (jq.match(/GMaps/) || jq.match(/gmaps/)) {
     106                        Gmaps_status = true;
    80107            if (jq == "#iGMapsIconContent") {
    81108                setTimeout('jQuery().recentrage_widget()', 0);
    82109            }
    83             if (new_element.length > 0) return new_element;
    84             return new_element;
     110            if (ret_el.jquery.length > 0) return ret_el.jquery;
     111            return ret_el.jquery;
    85112        }
    86113        if (Prototype_Version == "0" && MooTools_version == "0") {
    87             return new_element;
     114            return ret_el.jquery;
    88115        }
    89116        //=======================================================================================
     
    91118            if (arguments.caller.length > 1) {
    92119                if (element == "pamoorama") {
    93                     return jQuery().$Pamoorama(element);
     120                    return ret_el.pamoorama
    94121                }
    95122                arg = arguments.caller[1];
     
    101128                        case "dom:loaded":
    102129                            return element;
    103                             return jQuery().$Prototype(element);
     130                            return ret_el.prototype
    104131                            break;
    105132                        case "load":
    106                             return jQuery().$Prototype(element);
     133                            return ret_el.prototype
    107134                            break;
    108135                        case "unload":
    109                             return jQuery().$Prototype(element);
     136                            return ret_el.prototype
    110137                            break;
    111138                        case "prototype_event_registry":
    112139
    113140                            try {
    114                                 new_element = jQuery().$Prototype(element);
     141                                retour = ret_el.prototype;
    115142                            } catch (e) {
    116                                 new_element = null;
     143                                retour = null;
    117144                            }
    118 
    119 
    120                             return new_element;
     145                            return retour;
    121146                            break;
    122147                        case "readystatechange":
    123148                            try {
    124                                 new_element = jQuery().$Prototype(element);
     149                                retour = ret_el.Luciano;
    125150                            } catch (e) {
    126                                 new_element = null;
     151                                retour = null;
    127152                                try {
    128                                     new_element = jQuery().$Luciano(element, nc);
    129                                     new_element = jQuery(element).get(0);
     153                                    retour = ret_el.Luciano;
     154                                    retour = jQuery(element).get(0);
    130155                                } catch (e) {
    131                                     new_element = null;
     156                                    retour = null;
    132157                                }
    133158
    134159                            }
    135160
    136                             return new_element;
     161                            return ret_el.jquery;
    137162                            break;
    138163                    }
     
    144169                        switch (arg) {
    145170                            case "bottom":
    146                                 return jQuery().$Pamoorama(element);
     171                                return ret_el.pamoorama
    147172                                break;
    148173                            case "left":
    149                                 return jQuery().$Pamoorama(element);
     174                                return ret_el.pamoorama
    150175                                break;
    151176                            case "prototype_event_registry":
    152                                 return jQuery().$Pamoorama(element);
     177                                return ret_el.pamoorama
    153178                                break;
    154179                            case "readystatechange":
    155                                 return jQuery().$Pamoorama(element);
     180                                return ret_el.pamoorama
    156181                                break;
    157182
    158183                            default:
    159184                                if (arg.area) {
    160                                     return jQuery().$Pamoorama(element);
     185                                    return ret_el.pamoorama
    161186                                } else
    162187                                    if (arg.velocity) {
    163                                         return jQuery().$Pamoorama(element);
     188                                        return ret_el.pamoorama
    164189                                    } else if (arg.src) {
    165                                         return jQuery().$Pamoorama(element);
     190                                        return ret_el.pamoorama
    166191                                    } else if (arg.modifiers) {
    167                                         return jQuery().$Pamoorama(element);
     192                                        return ret_el.pamoorama
    168193                                    } else if (arg.limit) {
    169                                         return jQuery().$Pamoorama(element);
     194                                        return ret_el.pamoorama
    170195                                    } else if (arg.duration) {
    171                                         return jQuery().$Pamoorama(element);
     196                                        return ret_el.pamoorama
    172197                                    } else if (arg.id) {
    173198                                        switch (arg.id) {
    174199                                            case "pamoorama_footer":
    175                                                 return jQuery().$Pamoorama(element);
     200                                                return ret_el.pamoorama
    176201                                                break;
    177202                                            case "pamoorama_outter":
    178                                                 return jQuery().$Pamoorama(element);
     203                                                return ret_el.pamoorama
    179204                                                break;
    180205                                            case "pamoorama_inner":
    181                                                 return jQuery().$Pamoorama(element);
     206                                                return ret_el.pamoorama
    182207                                                break;
    183208
    184209                                            default:
    185                                                 return jQuery().$Pamoorama(element);
     210                                                return ret_el.pamoorama
    186211                                                break;
    187212
    188213                                        }
    189214                                    } else if (arg.src) {
    190                                         return jQuery().$Pamoorama(element);
     215                                        return ret_el.pamoorama
    191216
    192217                                    }
    193218                                //=======================================================
    194                                 return new_element;
     219                                return ret_el.jquery;
    195220                                break;
    196221
     
    212237                if (element.match(/[a-z]_[a-z]/)) {
    213238
    214                     return jQuery().$Prototype(element);
     239                    return ret_el.prototype
    215240                }
    216241                id = "window_" + new Date().getTime();
     
    219244
    220245                    if (element.match(/_[a-z]/)) {
    221                         return jQuery().$Prototype(element);
     246                        return ret_el.prototype
    222247                    }
    223248                    return null;
     
    228253        if (tpe == "string")
    229254            if (element.match(RegExp("^#", "g")) ) {
    230                 return new_element;
     255                return ret_el.jquery;
    231256            }
    232257        if (jq.match(RegExp("^#", "g")) || jq == "html") {
    233             return new_element;
     258            return ret_el.jquery;
    234259        }
    235260        if (tpe == "undefined") {
     
    239264        if (MooTools_version == "Luciano" && tpe == "string") {
    240265            //=== theme Luciano ====
    241             new_element = jQuery().$Luciano(element, nc);
    242             if (element == "order") return new_element;
    243             if (element == "themeSelect") return new_element;
    244             if (element == "languageSelect") return new_element;
    245             if (element == 'linkPrev') return new_element;
    246             if (element == 'linkNext') return new_element;
    247             if (element == 'rateForm') return new_element;
     266            ret_el.jquery = ret_el.Luciano;
     267            if (element == "order") return ret_el.jquery;
     268            if (element == "themeSelect") return ret_el.jquery;
     269            if (element == "languageSelect") return ret_el.jquery;
     270            if (element == 'linkPrev') return ret_el.jquery;
     271            if (element == 'linkNext') return ret_el.jquery;
     272            if (element == 'rateForm') return ret_el.jquery;
    248273        }
    249274
     
    255280                switch (jq) {
    256281                case "ie_ready":
    257                     return jQuery().$Pamoorama(element);
     282                    return ret_el.pamoorama
    258283                    break;
    259284                case "pamoorama":
    260                     return jQuery().$Pamoorama(element);
     285                    return ret_el.pamoorama
    261286                    break;
    262287                case ".tab a":
     
    265290
    266291            } else if (tpe == "boolean") {
    267                 return jQuery().$Pamoorama(element);
    268             }
    269            
     292                return ret_el.pamoorama
     293            }
     294            if(element)
    270295            if (typeof (element.nodeName) != "undefined") {
    271296            el = element.nodeName;
    272             if (el == "DIV") return jQuery().$Pamoorama(element);
    273             if (el == "IMG") return jQuery().$Pamoorama(element);
    274             if (el == "#document") return jQuery(element);
     297            if (el == "DIV") return ret_el.pamoorama
     298            if (el == "IMG") return ret_el.pamoorama
     299            if (el == "#document") {
     300                if (Prototype_Version != "0") return ret_el.prototype; //rv_gmaps
     301                if (MooTools_version == "pamoorama") return ret_el.pamoorama;
     302                return ret_el.jquery;
     303            }
    275304            if (el == "BODY") {
    276                 try { return jQuery().$Pamoorama(element) } catch (e) {
     305                try {
     306                    if (Prototype_Version != "0") return ret_el.prototype; //rv_gmaps
     307                    if (MooTools_version == "pamoorama") return ret_el.pamoorama;
     308                    return ret_el.jquery;
     309                    return jQuery().$Pamoorama(element)
     310                } catch (e) {
    277311                    return jQuery(element);
    278312                };
    279313            }
    280             }
    281             if (element == window)
    282                 return new_element;
     314        }
     315
     316
     317
     318        if (element == window) {
     319            if (Prototype_Version != "0") return ret_el.prototype; //rv_gmaps
     320            if (MooTools_version == "pamoorama") return ret_el.pamoorama;
     321            return ret_el.jquery;
     322
     323        }
    283324           
    284325        }
     
    296337                }
    297338
    298             if (new_element.length < 2) return new_element;
    299             if (new_element.length == 2) return jQuery(element).get(1);
    300             if (new_element.length == 3) return jQuery(element).get(2);
     339            if (ret_el.jquery.length < 2) return ret_el.jquery;
     340            if (ret_el.jquery.length == 2) return jQuery(element).get(1);
     341            if (ret_el.jquery.length == 3) return jQuery(element).get(2);
    301342
    302343        }
     
    305346            if (init_tb == 1) {
    306347                init_tb = 2;
    307                 return new_element;
     348                return ret_el.jquery;
    308349            }
    309350
    310351
    311352        //========= ????  ===================
    312         if (new_element != null) {
    313             if (typeof (new_element.context) != "undefined") {
     353        if (ret_el.jquery != null) {
     354            if (typeof (ret_el.jquery.context) != "undefined") {
    314355                if (afq != 1 && afq != undefined) {
    315356                    if (init_tb != 2) init_tb = 1;
    316                     return new_element;
    317                 }
    318                 if (new_element.context.loaded) {
     357                    return ret_el.jquery;
     358                }
     359                if (ret_el.jquery.context.loaded) {
    319360                    //=== theme Luciano ====
    320361                    if (MooTools_version == "Luciano") {
     
    331372                        //=== rvmaps ===
    332373                        try {
    333                             return jQuery().$Prototype(element);
     374                            return ret_el.prototype
    334375
    335376                        } catch (e) {
     
    348389            //=== theme Luciano ====
    349390            tp = this;
    350             new_element = ret_Luciano;
     391            ret_el.jquery = ret_Luciano;
    351392            //$(this.options.container)
    352             if (new_element != null) {
    353                 if (new_element.nodeName) {
    354                     tp = new_element.nodeName + new_element.nodeType;
    355                     if (tp == "DIV1") return new_element;
    356                     if (tp == "SELECT1") return new_element;
     393            if (ret_el.jquery != null) {
     394                if (ret_el.jquery.nodeName) {
     395                    tp = ret_el.jquery.nodeName + ret_el.jquery.nodeType;
     396                    if (tp == "DIV1") return ret_el.jquery;
     397                    if (tp == "SELECT1") return ret_el.jquery;
    357398                    tp = element.nodeName + element.nodeType;
    358                     return new_element;
     399                    return ret_el.jquery;
    359400                }
    360401
     
    363404            //=== paMOOramics ===
    364405            // ie_ready,undefined
    365             return jQuery().$Pamoorama(element);
     406            return ret_el.pamoorama
    366407        }
    367408
     
    372413            //=== rvmaps ===
    373414            try {
    374                 return jQuery().$Prototype(element);
     415                return ret_el.prototype
    375416            } catch (e) {
    376417                return jQuery(element);
     
    414455    //---------------- luciano -------------------------------
    415456    $Luciano: function (el, nc) {
    416         return document.id(el, nc, this.document);
     457        try {
     458            return document.id(el, nc, this.document)
     459        } catch (e) {
     460            return;
     461        };
    417462    },
    418463    //=============== PaMOOramics ===========================
    419464    $Pamoorama: function (B) {
     465 
    420466        if (!B) {
    421467            if (typeof (B) == "boolean") return null;
     
    436482        $extend(B, Element.prototype);
    437483        B.htmlElement = function () { };
    438        try{ return Garbage.collect(B);}catch(e){
    439        return ;
    440        }
     484        try { return Garbage.collect(B); } catch (e) {
     485            return;
     486        }
    441487
    442488    },
     
    452498            element = document.getElementById(element);
    453499
    454           return Element.extend(element);
     500        return Element.extend(element);
    455501
    456502        try {
    457             new_element = Element.extend(element);
     503            ret_el.jquery = Element.extend(element);
    458504        } catch (e) {
    459             return new_element;
    460         }
    461         return new_element;
     505            return ret_el.jquery;
     506        }
     507        return ret_el.jquery;
    462508    }
    463509    //=========================================================
    464 });   // fin extend
     510});      // fin extend
Note: See TracChangeset for help on using the changeset viewer.