Patching cheap DHTML effects with super-simplistic polyfills.
TODO: use MessageChannel pending moz bug#677638
@see http://www.nonblocking.io/2011/06/windownexttick.html
@param [Window} win
337526
function effects() {
		extend(window, {
			requestAnimationFrame: (function() {
				var func =
					window.requestAnimationFrame ||
					window.webkitRequestAnimationFrame ||
					window.mozRequestAnimationFrame ||
					window.oRequestAnimationFrame ||
					window.msRequestAnimationFrame ||
					(function() {
						var lastTime = 0;
						return function(callback, element) {
							var currTime = new Date().getTime();
							var timeToCall = Math.max(0, 16 - (currTime - lastTime));
							var id = window.setTimeout(function() {
									callback(currTime + timeToCall);
								},
								timeToCall);
							lastTime = currTime + timeToCall;
							return id;
						};
					}());
				return func;
			})(),
			cancelAnimationFrame: (function() {
				return (
					window.cancelAnimationFrame ||
					window.webkitCancelAnimationFrame ||
					window.mozCancelAnimationFrame ||
					window.oCancelAnimationFrame ||
					window.msCancelAnimationFrame ||
					clearTimeout
				);
			}()),
			/*
			 * TODO: Internalize into gui.Tick
			 * TODO: Move to MessageChannel!!!
			 */
			setImmediate: (function() {
				var list = [],
					handle = 1;
				var name = "spiritual:emulated:setimmediate";
				window.addEventListener("message", function(e) {
					if (e.data === name && list.length) {
						list.shift().apply(window);
						e.stopPropagation();
					}
				}, false);
				return function emulated(func) {
					list.push(func);
					window.postMessage(name, "*");
					return handle++;
				};
			})()
		});
	}
1308621
function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {
  if (!window.RTCPeerConnection) {
    return;
  }
  var proto = window.RTCPeerConnection.prototype;
  var nativeAddEventListener = proto.addEventListener;
  proto.addEventListener = function(nativeEventName, cb) {
    if (nativeEventName !== eventNameToWrap) {
      return nativeAddEventListener.apply(this, arguments);
    }
    var wrappedCallback = function(e) {
      var modifiedEvent = wrapper(e);
      if (modifiedEvent) {
        cb(modifiedEvent);
      }
    };
    this._eventMap = this._eventMap || {};
    this._eventMap[cb] = wrappedCallback;
    return nativeAddEventListener.apply(this, [nativeEventName,
      wrappedCallback]);
  };

  var nativeRemoveEventListener = proto.removeEventListener;
  proto.removeEventListener = function(nativeEventName, cb) {
    if (nativeEventName !== eventNameToWrap || !this._eventMap
        || !this._eventMap[cb]) {
      return nativeRemoveEventListener.apply(this, arguments);
    }
    var unwrappedCb = this._eventMap[cb];
    delete this._eventMap[cb];
    return nativeRemoveEventListener.apply(this, [nativeEventName,
      unwrappedCb]);
  };

  Object.defineProperty(proto, 'on' + eventNameToWrap, {
    get: function() {
      return this['_on' + eventNameToWrap];
    },
    set: function(cb) {
      if (this['_on' + eventNameToWrap]) {
        this.removeEventListener(eventNameToWrap,
            this['_on' + eventNameToWrap]);
        delete this['_on' + eventNameToWrap];
      }
      if (cb) {
        this.addEventListener(eventNameToWrap,
            this['_on' + eventNameToWrap] = cb);
      }
    },
    enumerable: true,
    configurable: true
  });
}
772290
public static void snapWindowTo(Window win, int location)
	{
		Dimension _screen = Toolkit.getDefaultToolkit().getScreenSize();
		Dimension _window = win.getSize();
		int _wx = 0;
		int _wy = 0;
		switch (location)
		{
			case TOP_LEFT:
				break;
			case TOP_CENTER:
				_wx = (_screen.width - _window.width) / 2;
				break;
			case TOP_RIGHT:
				_wx = _screen.width - _window.width;
				break;
			case MIDDLE_LEFT:
				_wy = (_screen.height - _window.height) / 2;
				break;
			case MIDDLE_CENTER:
				_wx = (_screen.width - _window.width) / 2;
				_wy = (_screen.height - _window.height) / 2;
				break;
			case MIDDLE_RIGHT:
				_wx = _screen.width - _window.width;
				_wy = (_screen.height - _window.height) / 2;
				break;
			case BOTTOM_LEFT:
				_wy = _screen.height - _window.height;
				break;
			case BOTTOM_CENTER:
				_wx = (_screen.width - _window.width) / 2;
				_wy = _screen.height - _window.height;
				break;
			case BOTTOM_RIGHT:
				_wx = _screen.width - _window.width;
				_wy = _screen.height - _window.height;
				break;
		}
		win.setLocation(new Point(_wx, _wy));
	}
