IE opacity hack
转换为 IE filter
427203
function ieOpacityHack(decl, i) {
  //四舍五入
  var amount = Math.round(decl.value * 100)
  if (decl.prop == 'opacity') {
    var reBefore = decl.raws.before.replace(reBLANK_LINE, '$1')

    insertDecl(decl, i, {
      raws: {
        before: reBefore
      },
      prop: 'filter',
      value: 'alpha(opacity=' + amount + ')'
    })
  }
}
1037493
function _fnFeatureHtmlFilter ( oSettings )
		{
			var oPreviousSearch = oSettings.oPreviousSearch;
			
			var sSearchStr = oSettings.oLanguage.sSearch;
			sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
			  sSearchStr.replace('_INPUT_', '<input type="text" />') :
			  sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';
			
			var nFilter = document.createElement( 'div' );
			nFilter.className = oSettings.oClasses.sFilter;
			nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
			if ( !oSettings.aanFeatures.f )
			{
				nFilter.id = oSettings.sTableId+'_filter';
			}
			
			var jqFilter = $('input[type="text"]', nFilter);
		
			// Store a reference to the input element, so other input elements could be
			// added to the filter wrapper if needed (submit button for example)
			nFilter._DT_Input = jqFilter[0];
		
			jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
			jqFilter.bind( 'keyup.DT', function(e) {
				/* Update all other filter input elements for the new display */
				var n = oSettings.aanFeatures.f;
				var val = this.value==="" ? "" : this.value; // mental IE8 fix :-(
		
				for ( var i=0, iLen=n.length ; i<iLen ; i++ )
				{
					if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
					{
						$(n[i]._DT_Input).val( val );
					}
				}
				
				/* Now do the filter */
				if ( val != oPreviousSearch.sSearch )
				{
					_fnFilterComplete( oSettings, { 
						"sSearch": val, 
						"bRegex": oPreviousSearch.bRegex,
						"bSmart": oPreviousSearch.bSmart ,
						"bCaseInsensitive": oPreviousSearch.bCaseInsensitive 
					} );
				}
			} );
		
			jqFilter
				.attr('aria-controls', oSettings.sTableId)
				.bind( 'keypress.DT', function(e) {
					/* Prevent form submission */
					if ( e.keyCode == 13 )
					{
						return false;
					}
				}
			);
			
			return nFilter;
		}
154776
function () {
		var hash = window.location.hash;
		var filterIndex = hash.indexOf('filter=');
		if (filterIndex !== -1) {
			var filterString = hash.substr(filterIndex + 7).trim();
			var visible = layersControl.filter(filterString);

			// enable first layer as actual layer.
			var first = Object.keys(visible)[0];
			if (first in baseLayers) {
				map.addLayer(baseLayers[first]);
				map.eachLayer(function (layer) {
					if (layer._providerName !== first) {
						map.removeLayer(layer);
					}
				});
				layersControl.filter(filterString);
			}
		}
	}
747444
function visibilityFilter(state = SHOW_ALL, action = {}) {
    const {type, filter} = action;
    switch (type) {
        case SET_VISIBILITY_FILTER:
            return filter;
        default:
            return state;
    }
}
1261910
function (element, opacity) {
            var browser = ariaCoreBrowser;
            var isIE8OrLess = (browser.isIE8 || browser.isIE7);
            this.setOpacity = isIE8OrLess ? this._setOpacityLegacyIE : this._setOpacityW3C;
            this.setOpacity(element, opacity);
        }
1311105
function(opacity) { 
        if (opacity != undefined) {
            this.opacity = opacity; 
        }
        
        if (this.div != null) {
            // for Mozilla and Safari
            this.div.style.opacity = this.opacity;

            // for IE
            this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')';
        }
    }
