Javascript PopUp Generator

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Javascript PopUp Generator

Post by DrXThirst »

Well, after seeing the site http://bulltrue.net , I thought it would be really cool to have pictures of videos, that when clicked bring up that video in a popup. However, I didn't have a reason to make a site that did that until today when a guy had a video of him getting an extremely lucky splatter on Narrows. I Googled the JS code, and then made an app that did it for you with C#. (Yes, I'm a very bored person.) Anyways, onto features and picture.

Features:
  • Options for Toolbars, Scrollbars, etc.
  • Options on how the popup opens. (By a Link, a Button, or Automatically.)
  • Settings for Width and Height of the Pop Up Window.
  • Instructions Message Box
  • Program Status Label
  • Date/Time Status Bar Label
Pictures:
  • Image
  • Image
Pictures:
  • Click [HERE] to Download.
Image
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Meh it's alright. Can you show us a few snippets of your code?
...left for good
User avatar
HaLo2FrEeEk





Posts: 170
Joined: Fri Aug 10, 2007 9:25 pm

Post by HaLo2FrEeEk »

I would change the link output code to this:

Code: Select all

<a href="" onclick="javascript:popUp('[LINK HERE]');return false;">Open the Popup Window</a>
That way it won't show the javascript code being executed in the status bar of the window. The return false at the end of the onclick makes it so that href is ignored.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Patrickssj6 wrote:Meh it's alright. Can you show us a few snippets of your code?
I can release the source, if you want.
Image
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

I don't want the whole source. I just want to know if you found a nifty way to make the whole text creation thing...or is it simply just something like

Code: Select all

Textbox.Paste("Blehblugblah" + FirstVariable + "morebleh" + SecondVariable")
:wink:
...left for good
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

No, it's just like that.
Image
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

:wink:
...left for good
User avatar
Corvette19




Snitch!

Posts: 1191
Joined: Wed Jun 21, 2006 6:05 am
Location: South Carolina

Post by Corvette19 »

I just realized, you could get a virus to run with that, file to be opened if clicked picture?
Xfire = corvette19
WaeV wrote:Mess around with stuff, make exceptions, get messy! Do something we've never seen before.
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

No current browser would allow an executable to run without prompting the user. You cannot launch a program on the client's computer from Javascript with the current securities.
User avatar
Corvette19




Snitch!

Posts: 1191
Joined: Wed Jun 21, 2006 6:05 am
Location: South Carolina

Post by Corvette19 »

Alright, that makes me feel 2x better. Thank you.
Xfire = corvette19
WaeV wrote:Mess around with stuff, make exceptions, get messy! Do something we've never seen before.
User avatar
HaLo2FrEeEk





Posts: 170
Joined: Fri Aug 10, 2007 9:25 pm

Post by HaLo2FrEeEk »

It's still possible to get a virus from malicious Javascript, or an xml file cached by a page, it doesn't have to be an executable though that is the most common way.

And thirst, are you gonna take my advice? I don't know about you but when I'm designing a webpage I hate having the script that I'm trying to run show up in the status bar, I'd rather have the name of the page show up. Here:

http://forums.halomods.com/viewtopic.php?t=78040#795908

That'll pop you up to my post. It's just a piece of friendly advice, from a design standpoint.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Sure, but what is it exactly that you're trying to run without people knowing the link to it?
Image
User avatar
HaLo2FrEeEk





Posts: 170
Joined: Fri Aug 10, 2007 9:25 pm

Post by HaLo2FrEeEk »

It's not that, I'm saying from a design standpoint it looks better to have http://halomods.com in the status bar than it does to have this:

Code: Select all

javascript:popUp('http://halomods.com')
That's all I'm saying. I'm fully capable of writing all of this myself and it's been literally years since I've needed to use a code generator. I even wrote my myspace code by myself without any sort of guidance, I just trial-and-error'd everything. Anyways, I'm not saying I or anyone else wants to run something malicious using this, I'm saying from a asthetic point of view, having a load of Javascript in the status bar looks tacky...to me at least.
User avatar
DrXThirst




Connoisseur Foundry Pyre

Posts: 3011
Joined: Fri Jun 29, 2007 6:28 am
Location: Georgia
Contact:

Post by DrXThirst »

Oh, nevermind. I thought you were talking about something totally different.
Yeah, I'll fix that in a little while.
Image
User avatar
THE-MASTER




Critic Trickster

Posts: 225
Joined: Mon Aug 29, 2005 10:31 am
Location: Scotland

Post by THE-MASTER »

YEY! I love popups... jk.

I like it but would it not make sense to make a javascript/HTML version of it? I don't know. Having it in the same language kind of makes sense to me. Also if you want multiple popups with different things (like one with and one without scrollbars) this wouldn't work. What about making the function contain those variables like:

Code: Select all

function popUp(URL, toolbars, scrollbar, locationbar...){
It would make the script in both sections longer but would give you more options.

Just a suggestion.
Now Playing:Image
Please contact me if the sig is over the limit with the title of the song, artist and album. :) Thanks!
Ace Space Race, Halo 3 player snapshot generator,Random Sig
Post Reply