Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello my friend
I want to ask How to make download content locker in javascript ?
before I had a function share (tweet) to unlock, but i wanna change a function share (tweet) to follow my twitter.

View image : http://i.imgur.com/th487FG.png[^]

And code : https://f4086fd6b2c644c1f93aa58045d394c7be941d57.googledrive.com/host/0B35GaiSH3U65NmhfdVZ0UUZORjg/lockers.js[^]

Mybe action code to tweet content in the script :
JavaScript
// --
        // Twitter 
        // --
            {
            name: 'twitter',
            url: '//platform.twitter.com/widgets.js',
            scriptId: 'twitter-wjs',
            hasParams: false,
            isRender: false,

            pre: function () {

                var canonical = ($("link[rel='canonical']").length > 0)
				    ? $("link[rel='canonical']").attr('href')
				    : null;

                $(".twitter-share-button").each(function (index, item) {
                    var $item = $(item);
                    var $target = $(item).parent();

                    if ($target.attr('data-url-to-compare')) return;

                    var url = $item.attr("data-url");
                    if (!url && canonical) url = canonical;
                    url = (!url) ? window.location : url;

                    $item.parent().attr('data-url-to-compare', url);
                });
            },

            createEvents: function (isLoaded) {
                var self = this;

                var load = function () {

                    window.twttr.events.bind('tweet', function (event) {
                        $(document).trigger('tw-tweet', [event.target, event.data]);
                    });

                    window.twttr.events.bind('follow', function (event) {
                        $(document).trigger('tw-follow', [event.target, event.data]);
                    });

                    $(document).trigger(self.name + '-init');
                };

                if (isLoaded) { load(); return; }

                if (!window.twttr) window.twttr = { _e: [], ready: function (f) { this._e.push(f); } };
                twttr.ready(function (twttr) { load(); });
            }
        },
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900