📄 ssfx.core.debug.js
字号:
}
if ((!ScriptFX.Net.HTTPRequestManager._activeRequests.length) && (ScriptFX.Net.HTTPRequestManager._appIdleHandler)) {
ScriptFX.Application.current.remove_idle(ScriptFX.Net.HTTPRequestManager._appIdleHandler);
ScriptFX.Net.HTTPRequestManager._appIdleHandler = null;
}
}
ScriptFX.Net.HTTPRequestManager._onApplicationIdle = function ScriptFX_Net_HTTPRequestManager$_onApplicationIdle(sender, e) {
if (!ScriptFX.Net.HTTPRequestManager._activeRequests.length) {
return;
}
var timedOutRequests = null;
var currentTimeValue = (new Date()).getTime();
var $enum1 = ScriptFX.Net.HTTPRequestManager._activeRequests.getEnumerator();
while ($enum1.moveNext()) {
var request = $enum1.get_current();
var timeStampValue = request.get_timeStamp().getTime();
var interval = request.get_timeout();
if (!interval) {
interval = ScriptFX.Net.HTTPRequestManager._timeoutInterval;
if (!interval) {
continue;
}
}
if ((currentTimeValue - timeStampValue) > interval) {
if (!timedOutRequests) {
timedOutRequests = [];
}
timedOutRequests.add(request);
}
}
if (timedOutRequests) {
var $enum2 = timedOutRequests.getEnumerator();
while ($enum2.moveNext()) {
var request = $enum2.get_current();
ScriptFX.Net.HTTPRequestManager._abort(request, true);
}
}
}
ScriptFX.Net.HTTPRequestManager._onCompleted = function ScriptFX_Net_HTTPRequestManager$_onCompleted(request, response) {
ScriptFX.Net.HTTPRequestManager._endInvoke(request, response, false);
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.Net.HTTPTransport
ScriptFX.Net.HTTPTransport = function ScriptFX_Net_HTTPTransport(request) {
this._request = request;
}
ScriptFX.Net.HTTPTransport.createURI = function ScriptFX_Net_HTTPTransport$createURI(uri, transportType, parameters) {
Debug.assert(!String.isNullOrEmpty(uri));
Debug.assert((transportType) && ScriptFX.Net.HTTPTransport.isAssignableFrom(transportType));
if (!parameters) {
return '{__nullParams: true, __uri:\'' + uri + '\', __transportType: ' + transportType.get_fullName() + '}';
}
else {
parameters['__uri'] = uri;
parameters['__transportType'] = transportType.get_fullName();
return ScriptFX.JSON.serialize(parameters);
}
}
ScriptFX.Net.HTTPTransport.prototype = {
_request: null,
get_parameters: function ScriptFX_Net_HTTPTransport$get_parameters() {
return this._request.get__transportParameters();
},
get_request: function ScriptFX_Net_HTTPTransport$get_request() {
return this._request;
},
getMethod: function ScriptFX_Net_HTTPTransport$getMethod() {
return Enum.toString(ScriptFX.Net.HTTPVerb, this._request.get_verb());
},
onCompleted: function ScriptFX_Net_HTTPTransport$onCompleted(response) {
ScriptFX.Net.HTTPRequestManager._onCompleted(this._request, response);
}
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.Net.PostHTTPRequestEventArgs
ScriptFX.Net.PostHTTPRequestEventArgs = function ScriptFX_Net_PostHTTPRequestEventArgs(request, response) {
ScriptFX.Net.PostHTTPRequestEventArgs.constructBase(this);
this._request$1 = request;
this._response$1 = response;
}
ScriptFX.Net.PostHTTPRequestEventArgs.prototype = {
_request$1: null,
_response$1: null,
get_request: function ScriptFX_Net_PostHTTPRequestEventArgs$get_request() {
return this._request$1;
},
get_response: function ScriptFX_Net_PostHTTPRequestEventArgs$get_response() {
return this._response$1;
}
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.Net.PreHTTPRequestEventArgs
ScriptFX.Net.PreHTTPRequestEventArgs = function ScriptFX_Net_PreHTTPRequestEventArgs(request) {
ScriptFX.Net.PreHTTPRequestEventArgs.constructBase(this);
this._request$1 = request;
}
ScriptFX.Net.PreHTTPRequestEventArgs.prototype = {
_request$1: null,
_response$1: null,
_suppressed$1: false,
get_isSuppressed: function ScriptFX_Net_PreHTTPRequestEventArgs$get_isSuppressed() {
return this._suppressed$1;
},
get_request: function ScriptFX_Net_PreHTTPRequestEventArgs$get_request() {
return this._request$1;
},
get_response: function ScriptFX_Net_PreHTTPRequestEventArgs$get_response() {
return this._response$1;
},
suppressRequest: function ScriptFX_Net_PreHTTPRequestEventArgs$suppressRequest(response) {
this._suppressed$1 = true;
this._response$1 = response;
}
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.Net._xmlhttpResponse
ScriptFX.Net._xmlhttpResponse = function ScriptFX_Net__xmlhttpResponse(request, xmlHTTP) {
this._timeStamp = new Date();
this._request = request;
this._xmlHTTP = xmlHTTP;
}
ScriptFX.Net._xmlhttpResponse.prototype = {
_request: null,
_xmlHTTP: null,
_headers: null,
_timeStamp: null,
_text: null,
_object: null,
_xml: null,
get_contentLength: function ScriptFX_Net__xmlhttpResponse$get_contentLength() {
return this.getText().length;
},
get_contentType: function ScriptFX_Net__xmlhttpResponse$get_contentType() {
return this._xmlHTTP.getResponseHeader('Content-Type');
},
get_headers: function ScriptFX_Net__xmlhttpResponse$get_headers() {
if (!this._headers) {
var headers = this._xmlHTTP.getAllResponseHeaders();
var parts = headers.split('\r\n');
this._headers = {};
var $enum1 = parts.getEnumerator();
while ($enum1.moveNext()) {
var part = $enum1.get_current();
var colonIndex = part.indexOf(':');
this._headers[part.substr(0, colonIndex)] = part.substr(colonIndex + 1);
}
}
return this._headers;
},
get_request: function ScriptFX_Net__xmlhttpResponse$get_request() {
return this._request;
},
get_statusCode: function ScriptFX_Net__xmlhttpResponse$get_statusCode() {
return this._xmlHTTP.status;
},
get_statusText: function ScriptFX_Net__xmlhttpResponse$get_statusText() {
return this._xmlHTTP.statusText;
},
get_timeStamp: function ScriptFX_Net__xmlhttpResponse$get_timeStamp() {
return this._timeStamp;
},
getHeader: function ScriptFX_Net__xmlhttpResponse$getHeader(name) {
return this._xmlHTTP.getResponseHeader(name);
},
getObject: function ScriptFX_Net__xmlhttpResponse$getObject() {
if (!this._object) {
this._object = ScriptFX.JSON.deserialize(this.getText());
}
return this._object;
},
getText: function ScriptFX_Net__xmlhttpResponse$getText() {
if (!this._text) {
this._text = this._xmlHTTP.responseText;
}
return this._text;
},
getXML: function ScriptFX_Net__xmlhttpResponse$getXML() {
if (!this._xml) {
var xml = this._xmlHTTP.responseXML;
if ((!xml) || (!xml.documentElement)) {
try {
xml = XMLDocumentParser.parse(this._xmlHTTP.responseText);
if ((xml) && (xml.documentElement)) {
this._xml = xml;
}
}
catch ($e1) {
}
}
else {
this._xml = xml;
if (ScriptFX.Application.current.get_isIE()) {
xml.setProperty('SelectionLanguage', 'XPath');
}
}
}
return this._xml;
}
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.Net._xmlhttpTransport
ScriptFX.Net._xmlhttpTransport = function ScriptFX_Net__xmlhttpTransport(request) {
ScriptFX.Net._xmlhttpTransport.constructBase(this, [ request ]);
}
ScriptFX.Net._xmlhttpTransport.prototype = {
_xmlHTTP$1: null,
abort: function ScriptFX_Net__xmlhttpTransport$abort() {
if (this._xmlHTTP$1) {
this._xmlHTTP$1.onreadystatechange = Delegate.Null;
this._xmlHTTP$1.abort();
this._xmlHTTP$1 = null;
}
},
dispose: function ScriptFX_Net__xmlhttpTransport$dispose() {
this.abort();
},
invoke: function ScriptFX_Net__xmlhttpTransport$invoke() {
var request = this.get_request();
this._xmlHTTP$1 = new XMLHttpRequest();
this._xmlHTTP$1.onreadystatechange = Delegate.create(this, this._onReadyStateChange$1);
if (!this.get_request().get_hasCredentials()) {
this._xmlHTTP$1.open(this.getMethod(), request.get_URI(), true);
}
else {
this._xmlHTTP$1.open(this.getMethod(), request.get_URI(), true, request.get_userName(), request.get_password());
}
var headers = (request.get_hasHeaders()) ? request.get_headers() : null;
if (headers) {
var $dict1 = headers;
for (var $key2 in $dict1) {
var entry = { key: $key2, value: $dict1[$key2] };
this._xmlHTTP$1.setRequestHeader(entry.key, entry.value);
}
}
var body = request.get_content();
if ((body) && ((!headers) || (!headers['Content-Type']))) {
this._xmlHTTP$1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
}
this._xmlHTTP$1.send(body);
},
_onReadyStateChange$1: function ScriptFX_Net__xmlhttpTransport$_onReadyStateChange$1() {
if (this._xmlHTTP$1.readyState === 4) {
var response = new ScriptFX.Net._xmlhttpResponse(this.get_request(), this._xmlHTTP$1);
this._xmlHTTP$1.onreadystatechange = Delegate.Null;
this._xmlHTTP$1 = null;
this.onCompleted(response);
}
}
}
Type.createNamespace('ScriptFX.UI');
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.AnimationStopState
ScriptFX.UI.AnimationStopState = function() { };
ScriptFX.UI.AnimationStopState.prototype = {
complete: 0,
abort: 1,
revert: 2
}
ScriptFX.UI.AnimationStopState.createEnum('ScriptFX.UI.AnimationStopState', false);
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.Bounds
ScriptFX.UI.$create_Bounds = function ScriptFX_UI_Bounds(left, top, width, height) {
var $o = { };
$o.left = left;
$o.top = top;
$o.width = width;
$o.height = height;
return $o;
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.DragDropData
ScriptFX.UI.$create_DragDropData = function ScriptFX_UI_DragDropData(mode, dataType, data) {
var $o = { };
$o.mode = mode;
$o.dataType = dataType;
$o.data = data;
return $o;
}
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.DragMode
ScriptFX.UI.DragMode = function() { };
ScriptFX.UI.DragMode.prototype = {
move: 0,
copy: 1
}
ScriptFX.UI.DragMode.createEnum('ScriptFX.UI.DragMode', false);
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.IAction
ScriptFX.UI.IAction = function() { };
ScriptFX.UI.IAction.prototype = {
get_actionArgument : null,
get_actionName : null,
add_action : null,
remove_action : null
}
ScriptFX.UI.IAction.createInterface('ScriptFX.UI.IAction');
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.IDragDrop
ScriptFX.UI.IDragDrop = function() { };
ScriptFX.UI.IDragDrop.prototype = {
get_supportsDataTransfer : null,
dragDrop : null
}
ScriptFX.UI.IDragDrop.createInterface('ScriptFX.UI.IDragDrop');
////////////////////////////////////////////////////////////////////////////////
// ScriptFX.UI.IDragSource
ScriptFX.UI.IDragSource = function() { };
ScriptFX.UI.IDragSource.prototype =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -