GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   jquery alternative to a popunder for those who want it. (https://gfy.com/showthread.php?t=1072926)

fris 06-28-2012 10:53 AM

jquery alternative to a popunder for those who want it.
 
hope this is of use to someone

jquery.popunder.js way (download link) https://github.com/chrismccoy/jquery.popunder

Code:

$.popunder('http://google.com',24); // once every 24 hours
$.popunder('http://google.com',0); // reset when browser closes
$.popunder('http://google.com'); // every time

full html example

Code:

!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jquery.popunder.js</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cookies.js"></script>
<script type="text/javascript" src="js/jquery.popunder.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
        $(document).click(function () {
                $.popunder('http://google.com',24); // once every 24 hours
        });
});
</script>
</head>

<body>

</body>
</html>

Here is a previous method of doing a popunder.

Code:

var Popup = {

    AddListener: function(target, eventName, handler) {
        if (eventName == "beforeunload" || eventName == "unload") {
            var originalHandler = target["on" + eventName];
            if (originalHandler) {
                target["on" + eventName] = function(e) {
                    var ret = originalHandler(e);
                    if (typeof(ret) == "undefined" || ret == "") ret = handler(e);
                    return ret;
                };
            } else {
                target["on" + eventName] = handler;
            }
        } else if (target.addEventListener) {
            target.addEventListener(eventName, handler, false);
        } else if (target.attachEvent) {
            target.attachEvent("on" + eventName, handler);
        } else {
            var originalHandler = target["on" + eventName];
            if (originalHandler) {
                target["on" + eventName] = function(e) {
                    originalHandler(e);
                    handler(e);
                };
            } else {
                target["on" + eventName] = handler;
            }
        }
    },

    CreatePop: function(e) {


        var popURL = "about:blank"
        var popID = "ad_" + Math.floor(89999999 * Math.random() + 10000000);
        var pxLeft = 0;
        var pxTop = 0;

        // Place the window coordinates in the center of the active window
        pxLeft = (this.GetWindowLeft() + (this.GetWindowWidth() / 2) - (this.PopWidth / 2));
        pxTop = (this.GetWindowTop() + (this.GetWindowHeight() / 2) - (this.PopHeight / 2));

        // Create the popup
        this.PopWin = this.Window.open(popURL, popID, 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top=' + pxTop + ',left=' + pxLeft + ',width=' + this.PopWidth + ',height=' + this.PopHeight);

        if (this.PopWin) {


            // We don't want to pop again on the same pop load.
            this.PopLoaded = true;

            // Increment the successfull pop count cookie
            this.SetPoppedTotal();

            // Make the popup show either in front or behind the page
            if (this.PopFocus == 0) {
                this.PopWin.blur();

                if (navigator.userAgent.toLowerCase().indexOf("applewebkit") > -1) {
                    this.Window.blur();
                    this.Window.focus();
                }
            }

            // Load the url in the placeholder window
            this.PopWin.Init = function(e) {

                with(e) {

                    this.Params = e.Params; // IE9 Bugfix. "this" not functioning properly
                    // Main code function
                    this.Main = function() {

                        if (typeof window.mozPaintCount != "undefined") {
                            var x = this.window.open("about:blank");
                            x.close();
                        }

                        // Set the parameters in the local scope
                        var popURL = this.Params.PopURL;

                        try {
                            opener.window.focus();
                        } catch (err) {}

                        window.location = popURL;
                    }

                    this.Main();
                }
            };

            this.PopWin.Params = {
                PopURL: this.PopURL
            }

            this.PopWin.Init(this.PopWin);
        }

        return true;
    },

    GetWindowHeight: function() {

        var myHeight = 0;

        if (typeof(this.Window.innerHeight) == 'number') {
            //Non-IE
            myHeight = this.Window.innerHeight;
        } else if (this.Window.document.documentElement && this.Window.document.documentElement.clientHeight) {
            //IE 6+ in 'standards compliant mode'
            myHeight = this.Window.document.documentElement.clientHeight;
        } else if (this.Window.document.body && this.Window.document.body.clientHeight) {
            //IE 4 compatible
            myHeight = this.Window.document.body.clientHeight;
        }

        return myHeight;

    },

    GetWindowWidth: function() {

        var myWidth = 0;

        if (typeof(this.Window.innerWidth) == 'number') {
            //Non-IE
            myWidth = this.Window.innerWidth;
        } else if (this.Window.document.documentElement && this.Window.document.documentElement.clientWidth) {
            //IE 6+ in 'standards compliant mode'
            myWidth = this.Window.document.documentElement.clientWidth;
        } else if (this.Window.document.body && this.Window.document.body.clientWidth) {
            //IE 4 compatible
            myWidth = this.Window.document.body.clientWidth;
        }

        return myWidth;
    },

    GetWindowTop: function() {
        return (this.Window.screenTop != undefined) ? this.Window.screenTop : this.Window.screenY;
    },

    GetWindowLeft: function() {
        return (this.Window.screenLeft != undefined) ? this.Window.screenLeft : this.Window.screenX;
    },
    InitPop: function(e) {

        // Allow one pop per page, prevent double execution
        if (this.PopLoaded || arguments.callee.init) return true;

        // Double check to see if the pop cap has been reached
        if (this.GetPoppedTotal() >= this.PopFreq) return true;

        arguments.callee.init = true;

        var status = this.CreatePop(e);

        arguments.callee.init = false;

        return status;
    },
    Watch: function(ctx, options) {

        for (var i in options) {
            this[i] = options[i];
        }
        this.Window = ctx;
        Popup.AddListener(this.Window.document, "click", function(e) {
            if (!Popup.InitPop(e)) {
                if (e.preventDefault) {
                    e.preventDefault()
                }
                e.returnValue = false;
            }
        });
    },
    CreateCookie: function(name, value, days) {

        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            var expires = "; expires=" + date.toGMTString();
        } else var expires = "";
        this.Window.document.cookie = name + "=" + value + expires + "; path=/";
    },


    ReadCookie: function(name) {

        var ca = this.Window.document.cookie.split(';');
        var nameEQ = name + "=";
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') c = c.substring(1, c.length); //delete spaces
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
        }
        return null;
    },

    GetPoppedTotal: function() {

        var popTotal = this.ReadCookie(this.CookieName);
        popTotal = (popTotal != null) ? parseInt(popTotal) : 0;

        return popTotal;
    },

    SetPoppedTotal: function() {

        var popTotal = this.ReadCookie(this.CookieName);

        if (popTotal != null) this.CreateCookie(this.CookieName, parseInt(popTotal) + 1, 1);
        else this.CreateCookie(this.CookieName, 1, 1);
    }

}


