event.js

来自「航空自助值机java BS模式程序」· JavaScript 代码 · 共 38 行

JS
38
字号
/****************************************************************
 *  Copyright (c) 2002 IER International    			*
 *  All rights reserved. See the LICENSE for usage conditions.  *
 ***************************************************************/

/* Object to represent an event - Mapping between CUSS Event and java script event. 
   Arguments are an array where args[i] is name and args[i+1] is value 
*/
function CUSSEvent(args) {
   // Member variable setup; the Map stores the N/V pairs
   this.map = new Map();
   
   // Member function setup
   this.put = CUSSEventPut
   this.get = CUSSEventGet
   this.toString = CUSSEventToString

   // Put the arguments' name/value pairs in the Map
   for (var i=0; i < args.length; i++) {
     this.put(new String(args[i]), new String(args[++i]));     
   }
}


// Get event attribute
function CUSSEventGet(name) {
  return this.map.get(name)
}

// Put event attribute
function CUSSEventPut(name, value) {
  return this.map.put(name, value)
}

function CUSSEventToString() {
  return this.map.toString();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?