Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/02/2009, 06:33
Avatar de MaTyS
MaTyS
 
Fecha de Ingreso: enero-2009
Ubicación: Mar del Plata
Mensajes: 220
Antigüedad: 15 años, 10 meses
Puntos: 18
Respuesta: [APORTE] Calendario {usando: AJAX, PHP y MySQL}

ajax_queue.js {PARTE 1}
Código PHP:
var    g_ajax_obj = new c_ajax_object;    
function 
c_ajax_object() {
};
c_ajax_object.prototype._dm_xmlhttprequest_type=null;        
c_ajax_object.prototype._dm_xmlhttprequestobject=null;    
c_ajax_object.prototype._dm_callback_function=null;        
c_ajax_object.prototype._dm_param=null;                    
c_ajax_object.prototype._dm_partialcallback_function=null;    
c_ajax_object.prototype._dm_param2=null;                        
c_ajax_object.prototype._dm_phase=0;                        
c_ajax_object.prototype._dm_queue=new Array();                
c_ajax_object.prototype._dm_queue_state=true;            
c_ajax_object.prototype._dm_committed=false;                    
c_ajax_object.prototype._dm_pre_queue_in_url=null;            
c_ajax_object.prototype._dm_pre_queue_in_callback=null;
c_ajax_object.prototype._dm_pre_queue_in_method=null;
c_ajax_object.prototype._dm_pre_queue_in_param=null;
c_ajax_object.prototype._dm_pre_queue_in_pcallback=null;
c_ajax_object.prototype._dm_pre_queue_in_param2=null;
c_ajax_object.prototype._dm_pre_queue_in_c2_phase=0;
c_ajax_object.prototype.GetNewRequestObject = function() {
    if (
window.XMLHttpRequest) {
        
this._dm_xmlhttprequestobject = new XMLHttpRequest();
    } else if (
window.ActiveXObject) {
        if (
this._dm_xmlhttprequest_type) {
            
this._dm_xmlhttprequestobject = new ActiveXObject(this._dm_xmlhttprequest_type);
        } else {
            var 
versions = ["Msxml2.XMLHTTP.7.0""Msxml2.XMLHTTP.6.0""Msxml2.XMLHTTP.5.0""Msxml2.XMLHTTP.4.0""MSXML2.XMLHTTP.3.0""MSXML2.XMLHTTP""Microsoft.XMLHTTP"];
            for (var 
0versions.length i++) {
             try {
                    
this._dm_xmlhttprequestobject = new ActiveXObject(versions[i]);
                    if (
this._dm_xmlhttprequestobject) {
                        
this._dm_xmlhttprequest_type versions[i];
                        break;
                    }}
            catch (
objException) {};};}}};
c_ajax_object.prototype.QueueFlush = function ( ) {
    
this._dm_queue = new Array();
    
this.QueueResume();    // If the queue was paused, it is now re-enabled
}c_ajax_object.prototype.QueuePause = function ( ) {
    
this._dm_queue_state false;
}
c_ajax_object.prototype.QueueResume = function ( ) {
    
this._dm_queue_state true;
    
this.Dequeue();
}
c_ajax_object.prototype.QueueInterrupt = function ( in_urlin_callbackin_methodin_paramin_pcallbackin_param2in_phase ) {
    var 
url in_url;
    
this._dm_callback_function in_callback;
    var 
method in_method;
    
this._dm_param in_param;
    
this._dm_partialcallback_function in_pcallback;
    
this._dm_param2 in_param2;
    
this._dm_phase in_phase;
    
    if ( 
url && method ) {
        
ret this._CallXMLHTTPObject urlmethod );
        }
    
    return 
ret;
}
c_ajax_object.prototype.QueueInject = function ( in_urlin_callbackin_methodin_paramin_pcallbackin_param2in_phase ) {
    
this._dm_queue_state false;
    for ( var 
counter this._dm_queue.lengthcounter 0counter-- ) {
        
this._dm_queue[counter] = this._dm_queue[counter 1];}    
this._dm_queue[0] = new Array ( in_urlin_callbackin_methodin_paramin_pcallbackin_param2in_phase );
this._dm_queue_state true;    // We don't call DeQueue, so we won't interrupt any request in progress.
}
c_ajax_object.prototype.CallXMLHTTPObjectGET = function ( in_urlin_callback ) {return this.CallXMLHTTPObject in_urlin_callback"GET"nullnull);
}
c_ajax_object.prototype.CallXMLHTTPObjectGETParam = function ( in_urlin_callbackin_param ) {
    return 
this.CallXMLHTTPObject in_urlin_callback"GET"in_paramnull);
}
c_ajax_object.prototype.CallXMLHTTPObjectGETParamPartial = function ( in_urlin_callbackin_paramin_pcallbackin_param2 ) {
    return 
this.CallXMLHTTPObject in_urlin_callback"GET"in_paramin_pcallbackin_param2);}
c_ajax_object.prototype.CallXMLHTTPObjectGETParamPartialPhase = function ( in_urlin_callbackin_paramin_pcallbackin_param2in_phase ) {return this.CallXMLHTTPObject in_urlin_callback"GET"in_paramin_pcallbackin_param2in_phase );
}
c_ajax_object.prototype.CallXMLHTTPObjectPOST = function ( in_urlin_callback ) {
    return 
this.CallXMLHTTPObject in_urlin_callback"POST"nullnull);

Continua en otro post..