var PopUpConfig = {
    CookieName: "goog",
    PopFocus: 0,
    PopURL: "http://www.google.com",
    PopFreq: 1,
    PopWidth: 1024,
    PopHeight: 764
}

Popup.Watch(window, PopUpConfig);


Tijuana_Tom 06-28-2012 11:04 AM

Where Fris took the script from. :1orglaugh

https://gist.github.com/2058263

Creator testing script.

https://gist.github.com/1021924

jimmycooper 06-28-2012 11:04 AM

Thanks dude!

Tijuana_Tom 06-28-2012 11:13 AM

Quote:

Originally Posted by jimmycooper (Post 19029325)
Thanks dude!

Say Thank-You to Hans-Peter Buniat for writing it.

fris 06-28-2012 12:04 PM

Quote:

Originally Posted by Tijuana_Tom (Post 19029352)
Say Thank-You to Hans-Peter Buniat for writing it.

yep totally.

forgot to add that to the header, do you wanna do it for me?

fris 06-28-2012 12:10 PM

since tom didnt wanna do it for me, he says he doesnt know how to use a text editor, so i did it for him

https://github.com/chrismccoy/jquery.popunder

Tijuana_Tom 06-28-2012 12:11 PM

Quote:

Originally Posted by fris (Post 19029495)
yep totally.

