[TYPO3-core] jQuery Integration

Daniel Sattler sattler at b13.de
Mon Apr 16 16:45:14 CEST 2012


Hi everbody,

I‘m Daniel Sattler from Stuttgart (Germany). I study media informatics and work as a webdeveloper with Benni Mack in Stuttgart. At the moment I‘m doing my bachelor thesis. The goal of my thesis is to integrate jQuery into the TYPO3 Backend and to create an API for Extensions that defines how developers can run jQuery in their extensions easily.

In the TYPO3 Backend should always run the latest version of jQuery. With the API, developers can decide which version of jQuery they want to use, i.e. Extensions can call something like the following snipped to get their requested jQuery version integrated:

t3lib_extMgm::addjQueryComponent('t3jQuery, 'EXT:jquery/Resources/jQuery/' array(
    'dependencies' => array(
        'version' => 1.5
    )
))

To avoid problems with different jQuery versions or other script librarys, jQuery will be moved into a new global namespace t3jQuery. Each jQuery version will be added to this global object with the noConflict function for later usage. 

//global Var
var t3jQuery = {}

<script src="jquery-1.7.2.js" type="text/javascript"></script>
<script>
	t3jQuery.lastest = jQuery.noConflict(true);
</script>

<script src="jquery-1.6.js" type="text/javascript"></script>
<script>
	t3jQuery.v16 = jQuery.noConflict(true);
</script>

If jQuery is integrated like this, there will be no version conflicts and the $-Sight will not be reserved. So, an extension can use jQuery 1.6 no matter what other versions or scripts are running somewhere else in the backend. 

(function($) {
	$(function() {
		//do some magic with jQuery version 1.6	
	}
})(t3jQuery.v16)

So far, this is the rough plan. If this is done, I would like to upgrade some Prototype/ExtJS functions with jQuery ;)

I will keep you posted with updates on this list. You will also find my code soon on forge: http://forge.typo3.org/projects/typo3v6-jquery).

Greets,
Dani




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20120416/cc7df934/attachment.htm>


More information about the TYPO3-team-core mailing list