Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript
Author Message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Jun 06, 2009 9:58 pm Reply with quote

Working on something I would like to redistribute someday, and need to find a replacement for a script that has licensing restrictions, Shadowbox. More specifically, just need to find a replacement for one task it performed, a JS function that pops up a modal window, like so:

html
Code:
<a class="option" onclick="demoMessage();">Script-triggered Message</a>

js
Code:
function demoMessage(){

    Shadowbox.open({
        player:     'html',
        content:    '<div style="text-align:center;padding-top:10px;">You\'re using <a href="http://www.shadowbox-js.com">Shadowbox</a>!</div>',
        height:     100,
        width:      200
    });
}

as used on the Only registered users can see links on this board! Get registered or login!
I was hoping to use Only registered users can see links on this board! Get registered or login! to perform that task (since it will be used in nukeNAV) but I can't seem to get it.

Will probably also be using Only registered users can see links on this board! Get registered or login! so that I can format the URL's like so
Code:
<a class="option" href="demomessage.html" onclick="demoMessage();">Script-triggered Message</a>

which allows it to degrade to a standard link if js disabled.

I'm using this for a small inline function, because I don't want the content in a hidden div on the page...
 
View user's profile Send private message Visit poster's website
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun Jun 07, 2009 8:33 am Reply with quote

You are correct. It appears that this modal doesn't have this functionality. What do you have against hidden divs? The only draw back I really see is that if you want to use this script on different pages.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
spasticdonkey







PostPosted: Sun Jun 07, 2009 9:18 am Reply with quote

I didn't want to use a hidden div because the content contains a bunch of smilies, and would rather reload a small function on every page than a bunch of http requests... I know some browsers don't load hidden content, but others do..
 
Palbin







PostPosted: Sun Jun 07, 2009 11:47 am Reply with quote

Yeah that is what I was worried about you want to use it on multiple pages. Its not very friendly that way.
 
Palbin







PostPosted: Sun Jun 07, 2009 11:50 am Reply with quote

Can you just have them in a separate file and use an iframe? I know colorbox has this option.
 
spasticdonkey







PostPosted: Sun Jun 07, 2009 2:24 pm Reply with quote

yes i suppose that's possible, although it gets a little more complicated because it needs to interact with a textarea on the parent page. I'll do some research Smile
 
Palbin







PostPosted: Sun Jun 07, 2009 2:35 pm Reply with quote

I wasn't sure of what kind of "interaction" you are doing. It might be just better to look for an alternative plug-in.
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sun Jun 07, 2009 2:47 pm Reply with quote

You say you are using the smilies to interact with a text area?
Why not create a customs toolbar in fckeditor.js (disable everytthing except the smilie button) and use that?
 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©