forgot to add that to the header, do you wanna do it for me?

Good job stripping out all the guys info. Creating your own nfo files and reposting it.

Took me to say something for you to give the guy credit. :1orglaugh

If you were an honest guy you would have just posted the original. :2 cents:

fris 06-28-2012 12:14 PM

Quote:

Originally Posted by Tijuana_Tom (Post 19029511)
Good job stripping out all the guys info. Creating your own nfo files and reposting it.

Took me to say something for you to give the guy credit. :1orglaugh

If you were an honest guy you would have just posted the original. :2 cents:

nowhere in his original code was his name, or web address, i did not modify the code at all, just put it into jquery.popunder.js

so no, i did not pass this off as my own.

check the source, nothing was modified.

:helpme:helpme

Tijuana_Tom 06-28-2012 12:21 PM

Quote:

Originally Posted by fris (Post 19029517)
nowhere in his original code was his name, or web address, i did not modify the code at all, just put it into jquery.popunder.js

so no, i did not pass this off as my own.

check the source, nothing was modified.

:helpme:helpme

:1orglaugh Yes Fris everyone is as stupid as you are.

fris 06-28-2012 12:23 PM

Quote:

Originally Posted by Tijuana_Tom (Post 19029530)
:1orglaugh Yes Fris everyone is as stupid as you are.

run the orig gist against jquery.popunder.js using diff, if you know how.

TheSenator 06-28-2012 12:24 PM

Can I see it in action?

Please

NaughtyRob 06-28-2012 12:27 PM

Thanks Fris.

Tijuana_Tom 06-28-2012 12:29 PM

Quote:

Originally Posted by fris (Post 19029532)
run the orig gist against jquery.popunder.js using diff, if you know how.

You are such a little idiot. :1orglaugh

well not little...

fris 06-28-2012 12:49 PM

Quote:

Originally Posted by Tijuana_Tom (Post 19029555)
You are such a little idiot. :1orglaugh

well not little...

comon use diff to find out or do i have to do it for you?

since you simple dont know how, let me fill in those gaping holes for you.

here i compared jquery.popunder.js to orig.js as you can see no differences at all

http://i.imgur.com/zdAwO.jpg

here i compared orig.js to the ones without the cookies (both by the same owner) 7 diferences, only did this cause tom asked me too.

http://i.imgur.com/8l30l.jpg

why am i doing this? hah, i dont know, im only feeding tom the troll, so i expect nothing but more replies from tom, keep up the good work.

Thesenator here is an example of it working.

http://fris.net/pop/ click anywhere.

TheSenator 06-28-2012 01:22 PM

Quote:

Originally Posted by fris (Post 19029620)
comon use diff to find out or do i have to do it for you?

since you simple dont know how, let me fill in those gaping holes for you.

here i compared jquery.popunder.js to orig.js as you can see no differences at all

http://i.imgur.com/zdAwO.jpg

here i compared orig.js to the ones without the cookies (both by the same owner) 7 diferences, only did this cause tom asked me too.

http://i.imgur.com/8l30l.jpg

why am i doing this? hah, i dont know, im only feeding tom the troll, so i expect nothing but more replies from tom, keep up the good work.

Thesenator here is an example of it working.

http://fris.net/pop/ click anywhere.

Thank You....

Deej 06-28-2012 01:25 PM

Is it 'funny' to anyone else that this TjTommy wasnt even heard of until the Gimme/Fris fiasco?

Now all the sudden the dude is everywhere... especially up Fris' ass...

makes you go hrmmm....?!

Freaky_Akula 06-28-2012 01:49 PM

Thank you, Fris.

sandman! 06-28-2012 01:50 PM

lookin good :thumbsup:thumbsup

