globalObject.js

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;
	};
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值