function GlobalObject() { this.elementCycleTimeId = null; // global index of all excel images array this.excelIndex = 0; // all left elements this.leftElements = []; // all right elements this.rightElements = []; // all images(exclude auto generated excel images) this.images = []; // all excel images url this.excelImages = []; // all elements, web array, image array, excel image array etc this.allElements = []; // bulletin contents this.bulletinContents = []; this.bulletinSpeed = null; this.leftElementShowTime = []; this.rightElementShowTime = []; this.imageShowTime = []; this.excelShowTime = []; this.bulletinShowTime = []; this.setElementCycleTimeId = function(elementCycleTimeId) { this.elementCycleTimeId = elementCycleTimeId; }; this.getElementCycleTimeId = function() { return this.elementCycleTimeId; }; this.getExcelIndex = function() { return this.excelIndex; }; this.setExcelIndex = function (excelIndex) { this.excelIndex = excelIndex; }; this.getLeftElements = function() { return this.leftElements; }; // need to refresh attribute allElements this.setLeftElelments = function(leftElements) { if(leftElements) { this.leftElements = leftElements; var length = this.allElements.length; var min = 0; for(var i=0;i<length;++i) { if(!this.allElements[i] || !(this.allElements[i] instanceof Array)) { min = i; } else { if(this.allElements[i].name == this.leftElements.name) { this.allElements[i] = leftElements; return; } } } this.allElements[min] = leftElements; } }; this.getRightElements = function() { return this.rightElements; }; // need to refresh attribute allElements this.setRightElements = function(rightElements) { this.rightElements = rightElements; var length = this.allElements.length; var min = 0; for(var i=0;i<length;++i) { if(!this.allElements[i] || !(this.allElements[i] instanceof Array)) { min = i; } else { if(this.allElements[i].name == rightElements.name) { this.allElements[i] = rightElements; return; } } } this.allElements[min] = rightElements; }; this.getImages = function() { return this.images; }; this.setImages = function(images) { this.images = images; }; this.getExcelImages = function() { return this.excelImages; }; // need to refresh attribute allElements this.setExcelImages = function(excelImages) { this.excelImages = excelImages; var length = this.allElements.length; var min = 0; for(var i=0;i<length;++i) { if(!this.allElements[i] || !(this.allElements[i] instanceof Array)) { min = i; } else { if(this.allElements[i].name == excelImages.name) { this.allElements[i] = excelImages; return; } } } this.allElements[min] = excelImages; }; this.getAllElements = function() { return this.allElements; }; this.setAllElements = function(allElements) { this.allElements = allElements; }; this.getLeftElementShowTime = function() { return this.leftElementShowTime; }; this.setLeftElementShowTime = function(leftElementShowTime) { this.leftElementShowTime =leftElementShowTime; }; this.getRightElementShowTime = function() { return this.rightElementShowTime; }; this.setRightElementShowTime = function(rightElementShowTime) { this.rightElementShowTime = rightElementShowTime; }; this.getImageShowTime = function() { return this.imageShowTime; }; this.setImageShowTime = function(imageShowTime) { this.imageShowTime = imageShowTime; }; this.getExcelShowTime = function() { return this.excelShowTime; }; this.setExcelShowTime = function(excelShowTime) { this.excelShowTime = excelShowTime; }; this.getBulletinShowTime = function() { return this.bulletinShowTime; }; this.setBulletinShowTime = function(bulletinShowTime) { this.bulletinShowTime = bulletinShowTime; }; this.getBulletinContents = function() { return this.bulletinContents; }; this.setBulletinContents = function(bulletinContents) { this.bulletinContents = bulletinContents; }; this.getBulletinSpeed = function() { return this.bulletinSpeed; }; this.setBulletinSpeed = function(bulletinSpeed) { this.bulletinSpeed = bulletinSpeed; }; }
globalObject.js
最新推荐文章于 2021-03-22 21:19:44 发布