Tijuana_Tom 06-28-2012 01:55 PM

Yah Fris you didn't EDIT OUT the guys name you just LEFT IT OUT.

LOL

Quote:

Originally Posted by Deej (Post 19029681)
Is it 'funny' to anyone else that this TjTommy wasnt even heard of until the Gimme/Fris fiasco?

Now all the sudden the dude is everywhere... especially up Fris' ass...

makes you go hrmmm....?!

Shut up you pathetic excuse of a designer.

All up in Fris' ass because he's a little homo he likes it. :1orglaugh

fris 06-28-2012 01:57 PM

Quote:

Originally Posted by Deej (Post 19029681)
Is it 'funny' to anyone else that this TjTommy wasnt even heard of until the Gimme/Fris fiasco?

Now all the sudden the dude is everywhere... especially up Fris' ass...

makes you go hrmmm....?!

trolls will be trolls.

i dont mind being insulted, but have the balls to do it without needing a fake nick.

BaldBishop 06-28-2012 02:01 PM

Thank you! :thumbsup

CyberHustler 06-28-2012 02:02 PM

:1orglaugh

Lace 06-28-2012 04:47 PM

Thanks, Fris. Going to try this out now on a few sites.

candyflip 06-28-2012 04:53 PM

Quote:

Originally Posted by fris (Post 19029731)
trolls will be trolls.

i dont mind being insulted, but have the balls to do it without needing a fake nick.

Typical troll behavior :winkwink:

Screwed Up 06-28-2012 10:04 PM

Why this line?

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>


I suppose you could just download that *.js and host it on your own server?

freecartoonporn 06-28-2012 11:32 PM

thanks fris, will test it.

JOKER 06-28-2012 11:53 PM

Quote:

Originally Posted by Screwed Up (Post 19030447)
Why this line?

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>


I suppose you could just download that *.js and host it on your own server?

The idea behind using the public google api codes is that so many people use that, it's probably already loaded in the surfers browser-cache - which speeds up your load-time and saves you bandwidth.

TheSenator 06-29-2012 03:12 PM

Is there a way to combine the jquery into one file?

TheSenator 06-29-2012 03:25 PM

I am trying to use this tool but I can not get it to work.

http://www.refresh-sf.com/yui/

EddyTheDog 06-29-2012 03:27 PM

Quote:

Originally Posted by JOKER | JOKEREMPIRE Inc. (Post 19030512)
The idea behind using the public google api codes is that so many people use that, it's probably already loaded in the surfers browser-cache - which speeds up your load-time and saves you bandwidth.

:thumbsup

Remember, you are bound by Googles API T&Cs when you use it....

fris 06-29-2012 09:45 PM

Quote:

Originally Posted by TheSenator (Post 19031784)
Is there a way to combine the jquery into one file?

you could add the cookie plugin above the jquery popunder.

19teenporn 06-29-2012 11:07 PM

Gonna try this for sure. Thanks for sharing.

And also for the domain dude.

fris 07-01-2012 06:36 AM

Quote:

Originally Posted by TheSenator (Post 19031798)
I am trying to use this tool but I can not get it to work.

http://www.refresh-sf.com/yui/

https://github.com/chrismccoy/jquery.popunder

use jquery.popunder.full.js

only file required, has cookies and the popunder in 1 file.

also added a compressed version

Code:

[fris@fris ~/git/jquery.popunder/js]$ ls -l jquery.popunder.full.*
-rw-r--r--  1 fris  fris  15861 Jun 30 22:06 jquery.popunder.full.js
-rw-r--r--  1 fris  fris  4537 Jul  1 09:39 jquery.popunder.full.min.js

from 15k to 4k

hope this is what you meant for 1 file.

if you need this as a wp plugin with an options panel to set the url,etc i will put one together later.

Tijuana_Tom 07-01-2012 06:46 AM

Quote:

Originally Posted by fris (Post 19029731)
trolls will be trolls.

