Author |
Message |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Wed Mar 14, 2007 7:08 am |
|
Raven, I'm sitting on a big bag of cash now, thanks. However the core RavenNuke does generate some Javascript (includes/javascript.php) that will probably need this treatment also...? And maybe some themes spit out javascript too.
I tried fixing just the shout box inline javascript and it didn't work, but then I noticed there was other inline javascript on the page. I will look into this some more.
After doing some more reading, I take what I said back about inline style attributes in tags. It is discouraged in XHTML, but it won't cause problems like inline javascript.
Here is a good article about the issues:
http://developer.mozilla.org/en/docs/Properly_Using_CSS_and_JavaScript_in_XHTML_Documents
It seems you cannot use the <!-- comments like you have above Raven. Instead of <!-- comments you have to do this:
Code:
<s~cript type="text/javascript">
//<![CDATA[
var i = 0;
while (++i < 10)
{
// ...
}
//]]>
</s~cript>
|
|
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 7:15 am |
|
It looks like I have some more work to do with GCalendar now....Montego had suggested I make it XHTML compliant and I had put it on the to-do list, but I did not know my Javascript was going to completely break under the new RavenNuke. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Wed Mar 14, 2007 7:20 am |
|
Well, it is not all javascript that will "break", only where there is a violation of the XML rules. This is why the RavenNuke core functions, I believe, are not breaking.
There is also definitely a difference between "breaking" and being "not compliant". It can be a fine line at times it is sounding like. So, I guess the CDATA approach is the best all around methodology to adopt... Its now on my To Do list as well!!! LOL. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 7:29 am |
|
I did try wrapping the shout box inline javascript with CDATA and it still didn't work. There might be something else going on here. I will bang on this some more later (d*** my real job).
I haven't tried installing GCalendar on RavenNuke 2.10 yet....so I don't know for sure if it completely breaks. |
|
|
|
 |
wiz
Involved


