Welcome, Guest
Username: Password: Remember me

TOPIC: COOK v2.5 and changes to JDom??

COOK v2.5 and changes to JDom?? 16 Feb 2013 20:55 #6787

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @admin,

I just wanted to ask a couple of questions about the implementation of JDom in the new version of Cook as I need to create a few different implementations of a jQuery based image/product rotator for my component.

I haven't started coding my custom JDom class yet but, as I am about to any day now, I thought I should ask about the changes to JDom and any modifications I will need to make to ensure it is compatible with Cook 2.5. For instance, will my JDom class be at all portable to the new version or will it require almost a new rewrite - and, if it would require a rewrite - would you recommend me waiting for the release to save coding it twice?

I have maybe 2-3 weeks tops to complete the project in question (justin case it has any bearing on your answer).

When do you anticipate the release?

Many thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: COOK v2.5 and changes to JDom?? 16 Feb 2013 22:13 #6788

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
If you want to create your own customs, no problem, it didn't changed at this level.

The only changed thing is the core that it much more powerfull, and also some namespaces that have changed. The classes have moved in the tree is order to herit correctly and take more advantage of it. The constructor is not anymore called thousands of times (sic..) (There was a big mistake there... try to dump something in the constructor of your class, you will see...)

When you will be building your JDom class, it is possible that some core functions you want to use are now changed (include assets functionalities, ajax callbacks, parseVars ...)

Anyway, if there was any problem, don't worry it will not be a big deal because the structure is always the same. You still can use the arrays to declare the asset files on the top of your class. (attachJs, attachCss)

Hope it helps.

About the release date... This is the forbidden question ... argh ... I do my best.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: COOK v2.5 and changes to JDom?? 16 Feb 2013 22:38 #6789

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Thanks for the heads up and all of the info!

Sorry to ask the dreaded question! ;)

Can I just double check, in JDom, how do we pass a bunch of CSS classes in to style an element?

Thanks @admin!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: COOK v2.5 and changes to JDom?? 16 Feb 2013 22:49 #6790

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
4 different ways :
In actual version, I am not sure if all are working. (1°, 4° for sure )

1. static file
dom/assets/ASSET_NAME/css/MYCSS.css (your css file)

in your class :
protected $assetName = 'ASSET_NAME'; (can be different than the name of the class)
protected $attachCss = array(
	'MYCSS.css'
);

2. static file with check
In buildCss() : (better, but can also be in constructor)
$this->attachCss[] = 'MYCSS.css';

3. Full name CSS (not necessary in assets)
$this->addStyleSheet('FULL_URL.css');

4. Only style
$this->addStyle('font-size', '1em');
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: VeCrea, JoomGuy

Re: COOK v2.5 and changes to JDom?? 16 Feb 2013 22:53 #6791

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
But you must check it well, because JDom is stacking all the calls, so be carefull.
I mean, one of the optimizations was to check if the JS/CSS has already been called. Because when you have a grid and your class is called many times, it is Joomla wich is avoiding the multiples calls, and this is not very clean.

All this was (and still now), so dirty. Shame on me.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: COOK v2.5 and changes to JDom?? 17 Feb 2013 09:49 #6795

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Yes, shame on you... this all cook thing is a mess ;-)
Just kidding obviously. But I like how you want to always make it cleaner.
Last Edit: 17 Feb 2013 09:50 by VeCrea.
The administrator has disabled public write access.

Re: COOK v2.5 and changes to JDom?? 17 Feb 2013 11:44 #6797

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
@admin don't be hard on yourself, joomla itself has so many devs and is pretty dirty!

Cook is awesome and we all appreciate your hard work to continually develop it!

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: COOK v2.5 and changes to JDom?? 17 Feb 2013 15:25 #6800

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Thanks Gez,

I would like to write a little bit in Joomla too, I am sure I will love it and understanding better how works GitHub in team. For the moment I only putted JDom :

github.com/Cook-Self-Service/joomla-plat...libraries/joomla/dom

It is synchronistic because I was just speaking to etc about JDom and I posted the link.

Look also what about the JLoader feature I am explaining there :
www.j-cook.pro/forum/9-coding-inside-you...th-without-jdom#6799
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: COOK v2.5 and changes to JDom?? 17 Feb 2013 15:53 #6801

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Here is the pull request I did, but I was not serious for it, just testing the pulls :

github.com/joomla/joomla-platform/pull/1...ssuecomment-12005520

You are really welcome to comment the pull request if you feel it.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: COOK v2.5 and changes to JDom?? 17 Feb 2013 18:41 #6803

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Done
The administrator has disabled public write access.
Time to create page: 0.090 seconds

Get Started