468850
function (scope, sender) {
/*Line 31 - 'AtomWindow.js' */                AtomBinder.setValue(this, "isOpen", false);
/*Line 32 - 'AtomWindow.js' */                var val = this._value;
/*Line 33 - 'AtomWindow.js' */                var caller = this;
/*Line 34 - 'AtomWindow.js' */                this._value = null;

/*Line 36 - 'AtomWindow.js' */                WebAtoms.dispatcher.callLater(function () {
/*Line 37 - 'AtomWindow.js' */                    AtomBinder.setValue(caller, "value", val);
/*Line 38 - 'AtomWindow.js' */                    caller.invokeAction(caller._next);
/*Line 39 - 'AtomWindow.js' */                    caller.disposeChildren(caller._element);
/*Line 40 - 'AtomWindow.js' */                });
/*Line 41 - 'AtomWindow.js' */            }
1093201
function setupWindow(win, conn) {
  win.on('inputChar', function (c, i) {
    if (i === nc.keys.ESC) {
      var items = {};
      for (var i=0; i<connections.length; i++) {
        items[connections[i].client.opt.server] = connections[i].wins.status;
        for (var j=0,chans=Object.keys(connections[i].wins.channels); j<chans.length; j++)
          items['  ' + chans[j]] = connections[i].wins.channels[chans[j]];
        for (var j=0,queries=Object.keys(connections[i].wins.queries); j<queries.length; j++)
          items['  Q:' + queries[j]] = connections[i].wins.queries[queries[j]];
      }
      widgets.ListBox(items,
        {
          title: 'Windows',
          height: Math.min(Object.keys(items).length+2, nc.lines-2),
          style: {
            colors: {
              bg: 'blue',
              fg: 'white'
            }
          }
        }, function(window) {
          if (window)
            window.top();
          nc.redraw();
      });
    } else if (i === nc.keys.BACKSPACE && win.curx > 0) {
      win.inbuffer = win.inbuffer.substring(0, win.curx - 1) + win.inbuffer.substring(win.curx);
      win.delch(win.height-1, win.curx - 1);
      win.refresh();
    } else if (i === nc.keys.DEL) {
      win.inbuffer = win.inbuffer.substring(0, win.curx) + win.inbuffer.substring(win.curx + 1);
      win.delch(win.height-1, win.curx);
      win.refresh();
    } else if (i === nc.keys.LEFT && win.curx > 0) {
      win.cursor(win.height-1, win.curx-1);
      win.refresh();
    } else if (i === nc.keys.RIGHT && win.curx < win.inbuffer.length) {
      win.cursor(win.height-1, win.curx+1);
      win.refresh();
    } else if (i === nc.keys.END) {
      win.cursor(win.height-1, win.inbuffer.length);
      win.refresh();
    } else if (i === nc.keys.HOME) {
      win.cursor(win.height-1, 0);
      win.refresh();
	  } else if (i === nc.keys.NEWLINE) {
	    if (win.inbuffer.length) {
	      if (win.inbuffer[0] === '/') {
  	      var cmd = win.inbuffer.substring(1).split(' ', 1).join('').trim(),
  	          args = win.inbuffer.substring(win.inbuffer.indexOf(cmd)+cmd.length+1).trim();
	        switch (cmd.toLowerCase()) {
            case 'j':
	          case 'join':
              if (args.length) {
                if (args[0] !== '#' && args[0] !== '&'
                    && args[0] !== '+' && args[0] !== '!')
                  args = "#" + args;
                if (args.length > 1 && !conn.wins.channels[args])
                  conn.client.join(args);
              }
	          break;
            case 'part':
              var name = getWinName(win, conn);
              if (name[0] === '#' || name[0] === '&'
                  || name[0] === '+' || name[0] === '!') {
                conn.client.part(name);
                delete conn.wins.channels[name];
              }
            break;
	          case 'msg':
	            var who = args.substring(0, args.indexOf(' ')),
	                message = args.substring(args.indexOf(' ')+1);
	            if (!who.length || !message.length)
	              appendLine(win, 'Invalid arguments');
	            else {
	              conn.client.say(who, message);
	              appendLine(win, '* ->' + who + ': ' + message);
	            }
	          break;
	          case 'me':
	            if (win !== conn.wins.status) {
	              if (args.length) {
                  var key = getWinName(win, conn);
	                conn.client.say(key, CTCP_DELIM + 'ACTION ' + args + CTCP_DELIM);
  	              appendLine(win, '* ' + conn.client.nick + ' ' + args, COLOR_ACTION);
  	            }
	            } else
	              appendLine(win, 'That command is only valid on channel and query windows');
	          break;
            case 'whois':
              if (args.length) {
                conn.client.send('WHOIS', args, false);
              }
            break;
            case 'nick':
              if (args.length) {
                var newnick = args.split(' ', 1).join('');
                if (newnick) {
                  conn.client.prevnick = conn.client.nick;
                  conn.client.send("NICK", newnick);
                  conn.client.nick = newnick;
                }
              }
            break;
            case 'away':
              conn.client.send('AWAY', (args.length ? args : 'I am away'));
              appendLine(conn.wins.status, '* You have been marked as being away', nc.attrs.BOLD);
            break;
            case 'back':
              conn.client.send('AWAY');
              appendLine(conn.wins.status, '* You are no longer marked as being away', nc.attrs.BOLD);
            break;
            case 'exit':
	          case 'quit':
	            if (args.length)
  	            conn.client.disconnect(args);
  	          else
  	            conn.client.disconnect();
	            cleanup();
	          break;
	          case 'close':
	            if (win === conn.wins.status)
	              conn.client.disconnect();
	            else {
                var key = getWinName(win, conn);
                if (key[0] === '#' || key[0] === '&'
                    || key[0] === '+' || key[0] === '!') {
                  conn.client.part(key);
                  delete conn.wins.channels[key];
                } else
                  delete conn.wins.queries[key];
	            }
              win.close();
              nc.redraw();
              if (nc.numwins === 1)
                cleanup();
              return;
	          break;
	          case 'query':
	            var to = args.split(' ', 1).join('');
              if (!conn.wins.queries[to.toLowerCase()]) {
                var query = new nc.Window(nc.lines, nc.cols);
                setupWindow(query, conn);
                updateHeader(query, 'Query: ' + to, {pos: 'center'});
                conn.wins.queries[to.toLowerCase()] = query;
              }
	          break;
            case 'connect':
            break;
            case 'server':
            break;
            case 'whowas':
            break;
            case 'who':
            break;
            case 'info':
            break;
            case 'banlist':
            break;
            case 'notice':
            break;
            case 'invite':
            break;
            case 'ctcp':
            break;
	          default:
  	          appendLine(win, 'Unknown command: ' + cmd);
	        }
	      } else if (win.inbuffer.length && win !== conn.wins.status) {
          var key = getWinName(win, conn);
	        conn.client.say(key, win.inbuffer);
	        appendLine(win, '<' + conn.client.nick + '> ' + win.inbuffer);
	      }
	      win.inbuffer = "";
	      win.cursor(win.height-1, 0);
	      win.clrtoeol();
	      win.refresh();
	    }
	  } else if (i >= 32 && i <= 126 && win.curx < win.width-1) {
	    win.inbuffer = win.inbuffer.slice(0, win.curx) + c + win.inbuffer.slice(win.curx);

	    if (win.curx < win.inbuffer.length) {
	      win.insch(i);
	      win.cursor(win.height - 1, win.curx + 1);
	    } else {
	      win.addch(i);
	    }
	    
	    win.refresh();
	  }
  });
  win.scrollok(true);
  win.hline(win.height-2, 0, win.width);
  win.setscrreg(1, win.height-3); // Leave one line at the top for the header
  win.cursor(win.height-1, 0);
  win.refresh();
  win.inbuffer = "";
}
1278408
function (bSwitch) {

			jQuery.sap.require("sap.ui.core.routing.HashChanger");
			var HashChanger = sap.ui.require("sap/ui/core/routing/HashChanger");
			var oHashChanger = new HashChanger();
			var sHash = oHashChanger.getHash();
			var oUri = window.location;

			// TODO: remove this fix when microsoft fix this under IE11 on Win 10
			if (!window.location.origin) {
				window.location.origin = window.location.protocol + "//" +
					window.location.hostname +
					(window.location.port ? ':' + window.location.port : '');
			}

			if (bSwitch) {
				// add the parameter
				window.location = oUri.origin + oUri.pathname + "?sap-ui-rtl=true#" + sHash;
			} else {
				// or remove it
				window.location = oUri.origin + oUri.pathname + "#/" + sHash;
			}

		}