429799
function applyMask(mask) {
    var x, y, r3x, r3y;

    switch (mask) {
      case 0:
        for (y = 0; y < width; y++) {
          for (x = 0; x < width; x++) {
            if (!((x + y) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 1:
        for (y = 0; y < width; y++) {
          for (x = 0; x < width; x++) {
            if (!(y & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 2:
        for (y = 0; y < width; y++) {
          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!r3x && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 3:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = r3y, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!r3x && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 4:
        for (y = 0; y < width; y++) {
          for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) {
            if (r3x === 3) {
              r3x = 0;
              r3y = !r3y;
            }

            if (!r3y && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 5:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!((x & y & 1) + !(!r3x | !r3y)) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 6:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!(((x & y & 1) + (r3x && (r3x === r3y))) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 7:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!(((r3x && (r3x === r3y)) + ((x + y) & 1)) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
    }
  }
897797
function filter(results, data, ignored) {
    if (!data.length) return results;
    //这里是为了缓存match匹配函数
    var preMatchesCache = matchesCache;
    matchesCache = createMatches(data);
    for (var i = results.length; i--;) {
      if (!matchData(results[i], data, ignored)) {
        results.splice(i, 1);
      }
    }
    // Fixed: 因为一次filter可能会有字filter调用，比如matches、not、include
    matchesCache = preMatchesCache; // warning :以后写全局变量一定当心
    return results;
  }
699043
function _filterToWhereClause(filter, args) {
  var clausePartial = "";
  var keyIndex = 1;
  for (var fieldName in filter) {
    var andStr = "";
    if (keyIndex != 1) andStr = " and ";
    var fieldDesc = filter[fieldName];  //一个字段的查询描述对象 or 值
    var descType = typeof fieldDesc;
    if (descType == "string") {
      if (args) {
        clausePartial += andStr + '"' + fieldName + '"=$' + (args.length + 1);
        args.push(fieldDesc);
      } else {
        clausePartial += andStr + '"' + fieldName + "\"='" + fieldDesc + "'";
      }
    } else if (descType == "number" || descType == "boolean") {
      clausePartial += andStr + '"' + fieldName + '"=' + fieldDesc;
    } else if (descType == "object") { //fieldDesc形如:{"$gte":5}
      var operatorCodeArr = Object.keys(fieldDesc);

      var andStrForOPCode = "";
      var keyIndexForOPCode = 1;
      operatorCodeArr.forEach(operatorCode => {
        if (keyIndexForOPCode != 1 || keyIndex != 1) andStrForOPCode = " and ";//这里不能漏判断keyIndex
        var operator = validOperator[operatorCode];//>= , =, <......
        if (!operator) {
          throw new Error("_filterToWhereClause:invalid operator code " + operatorCode);
        }
        var operand = fieldDesc[operatorCode];//具体的操作数
        var operandType = typeof operand;
        if (args) {
          if (operatorCode == "$in") {
            if (!Array.isArray(operand)) throw new Error('_filterToWhereClause:invalid operand(not an array) for operatorCode:$in in filter:', filter);
            if (operand.length > 0) {
              var operandItemType = typeof operand[0];
              if (operandItemType == 'number' || operandItemType == "boolean") {
                clausePartial += andStrForOPCode + '"' + fieldName + '" ' + operator + '(' + operand.join(',') + ')';
              } else if (operandItemType == 'string') {//string型,在in子句里要加上单引号
                clausePartial += '"' + fieldName + '" ' + operator + '(';
                var lastOperandIdx = operand.length - 1;
                operand.forEach(function (v, idx) {
                  clausePartial += "'" + v + "'";
                  if (idx != lastOperandIdx) clausePartial += ',';
                });
                clausePartial += andStrForOPCode + ')';
              } else {
                throw new Error('_filterToWhereClause:invalid operandItemType:' + operandItemType + ' for operatorCode:$in in filter:', filter);
              }
            } else clausePartial += '1=1';
          } else {
            if (operandType == "string") {
              clausePartial += andStrForOPCode + '"' + fieldName + '"' + operator + " $" + (args.length + 1);
              args.push(operand);
            } else if (operandType == "number" || operandType == "boolean") {
              clausePartial += andStrForOPCode + '"' + fieldName + '"' + operator + operand;
            } else {
              throw new Error("_filterToWhereClause:invalid operand type " + operandType + " in filter:", filter);
            }
          }
        } else {
          if (operatorCode == '$in') {
            if (!Array.isArray(operand)) throw new Error('_filterToWhereClause:invalid operand(not an array) for operatorCode:$in in filter:', filter);
            if (operand.length > 0) {
              var operandItemType = typeof operand[0];
              if (operandItemType == 'number' || operandType == "boolean") {
                clausePartial += andStrForOPCode + '"' + fieldName + '" ' + operator + '(' + operand.join(',') + ')';
              } else if (operandItemType == 'string') {//string型,在in子句里要加上单引号
                clausePartial += '"' + fieldName + '" ' + operator + '(';
                var lastOperandIdx = operand.length - 1;
                operand.forEach(function (v, idx) {
                  clausePartial += "'" + v + "'";
                  if (idx != lastOperandIdx) clausePartial += ',';
                });
                clausePartial += andStrForOPCode + ')';
              } else {
                throw new Error('_filterToWhereClause:invalid operandItemType:' + operandItemType + ' for operatorCode:$in in filter:', filter);
              }
            } else clausePartial += '1=1';
          } else {
            if (operandType == 'string') {
              clausePartial += andStrForOPCode + '"' + fieldName + '"' + operator + '"' + operand + '"';
            } else if (operandType == 'number' || operandType == "boolean") {
              clausePartial += andStrForOPCode + '"' + fieldName + '"' + operator + operand;
            } else {
              throw new Error('_filterToWhereClause:invalid operand type ' + operandType + ' in filter:', filter);
            }
          }
        }
        keyIndexForOPCode++;
      });

    } else {
      console.log('filter:' + JSON.stringify(filter));
      throw new Error('_filterToWhereClause:invalid field descriptor type, must be one of them:string,number,object,fieldName:' + fieldName + ',descType:' + descType);
    }
    keyIndex++;
  }

  var whereClause = "";
  if (clausePartial) whereClause = " where " + clausePartial;
  return whereClause;
}
588531
def _filter(self):
        
        pattern = u"[\s+\.\!\-\/_,$%^*(+\"\']+|[+——！】【，。？?:、：~@#￥%……&*“”（）]+"
        self.m = re.sub(pattern, "", self.m)
548710
function BlurYTintFilter()
{
    core.AbstractFilter.call(this,
        // vertex shader
        fs.readFileSync(__dirname + '/blurYTint.vert', 'utf8'),
        // fragment shader
        fs.readFileSync(__dirname + '/blurYTint.frag', 'utf8'),
        // set the uniforms
        {
            blur: { type: '1f', value: 1 / 512 },
            color: { type: 'c', value: [0,0,0]},
            alpha: { type: '1f', value: 0.7 },
            offset: { type: '2f', value:[5, 5]},
            strength: { type: '1f', value:1}
        }
    );

    this.passes = 1;
    this.strength = 4;
}
984105
function fadeIn(el)
{
	el.style.opacity = 0;
	el.style.display = "block";

	(function fadeIn() {
		let val = parseFloat(el.style.opacity);
		if (! ((val += .1) > 1)) {
			el.style.opacity = val;
			setTimeout(fadeIn, 40);
		}
	})();
}
1250853
function(elem, interval) {
      if (+elem.style.opacity < 1) {
        interval = interval || 16;
        elem.style.opacity = 0;
        elem.style.display = 'block';
        var last = +new Date();
        var tick = function() {
          elem.style.opacity = +elem.style.opacity + (new Date() - last) / 100;
          last = +new Date();

          if (+elem.style.opacity < 1) {
            setTimeout(tick, interval);
          }
        };
        tick();
      }
      elem.style.display = 'block'; //fallback IE8
    }
1296237
function flatFilter(filterString) {

    var filter_list = [];

    if (typeof filterString == 'string') {
        filter_list = matches$1(filterString);
    } else if (Array.isArray(filterString)) {
        filter_list = filterString;
    }

    var allFilter = [];

    filter_list.forEach(function (filterObj) {
        var filterName = filterObj.arr[0];

        if (GLFilter[filterName]) {
            var f = makeFilterFunction(filterObj);

            if (f.type == 'convolution' || f.type == 'shader') {
                allFilter.push(f);
            } else {
                f.forEach(function (subFilter) {
                    allFilter = allFilter.concat(flatFilter(subFilter));
                });
            }
        }
    });

    // console.log(filter_list, allFilter)

    return allFilter;
}
314437
function(obj) {
				return (_opacityExp.test( ((typeof(obj) === "string") ? obj : (obj.currentStyle ? obj.currentStyle.filter : obj.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1);
			}
1184278
function FilterCSS (options) {
  options = shallowCopyObject(options || {});
  options.whiteList = options.whiteList || DEFAULT.whiteList;
  options.onAttr = options.onAttr || DEFAULT.onAttr;
  options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT.onIgnoreAttr;
  options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
  this.options = options;
}
893543
function(obj, alpha)
              {
                obj.css({ visibility: alpha > 0 ? 'visible' : 'hidden' });
                if (alpha > 0 && alpha < 100)
                {
                  if (isLessThanIE7)
                  {
                    var src = obj.attr('pngSrc');
                    if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1))
                      obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\') progid:DXImageTransform.Microsoft.Alpha(opacity=' + alpha + ')' });
                    else obj.css({ opacity: Math.precision(alpha / 100, 4) });
                  }
                  else obj.css({ opacity: Math.precision(alpha / 100, 4) });
                }
                else if (alpha == 0 || alpha == 100)
                {
                  if (isLessThanIE7)
                  {
                    var src = obj.attr('pngSrc');
                    if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1))
                      obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' });
                    else obj.css({ opacity: '' });
                  }
                  else obj.css({ opacity: '' });
                }
              }