mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged 3.1 to HEAD
13275: updated web-client to use tinymce v3 13276: overlay display fix for when field has large content git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13585 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
80
source/web/scripts/tiny_mce/classes/util/XHR.js
vendored
Executable file
80
source/web/scripts/tiny_mce/classes/util/XHR.js
vendored
Executable file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* $Id: XHR.js 832 2008-05-02 11:01:57Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright <20> 2004-2006, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/**#@+
|
||||
* @class This class enables you to send XMLHTTPRequests cross browser.
|
||||
* @member tinymce.util.XHR
|
||||
* @static
|
||||
*/
|
||||
tinymce.create('static tinymce.util.XHR', {
|
||||
/**#@+
|
||||
* @method
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sends a XMLHTTPRequest.
|
||||
* Consult the Wiki for details on what settings this method takes.
|
||||
*
|
||||
* @param {Object} o Object will target URL, callbacks and other info needed to make the request.
|
||||
*/
|
||||
send : function(o) {
|
||||
var x, t, w = window, c = 0;
|
||||
|
||||
// Default settings
|
||||
o.scope = o.scope || this;
|
||||
o.success_scope = o.success_scope || o.scope;
|
||||
o.error_scope = o.error_scope || o.scope;
|
||||
o.async = o.async === false ? false : true;
|
||||
o.data = o.data || '';
|
||||
|
||||
function get(s) {
|
||||
x = 0;
|
||||
|
||||
try {
|
||||
x = new ActiveXObject(s);
|
||||
} catch (ex) {
|
||||
}
|
||||
|
||||
return x;
|
||||
};
|
||||
|
||||
x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');
|
||||
|
||||
if (x) {
|
||||
if (x.overrideMimeType)
|
||||
x.overrideMimeType(o.content_type);
|
||||
|
||||
x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);
|
||||
|
||||
if (o.content_type)
|
||||
x.setRequestHeader('Content-Type', o.content_type);
|
||||
|
||||
x.send(o.data);
|
||||
|
||||
function ready() {
|
||||
if (!o.async || x.readyState == 4 || c++ > 10000) {
|
||||
if (o.success && c < 10000 && x.status == 200)
|
||||
o.success.call(o.success_scope, '' + x.responseText, x, o);
|
||||
else if (o.error)
|
||||
o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);
|
||||
|
||||
x = null;
|
||||
} else
|
||||
w.setTimeout(ready, 10);
|
||||
};
|
||||
|
||||
// Syncronous request
|
||||
if (!o.async)
|
||||
return ready();
|
||||
|
||||
// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
|
||||
t = w.setTimeout(ready, 10);
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user