Ignore:
Timestamp:
06/16/09 11:47:05 (3 years ago)
Author:
sam
Message:

merge to #477

Location:
branches/sc36
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/sc36

  • branches/sc36/model/sources/dkCore/genSld/wdt/mgr/scPresMgr.doss/scPresMgr.js

    r474 r478  
    1717 * samuel.monsarrat@kelis.fr 
    1818 * 
    19  * Portions created by the Initial Developer are Copyright (C) 2008 
     19 * Portions created by the Initial Developer are Copyright (C) 2009 
    2020 * the Initial Developer. All Rights Reserved. 
    2121 * 
     
    4747        fNavPath : null, 
    4848         
     49        /* Paths standards. */ 
    4950        fContainerFilter : ".ssContainer", 
    5051        fContainerBlocksRootPath : "des:.ssBkRoot", 
    51         fBlkCoPath :       "des:.ssBkCo", 
    52         fCutableFilter :   ".ssCutable|p|ol|ul|li", 
    53          
     52        fBlkCoPath : "des:.ssBkCo", 
     53        fCutableFilter : ".ssCutable|p|ol|ul|li", 
     54 
     55        /* Constantes de stylage. */ 
    5456        fSsCssName : "modeSS", 
     57        fSsClassPrefix : "tpl", 
    5558 
    5659        /* Constantes pour les animations. */ 
    57          
    5860        /** Largeur mini du slide */ 
    5961        fBlockMinWidth : 500, 
    6062        /** Ratio de marge max par rapport à la largeur du container */ 
    61         fBlockMaxMargin : .3, 
     63        fBlockMaxMargin : 0.3, 
    6264        /** Ratio d'espace libre à placer au dessus du contenu */ 
    63         fBlockTopSpace : .3, 
     65        fBlockTopSpace : 0.3, 
    6466        /** Opacité pour les masks des steps. */ 
    6567        fStepMaskOpacity : 0.9, 
     
    7880        fListeners : [], 
    7981        fToolElts : [], 
     82        fSldPosStyledElts : [], 
     83        fEnableEffects : true, 
    8084         
    8185        /* Etats */ 
     
    8387 
    8488        /* Localisations */ 
    85         fStrings : {en:["previous","previous image (left arrow)",       //0 
    86                     "next","next image (right arrow)",                  //2 
    87                     "close","close the zoom (ESC)",                     //4 
    88                     "WARNING: The Firebug extention is active.\nIt is advisable to deactivate Firebug while viewing this slide-show",""],//6 
     89        fStrings : {en:["previous","previous (left arrow)",       //0 
     90                    "next","next (right arrow)",                  //2 
     91                    "close","close the zoom (ESC)",               //4 
     92                    "WARNING: The Firebug extention is active.\nIt is advisable to deactivate Firebug while viewing this slide-show.",""],//6 
    8993                    fr:["Précédant","Précédant (flèche gauche)", 
    9094                    "Suivant","Suivant (flèche droite)", 
    9195                    "Fermer","Fermer le zoom (ESC)", 
    92                     "ATTENTION : L'extension Firebug est actif.\nIl est conseillé de désactiver Firebug pour visualiser ce diaporama.",""] 
     96                    "ATTENTION : L'extension Firebug est actif.\nIl est conseillé de désactiver Firebug pour visualiser ce diaporama.",""], 
     97                    es:["anterior","anterior (flecha izquierda)", 
     98              "siguiente","siguiente (flecha derecha)", 
     99              "cerrar","cerrar el zoom (ESC)", 
     100              "ATENCIÓN: La extensión Firebug esta activa.\nSe recomienda desactivar Firebug mientras consulte esa presentación",""] 
    93101                    }, 
    94102 
     
    116124                //Init liste elements outils 
    117125                this.fToolElts = new Array(); 
     126                //Init liste elements stylés avec la position actuel dans le slide-show (FirstSlide LastSlide, FirstStep, LastStep) 
     127                this.fSldPosStyledElts = new Array(); 
    118128 
    119129                scOnLoads[scOnLoads.length] = this; 
     
    122132                this.fContainerFilter = pContainerFilter; 
    123133        }, 
     134        setCutableFilter : function(pCutableFilter) { 
     135                this.fCutableFilter = pCutableFilter; 
     136        }, 
    124137        setContainerBlocksRootPath : function(pContainerBlocksRootPath) { 
    125138                this.fContainerBlocksRootPath = pContainerBlocksRootPath; 
     
    128141                this.fBlkCoPath = pBlkCoPath; 
    129142        }, 
    130         setCutableFilter : function(pCutableFilter) { 
    131                 this.fCutableFilter = pCutableFilter; 
    132         }, 
     143        /** Set paths of elements that constitute the zoom frame. */ 
     144        setZoomPaths : function(pZoomFramePath,pZoomContentPath) { 
     145                this.fZoomFramePath = pZoomFramePath; 
     146                this.fZoomContentPath = pZoomContentPath; 
     147        }, 
     148        /** register a path as a slide-position styled element. */ 
     149        addSlidePositionStyledPath : function(pPath) { 
     150                this.fSldPosStyledElts.push(pPath); 
     151        }, 
     152        /** register a listener. */ 
     153        register : function(pType, pFunc) { 
     154                this.fListeners[pType].push(pFunc); 
     155        }, 
     156        /** Enable / Disable auto tool hiding */ 
     157        enableToolHider : function(pEnable) { 
     158                this.fToolHider = pEnable; 
     159                if (!pEnable) this.xShowTools(); 
     160        }, 
     161        /** Enable / Disable visual effects */ 
     162        enableEffects : function(pEnable) { 
     163                this.fEnableEffects = pEnable; 
     164        }, 
     165        /** Enable / Disable visual effects */ 
     166        toggleEffects : function() { 
     167                this.fEnableEffects = ! this.fEnableEffects; 
     168        }, 
     169        /** register a node as a tool (auto hidden elements). */ 
     170        addToolElt : function(pNode) { 
     171                this.fToolElts.push(pNode); 
     172        }, 
     173        /** Main OnLoad function called by the SCENARI framework. */ 
    133174        onLoad : function() { 
    134175                try{ 
     
    166207                        //Init nav bar 
    167208                        this.fNav = scPaLib.findNode(this.fNavPath); 
     209                        this.fNav.fDefaultClass = this.fNav.className; 
    168210                        this.fNav.innerHTML = ""; // Purge the nav bar 
    169211                        this.fBtnPrv = this.xAddBtn(this.fNav, "btnPrv", this.xGetStr(0), this.xGetStr(1)); 
     
    176218                        this.fSldHome.fSldMgr.initSld(); 
    177219                        //Init zoom container 
    178                         this.fZoom = this.xAddEltHidden("div", document.body, "tplZm"); 
    179                         this.fZoom.fSld = scPresMgr.xAddElt("div", this.fZoom, "tplZmSld"); 
    180                         this.fZoom.fCo = this.xAddElt("div", this.fZoom, "tplZmCo"); 
    181                         this.fZoom.fBtnCls = this.xAddBtn(this.fZoom, "btnZmCls", this.xGetStr(4), this.xGetStr(5)); 
     220                        this.fZoom = (this.fZoomFramePath ? scPaLib.findNode(this.fZoomFramePath) : this.xAddElt("div", document.body, null)); 
     221                        this.fZoom.className = this.fZoom.className + " "+this.fSsClassPrefix+"Zm" 
     222                        this.fZoom.style.visibility = "hidden"; 
     223                        this.fZoom.fCo = (this.fZoomContentPath ? scPaLib.findNode(this.fZoomContentPath) : this.fZoom); 
     224                        this.fZoom.fSld = scPresMgr.xAddElt("div", this.fZoom.fCo, this.fSsClassPrefix+"ZmSld"); 
     225                        this.fZoom.fFrg = this.xAddElt("div", this.fZoom.fCo, this.fSsClassPrefix+"ZmFrg"); 
     226                        this.fZoom.fBtnCls = this.xAddBtn(this.fZoom.fCo, "btnZmCls", this.xGetStr(4), this.xGetStr(5)); 
     227                        //Init slide-position styled elements 
     228                        for (var i in this.fSldPosStyledElts){ 
     229                                this.fSldPosStyledElts[i] = scPaLib.findNode(this.fSldPosStyledElts[i]); 
     230                                if (this.fSldPosStyledElts[i]) this.fSldPosStyledElts[i].fBaseClass = this.fSldPosStyledElts[i].className; 
     231                        } 
    182232                        //Enable tool auto hiding 
    183233                        this.enableToolHider(true); 
    184234                        //Affichage du slide d'accueil (rendu instantanné) 
    185235                        this.fSwitchSldTask.initTask(this.fSldHome, "first", true); 
     236//                      this.xUpdateSldPosStyledElts(); 
    186237                        if (!scCoLib.fDebug && window.console && window.console.firebug) alert(this.xGetStr(6)); 
    187238                }catch(e){scCoLib.util.logError("ERROR scPresMgr.onLoad : ", e);} 
    188239        }, 
    189240        loadSortKey : "A", 
    190  
    191241        /** Load a slide by index id.  
    192242         * @param pFromStart affiche le slide du début (true) ou de la fin (false). 
     
    195245         */ 
    196246        loadSld : function(pIdx, pFromStart, pInstantResult) { 
    197                 //scCoLib.util.log("scPresMgr.loadSld: "+pIdx); 
     247                scCoLib.util.log("scPresMgr.loadSld: "+pIdx); 
    198248                this.xResetFocus(); 
    199249                return this.xGotoSlide(pIdx, pFromStart, pInstantResult); 
    200250        }, 
    201  
    202251        /** Returns the current slide. */ 
    203252        getCurrSld : function(){ 
    204253                return scPresMgr.fSwitchSldTask.fNewSld || this.fCurrSld; 
    205254        }, 
    206  
    207255        /** Redessinement de la zone des slides (suite à resize notamment). */ 
    208256        redrawSlideZone : function(){ 
     
    221269                } 
    222270        }, 
    223  
    224271        /** Show the passed ressource in the zoom. */ 
    225272        showZoom : function(pRes) { 
    226273                return this.xShowZoom(pRes); 
    227274        }, 
    228  
    229275        /** Returns true if the presentation has a next step / slide. */ 
    230276        hasNxt : function() { 
     
    234280                } else return false; 
    235281        }, 
    236  
    237282        /** Returns true if the presentation has a previous step / slide. */ 
    238283        hasPrv : function() { 
     
    241286                        return (vSld.fSldMgr.hasPrv() ? true : !vSld.fSldMgr.isFirstSld()); 
    242287                } else return false; 
    243         }, 
    244  
    245         /** register a listener. */ 
    246         register : function(pType, pFunc) { 
    247                 this.fListeners[pType].push(pFunc); 
    248         }, 
    249  
    250         /** Enable / Disable auto tool hiding */ 
    251         enableToolHider : function(pEnable) { 
    252                 this.fToolHider = pEnable; 
    253                 if (!pEnable) this.xShowTools(); 
    254         }, 
    255  
    256         /** register a node as a tool (auto hidden elements). */ 
    257         addToolElt : function(pNode) { 
    258                 this.fToolElts.push(pNode); 
    259288        }, 
    260289 
     
    280309                return true; 
    281310        }, 
    282  
    283311        /** Move back 1 step / slide. 
    284312         * @param pSkip if true move to beginning of previous slide. 
     
    305333                        this.fBtnPrv.style.visibility = (vSld.fSldMgr.hasPrv() ? "" : (!vSld.fSldMgr.isFirstSld() ? "" : "hidden")); 
    306334                } 
    307         }, 
    308          
     335                this.xUpdateSldPosStyledElts(); 
     336        }, 
     337        /** xUpdateSldPosStyledElts */ 
     338        xUpdateSldPosStyledElts : function() { 
     339                // Add slide-postion classes on registed elements if needed. 
     340                var vSld = this.getCurrSld(); 
     341                if (vSld && vSld.fSldMgr) { 
     342                        for (var i in this.fSldPosStyledElts){ 
     343                                var vNewClass = this.fSldPosStyledElts[i].fBaseClass + (vSld.fSldMgr.isFirstSld() ? " "+this.fSsClassPrefix+"FirstSlide" + (!vSld.fSldMgr.hasPrv() ? " "+this.fSsClassPrefix+"FirstStep" : "") : (vSld.fSldMgr.isLastSld() ? " "+this.fSsClassPrefix+"LastSlide" + (!vSld.fSldMgr.hasNxt() ? " "+this.fSsClassPrefix+"LastStep" : "") : "")); 
     344//                              var vNewClass = this.fSldPosStyledElts[i].fBaseClass + (vSld.fSldMgr.isFirstSld() ? " "+this.fSsClassPrefix+"FirstSlide" + (!vSld.fSldMgr.hasPrv() ? " "+this.fSsClassPrefix+"FirstStep" : "") : ""); 
     345                                if (this.fSldPosStyledElts[i].className != vNewClass) this.fSldPosStyledElts[i].className = vNewClass; 
     346                        } 
     347                } 
     348        }, 
    309349        /** Navigation vers un slide.  
    310350         * @param pFromStart affiche le slide du début (true) ou de la fin (false). 
     
    312352         */ 
    313353        xGotoSlide : function(pIdx, pFromStart, pInstantResult) { 
    314                 //scCoLib.util.log("scPresMgr.xGotoSlide: "+pIdx); 
     354                scCoLib.util.log("scPresMgr.xGotoSlide: "+pIdx); 
    315355                try{ 
    316356                        //Borne pIdx selon les limites du slide show 
     
    341381                                                //Trouvé 
    342382                                                scPresMgr.fSwitchSldTask.initTask(vSld, pFromStart? "first" : "last", pInstantResult); 
     383//                                              this.xUpdateSldPosStyledElts(); 
    343384                                                return true; 
    344385                                        } 
     
    348389                                scPresMgr.fSwitchSldTask.initTask(this.xBuildSlide(pIdx), pFromStart? "first" : "last", pInstantResult); 
    349390                        } 
     391//                      this.xUpdateSldPosStyledElts(); 
    350392                        return true; 
    351393                }catch(e){scCoLib.util.logError("ERROR scPresMgr.xGotoSlide: ",e);} 
    352394        }, 
    353          
    354395        /** Affecte le nouveau slide "stabilisé" et devient la nouvelle référence. 
    355396         * Gère le cache des slides en fonction de cette nouvelle position. 
     
    390431                }catch(e){scCoLib.util.logError("ERROR scPresMgr.xSetCurrSlide: ",e);} 
    391432        }, 
    392          
    393433        /** Chargement d'un slide. */ 
    394434        xBuildSlide : function(pIdx) { 
     
    399439                return vSld; 
    400440        }, 
    401          
    402441        /** Buttons manager. */ 
    403442        xBtnMgr : function(pBtn){ 
     
    412451                this.xResetFocus(); 
    413452        }, 
    414          
    415453        /** Event clavier. */ 
    416454        sOnKeyUp : function(pEvent){ 
     
    419457                return scPresMgr.xKeyMgr(vCharCode); 
    420458        }, 
    421  
    422459        /** scPresMgr.xKeyMgr */ 
    423460        xKeyMgr : function(pCharCode){ 
     
    435472                        case 80://p 
    436473                                this.xPrv(); return false; 
     474                        case 70://f 
     475                                this.toggleEffects(); return false; 
    437476                        case 34://pg_dwn 
    438477                                this.xNxt(true); return false; 
     
    445484                } 
    446485        }, 
    447  
    448486        /** scPresMgr.xShowZoom : display the zoom window 
    449487         * @param pRes : resource to zoom : if it is a anchor (A) then we zoom the href as a slide otherwise we clone/import the node 
     
    454492                if (!vZm.fAct){ 
    455493                        vZm.fAct = true; 
    456                         vZm.fCo.innerHTML = ""; 
     494                        vZm.fFrg.innerHTML = ""; 
    457495                        vZm.fSld.innerHTML = ""; 
    458496                        vZm.fSldMgr = null; 
    459497                        if (pRes.nodeName.toLowerCase() == "a") { 
    460                                 new scPresMgr.FadeEltTask(vZm.fCo,0,null,null,true); 
     498                                new scPresMgr.FadeEltTask(vZm.fFrg,0,null,null,true); 
    461499                                new scPresMgr.FadeEltTask(vZm.fSld,1,null,null,true); 
    462                                 vZm.fSldMgr = new scPresMgr.SldZoomMgr(vZm.fSld, pRes.href,function(){new scPresMgr.FadeEltTask(scPresMgr.fZoom,1);}); 
     500                 
     501                                vZm.fSldMgr = new scPresMgr.SldZoomMgr(vZm.fSld, pRes.href,function(){new scPresMgr.FadeEltTask(scPresMgr.fZoom,1,this.sFadeEltStart,this.sFadeEltEnd);}); 
    463502                                vZm.fSldMgr.initSld(); 
    464503                        } else { 
    465                                 new scPresMgr.FadeEltTask(vZm.fCo,1,null,null,true); 
     504                                new scPresMgr.FadeEltTask(vZm.fFrg,1,null,null,true); 
    466505                                new scPresMgr.FadeEltTask(vZm.fSld,0,null,null,true); 
    467                                 vDst = scPresUt.importDeepNode(pRes, vZm.fCo.ownerDocument, vZm.fCo); 
    468                                 new scPresMgr.FadeEltTask(vZm,1); 
    469                         } 
     506                                vDst = scPresUt.importDeepNode(pRes, vZm.fFrg.ownerDocument, vZm.fFrg); 
     507                                new scPresMgr.FadeEltTask(vZm,1,this.sFadeEltStart,this.sFadeEltEnd); 
     508                        } 
     509                        this.fNav.className = this.fNav.fDefaultClass + " "+this.fSsClassPrefix+"NavZoom"; 
    470510                } else { 
    471511                        if (pRes.nodeName.toLowerCase() == "a") { 
     
    474514                                vZm.fSldMgr.initSld(); 
    475515                        } else { 
    476                                 vDst = scPresUt.importDeepNode(pRes, vZm.fCo.ownerDocument, vZm.fCo); 
    477                                 new scPresMgr.FadeEltTask(vZm.fSld,0); 
    478                                 new scPresMgr.FadeEltTask(vZm.fCo,1); 
     516                                vDst = scPresUt.importDeepNode(pRes, vZm.fFrg.ownerDocument, vZm.fFrg); 
     517                                new scPresMgr.FadeEltTask(vZm.fSld,0,this.sFadeEltStart,this.sFadeEltEnd); 
     518                                new scPresMgr.FadeEltTask(vZm.fFrg,1,this.sFadeEltStart,this.sFadeEltEnd); 
    479519                        } 
    480520                } 
    481521                return vDst; 
    482522        }, 
    483  
    484523        /** scPresMgr.xHideZoom : hide the zoom window */ 
    485524        xHideZoom : function(){ 
    486525                if (this.fZoom.fAct){ 
    487526                        this.fZoom.fAct = false; 
    488                         new scPresMgr.FadeEltTask(this.fZoom, 0, null, function(){scPresMgr.fZoom.fSldMgr = null; scPresMgr.fZoom.fSld.innerHTML = ""; scPresMgr.fZoom.fCo.innerHTML = "";      scPresMgr.fNav.style.zIndex = "";}); 
    489                 } 
    490         }, 
    491  
     527                        new scPresMgr.FadeEltTask(this.fZoom, 0, this.sFadeEltStart, this.sHideZoomEnd); 
     528                        this.fNav.className = this.fNav.fDefaultClass; 
     529                } 
     530        }, 
     531        /** scPresMgr.sHideZoomEnd */ 
     532        sHideZoomEnd : function(){ 
     533                this.fElt.fSldMgr = null;  
     534                this.fElt.fSld.innerHTML = ""; 
     535                this.fElt.fFrg.innerHTML = ""; 
     536                if (scCoLib.isIE) this.fElt.style.backgroundColor = ""; 
     537        }, 
    492538        /** scPresMgr.xGetZoomContainer : return the zoom container */ 
    493539        xGetZoomContainer : function(){ 
    494                 return this.fZoom.fCo; 
    495         }, 
    496  
     540                return this.fZoom.fFrg; 
     541        }, 
    497542        /** scPresMgr.xGetZoomSlide : return the zoom iframe container */ 
    498543        xGetZoomSlide : function(){ 
    499544                return this.fZoom.fFra; 
    500545        }, 
    501  
    502546        /** scPresMgr.xResetFocus - sets the focus to the current slide. */ 
    503547        xResetFocus : function() { 
     
    510554                } 
    511555        }, 
    512         /** scPresMgr.xNotifyListeners - calls all the listeners of a given type. 
    513          */ 
     556        /** scPresMgr.xNotifyListeners - calls all the listeners of a given type. */ 
    514557        xNotifyListeners : function(pType,pRes) { 
    515558                //scCoLib.util.log("scPresMgr.xNotifyListeners: "+pType); 
     
    521564                } 
    522565        }, 
    523  
    524566        /** scPresMgr.xHideTools : tool hider */ 
    525567        xHideTools : function(){ 
     
    530572                                for (i in this.fToolElts) { 
    531573                                        try { 
    532                                                 new this.FadeEltTask(this.fToolElts[i],0,this.sFadeToolsStart,this.sFadeToolsEnd); 
     574                                                new this.FadeEltTask(this.fToolElts[i],0,this.sFadeEltStart,this.sFadeEltEnd); 
    533575                                        } catch(e) {scCoLib.util.logError("ERROR scPresMgr.xHideTools: ",e);} 
    534576                                } 
     
    536578                } 
    537579        }, 
    538  
    539580        /** scPresMgr.xShowTools : mouse event manager */ 
    540581        xShowTools : function(){ 
     
    543584                        for (i in this.fToolElts) { 
    544585                                try { 
    545                                         new this.FadeEltTask(this.fToolElts[i],1,this.sFadeToolsStart,this.sFadeToolsEnd); 
     586                                        new this.FadeEltTask(this.fToolElts[i],1,this.sFadeEltStart,this.sFadeEltEnd); 
    546587                                } catch(e) {scCoLib.util.logError("ERROR scPresMgr.xShowTools: ",e);} 
    547588                        } 
     
    549590                this.fToolsShowTime = new Date().getTime(); 
    550591        }, 
    551  
    552592        /** Init tous les blocks fils d'un blockRoot (du slide ou d'un container) */ 
    553593        xInitBlocks : function(pParentMgr, pBlockRoot){ 
     
    570610                return vResult; 
    571611        }, 
    572  
    573612        /** scPresMgr.sOnClickTocLnk : TOC item onclick event */ 
    574613        sOnClickTocLnk : function(){ 
     
    576615                return false; 
    577616        }, 
    578          
    579617        /** scPresMgr.sMouseMgr : mouse event manager */ 
    580618        sMouseMgr : function(){ 
    581619                if (scPresMgr.fToolHider) scPresMgr.xShowTools(); 
    582620        }, 
    583  
    584621        /** scPresMgr.sHeartbeat : run every second. */ 
    585622        sHeartbeat : function(){ 
    586623                if (scPresMgr.fToolHider) scPresMgr.xHideTools(); 
    587624        }, 
    588  
    589         /** scPresMgr.sFadeToolsStart */ 
    590         sFadeToolsStart : function(){ 
    591                 if (scCoLib.isIE) this.fElt.style.backgroundColor = scPresMgr.xReadStyle(scPresMgr.fSldFra, "backgroundColor") || "white"; 
    592         }, 
    593         /** scPresMgr.sFadeToolsEnd */ 
    594         sFadeToolsEnd : function(){ 
     625        /** scPresMgr.sFadeEltStart */ 
     626        sFadeEltStart : function(){ 
     627                var vBkColor = scPresMgr.xReadStyle(scPresMgr.fSldFra, "backgroundColor") || "white"; 
     628                if (scCoLib.isIE) this.fElt.style.backgroundColor = (vBkColor == "transparent" ? "white" : vBkColor); 
     629        }, 
     630        /** scPresMgr.sFadeEltEnd */ 
     631        sFadeEltEnd : function(){ 
    595632                if (scCoLib.isIE) this.fElt.style.backgroundColor = ""; 
    596633        }, 
     
    606643                        if (pNxtSib) pParent.insertBefore(vFrmHolder,pNxtSib) 
    607644                        else pParent.appendChild(vFrmHolder); 
    608                         vFrmHolder.innerHTML = "<iframe scrolling='no' frameborder='0'></iframe>"; 
     645                        vFrmHolder.innerHTML = "<iframe scrolling='no' frameborder='0' allowtransparency='true'></iframe>"; 
    609646                        vElt = vFrmHolder.firstChild; 
    610647                } else { 
     
    618655                return vElt; 
    619656        }, 
    620  
    621657        /** scPresMgr.xAddEltNoDisp : Add a non displayed HTML element to a parent node. */ 
    622658        xAddEltNoDisp : function(pName, pParent, pClassName) { 
     
    624660                return vElt; 
    625661        }, 
    626  
    627662        /** scPresMgr.xAddEltHidden : Add a hidden HTML element to a parent node. */ 
    628663        xAddEltHidden : function(pName, pParent, pClassName) { 
     
    630665                return vElt; 
    631666        }, 
    632  
    633667        /** scPresMgr.xAddBtn : Add a HTML button to a parent node. */ 
    634668        xAddBtn : function(pParent, pClassName, pCapt, pTitle, pNxtSib) { 
     
    648682                return vBtn; 
    649683        }, 
    650  
    651684        /** scPresMgr.xReadStyle : Read a style property (inline or CSS). */ 
    652685        xReadStyle : function(pElt, pProp) { 
     
    669702                } 
    670703        }, 
    671  
    672704        /** scPresMgr.xGetEltTop : Retrun an element's absolute top (from pRoot or the top of the page). 
    673705         * @param pElt start element. 
     
    684716                return vY; 
    685717        }, 
    686  
    687718        /** scPresMgr.xGetEltH : Retrun an element's height. */ 
    688719        xGetEltH: function(pElt) { 
    689720                return(scCoLib.toInt(pElt.style.pixelHeight || pElt.offsetHeight)); 
    690721        }, 
    691          
    692722        /** Set the opacity of a given node. 
    693723         * @param pRate Variable de 0 à 1. 
     
    697727                else pNode.style.opacity = pRate; 
    698728        }, 
    699  
    700729        /** Start the opacity of a given node. 
    701730         * On ajoute le filtre d'opacité sur IE. 
     
    708737                pNode.style.visibility = ""; 
    709738        }, 
    710  
    711739        /** End the opacity of a given node. 
    712740         * On supprime le filtre d'opacité sur IE (évite des bugs de refresh). 
     
    720748                else pNode.style.visibility = ""; 
    721749        }, 
    722  
    723750        /** Reteive a localized string. */ 
    724751        xGetStr: function(pStrId) { 
     
    735762                fNewSld: null, 
    736763                fStatus: null, 
    737                  
    738764                fIdx: -1, 
    739765                fRateOld: [.9, .8, .7, .5, .3, .2, .1,  0,  0,  0,  0], 
    740766                fRateNew: [ 0,  0,  0,  0, .1, .2, .3, .5, .7, .8, .9], 
    741                  
    742                 /** 
    743                  * Init la task pour accéder à un nouveau slide. 
     767                /** Init la task pour accéder à un nouveau slide. 
    744768                 * @param pBlock block à afficher. 
    745769                 * @param pStatus  
     
    751775                        //scCoLib.util.log("fSwitchSldTask.initTask: status: "+pStatus); 
    752776                        try{ 
     777                        if (!scPresMgr.fEnableEffects) pInstantResult = true; 
    753778                        //On annule tout autre task en cours 
    754779                        scPresMgr.fSwitchStpTask.precipitateEndTask(); 
     
    840865                                scPresMgr.xEndOpacityEffect(this.fNewSld, 1); 
    841866                        } 
     867                        scPresMgr.xUpdateGui(); 
    842868                        scPresMgr.xSetCurrSlide(this.fNewSld); 
    843                         scPresMgr.xUpdateGui(); 
    844869                        this.fNewSld = null; 
    845870                        this.fIdx = -1; 
     
    868893                fNewBlock: null, 
    869894                fStep: 0, 
    870                  
    871895                fIdx: -1, 
    872896                fRateOld: [.9, .8, .7, .5, .3, .2, .1,  0,  0,  0,  0], 
    873897                fRateNew: [ 0,  0,  0,  0, .1, .2, .3, .5, .7, .8, .9], 
    874          
    875                 /** 
    876                  * init la task pour accéder à un nouveau block. 
     898                /** init la task pour accéder à un nouveau block. 
    877899                 * @param pTarget Block/Step cible à afficher 
    878900                 *                      "F" : First 
     
    885907                        //scCoLib.util.log("fSwitchBlkTask.initTask: "+pNewBlock); 
    886908                        try{ 
     909                        if (!scPresMgr.fEnableEffects) pInstantResult = true; 
    887910                        //On précipite le chgt de steps. 
    888911                        scPresMgr.fSwitchStpTask.precipitateEndTask(); 
     
    965988                /** Mask précédent qui détenait le focus. */ 
    966989                fOldMask : null, 
    967                  
    968                 /** 
    969                  * init la task pour accéder à un nouveau step. 
     990                /** init la task pour accéder à un nouveau step. 
    970991                 * @param pTargetStep Step cible à passer en focus 
    971992                 *                      "F" : First (pInstantResult est alors forcé à true) 
     
    9791000                initTask : function(pBlock, pTargetStep, pInstantResult){ 
    9801001                        try{ 
     1002                                if (!scPresMgr.fEnableEffects) pInstantResult = true; 
    9811003                                if(this.fBlockMgr) { 
    9821004                                        this.precipitateEndTask(); 
     
    10621084                        } 
    10631085                        }catch(e){scCoLib.util.log("ERROR fSwitchStpTask.execTask: "+e);} 
    1064                 } 
    1065                 , 
     1086                }, 
    10661087                /** Permet de précipiter la fin de la task en cours. */ 
    10671088                precipitateEndTask : function(){ 
     
    11141135                var vSldMgr = this.fSldMgr; 
    11151136                scCoLib.util.log("scPresMgr.SldMgr.sOnLoadSld: "+vSldDoc.title); 
    1116                  
    11171137                // Enable fSsCssName CSS on slide 
    11181138                var vCss = null; 
     
    12981318scPresMgr.SldZoomMgr.prototype.postOnLoad = function() { 
    12991319        scPresMgr.fSwitchBlkTask.initTask(this.fCurrBlk, this.getFirstBlock(), "F", true); 
    1300         scPresMgr.fNav.style.zIndex = this.hasNxt() ? "100" : ""; 
    13011320        this.fPostLoadFunc(); 
    13021321} 
     
    13751394                        } 
    13761395                } 
    1377         } else { 
    1378                 this.fCurrStep = -1; 
    1379         } 
    1380          
     1396        } else this.fCurrStep = -1; 
    13811397        // Centre le block dans son container 
    13821398        this.xCenterBlock(); 
    1383          
    13841399        // Resize ok 
    13851400        this.fNeedResize = false; 
    1386  
    13871401        //On resize et redessine le block 
    13881402        scPresMgr.fSwitchBlkTask.initTask(this.fBlkNode, this.fBlkNode, "S", true); 
     
    14091423                // Flag ok 
    14101424                this.fNeedResize = false; 
    1411  
    1412                 //scCoLib.util.log("Afetr RESIAZE : this.fTargetStepIdx: "+pTarget+" - "+this.fCurrStep); 
    1413                 //scCoLib.util.log("Afetr RESIAZE : this.fBlockMgr.fMasks: "+this.fMasks); 
    14141425        } 
    14151426        //Redraw sans animation des steps du block. 
     
    14751486        if(! this.fAllSteps || this.fAllSteps.length==0) return; 
    14761487        //On fige les dimensions du content du block 
    1477         var vContentH = Math.max(20, vAvailH - scPresMgr.xGetEltTop(this.fBlkContent,this.fParentMgr.fBlocksRoot)); 
     1488        var vContentH = Math.max(20, vAvailH - scPresMgr.xGetEltTop(this.fBlkNode,this.fParentMgr.fBlocksRoot) - (this.fBlkNode.offsetHeight - this.fBlkContent.offsetHeight)); 
    14781489        vBlkContentStyle.position = "absolute"; 
    14791490        vBlkContentStyle.width = "100%"; 
     
    14921503                var vTop = pNode.offsetTop; 
    14931504                var vH = vTop - vPreviousTop; 
    1494                 if(vH > vAvailH) return -1; 
     1505                if(vH > vContentH) return -1; 
    14951506                //Malus en fonction de la profondeur de cuttable au dessus 
    14961507                var vP = pNode.parentNode; 
     
    15001511                } 
    15011512                //Malus si le dernier step devient plus petit que celui-là 
    1502                 if( vRealH - vTop < vTop - vPreviousTop) vH -= (vAvailH - (vRealH - vTop))/2; 
     1513                if( vRealH - vTop < vTop - vPreviousTop) vH -= (vContentH - (vRealH - vTop))/2; 
    15031514                return 1000000 + vH; 
    15041515        } 
     
    15221533                        vPreviousAllStepsIdx = vBestIdx; 
    15231534                } 
    1524         } while(vBestIdx>=0 && (vRealH-vPreviousTop > vAvailH)); 
     1535        } while(vBestIdx>=0 && (vRealH-vPreviousTop > vContentH)); 
    15251536        //On crée le tableau des masks 
    15261537        if(! this.fMasks) this.fMasks = []; 
     
    16011612        this.fBlkNode = pBlkContainerNode; 
    16021613        this.fBlkIdx = pBlkIdx; 
    1603          
    16041614        // Racine des blocks du container. 
    1605         this.fSubBlocksRoot = scPaLib.findNode(scPresMgr.fContainerBlocksRootPathComp, this.fBlkNode); 
    1606          
     1615        this.fBlocksRoot = scPaLib.findNode(scPresMgr.fContainerBlocksRootPathComp, this.fBlkNode); 
    16071616        //Fixe les dim du container 
    16081617        this.xFixContainerSize(); 
    1609          
    16101618        //init les blocks de ce container 
    1611         this.fSubBlocks = scPresMgr.xInitBlocks(this, this.fSubBlocksRoot); 
    1612          
     1619        this.fSubBlocks = scPresMgr.xInitBlocks(this, this.fBlocksRoot); 
    16131620        // Sous-bloc en cours. 
    16141621        this.fCurrSubBlk = null; 
     
    17241731/** Hauteur disponible pour les fils de ce container. */ 
    17251732scPresMgr.BlkContainerMgr.prototype.getAvailHeight = function(){ 
    1726         return this.fSubBlocksRoot.offsetHeight; 
     1733        return this.fBlocksRoot.offsetHeight; 
    17271734} 
    17281735/** Largeur disponible pour les fils de ce container. */ 
    17291736scPresMgr.BlkContainerMgr.prototype.getAvailWidth = function(){ 
    1730         return this.fSubBlocksRoot.offsetWidth; 
     1737        return this.fBlocksRoot.offsetWidth; 
    17311738} 
    17321739/** Fixe la taille du container dans son contexte parent. */ 
    17331740scPresMgr.BlkContainerMgr.prototype.xFixContainerSize = function(){ 
    17341741        var vBodyH = this.fParentMgr.getAvailHeight(); 
    1735         var vTop = this.fSubBlocksRoot.offsetTop; 
     1742        var vTop = this.fBlocksRoot.offsetTop; 
    17361743        //scCoLib.util.log("vBodyH: "+vBodyH+" - vTop"+vTop); 
    1737         this.fSubBlocksRoot.style.height = Math.max(50, vBodyH - vTop)+"px"; 
     1744        this.fBlocksRoot.style.height = Math.max(50, vBodyH - vTop)+"px"; 
    17381745        this.fNeedResize = false; 
    17391746} 
    1740  
    1741  
    1742  
    17431747 
    17441748/** scPresMgr.FadeEltTask : TiLib task that fades a given element in or out. 
     
    17581762                this.fStartFunc = pStartFunc || function(){}; 
    17591763                this.fEndFunc = pEndFunc || function(){}; 
    1760                 if (pInstant) { 
     1764                if (pInstant || !scPresMgr.fEnableEffects) { 
    17611765                        this.terminate(); 
    17621766                        return; 
     
    18001804} 
    18011805 
    1802 /** scSlideMgr : scSlideMgr pour le homeSlide. 
    1803  */ 
     1806/** scSlideMgr : scSlideMgr pour le homeSlide. */ 
    18041807var scSlideMgr = { 
    18051808        fDefaultFontSize : 22, // fontSize in pixels 
     
    18261829                return this.fBlocksRoot.offsetWidth; 
    18271830        }, 
    1828  
    18291831        /** Api scSiLib. */ 
    18301832        onResizedAnc : function(pOwnerNode, pEvent) { 
     
    18611863} 
    18621864 
    1863 /** scPresUt : Browser dependant utility toolbox. 
    1864  */ 
     1865/** scPresUt : Browser dependant utility toolbox. */ 
    18651866var scPresUt = {}; 
    18661867if(scCoLib.isIE) { 
Note: See TracChangeset for help on using the changeset viewer.