Changeset 1291


Ignore:
Timestamp:
09/19/10 20:01:24 (3 years ago)
Author:
zach
Message:

Stylizing display

Location:
trunk/html5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/html5/bin-debug/jwplayer.html5.js

    r1288 r1291  
    102102                                try { 
    103103                                        if (typeof styles[style] == "number" && !(style == "zIndex" || style == "opacity")) { 
    104                                                 styles[style] = styles[style] + "px"; 
     104                                                if (style.match(/color/i)) { 
     105                                                        styles[style] = "#" + _pad(styles[style].toString(16), 6); 
     106                                                } else { 
     107                                                        styles[style] = styles[style] + "px"; 
     108                                                } 
    105109                                        } 
    106110                                        domelement.style[style] = styles[style]; 
     
    110114                } 
    111115        }; 
     116         
     117        function _pad(string, length) { 
     118                while (string.length < length) { 
     119                        string = "0" + string; 
     120                } 
     121                return string; 
     122        } 
     123         
    112124})(jwplayer); 
    113125/** 
     
    142154                                margin: "auto", 
    143155                                padding: 0, 
    144                                 background: _api.skin.getComponentSettings("display").backgroundcolor === undefined ? "#000" : _api.skin.getComponentSettings("display").backgroundcolor.replace("0x", "#"), 
     156                                backgroundColor: _api.skin.getComponentSettings("display").backgroundcolor === undefined ? parseInt("000000", 16) : _api.skin.getComponentSettings("display").backgroundcolor, 
    145157                                zIndex: 0 
    146158                        }); 
     
    430442        /** Map with config for the jwplayerControlbar plugin. **/ 
    431443        var _defaults = { 
    432                 backgroundcolor: "000000", 
     444                backgroundcolor: parseInt("000000", 16), 
    433445                margin: 10, 
    434446                //font: "_sans", 
    435447                font: "Arial,sans-serif", 
    436448                fontsize: 10, 
    437                 fontcolor: "000000", 
     449                fontcolor: parseInt("000000", 16), 
    438450                fontstyle: "normal", 
    439451                //fontweight: "normal", 
    440452                fontweight: "bold", 
    441                 buttoncolor: "ffffff", 
     453                buttoncolor: parseInt("ffffff", 16), 
    442454                position: jwplayer.html5.view.positions.BOTTOM, 
    443455                idlehide: false, 
     
    542554                        var wrappercss = { 
    543555                                height: _api.skin.getSkinElement("controlbar", "background").height, 
    544                                 backgroundColor: "#" + _settings.backgroundcolor 
     556                                backgroundColor: _settings.backgroundcolor 
    545557                        }; 
    546558                         
     
    567579                        if (!_ready && _wrapper.parentElement !== undefined) { 
    568580                                _ready = true; 
    569                                 if (_settings.position == jwplayer.html5.view.positions.OVER.toLowerCase()){ 
     581                                if (_settings.position == jwplayer.html5.view.positions.OVER.toLowerCase()) { 
    570582                                        document.getElementById(_api.id).onmousemove = _fadeOut; 
    571583                                } 
     
    598610                } 
    599611                 
    600                 function _fadeIn(){ 
     612                function _fadeIn() { 
    601613                        _wrapper.style.opacity = 1; 
    602614                } 
     
    740752                                        css.cursor = "default"; 
    741753                                        wid = 14 + 3 * _settings.fontsize; 
    742                                         css.color = "#" + _settings.fontcolor.substr(-6); 
    743754                                } else if (element.indexOf("divider") === 0) { 
    744755                                        css.background = "url(" + _api.skin.getSkinElement("controlbar", "divider").src + ") repeat-x center left"; 
     
    950961                        // Show / hide progress bar 
    951962                        if (event.newstate == jwplayer.api.events.state.IDLE) { 
    952                                 if (!_settings.idlehide && _settings.position == jwplayer.html5.view.positions.OVER){ 
     963                                if (!_settings.idlehide && _settings.position == jwplayer.html5.view.positions.OVER) { 
    953964                                        _fadeIn(); 
    954965                                } 
     
    13981409                                        border: 0, 
    13991410                                        margin: 0, 
    1400                                         padding: 0 
     1411                                        padding: 0, 
     1412                                        zIndex: 3 
    14011413                                } 
    14021414                        }, 
     
    14121424                                        height: _api.skin.getSkinElement("display", "background").height, 
    14131425                                        margin: 0, 
    1414                                         padding: 0 
     1426                                        padding: 0, 
     1427                                        zIndex: 2 
    14151428                                } 
    14161429                        }, 
     
    14261439                                        margin: 0, 
    14271440                                        padding: 0, 
    1428                                         textDecoration: "none" 
     1441                                        textDecoration: "none", 
     1442                                        zIndex: 1 
    14291443                                } 
    14301444                        }, 
    14311445                        display_text: { 
    14321446                                style: { 
     1447                                        zIndex: 4, 
    14331448                                        position: "relative", 
    1434                                         top: "50%", 
    14351449                                        opacity: 0.8, 
    1436                                         backgroundColor: "black", 
    1437                                         color: "white", 
    1438                                         display: "none", 
     1450                                        backgroundColor: parseInt("000000", 16), 
     1451                                        color: parseInt("ffffff", 16), 
    14391452                                        textAlign: "center", 
    14401453                                        fontFamily: "Arial,sans-serif", 
     
    14741487                                width: width, 
    14751488                                height: height 
     1489                        }); 
     1490                        _css(_display.display_text, { 
     1491                                width: width 
    14761492                        }); 
    14771493                        _css(_display.display_image, { 
     
    15491565                function _errorHandler(evt){ 
    15501566                        _hideDisplayIcon(); 
    1551                         _display.display_text.innerHTML = "<p>"+evt.error+"</p>"; 
     1567                        _display.display_text.innerHTML = evt.error; 
    15521568                        _show(_display.display_text); 
    15531569                        _display.display_text.style.top = ((_height -  _display.display_text.getBoundingClientRect().height) / 2) + "px"; 
     
    25662582                var _loading = true; 
    25672583                var _completeInterval; 
    2568                 var _skinPath = jwplayer.html5.utils.getAbsolutePath(skinPath); 
     2584                var _skinPath = skinPath; 
    25692585                 
    25702586                /** Load the skin **/ 
    25712587                function _load() { 
    2572                         if (_skinPath === undefined) { 
     2588                        if (_skinPath === undefined || _skinPath == "") { 
    25732589                                _loadSkin(jwplayer.html5.defaultSkin().xml); 
    25742590                        } else { 
    2575                                 jwplayer.utils.ajax(_skinPath, function(xmlrequest) { 
     2591                                jwplayer.utils.ajax(jwplayer.html5.utils.getAbsolutePath(_skinPath), function(xmlrequest) { 
    25762592                                        _loadSkin(xmlrequest.responseXML); 
    25772593                                }, function(path) { 
  • trunk/html5/src/html5/jwplayer.html5.display.js

    r1289 r1291  
    4444                                        border: 0, 
    4545                                        margin: 0, 
    46                                         padding: 0 
     46                                        padding: 0, 
     47                                        zIndex: 3 
    4748                                } 
    4849                        }, 
     
    5859                                        height: _api.skin.getSkinElement("display", "background").height, 
    5960                                        margin: 0, 
    60                                         padding: 0 
     61                                        padding: 0, 
     62                                        zIndex: 2 
    6163                                } 
    6264                        }, 
     
    7274                                        margin: 0, 
    7375                                        padding: 0, 
    74                                         textDecoration: "none" 
     76                                        textDecoration: "none", 
     77                                        zIndex: 1 
    7578                                } 
    7679                        }, 
    7780                        display_text: { 
    7881                                style: { 
     82                                        zIndex: 4, 
    7983                                        position: "relative", 
    80                                         top: "50%", 
    8184                                        opacity: 0.8, 
    8285                                        backgroundColor: parseInt("000000", 16), 
    8386                                        color: parseInt("ffffff", 16), 
    84                                         display: "none", 
    8587                                        textAlign: "center", 
    8688                                        fontFamily: "Arial,sans-serif", 
     
    120122                                width: width, 
    121123                                height: height 
     124                        }); 
     125                        _css(_display.display_text, { 
     126                                width: width 
    122127                        }); 
    123128                        _css(_display.display_image, { 
     
    195200                function _errorHandler(evt){ 
    196201                        _hideDisplayIcon(); 
    197                         _display.display_text.innerHTML = "<p>"+evt.error+"</p>"; 
     202                        _display.display_text.innerHTML = evt.error; 
    198203                        _show(_display.display_text); 
    199204                        _display.display_text.style.top = ((_height -  _display.display_text.getBoundingClientRect().height) / 2) + "px"; 
Note: See TracChangeset for help on using the changeset viewer.