Click here to Skip to main content
11,629,614 members (55,101 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
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 :
// --
        // 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 5-Aug-14 8:22am

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150723.1 | Last Updated 5 Aug 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100