1. JavaScript / Говнокод #13088

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    --- a/src/Foo.js
    +++ b/src/Foo.js
    @@ -1,21 +1,61 @@
         var Foo = (function () {
             function Foo(productId, productSettings, overrides) {
                 var backup, loc = document.location, home;
    -            this._sdkSettings = Program.Utils.deepCopy(Take5.settings);
    +            this._sdkSettings = JSON.parse(JSON.stringify(TGH5.settings));
                 if(overrides) {
    -                this._sdkSettings = Program.Utils.copyProperties(overrides, this._sdkSettings);
    +                if('debug' in overrides) {
    +                    this._sdkSettings.debug = overrides.debug;
    +                }
    +                if('inDemoMode' in overrides) {
    +                    this._sdkSettings.inDemoMode = overrides.inDemoMode;
    +                }
    +                if('sdkHome' in overrides) {
    +                    this._sdkSettings.sdkHome = overrides.sdkHome;
    +                }
    +                if('eixtUrl' in overrides) {
    +                    this._sdkSettings.exitUrl = overrides.exitUrl;
    +                }
    +                if('ads' in overrides) {
    +                    if('preRoll' in overrides.ads) {
    +                        this._sdkSettings.ads.preRoll = overrides.ads.preRoll;
    +                    }
    +                    if('inGame' in overrides.ads) {
    +                        this._sdkSettings.ads.inGame = overrides.ads.inGame;
    +                    }
    +                    if('postRoll' in overrides.ads) {
    +                        this._sdkSettings.ads.postRoll = overrides.ads.postRoll;
    +                    }
    +                }
    +                if('reporting' in overrides) {
    +                    if(overrides.reporting instanceof Object) {
    +                        if('analyticsId' in overrides.reporting) {
    +                            this._sdkSettings.reporting.analyticsId = overrides.reporting.analyticsId;
    +                        }
    +                        if('site' in overrides.reporting) {
    +                            this._sdkSettings.reporting.site = overrides.reporting.site;
    +                        }
    +                        if('virtualPageRoot' in overrides.reporting) {
    +                            this._sdkSettings.reporting.virtualPageRoot = overrides.reporting.virtualPageRoot;
    +                        }
    +                        if('initParams' in overrides.reporting) {
    +                            this._sdkSettings.reporting.initParams = overrides.reporting.initParams;
    +                        }
    +                    } else {
    +                        this._sdkSettings.reporting = overrides.reporting;
    +                    }
    +                }
                 }

    А я сажаю алюминивые агурцы - а-а - на брезентовом поле :(
    Некоторые имена сознательно изменены дабы не посягать на копирайты и торговые знаки.

    Запостил: wvxvw, 02 Июня 2013

    Комментарии (2) RSS

    Добавить комментарий