803391
def repaint
      my_win = @form ? @form.window : @target_window
      @graphic = my_win unless @graphic
      raise " #{@name} NO GRAPHIC set as yet                 CONTAINER paint " unless @graphic
      @components.each { |e| correct_component e } if @first_time
      #@components.each { |e| check_component e } # seeme one if printing out

      #return unless @repaint_required

      # if some major change has happened then repaint everything
      if @repaint_required
        $log.debug " VIM repaint graphic #{@graphic} "
        print_borders unless @suppress_borders # do this once only, unless everything changes
        @components.each { |e| e.repaint_all(true); e.repaint }
      else
        @components.each { |e| e.repaint }
      end # if repaint_required

      @repaint_required = false
    end
603568
function handleWindowResize () {
    ctrl.lastSelectedIndex = ctrl.selectedIndex;
    ctrl.offsetLeft        = fixOffset(ctrl.offsetLeft);

    $mdUtil.nextTick(function () {
      ctrl.updateInkBarStyles();
      updatePagination();
    });
  }
941316
function applyJsdomWorkaround(window) {
    Object.defineProperties(window.HTMLElement.prototype, {
        offsetLeft: {
            get: function () {
                return parseFloat(window.getComputedStyle(this).marginLeft) || 0;
            }
        },
        offsetTop: {
            get: function () {
                return parseFloat(window.getComputedStyle(this).marginTop) || 0;
            }
        },
        offsetHeight: {
            get: function () {
                return parseFloat(window.getComputedStyle(this).height) || 0;
            }
        },
        offsetWidth: {
            get: function () {
                return parseFloat(window.getComputedStyle(this).width) || 0;
            }
        }
    });
}
125564
function toHTML(win) {
    var nodes = win.document.querySelectorAll(config.selector);
    return Array.prototype.reduce.call(nodes, function (html, node) {
        return html + node.innerHTML;
    }, '');
}
178071
function getWHIgnoreDisplay() {
  for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
    args[_key2] = arguments[_key2];
  }

  var val = void 0;
  var elem = args[0];
  // in case elem is window
  // elem.offsetWidth === undefined
  if (elem.offsetWidth !== 0) {
    val = getWH.apply(undefined, args);
  } else {
    swap(elem, cssShow, function () {
      val = getWH.apply(undefined, args);
    });
  }
  return val;
}
685870
function nwmatcherFix(window) {

    var document = window.document;

    // :target 选择器支持
    window.location = document.location = {
        hash: ''
    };

    // 避免判断为低版本浏览器
    document.constructor.prototype.addEventListener = function() {
        throw new Error('not yet implemented');
    };
}
542819
function()
              {
                var win = settings.window,
                    popup = win.expandable ? $($this).next().find('.Container:first') : null;
                container = win.expandable ? $('<div/>') : $($this);
                container.addClass('jPicker Container');
                if (win.expandable) container.hide();
                container.get(0).onselectstart = function(event){ if (event.target.nodeName.toLowerCase() !== 'input') return false; };
                // inject html source code - we are using a single table for this control - I know tables are considered bad, but it takes care of equal height columns and
                // this control really is tabular data, so I believe it is the right move
                var all = color.active.val('all');
                if (win.alphaPrecision < 0) win.alphaPrecision = 0;
                else if (win.alphaPrecision > 2) win.alphaPrecision = 2;
                var controlHtml='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>' + (win.expandable ? '<tr><td class="Move" colspan="5">&nbsp;</td></tr>' : '') + '<tr><td rowspan="9"><h2 class="Title">' + (win.title || localization.text.title) + '</h2><div class="Map"><span class="Map1">&nbsp;</span><span class="Map2">&nbsp;</span><span class="Map3">&nbsp;</span><img src="' + images.clientPath + images.colorMap.arrow.file + '" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1">&nbsp;</span><span class="Map2">&nbsp;</span><span class="Map3">&nbsp;</span><span class="Map4">&nbsp;</span><span class="Map5">&nbsp;</span><span class="Map6">&nbsp;</span><img src="' + images.clientPath + images.colorBar.arrow.file + '" class="Arrow"/></div></td><td colspan="2" class="Preview">' + localization.text.newColor + '<div><span class="Active" title="' + localization.tooltips.colors.newColor + '">&nbsp;</span><span class="Current" title="' + localization.tooltips.colors.currentColor + '">&nbsp;</span></div>' + localization.text.currentColor + '</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="' + localization.text.ok + '" title="' + localization.tooltips.buttons.ok + '"/><input type="button" class="Cancel" value="' + localization.text.cancel + '" title="' + localization.tooltips.buttons.cancel + '"/><hr/><div class="Grid">&nbsp;</div></td></tr><tr class="Hue"><td class="Radio"><label title="' + localization.tooltips.hue.radio + '"><input type="radio" value="h"' + (settings.color.mode == 'h' ? ' checked="checked"' : '') + '/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.h : '') + '" title="' + localization.tooltips.hue.textbox + '"/>&nbsp;&deg;</td></tr><tr class="Saturation"><td class="Radio"><label title="' + localization.tooltips.saturation.radio + '"><input type="radio" value="s"' + (settings.color.mode == 's' ? ' checked="checked"' : '') + '/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.s : '') + '" title="' + localization.tooltips.saturation.textbox + '"/>&nbsp;%</td></tr><tr class="Value"><td class="Radio"><label title="' + localization.tooltips.value.radio + '"><input type="radio" value="v"' + (settings.color.mode == 'v' ? ' checked="checked"' : '') + '/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.v : '') + '" title="' + localization.tooltips.value.textbox + '"/>&nbsp;%<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="' + localization.tooltips.red.radio + '"><input type="radio" value="r"' + (settings.color.mode == 'r' ? ' checked="checked"' : '') + '/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.r : '') + '" title="' + localization.tooltips.red.textbox + '"/></td></tr><tr class="Green"><td class="Radio"><label title="' + localization.tooltips.green.radio + '"><input type="radio" value="g"' + (settings.color.mode == 'g' ? ' checked="checked"' : '') + '/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.g : '') + '" title="' + localization.tooltips.green.textbox + '"/></td></tr><tr class="Blue"><td class="Radio"><label title="' + localization.tooltips.blue.radio + '"><input type="radio" value="b"' + (settings.color.mode == 'b' ? ' checked="checked"' : '') + '/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.b : '') + '" title="' + localization.tooltips.blue.textbox + '"/></td></tr><tr class="Alpha"><td class="Radio">' + (win.alphaSupport ? '<label title="' + localization.tooltips.alpha.radio + '"><input type="radio" value="a"' + (settings.color.mode == 'a' ? ' checked="checked"' : '') + '/>A:</label>' : '&nbsp;') + '</td><td class="Text">' + (win.alphaSupport ? '<input type="text" maxlength="' + (3 + win.alphaPrecision) + '" value="' + (all != null ? Math.precision((all.a * 100) / 255, win.alphaPrecision) : '') + '" title="' + localization.tooltips.alpha.textbox + '"/>&nbsp;%' : '&nbsp;') + '</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="' + localization.tooltips.hex.textbox + '">#:<input type="text" maxlength="6" class="Hex" value="' + (all != null ? all.hex : '') + '"/></label>' + (win.alphaSupport ? '<input type="text" maxlength="2" class="AHex" value="' + (all != null ? all.ahex.substring(6) : '') + '" title="' + localization.tooltips.hex.alpha + '"/></td>' : '&nbsp;') + '</tr></tbody></table>';
                if (win.expandable)
                {
                  container.html(controlHtml);
                  if($(document.body).children('div.jPicker.Container').length==0)$(document.body).prepend(container);
                  else $(document.body).children('div.jPicker.Container:last').after(container);
                  container.mousedown(
                    function()
                    {
                      $(document.body).children('div.jPicker.Container').css({zIndex:10});
                      container.css({zIndex:20});
                    });
                  container.css( // positions must be set and display set to absolute before source code injection or IE will size the container to fit the window
                    {
                      left:
                        win.position.x == 'left' ? (popup.offset().left - 530 - (win.position.y == 'center' ? 25 : 0)) + 'px' :
                        win.position.x == 'center' ? (popup.offset().left - 260) + 'px' :
                        win.position.x == 'right' ? (popup.offset().left - 10 + (win.position.y == 'center' ? 25 : 0)) + 'px' :
                        win.position.x == 'screenCenter' ? (($(document).width() >> 1) - 260) + 'px' : (popup.offset().left + parseInt(win.position.x)) + 'px',
                      position: 'absolute',
                      top: win.position.y == 'top' ? (popup.offset().top - 312) + 'px' :
                           win.position.y == 'center' ? (popup.offset().top - 156) + 'px' :
                           win.position.y == 'bottom' ? (popup.offset().top + 25) + 'px' : (popup.offset().top + parseInt(win.position.y)) + 'px'
                    });
                }
                else
                {
                  container = $($this);
                  container.html(controlHtml);
                }
                // initialize the objects to the source code just injected
                var tbody = container.find('tbody:first');
                colorMapDiv = tbody.find('div.Map:first');
                colorBarDiv = tbody.find('div.Bar:first');
                var MapMaps = colorMapDiv.find('span'),
                    BarMaps = colorBarDiv.find('span');
                colorMapL1 = MapMaps.filter('.Map1:first');
                colorMapL2 = MapMaps.filter('.Map2:first');
                colorMapL3 = MapMaps.filter('.Map3:first');
                colorBarL1 = BarMaps.filter('.Map1:first');
                colorBarL2 = BarMaps.filter('.Map2:first');
                colorBarL3 = BarMaps.filter('.Map3:first');
                colorBarL4 = BarMaps.filter('.Map4:first');
                colorBarL5 = BarMaps.filter('.Map5:first');
                colorBarL6 = BarMaps.filter('.Map6:first');
                // create color pickers and maps
                colorMap = new Slider(colorMapDiv,
                  {
                    map:
                    {
                      width: images.colorMap.width,
                      height: images.colorMap.height
                    },
                    arrow:
                    {
                      image: images.clientPath + images.colorMap.arrow.file,
                      width: images.colorMap.arrow.width,
                      height: images.colorMap.arrow.height
                    }
                  });
                colorMap.bind(mapValueChanged);
                colorBar = new Slider(colorBarDiv,
                  {
                    map:
                    {
                      width: images.colorBar.width,
                      height: images.colorBar.height
                    },
                    arrow:
                    {
                      image: images.clientPath + images.colorBar.arrow.file,
                      width: images.colorBar.arrow.width,
                      height: images.colorBar.arrow.height
                    }
                  });
                colorBar.bind(colorBarValueChanged);
                colorPicker = new ColorValuePicker(tbody, color.active, win.expandable && win.bindToInput ? win.input : null, win.alphaPrecision);
                var hex = all != null ? all.hex : null,
                    preview = tbody.find('.Preview'),
                    button = tbody.find('.Button');
                activePreview = preview.find('.Active:first').css({ backgroundColor: hex && '#' + hex || 'transparent' });
                currentPreview = preview.find('.Current:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }).bind('click', currentClicked);
                setAlpha.call($this, currentPreview, Math.precision(color.current.val('a') * 100) / 255, 4);
                okButton = button.find('.Ok:first').bind('click', okClicked);
                cancelButton = button.find('.Cancel:first').bind('click', cancelClicked);
                grid = button.find('.Grid:first');
                setTimeout(
                  function()
                  {
                    setImg.call($this, colorMapL1, images.clientPath + 'Maps.png');
                    setImg.call($this, colorMapL2, images.clientPath + 'Maps.png');
                    setImg.call($this, colorMapL3, images.clientPath + 'map-opacity.png');
                    setImg.call($this, colorBarL1, images.clientPath + 'Bars.png');
                    setImg.call($this, colorBarL2, images.clientPath + 'Bars.png');
                    setImg.call($this, colorBarL3, images.clientPath + 'Bars.png');
                    setImg.call($this, colorBarL4, images.clientPath + 'Bars.png');
                    setImg.call($this, colorBarL5, images.clientPath + 'bar-opacity.png');
                    setImg.call($this, colorBarL6, images.clientPath + 'AlphaBar.png');
                    setImg.call($this, preview.find('div:first'), images.clientPath + 'preview-opacity.png');
                  }, 0);
                tbody.find('td.Radio input').bind('click', radioClicked);
                // initialize quick list
                if (color.quickList && color.quickList.length > 0)
                {
                  var html = '';
                  for (i = 0; i < color.quickList.length; i++)
                  {
                    /* if default colors are hex strings, change them to color objects */
                    if ((typeof (color.quickList[i])).toString().toLowerCase() == 'string') color.quickList[i] = new Color({ hex: color.quickList[i] });
                    var alpha = color.quickList[i].val('a');
                    var ahex = color.quickList[i].val('ahex');
                    if (!win.alphaSupport && ahex) ahex = ahex.substring(0, 6) + 'ff';
                    var quickHex = color.quickList[i].val('hex');
                    if(!ahex) ahex = "00000000";
                    html+='<span class="QuickColor"' + (ahex && ' title="#' + ahex + '"' || 'none') + ' style="background-color:' + (quickHex && '#' + quickHex || '') + ';' + (quickHex ? '' : 'background-image:url(' + images.clientPath + 'NoColor.png)') + (win.alphaSupport && alpha && alpha < 255 ? ';opacity:' + Math.precision(alpha / 255, 4) + ';filter:Alpha(opacity=' + Math.precision(alpha / 2.55, 4) + ')' : '') + '">&nbsp;</span>';
                  }
                  setImg.call($this, grid, images.clientPath + 'bar-opacity.png');
                  grid.html(html);
                  grid.find('.QuickColor').click(quickPickClicked);
                }
                setColorMode.call($this, settings.color.mode);
                color.active.bind(activeColorChanged);
                $.isFunction(liveCallback) && color.active.bind(liveCallback);
                color.current.bind(currentColorChanged);
                // bind to input
                if (win.expandable)
                {
                  $this.icon = popup.parents('.Icon:first');
                  iconColor = $this.icon.find('.Color:first').css({ backgroundColor: hex && '#' + hex || 'transparent' });
                  iconAlpha = $this.icon.find('.Alpha:first');
                  setImg.call($this, iconAlpha, images.clientPath + 'bar-opacity.png');
                  setAlpha.call($this, iconAlpha, Math.precision(((255 - (all != null ? all.a : 0)) * 100) / 255, 4));
                  iconImage = $this.icon.find('.Image:first').css(
                    {
                      backgroundImage: 'url(\'' + images.clientPath + images.picker.file + '\')'
                    }).bind('click', iconImageClicked);
                  if (win.bindToInput&&win.updateInputColor)
                    win.input.css(
                      {
                        backgroundColor: hex && '#' + hex || 'transparent',
                        color: all == null || all.v > 75 ? '#000000' : '#ffffff'
                      });
                  moveBar = tbody.find('.Move:first').bind('mousedown', moveBarMouseDown);
                  color.active.bind(expandableColorChanged);
                }
                else show.call($this);
              }
986373
def open_addnew_win(self, *args, **kwargs):
        
        if self.reftrackadderwin:
            self.reftrackadderwin.close()
        self.reftrackadderwin = ReftrackAdderWin(self.refobjinter, self.root, parent=self)
        self.reftrackadderwin.destroyed.connect(self.addnewwin_destroyed)
        self.reftrackadderwin.show()
1189589
function(url, win, attributes) {
        var o = {
            id:   Y.guid(),
            type: TYPE_JS
        };

        if (attributes) {
            Y.mix(o, attributes);
        }

        o.src = url;

        return _node("script", o, win);
    }
678655
function () {

            var isGeckoWin = (UA.gecko && this.platform == "windows");
            if (isGeckoWin) {
                // Help prevent spinning loading icon which 
                // started with FireFox 2.0.0.8/Win
                var self = this;
                setTimeout(function(){self._initResizeMonitor();}, 0);
            } else {
                this._initResizeMonitor();
            }
        }
750463
function decorateTape(tape) {
  tape.Test.prototype.html = function (message) {
    var that = this;
    trim(message).split('\n').forEach(function (aMsg) {
      that.emit('result', trim(aMsg).replace(/^\s*/, '#tapeworm-html'));
    });
  };
}