📄 atlascore.js
字号:
return object;}this.hideDataContext =function(){if (!_dataContextHidden){_dataContextHidden =true;return true;}return false;}this.restoreDataContext =function(){_dataContextHidden =false;}}Web.ISupportBatchedUpdates =function(){this.beginUpdate =Function.abstractMethod;this.endUpdate =Function.abstractMethod;}Type.registerInterface('Web.ISupportBatchedUpdates');Web.ICustomTypeDescriptor =function(){this.getProperty =Function.abstractMethod;this.setProperty =Function.abstractMethod;this.invokeMethod =Function.abstractMethod;}Type.registerInterface('Web.ICustomTypeDescriptor');Web.ITypeDescriptorProvider =function(){this.getDescriptor =Function.abstractMethod;}Type.registerInterface('Web.ITypeDescriptorProvider');Web.ActionSequence =Web.Enum.create('BeforeEventHandler','AfterEventHandler');Web.IAction =function(){this.get_sequence =Function.abstractMethod;this.execute =Function.abstractMethod;this.setOwner =Function.abstractMethod;}Type.registerInterface('Web.IAction');Web.Event =function(owner,autoInvoke){var _owner =owner;var _handlers =null;var _actions =null;var _autoInvoke =autoInvoke;var _invoked =false;this.get_autoInvoke =function(){return _autoInvoke;}this._getActions =function(){if (_actions ==null){_actions =Web.Component.createCollection(_owner);}return _actions;}this._getHandlers =function(){if (_handlers ==null){_handlers =[];}return _handlers;}this._getOwner =function(){return _owner;}this.isActive =function(){return ((_handlers !=null)&&(_handlers.length !=0))||((_actions !=null)&&(_actions.length !=0));}this.get_isInvoked =function(){return _isInvoked;}this.dispose =function(){if (_handlers){for (var h =_handlers.length -1;h >=0;h--){_handlers[h]=null;}_handlers =null;}if (_actions){_actions.dispose();_actions =null;}_owner =null;}this._setInvoked =function(value){_invoked =true;}}Type.registerSealedClass('Web.Event',null,Web.IDisposable);Web.Event.prototype.add =function(handler){this._getHandlers().add(handler);if (this.get_autoInvoke()&&this.get_isInvoked()){handler(this._getOwner(),Web.EventArgs.Empty);}}Web.Event.prototype.addAction =function(action){this._getActions().add(action);if (this.get_autoInvoke()&&this.get_isInvoked()){action.execute(this._getOwner(),Web.EventArgs.Empty);}}Web.Event.prototype.remove =function(handler){this._getHandlers().remove(handler);}Web.Event.prototype.removeAction =function(action){this._getActions().remove(action);}Web.Event.prototype.invoke =function(sender,eventArgs){if (this.isActive()){var actions =this._getActions();var handlers =this._getHandlers();var hasPostActions =false;var i;for (i =0;i <actions.length;i++){if (actions[i].get_sequence()==Web.ActionSequence.BeforeEventHandler){actions[i].execute(sender,eventArgs);}else {hasPostActions =true;}}for (i =0;i <handlers.length;i++){handlers[i](sender,eventArgs);}if (hasPostActions){for (i =0;i <actions.length;i++){if (actions[i].get_sequence()==Web.ActionSequence.AfterEventHandler){actions[i].execute(sender,eventArgs);}}}this._setInvoked();}}Web.EventArgs =function(){this.getDescriptor =function(){var td =new Web.TypeDescriptor();return td;}Web.EventArgs.registerBaseMethod(this,'getDescriptor');}Type.registerClass('Web.EventArgs',null,Web.ITypeDescriptorProvider);Web.EventArgs.Empty =new Web.EventArgs();Web.CancelEventArgs =function(){Web.CancelEventArgs.initializeBase(this);var _canceled =false;this.get_canceled =function(){return _canceled;}this.set_canceled =function(value){_canceled =value;}this.getDescriptor =function(){var td =Web.CancelEventArgs.callBaseMethod(this,'getDescriptor');td.addProperty('canceled',Boolean);return td;}Web.CancelEventArgs.registerBaseMethod(this,'getDescriptor');}Type.registerClass('Web.CancelEventArgs',Web.EventArgs);Web.ApplicationType =Web.Enum.create('Other','InternetExplorer','Firefox');Web._Application =function(){var _scriptDOM;var _scriptObjectsNode;var _references;var _currentLoadingReference;var _unloading;var _markupContext;var _disposableObjects;var _type;window.attachEvent('onload',onWindowLoad);window.attachEvent('onunload',onWindowUnload);this.get_type =function(){if (!_type){_type =Web.ApplicationType.Other;if (navigator.userAgent.indexOf('MSIE')!=-1){_type =Web.ApplicationType.InternetExplorer;}else if (navigator.userAgent.indexOf('Firefox')!=-1){_type =Web.ApplicationType.Firefox;}}return _type;}this.get_userAgent =function(){return navigator.userAgent;}this.load =new Web.Event(this);this.unload =new Web.Event(this);this.dispose =function(){}this.findObject =function(id){if (_markupContext){return _markupContext.findObject(id,false);}return null;}this.getDescriptor =function(){var td =new Web.TypeDescriptor();td.addEvent('load',true);td.addEvent('unload',true);return td;}this.getProperty =function(name,key){}this.getService =function(serviceType){return null;}this._initialize =function(){var atlasScript;var scripts =document.getElementsByTagName('script');for (var s =0;s <scripts.length;s++){if (scripts[s].type =='text/xml-script'){atlasScript =scripts[s];break;}}if (!atlasScript){onLoad();return;}var scriptMarkup =atlasScript.text ?atlasScript.text :atlasScript.innerHTML;if (scriptMarkup.startsWith('<!--')){var startIndex =scriptMarkup.indexOf('<',1);var endIndex =scriptMarkup.lastIndexOf('>');endIndex =scriptMarkup.lastIndexOf('>',endIndex -1);scriptMarkup =scriptMarkup.substring(startIndex,endIndex +1);}var scriptDOM =new XMLDOM(scriptMarkup);var scriptDocumentNode =scriptDOM.childNodes[0];var scriptDocumentItemNodes =scriptDocumentNode.childNodes;var referencesNode;var node;for (var i =scriptDocumentItemNodes.length -1;i >=0;i--){node =scriptDocumentItemNodes[i];if (node.nodeType !=1){continue;}if (node.baseName =='components'){_scriptObjectsNode =node;}else if (node.baseName =='references'){referencesNode =node;}}if (referencesNode){_references =[];for (var r =0;r <referencesNode.childNodes.length;r++){node =referencesNode.childNodes[r];if (node.nodeType !=1){continue;}if (node.baseName =='add'){var srcAttribute =node.attributes.getNamedItem('src');if (srcAttribute){_references.queue(srcAttribute.nodeValue);}}}}if (_references &&_references.length){loadReferences();}else {loadObjects();}}this.invokeMethod =function(methodName,parameters){var method =Function.parse(methodName);if (typeof(method)=='function'){method();}}this.registerDisposableObject =function(object){if (!_disposableObjects){_disposableObjects =[];}_disposableObjects.add(object);}this.unregisterDisposableObject =function(object){if (!_unloading &&_disposableObjects){_disposableObjects.remove(object);}}this.requiresReference =function(scriptPath){}this.setProperty =function(name,value,key){}function loadObjects(){_markupContext =new Web.TypeDescriptor.MarkupContext(document,true);if (_scriptObjectsNode){Web.TypeDescriptor.processMarkupNodes(_scriptObjectsNode.childNodes,_markupContext);_scriptObjectsNode =null;}_markupContext.complete();onLoad();}function loadReferences(){if (_currentLoadingReference){if ((_currentLoadingReference.readyState !='loaded')&&(_currentLoadingReference.readyState !='complete')){return;}else {if (Web.Application.get_type()!=Web.ApplicationType.InternetExplorer){_currentLoadingReference.onload =null;}else {_currentLoadingReference.onreadystatechange =null;}_currentLoadingReference =null;}}if (_references &&_references.length){var reference =_references.dequeue();var scriptElement =document.createElement('script');_currentLoadingReference =scriptElement;if (Web.Application.get_type()!=Web.ApplicationType.InternetExplorer){scriptElement.readyState ='loaded';scriptElement.onload =loadReferences;}else {scriptElement.onreadystatechange =loadReferences;}scriptElement.type ='text/javascript';scriptElement.src =reference;var headElement =document.getElementsByTagName('head')[0];headElement.appendChild(scriptElement);return;}loadObjects();}function onLoad(){Web.Application.load.invoke(Web.Application,Web.EventArgs.Empty);var pageLoadHandler =Function.parse('pageLoad');if (typeof(pageLoadHandler)=='function'){pageLoadHandler();}}function onWindowLoad(){window.detachEvent('onload',onWindowLoad);Web.Application._initialize();}function onWindowUnload(){window.detachEvent('onunload',onWindowUnload);Web.Application.unload.invoke(Web.Application,Web.EventArgs.Empty);var pageUnloadHandler =Function.parse('pageUnload');if (typeof(pageUnloadHandler)=='function'){pageUnloadHandler();}if (_disposableObjects){_unloading =true;var count =_disposableObjects.length;for (var i =0;i <count;i++){_disposableObjects[i].dispose();}_disposableObjects.clear();_disposableObjects =null;}if (_markupContext){_markupContext.dispose();_markupContext =null;}Web.TypeDescriptor.unload();}}Type.registerSealedClass('Web._Application',null,Web.IDisposable,Web.ITypeDescriptorProvider,Web.ICustomTypeDescriptor);Web.TypeDescriptor.addType('script','application',Web._Application);Web._Application.parseFromMarkup =function(type,node,markupContext){if (!markupContext.get_isGlobal()){return null;}Web.TypeDescriptor.initializeInstance(Web.Application,node,markupContext);return Web.Application;}Web.Application =new Web._Application();Web.INotifyPropertyChanged =function(){this.propertyChanged =null;}Type.registerInterface('Web.INotifyPropertyChanged');Web.INotifyCollectionChanged =function(){this.collectionChanged =null;}Type.registerInterface('Web.INotifyCollectionChanged');Web.PropertyChangedEventArgs =function(propertyName){Web.PropertyChangedEventArgs.initializeBase(this);var _propertyName =propertyName;this.get_propertyName =function(){return _propertyName;}this.getDescriptor =function(){var td =Web.PropertyChangedEventArgs.callBaseMethod(this,'getDescriptor');td.addProperty('propertyName',String,true);return td;}}Type.registerSealedClass('Web.PropertyChangedEventArgs',Web.EventArgs);Web.NotifyCollectionChangedAction =Web.Enum.create('Add','Remove','Update','Reset');Web.CollectionChangedEventArgs =function(action,changedItem){Web.CollectionChangedEventArgs.initializeBase(this);var _action =action;var _changedItem =changedItem;this.get_action =function(){return _action;}this.get_changedItem =function(){return _changedItem;}this.getDescriptor =function(){var td =Web.CollectionChangedEventArgs.callBaseMethod(this,'getDescriptor');td.addProperty('action',Web.NotifyCollectionChangedAction,true);td.addProperty('changedItem',Object,true);return td;}}Type.registerSealedClass('Web.CollectionChangedEventArgs',Web.EventArgs);Web.BindingDirection =Web.Enum.create('In','Out','InOut');Web.BindingEventArgs =function(value,direction,targetPropertyType,transformerArgument){Web.BindingEventArgs.initializeBase(this);var _value =value;var _direction =direction;var _targetPropertyType =targetPropertyType;var _transformerArgument =transformerArgument;this.get_direction =function(){return _direction;}this.get_targetPropertyType =function(){return _targetPropertyType;}this.get_transformerArgument =function(){return _transformerArgument;}this.get_value =function(){return _value;}this.set_value =function(value){_value =value;}this.getDescriptor =function(){var td =Web.BindingEventArgs.callBaseMethod(this,'getDescriptor');td.addProperty('direction',Web.BindingDirection,true);td.addProperty('targetPropertyType',Object,true);td.addProperty('transformerArgument',Object,true);td.addProperty('value',Object);return td;}Web.BindingEventArgs.registerBaseMethod(this,'getDescriptor');}Type.registerSealedClass('Web.BindingEventArgs',Web.CancelEventArgs);Web.Binding =function(){Web.Binding.initializeBase(this);var _id;var _component;var _componentNotificationHandler;var _dataContext;var _dataContextInUse;var _dataContextNotificationHandler;var _dataPath;var _dataPathParts;var _direction =Web.BindingDirection.In;var _property;var _propertyKey;var _automatic =true;var _transformerArgument;this.get_automatic =function(){return _automatic;}this.set_automatic =function(value){if (!_dataContextInUse){_automatic =value;}}this.get_dataContext =function(){return _dataContext;}this.set_dataContext =function(value){if (!_dataContextInUse){_dataContext =value;}}this.get_dataPath =function(){return _dataPath;}this.set_dataPath =function(value){if (!_dataContextInUse){_dataPath =value;}}this.get_direction =function(){return _direction;}this.set_direction =function(value){if (!_dataContextInUse){_direction =value;}}this.get_id =function(){return _id;}this.set_id =function(value){_id =value;}this.get_property =function(){return _property;}this.set_property =function(value){if (!_dataContextInUse){_property =value;}}this.get_propertyKey =function(){return _propertyKey;}this.set_propertyKey =function(value){if (!_dataContextInUse){_propertyKey =value;}}this.get_transformerArgument =function(){return _transformerArgument;}this.set_transformerArgument =function(value){_transformerArgument =value;}this.transform =new Web.Event(null);this.dispose =function(){this.transform.dispose();if (_componentNotificationHandler){_component.propertyChanged.remove(_componentNotificationHandler);_componentNotificationHandler =null;}if (_dataContextNotificationHandler){if (Web.INotifyPropertyChanged.isImplementedBy(_dataContextInUse)){_dataContextInUse.propertyChanged.remove(_dataContextNotificationHandler);}_dataContextNotificationHandler =null;}_dataContextInUse =null;_dataContext =null;_component =null;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -