Page 4 of 4

Re: AJAX-Frameworks...

Posted: Sat Sep 01, 2007 7:27 am
by darb
Here is some good info about various Ajax frameworks..

http://ajaxexperience.techtarget.com/we ... ResigIntro

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 12:39 am
by binhle410
How re you guys doing with the project ? it s been a long time, any result yet ?

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 12:47 am
by Hackwar
This thread is 5 years old. In the meantime we released more than 30 versions of Joomla. Of course we have a JS/Ajax framework implemented. Look at mootools.

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 12:57 am
by binhle410
Yes, I can see about mootools, but how is the server directory/files structures of Ajax handling files, where should we place it in a com_xxx ?

Other dimensions can also be discussed such as security and scalability but I think security s of more issues. Many of my websites got hacked recently.

By the way, do you guys know any Joomla Security Auditing Expert ?

http://pnt.edu.vn some hacker got into this and installed the virus.

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 7:44 am
by darb
Hackwar wrote:This thread is 5 years old. In the meantime we released more than 30 versions of Joomla. Of course we have a JS/Ajax framework implemented. Look at mootools.
Hackwar, can you simply explain w h y Joomla have chosen Mootools over Jquery? (that for example Drupal have standardized on)

Bcs this conflicting ajax libereries conflict is a "hell" for ever site developer and site owner when you have different addons and conflicts.

So why?

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 12:31 pm
by nibra
jQuery is just a DOM manipulation library, while MooTools is Object Oriented JavaScript.
See jQuery vs MooTools

Regards,
Niels

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 2:47 pm
by darb
Thanks Niels appreciate your info and link from this good reference article but as the author said it could be a little Mootools biased though.

Its much to read but that didn't answered the analysis question still: w h y? So what's the reason that Joomla have chosen Mootools (and Drupal have chosen Jquery)?

Some fragment from the article but you have to read all of it.

"The MooTools developers include a robust framework that is easy for you to extend with your own functionality with the intention that people who include the framework in the page are going to use it, not some other framework."

=We are intend and developers are intend to only use one framework - Mootools not Jquery if not we are going that have problems (conflicts)?

"Reusing Code with jQuery

It's very tempting when you're working on a web project to write code this way. Just add some logic on the page that selects the DOM elements and "sets them up" by hiding some, altering others, and adding event listeners for click or mouseover. Developing code this way is very efficient, very fast. The problem with writing all your logic in domready statements is that you end up with a lot of code that does the same thing in different places. If we take the FAQ pattern above we could easily apply the same logic elsewhere on a different page with any list of terms and definitions. Are we going to repeat the same logic every time we find this pattern?

A simple way to make it reusable is to wrap the logic in a function and pass in arguments. Here's what that might look like in jQuery:

function faq(container, terms, definitions) {
$(container).find(terms).hide().end().find(definitions).click(function() {
$(this).next().slideToggle();
});
};
$(document).ready(function() {
faq('#faq', 'dd', 'dt');
});

This is much better for two really big and important reasons:

1. If tomorrow we need to change how these lists work (maybe we want to add click tracking logic so we can measure it in our web logs or maybe we want to fetch the definitions via ajax) we can just change our main faq method and everywhere we use it just gets updated. Or if there's a new version of jQuery released that changes the way things work, we can just go update our one method instead of a dozen copies everywhere. I call this keeping a small footprint in my application. By keeping the points where my application touches my more generic code as small as possible, it makes it easier for me to fix bugs, upgrade frameworks, add features, or alter functionality.
2. The second reason is that it's less code. By reusing the same method over and over again, I don't repeat myself and this is valuable in any programming environment. It also makes the code my visitors have to download smaller.

jQuery actually has a slightly more refined system for writing reusable "widgets" like these. Rather than encourage you to drop them into functions like the above example (which is really rather crude) it encourages you to write jQuery plug-ins
."

etc etc... for both libraries compared in this article.

So Niels, do you mean that Joomla need a MooTools Object Oriented JavaScript for some reason and Drupal only need a just a DOM manipulation library tool?

Joomla still struggles with old Mootools 1.11 and its update problems and Drupal just fly away with its Jquery library that is continuously no updating problem with it. Is it so?

Again, so where is the analysis w h y its better to use Mootools instead of Jquery as a standard java script library for Joomla? I still dont understand by your and the articles explanation maybe I am stupid.

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 3:24 pm
by nibra
I don't know the exact reason for that decision. And I don't need to know it, because it does not matter.

For the first - the decision is made. That is good. Everybody should stick to that and not try to introduce concurrent solutions.

Second, I personally think that MooTools indeed is the better choice. There is nothing you can do with jQuery that cannot be done with MooTools, but the OOP approach of MooTools offers opportunities you'll not find with jQuery.

Regarding the 1.11 issue: Yes that's a problem, but there are solutions - you can exchange 1.11 by 1.2 together with a compatibility layer to avoid breaking current extensions. BTDT.

Regards,
Niels

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 6:08 pm
by darb
This is the problem Everybody should stick to that and not try to introduce concurrent solutions. and I understand that you can do "more" things with Mootools that Jquery can not bcs its OOP but what are these extra "things" that Joomla need and not other open source scripts like example Drupal? And creating extra layers that is exactly the problems you want to avoid isnt it?

Re: AJAX-Framework in Joomla?

Posted: Thu Mar 25, 2010 6:34 pm
by Hackwar
Why should there be anything that Joomla needs that Drupal doesn't need or the other way around? The decision was made years ago and we are sticking with Mootools, as does Drupal with jQuery. So where is the problem? There is no special reason why we chose mootools.