4 * Ajatus - Distributed CRM
5 * @requires jQuery v1.2.1
7 * Copyright (c) 2007 Jerry Jalava <jerry.jalava@gmail.com>
8 * Copyright (c) 2007 Nemein Oy <http://nemein.com>
9 * Website: http://ajatus.info
10 * Licensed under the GPL license
11 * http://www.gnu.org/licenses/gpl.html
16 $.ajatus = $.ajatus || {};
20 $.ajatus.types.init = function(on_ready)
22 if (typeof on_ready != 'function') {
23 var on_ready = function(){return;};
26 $.ajatus.events.named_lock_pool.increase('init_types');
27 $.ajatus.extensions.lock = new $.ajatus.events.lock({
29 validate: function(){return $.ajatus.events.named_lock_pool.count('init_types') == 0;},
36 $.each($.ajatus.preferences.client.types.system, function(i,type){
37 var type_url = $.ajatus.preferences.client.application_url + 'js/content_types/'+type+'.js';
39 $.ajatus.events.named_lock_pool.increase('init_types');
41 $.ajatus.utils.load_script(type_url, "$.ajatus.types.type_loaded", [type]);
44 $.each($.ajatus.preferences.client.types.in_use, function(i,type){
45 var type_url = $.ajatus.preferences.client.application_url + 'js/content_types/'+type+'.js';
47 $.ajatus.events.named_lock_pool.increase('init_types');
49 $.ajatus.utils.load_script(type_url, "$.ajatus.types.type_loaded", [type]);
52 $.ajatus.events.named_lock_pool.decrease('init_types');
55 $.ajatus.types.type_loaded = function(type)
57 // $.ajatus.preferences.client.content_types[type] = new $.ajatus.content_type[type]();
59 $.ajatus.events.named_lock_pool.decrease('init_types');