Joined: Oct 09, 2006
Posts: 413
Location: UK
|
Posted:
Wed Mar 14, 2007 7:55 am |
|
Sorry but i cannot find the lines that you posted Raven.
I have uploaded my Shoutbox.js as a text file Only registered users can see links on this board! Get registered or login!.
Cheers
WIZ |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 7:59 am |
|
wiz,
The code in the block will need to be modified, not the shoutbox.js file. I tried to do that last night but it still didn't work for me. I will need some more time to play with it, but if you or anyone else wants to try wrapping the inline javascript in CDATA sections, go ahead. |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 8:02 am |
|
It wont be me, my friend. All this went well over my head ages ago. But please go ahead, however long it takes, i dont care. It Seems that this problem is bar far limited to just me, and it is a very popular chat module. Therefore all attention is good attention.
Appreciated
WIZ |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 10:14 am |
|
technocrat wrote: | Just an FYI all windows.onload functions should be changed to be inline with the code I provided so they are more compatible. |
Thanks I will try this too. |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Mar 14, 2007 11:43 am |
|
Gremmie wrote: | It seems you cannot use the <!-- comments like you have above Raven. Instead of <!-- comments you have to do this: .... |
I knew that ! Thanks for pointing it out. I have corrected my post. |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 11:47 am |
|
Gremmie wrote: | I did try wrapping the shout box inline javascript with CDATA and it still didn't work. There might be something else going on here. I will bang on this some more later (d*** my real job).
I haven't tried installing GCalendar on RavenNuke 2.10 yet....so I don't know for sure if it completely breaks. |
On a plus note..my Gcalendar seems to be fine with 2.1 |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 2:23 pm |
|
wiz wrote: |
On a plus note..my Gcalendar seems to be fine with 2.1 |
Well that is somewhat surprising, but thanks for the data point. Perhaps it is what Montego said: there is line between XHTML compliance and still being functional. I know some of my inline Javascript does have "illegal" characters (<, --) that should be wrapped in CDATA sections (for XHMTL). But perhaps the browser carries on. I have some learning to do. Hopefully we will get this Shout Box / Javascript thing figured out quickly and it won't be a big deal to convert 3rd party modules over to RavenNuke once we have the "recipe". |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 2:44 pm |
|
Yes i was thinking along the same lines. Shoutbox appears to be the only real 3rd party software so far 'touch wood' that is having a major issue.
Have any of the guys here ever considered designing there own little chat project? |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 6:04 pm |
|
Ok, here is all you have to do to fix this for RavenNuke 2.10.
Open up shoutbox.js and find this line:
(Please ignore the ~ characters I introduced in the event handlers to avoid triggering Sentinel on this message)
Code:
SBtxt='<div style="position:relative;width:100%;height:'+SBheight+';overflow:hidden" on~mouseover="SBspeed=0" on~mouseout="SBspeed=1"><div id="SBiemarquee" style="position:absolute;left:0px;top:0px;width:100%;"></div></div>';
|
Change this to: (again, you don't need the ~ characters)
Code:
SBtxt='<div style="position:relative;width:100%;height:'+SBheight+'px;overflow:hidden" on~mouseover="SBspeed=0" on~mouseout="SBspeed=1"><div id="SBiemarquee" style="position:absolute;left:0px;top:0px;width:100%;"></div></div>';
|
All I did was to change ;overflow to px;overflow.
All that talk about CDATA, etc., was not needed to make it scroll (although it probably should be added for XHTML compliance). But we will save that for another day.
I have some other observations but I'll post those to another thread. |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 6:21 pm |
|
didnt work for me dude, maybe ive tried every suggestion available and my shoutbox.js is just a mess now.
If it works, thats really mad that we got 70 ish posts on a respectable forum for 2 alphas and a semi-colon  |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 6:28 pm |
|
Well I changed about 1000 files too chasing this down. However I did restore ALL of my RavenNuke files (minus config.php) and the Shoutbox files, then made that one edit. It now scrolls dude.  |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 6:32 pm |
|
Fair play Gremmie
Any chance you could mail me your shoutbox.js?
pwetty pwease  |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 6:39 pm |
|
PM me your email address. |
|
|
|
 |
Gremmie

|
Posted:
Wed Mar 14, 2007 6:44 pm |
|
Oh yeah, always clear your browser's cache after you make a change to an externally loaded script like this. |
|
|
|
 |
wiz

|
Posted:
Wed Mar 14, 2007 9:10 pm |
|
Yes
I dont know how it was fixed, but i thank you guys for looking into it. Thankyou Gremmie I installed your .js file and all is gravy.
how it works is not the issue, whether it works is  |
|
|
|
 |
Gremmie

|
Posted:
Thu Mar 15, 2007 6:59 am |
|
Glad to hear it works for you. That shoutbox script generates a number of warnings under Firefox and IE7. After giving up on the CDATA thing I just started trying to fix the warnings that showed up in the Firefox error console. For some reason, fixing that one "warning" started making it scroll in both IE and Firefox. I have no idea why. I just noticed that these extra warnings started appearing when the DOCTYPE was switched to XHTML.
Also, I had to actually use Opera's error console to find the offending code. Firefox would just say "invalid value for height in index.php". Big help. But Opera's error console would actually spit out the offending HTML in context, so I was able to find the code fragment in shoutbox.js. It still doesn't scroll under Opera, but I don't think it ever did there anyway. |
|
|
|
 |
slick_303
Hangin' Around

Joined: Feb 28, 2007
Posts: 34
|
Posted:
Thu Mar 15, 2007 2:18 pm |
|
Gremmie wrote: |
Ok, here is all you have to do to fix this for RavenNuke 2.10.
Open up shoutbox.js and find this line:
(Please ignore the ~ characters I introduced in the event handlers to avoid triggering Sentinel on this message)
Code:
SBtxt='<div style="position:relative;width:100%;height:'+SBheight+';overflow:hidden" on~mouseover="SBspeed=0" on~mouseout="SBspeed=1"><div id="SBiemarquee" style="position:absolute;left:0px;top:0px;width:100%;"></div></div>';
|
Change this to: (again, you don't need the ~ characters)
Code:
SBtxt='<div style="position:relative;width:100%;height:'+SBheight+'px;overflow:hidden" on~mouseover="SBspeed=0" on~mouseout="SBspeed=1"><div id="SBiemarquee" style="position:absolute;left:0px;top:0px;width:100%;"></div></div>';
|
All I did was to change ;overflow to px;overflow.
All that talk about CDATA, etc., was not needed to make it scroll (although it probably should be added for XHTML compliance). But we will save that for another day.
I have some other observations but I'll post those to another thread. |
Worked for me!!! Thanxs Gremmie |
|
|
|
 |
CodyG
Life Cycles Becoming CPU Cycles

Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Sun Mar 18, 2007 7:47 am |
|
I just got back to this forum this morning ...
I removed the commenting change I had made to header.php, added the px to shoutbox.js and it works like a charm!
Silly machines would be useless without the great support of nukers who rock.
 |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
 |
gator
Hangin' Around

Joined: Jul 24, 2003
Posts: 36
Location: Canada
|
Posted:
Sun Mar 18, 2007 4:17 pm |
|
Thanks for the fix |
_________________ .::.
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Gremmie

|
Posted:
Mon Mar 19, 2007 7:14 am |
|
Although it seems that the text is now centered under IE6 and IE7, while left justified under Firefox. Wasn't it left justified prior to RN2.10? Sigh... |
|
|
|
 |
FireATST
RavenNuke(tm) Development Team

Joined: Jun 12, 2004
Posts: 654
Location: Ohio
|
Posted:
Tue Mar 20, 2007 1:59 pm |
|
Yes Gremmie it was left justified before. My one site is 2.02 and it is left justified in IE7. Of course on that site I didn't have to add your "px" in the shoutbox.js. either for the scroll. I am not seeing away to change the justification in the block itself, so hopefully someone much smarter than I will be able to find it.....  |
|
|
 |
 |
|