MyBB Community Forums
CSS Buttons and other things - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 Suggestions and Feedback (https://community.mybb.com/forum-7.html)
+------ Thread: CSS Buttons and other things (/thread-120533.html)

Pages: 1 2 3 4 5


RE: CSS Buttons and other things - Tomm M - 2012-06-21

It will probably be more than several weeks when you consider testing and compatibility.

Adding jQuery support is probably the biggest disruptive change outside of the new theme (or I guess you can consider them part of the same upgrade). But when you look at the development of both libraries against how long we want MyBB 1.8 to 'survive', jQuery is the only option.

Plus, more and more theme artists would prefer jQuery over Prototype. We also need to consider the impact this has on the general user. And we're wanting to attract more developers, artists and users to MyBB - even though no one has complained that IP.Board uses the Prototype/Scriptaculous combination - I feel it won't be long before they too will be making the switch.


RE: CSS Buttons and other things - Sector - 2012-06-21

Good, good!

One amateurish question:
How does jQuery improve a Multiquote on/off state system based on CSS buttons? what are the limitations of Prototype? If it's too complex to explain, don't worry.


RE: CSS Buttons and other things - Tomm M - 2012-06-21

There are no limitations that I know of for using it with MyBB. I use CSS buttons on my forum and multi quote works fine. I think I made four tiny edits to my JavaScript files to do it.

I do protect Prototype where I can. Everything I have seen with MyBB themes, give or take a few exceptions, are more than possible with Prototype. Why they decide to just whap jQuery in there completely irks me rotten. Unfortunately the development is terrible - 1.7.1 was available on GitHub about 2 weeks ago and it still isn't on their website. That is almost 18 months without a single public release. We simply had to move to jQuery in 1.8.


RE: CSS Buttons and other things - brad-t - 2012-06-21

Tomm, mind sharing the JS changes you made? Would like to make my mq button pure CSS too


RE: CSS Buttons and other things - Leefish - 2012-06-21

(2012-06-21, 05:05 PM)Tomm M Wrote: There are no limitations that I know of for using it with MyBB. I use CSS buttons on my forum and multi quote works fine. I think I made four tiny edits to my JavaScript files to do it.

I did notice you were using css buttons on Xekko Tomm, but when I was snooping in your js (Blush) I thought you were still using an image on the MQ - a png yea, but still an image.

(2012-06-21, 05:05 PM)Tomm M Wrote: Everything I have seen with MyBB themes, give or take a few exceptions, are more than possible with Prototype.

I try to use Prototype based solutions where ever possible - but cookies in Prototype are a mystery to me. I want to be able to make a selection and keep it that way on page refresh. That is the only place where I use jQuery in the public areas of my board - where I want cookies/persistence


RE: CSS Buttons and other things - Tomm M - 2012-06-21

Your luck is in today Lee; check out ./jscripts/general.js - inside this file is a Cookie function you can use to get, set and remove cookies. The functionality is already built into MyBB.

(2012-06-21, 07:07 PM)brad-t Wrote: Tomm, mind sharing the JS changes you made? Would like to make my mq button pure CSS too

Certainly; I do use a PNG icon but I switch classes instead of icons in the JS.

Open ./jscripts/thread.js. Find the following:

Line 19: element.src = element.src.replace("postbit_multiquote.gif", "postbit_multiquote_on.gif");
Line 52: element.src = element.src.replace("postbit_multiquote.gif", "postbit_multiquote_on.gif");
Line 57: element.src = element.src.replace("postbit_multiquote_on.gif", "postbit_multiquote.gif");
Line 138: element.src = element.src.replace("postbit_multiquote_on.gif", "postbit_multiquote.gif");

Replace with:

Line 19: element.addClassName("multiquote_on");
Line 52: element.addClassName("multiquote_on");
Line 57: element.removeClassName("multiquote_on");
Line 138: element.removeClassName("multiquote_on");

So, basically it will change whatever element has the 'multiquote' id; for example my layout:

<span class="button multiquote" id="multiquote_1">
     <a href="x"><span>Quote</span></a>
</span>

This then becomes the following when activated:

<span class="button multiquote multiquote_on" id="multiquote_1">
     <a href="x"><span>Quote</span></a>
</span>

The multiquote_on class overwrites the background image in my multiquote class.

Viola.


RE: CSS Buttons and other things - brad-t - 2012-06-21

Thanks. I was able to learn a bit from this! Will be able to do what I want now ...


RE: CSS Buttons and other things - martec - 2012-06-21

I think it would be cool Tomm M put it also in http://community.mybb.com/forum-38.html

would greatly facilitate future reference and would also be of public utility

Thanks


RE: CSS Buttons and other things - Tomm M - 2012-06-21

Nope, because 1.8 should have this functionality built in.


RE: CSS Buttons and other things - martec - 2012-06-21

(2012-06-21, 11:04 PM)Tomm M Wrote: Nope, because 1.8 should have this functionality built in.

ok... Big Grin