Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Community Builder JQuery

  • AlanJones
  • AlanJones
  • OFFLINE
  • Posts: 510
  • Thanks: 42
  • Karma: 2
10 years 6 days ago #255422 by AlanJones
Community Builder JQuery was created by AlanJones
We're battling to to make jQuery scripts we've written work in new CB plugins we're developing. Is there something we're missing? Some kind of documentation that could help us?

Own Your Own Community!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
10 years 5 days ago #255476 by krileon
Replied by krileon on topic Community Builder JQuery
All your jQuery should still work. We load the jQuery migrate script so legacy usages should still function. Aside from that you can review the jQuery documentation below to see if any of the functions you're using have changed.

api.jquery.com/

You can also find the jQuery upgrade guide below.

jquery.com/upgrade-guide/1.9/


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • AlanJones
  • AlanJones
  • OFFLINE
  • Posts: 510
  • Thanks: 42
  • Karma: 2
10 years 5 days ago #255500 by AlanJones
Replied by AlanJones on topic Community Builder JQuery
I've looked through ProfileBook.php to get an idea of how to load a jquery script in a plugin. I found these two Function below:

function _getpbJS( )
{
global $_CB_framework;

$this->_getpbCSS();
$_CB_framework->addJQueryPlugin( 'cbprofilebook', '/components/com_comprofiler/plugin/user/plug_cbprofilebook/bb_adm.js', array( -1 => array( 'autosize' ) ) );
$_CB_framework->outputCbJQuery( '', 'cbprofilebook' );
}

function _getpbCSS( )
{
cbpbCssOutput();
}

Is there any documentation explaining what these functions are doing. Or perhaps you can explain it.
Thank you

Own Your Own Community!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
10 years 5 days ago #255509 by krileon
Replied by krileon on topic Community Builder JQuery
The addJQueryPlugin lets CB API know the jQuery plugin exists and where. This also lets you setup dependencies for the jQuery plugin (e.g. CSS files, other jQuery plugins, other JS files, etc..).

The outputCbJQuery function will output the specified jQuery, but will first load the jQuery plugins specified in the second variable (use array for multiple plugins).

Specifically that usage is telling CB that bb_adm.js is a jQuery plugin called cbprofilebook and that the core autosize jQuery plugin needs to load before it. outputCbJQuery following it then tells CB to actually output the plugin.

We'll have API documentation sometime in the future, but right now your best option is to review existing plugins. We also have a basic API documentation available for download in the Free downloads section.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • AlanJones
  • AlanJones
  • OFFLINE
  • Posts: 510
  • Thanks: 42
  • Karma: 2
10 years 5 days ago #255523 by AlanJones
Replied by AlanJones on topic Community Builder JQuery
Thank you for that explanation I got the script loading properly, the problem was I wasn't loading the jquery hide plugin before hand. Now does CB 2.0.4 also load Jquery UI and if not how would I go about loading the entire UI library?

Own Your Own Community!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
9 years 11 months ago #255651 by krileon
Replied by krileon on topic Community Builder JQuery
CB doesn't automatically load jQuery UI on load of jQuery. You need to specify that in the plugins loading of outputCbJQuery by using 'ui-all', which will load in all of jQuer UI. Example as follows.

Code:
$_CB_framework->outputCbJQuery( "YOUR_JS_HERE", 'ui-all' );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum