1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
avcms = avcms || {};

$(document).ready(function() {
    avcms.games.onPageLoad();
    avcms.event.addEvent('page-modified', avcms.games.onPageLoad);
});

avcms.games = {
    countdown: null,
    countdown_time: 30,

    onPageLoad: function() {
        if ($('#avcms-game-container').length > 0) {
            avcms.event.addEvent('window-resize', avcms.games.resizeGame);
            avcms.games.resizeGame();

            avcms.games.showAd();

            $('#avcms-game-advert-skip').find('button').click(avcms.games.showGame);
            $('#avcms-game-fullscreen').click(avcms.games.goFullscreen);
        }

        if ($('[name=mobile_only]').length > 0) {
            avcms.games.hideMobileFilter();
            avcms.event.addEvent('window-resize', avcms.games.hideMobileFilter);
        }

        avcms.event.addEvent('window-resize', avcms.games.squareThumbnails);
        avcms.games.squareThumbnails();

        if (!avcms.games.browserHasFlash()) {
            $('#flash-not-enabled').show();
        }
    },

    squareThumbnails: function() {
        var imgs = $('.layout-games-thumbnail.square');

        imgs.each(function() {
            $(this).find('img').height($(this).width());
        });
    },

    resizeGame: function() {
        var game_container = $('#avcms-game-container');
        var game_container_inner = $('#avcms-game-container-inner');

        var original_width = game_container.data('original-width');
        var original_height = game_container.data('original-height');

        if (game_container.width() < original_width) {
            game_container_inner.css('width', '100%');

            var new_height = original_height / original_width * game_container_inner.width();
            game_container_inner.css('height', new_height);
        }
        else {
            game_container_inner.css('width', original_width);
            game_container_inner.css('height', original_height);
        }
    },

    showAd: function() {
        if (avcms.gamesAdmin !== undefined) {
            return;
        }

        var ad_container = $('#avcms-game-advert');
        if (ad_container.length == 0) {
            return;
        }

        var game_container = $('#avcms-game-container');
        var countdown_container = $('#avcms-game-advert-countdown');

        game_container.hide();
        ad_container.show();

        avcms.games.countdown_time = countdown_container.data('countdown-time');

        if (!isNaN(avcms.games.countdown_time) && avcms.games.countdown_time !== 0) {
            avcms.games.countdown = setInterval(avcms.games.adCountdown, 1000);
        }
        else {
            countdown_container.text('');
        }
    },

    adCountdown: function() {
        avcms.games.countdown_time = avcms.games.countdown_time -1;
        if (avcms.games.countdown_time <= 0) {
            avcms.games.showGame();

            return;
        }

        $('#avcms-game-advert-countdown').text(avcms.games.countdown_time);
    },

    showGame: function() {
        clearInterval(avcms.games.countdown);

        $('#avcms-game-container').show();
        $('#avcms-game-advert').hide();
    },

    goFullscreen: function() {
        var game_container = document.getElementById("avcms-game-container");

        if (game_container.requestFullscreen) {
            game_container.requestFullscreen();
        } else if (game_container.webkitRequestFullscreen) {
            game_container.webkitRequestFullscreen();
        } else if (game_container.mozRequestFullScreen) {
            game_container.mozRequestFullScreen();
        } else if (game_container.msRequestFullscreen) {
            game_container.msRequestFullscreen();
        }
    },

    hideMobileFilter: function() {
        var field = $('[name=mobile_only]').parents('.checkbox');
        if ($(document).width() > 768) {
            field.hide();
        }
        else {
            field.show();
        }
    },

    browserHasFlash: function() {
        var hasFlash = false;
        try {
            var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
            if (fo) {
                hasFlash = true;
            }
        } catch (e) {
            if (navigator.mimeTypes
                && navigator.mimeTypes['application/x-shockwave-flash'] != undefined
                && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
                hasFlash = true;
            }
        }

        return hasFlash;
    }
};

Drop unavailable. This account has exceeded its data transfer limit for this period.

Copy Drop

Save a free copy of avcms_games.js to your Droplr account?

No thanks
Success

Saved! Just visit your Droplr dashboard to download it again.

Next step:

How it works.

To take screenshots and screen recordings Droplr needs these permissions. Droplr will only create screenshots and recordings when you ask it to by activating the extension. Droplr never tracks or shrares browsing activity.