Welcome Guest ( Log In | Register )



2 Pages V  < 1 2  
Reply to this topicStart new topic
> How To #3: Custom BBCdes For This Board (Note)
mastercomputers
post Apr 6 2006, 05:25 AM
Post #11


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



Just noting M^E, that the first click on the title of the note is not registering correctly. After that it works as it should.

If you want me to fix it I can, I just didn't update the note at antilost because of the time and did not want to go through the CSS to fix it, but if you want me to I can.

One thing for certain is I want to remove all id's from your note, as you can only use the named id once only in any document and cannot have ids that are the same which means multiple notes will conflict, that was probably why you thought of creating random generated id names, which in theory would work too, but more coding involved and harder to fix the CSS to reference it's styling. So I'm just saying use class as the alternative to style everything about it. No need to give it a name, if needs be comment above it and below it that states it's a notice for easier reading from source, but IPB HTML source is too messy for me to even bother looking through it.


Cheers,


MC
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Apr 6 2006, 05:29 AM
Post #12


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



Yep - I noticed that misclick too - but happens only first time you click the header.

I get what you mean - now there's no reason to have the ID's - since we're using the sibling iterator.

Am off to make the changes smile.gif

Done updating..

The new code, stripped of the div id's looks like this:
CODE

<div class="notice">
    <div class="header" onClick="java script:this.nextSibling.nextSibling.style.display = (this.nextSibling.nextSibling.style.display == 'block') ? 'none' : 'block';">
        <div class="middlebar">Notice from {option}:
        </div>
    </div>
    <div class="messagebody">{content}</div>
</div>


I updated it on Anitlost too.
Go to the top of the page
 
+Quote Post
mastercomputers
post Apr 6 2006, 08:18 AM
Post #13


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



Make it look like this and you've solved the 1 click misread, when actually it works as intended if you say it like this:

At present this.nextSibling.nextSibling.style.display = NULL, we never set a style and we can't read user/browser defaults. So (shortening the code) display = (test if display == 'block' it returns NULL) ? if true display = 'none' : Well it was false/NULL or at least != to 'block' so display = 'block';

We've now set a value, display now equals block, so the second click results in true and then display = none; Understandable? I hope so, I didn't want to go too much into this.


CODE

<div class="notice">
    <div class="header" onClick="java script:this.nextSibling.nextSibling.style.display = (this.nextSibling.nextSibling.style.display == 'block') ? 'none' : 'block';">
        <div class="middlebar">Notice from {option}:
        </div>
    </div>
    <div class="messagebody" style="display:block;">{content}</div>
</div>


I have updated here, you can do antilost tongue.gif. I also want to help clean the CSS, though are rounded corners neccessary, looks good but unless W3C supported it's not really things I would go out of.

What I'm proposing to do is clean up the HTML and CSS, eliminate the over use of div blocks if possible and use more semantic like means of displaying it. Also requires renaming the class names, due to reason that they could conflict especially using "header" which is too common.

Cheers,


MC
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Apr 6 2006, 09:44 AM
Post #14


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



Cool - am all up for it. I think I'd posted the note files at Anti.. if not, I'll post them - so you can have a go at the CSS.
Go to the top of the page
 
+Quote Post
mastercomputers
post Apr 6 2006, 11:04 AM
Post #15


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



QUOTE(miCRoSCoPiC^eaRthLinG @ Apr 6 2006, 09:44 PM) *

Cool - am all up for it. I think I'd posted the note files at Anti.. if not, I'll post them - so you can have a go at the CSS.


OK, well, while you were away I created this:

http://mastercomputers.uni.cc/bbcode/notice.html (you may also notice in the parent directory bbcode I'm also working on a book/article type means, it's basically quickly done, with inline styling, but I will seperate everything and make it easier to make changes).

and if you view the source, I have the seperation of CSS/Javascript and the HTML in quite a basic/simple look. I didn't use your background-image (I prefer png instead of jpg too, unless it's a photo) or rounded corners and kept it quite box shape looking.

I'm sure anyone if they wanted to, could jazz this up more, all I ask though is keep it W3C valid, it's what I aim for in all my web work.

Cheers,


MC
Go to the top of the page
 
+Quote Post
mastercomputers
post Apr 29 2006, 03:27 AM
Post #16


PESTICIDAL MANIAC
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



Notice from mastercomputers:
I have updated my Notice BBCode site


Just would like to point out the site now, which has instructions to get it working under IPB (not tested though), also fixes to work with IE, except I need to work on alpha-transparency, which I may remove since it would require server-side scripting, which won't do for this, so maybe revert back to normal images without transparency, but makes changing the colour easy.

The link is http://mastercomputers.uni.cc/bbcode/notice.html

Cheers,


MC
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To #4: Custom BBCodes For This Board (Pptions)(2)


 



- Lo-Fi Version Time is now: 11th October 2008 - 04:38 AM