i dont mind being insulted, but have the balls to do it without needing a fake nick.

Stop being a dipshit with other people's work.

lol @ wannabe hacker can't even code himself. :1orglaugh

You are such a pathetic loser.

fris 07-01-2012 06:48 AM

Quote:

Originally Posted by Tijuana_Tom (Post 19033586)
Stop being a dipshit with other people's work.

lol @ wannabe hacker can't even code himself. :1orglaugh

You are such a pathetic loser.

tell us how you really feel.

:thumbsup

fris 07-04-2012 08:11 AM

bump for tom cause he thinks i said i made this.

Niktamer 07-04-2012 08:14 AM

Tom your really annoying, Fris try to help the community here, you just a pain in the ass for everyone.

What have you done to help people make more revenue in the biz ?

stop trolling, its just pointless and unproductive.

Tijuana_Tom 07-04-2012 08:15 AM

Any fool can see what you tried to get away with here.

You have been constantly doing this over the years on GFY.

:thumbsup

fris 07-04-2012 08:15 AM

Quote:

Originally Posted by Niktamer (Post 19042160)
Tom your really annoying, Fris try to help the community here, you just a pain in the ass for everyone.

What have you done to help people make more revenue in the biz ?

stop trolling, its just pointless and unproductive.

thanks, but its really pointless to try and reason with a troll, im sure he will reply with some negative remark.

:helpme

Tijuana_Tom 07-04-2012 08:16 AM

Quote:

Originally Posted by Niktamer (Post 19042160)
Tom your really annoying, Fris try to help the community here, you just a pain in the ass for everyone.

What have you done to help people make more revenue in the biz ?

stop trolling, its just pointless and unproductive.

You have absolutely no idea who I am.

You're the president and CBDO of a business and you should have kept your mouth shut.

You are obviously not reading my posts but instead REACTING to them.

You obviously do not understand the situation with Fris here.

I am going to write your post off as ignorance.

Tijuana_Tom 07-04-2012 08:18 AM

Quote:

Originally Posted by Tijuana_Tom (Post 19042163)
Any fool can see what you tried to get away with here.

You have been constantly doing this over the years on GFY.

:thumbsup

Fris you're a joke.

fris 07-04-2012 08:19 AM

Quote:

Originally Posted by Tijuana_Tom (Post 19042165)
You have absolutely no idea who I am.

You're the president and CBDO of a business and you should have kept your mouth shut.

You are obviously not reading my posts but instead REACTING to them.

You obviously do not understand the situation with Fris here.

I am going to write your post off as ignorance.

told ya he would reply with a negative remark.

fris 07-04-2012 08:19 AM

Quote:

Originally Posted by Tijuana_Tom (Post 19042169)
Fris you're a joke.

i love jokes

Tijuana_Tom 07-04-2012 08:28 AM

Quote:

Originally Posted by fris (Post 19042170)
told ya he would reply with a negative remark.

Well it's true he has no idea what I do.

He doesn't realize what you're doing is at the cost of others.

Sure you may be helping people here but you are costing other people possible sales or appreciation.

You are doing this to fluff your ego and get work $$$.

It's cool but imma own you on it every time.

People like Nick Tamer always chiming into threads to support someone when they haven't read shit.

Nick prolly read my troll to Shap in another thread and got all butthurt.

Tijuana_Tom 07-04-2012 08:31 AM

You fucking Canadians stick together, eh?

Dicks right up each other's asses.

:1orglaugh

fris 07-04-2012 08:33 AM

Quote:

Originally Posted by Tijuana_Tom (Post 19042200)
You fucking Canadians stick together, eh?

Dicks right up each other's asses.

:1orglaugh

tell us how you really feel

Tijuana_Tom 07-04-2012 08:34 AM

Quote:

Originally Posted by fris (Post 19042205)
tell us how you really feel

lol you put me in your sig. :thumbsup


All times are GMT -7. The time now is 10:44 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc